Included Files
- #include <nut/include/cfg/memory.h>
- #include <nut/include/sys/nutdebug.h>
- #include <nut/include/dev/spi_node_at45d.h>
- #include <nut/include/include2/string.h>
Preprocessor definitions
#define FLASH_BUFFERS_AT45D 2
#define AT45D_CRC_SIZE 0
#define FLASH_BUFFER_DIRTY 0x0001
#define FLASH_MOUNT_OFFSET_AT45D0 0
#define FLASH_MOUNT_TOP_RESERVE_AT45D0 1
#define FLASH_MOUNT_OFFSET_AT45D1 0
#define FLASH_MOUNT_TOP_RESERVE_AT45D1 1
#define FLASH_MOUNT_OFFSET_AT45D2 0
#define FLASH_MOUNT_TOP_RESERVE_AT45D2 1
#define FLASH_MOUNT_OFFSET_AT45D3 0
#define FLASH_MOUNT_TOP_RESERVE_AT45D3 1
typedef struct _AT45D_FLASH AT45D_FLASH
struct _AT45D_FLASH
|
|
{
|
|
sf_unit_t dxb_page[2];
|
|
uint_fast8_t flags[2];
|
|
int dxb_locks[2];
|
|
HANDLE dxb_lque;
|
|
uint_fast8_t dxb_pshft;
|
|
uint8_t* dxb_pbuf[2];
|
|
}
|
|
NUTSERIALFLASH flashAt45d0
NUTSERIALFLASH flashAt45d1
NUTSERIALFLASH flashAt45d2
NUTSERIALFLASH flashAt45d3
static int_fast8_t At45dFlashLoadUnit ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int_fast8_t lock )
static void At45dFlashRelease ( NUTSERIALFLASH* sfi, int b )
static int At45dFlashSaveUnit ( NUTSERIALFLASH* sfi, int_fast8_t b )
static int SpiAt45dFlashCheck ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int cnt )
static int SpiAt45dFlashCommit ( NUTSERIALFLASH* sfi, sf_unit_t pgn )
static int SpiAt45dFlashCompare ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int off, const void* data, int len )
static int SpiAt45dFlashCopy ( NUTSERIALFLASH* sfi, sf_unit_t spg, sf_unit_t dpg )
static int SpiAt45dFlashErase ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int cnt )
static void SpiAt45dFlashExit ( NUTSERIALFLASH* sfi )
static int SpiAt45dFlashInit ( NUTSERIALFLASH* sfi )
static int SpiAt45dFlashRead ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int off, void* data, int len )
static int SpiAt45dFlashUsed ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int skip )
static int SpiAt45dFlashWrite ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int off, const void* data, int len )