Microchip® Advanced Software Framework

at45dbx.h File Reference
#include "conf_access.h"
#include "spi.h"

Macros

#define AT45DBX_SECTOR_BITS   9
 Number of bits for addresses within sectors. More...
 
#define AT45DBX_SECTOR_SIZE   (1 << AT45DBX_SECTOR_BITS)
 Sector size in bytes. More...
 
Available AT45DBX Sizes

Number of address bits of available AT45DBX data flash memories.

Note
Only memories with page sizes of at least 512 bytes (sector size) are supported.
#define AT45DBX_2MB   21
 
#define AT45DBX_4MB   22
 
#define AT45DBX_8MB   23
 

Functions

Control Functions
bool at45dbx_init (spi_options_t spiOptions, unsigned int pba_hz)
 Initializes the data flash controller and the SPI channel by which the DF is controlled. More...
 
bool at45dbx_mem_check (void)
 Performs a memory check on all DFs. More...
 
bool at45dbx_read_open (U32 sector)
 Opens a DF memory in read mode at a given sector. More...
 
void at45dbx_read_close (void)
 Unselects the current DF memory. More...
 
bool at45dbx_write_open (U32 sector)
 This function opens a DF memory in write mode at a given sector. More...
 
void at45dbx_write_close (void)
 Fills the end of the current logical sector and launches page programming. More...
 
Single-Byte Access Functions
U8 at45dbx_read_byte (void)
 Performs a single byte read from DF memory. More...
 
bool at45dbx_write_byte (U8 b)
 Performs a single byte write to DF memory. More...
 
Multiple-Sector Access Functions
bool at45dbx_read_multiple_sector (U16 nb_sector)
 Reads nb_sector sectors from DF memory. More...
 
void at45dbx_read_multiple_sector_callback (const void *psector)
 Callback function invoked after each sector read during at45dbx_read_multiple_sector. More...
 
bool at45dbx_write_multiple_sector (U16 nb_sector)
 Writes nb_sector sectors to DF memory. More...
 
void at45dbx_write_multiple_sector_callback (void *psector)
 Callback function invoked before each sector write during at45dbx_write_multiple_sector. More...
 
Single-Sector Access Functions
bool at45dbx_read_sector_2_ram (void *ram)
 Reads 1 DF sector to a RAM buffer. More...
 
bool at45dbx_write_sector_from_ram (const void *ram)
 Writes 1 DF sector from a RAM buffer. More...