Included Files
- #include <nut/include/cfg/memory.h>
- #include <nut/include/sys/nutdebug.h>
- #include <nut/include/dev/at45d.h>
- #include <nut/include/dev/spi_at45dib.h>
Preprocessor definitions
#define DFCMD_BUF1_LOAD_PAGE 0x53
#define DFCMD_BUF2_LOAD_PAGE 0x55
#define AT45DIB_FDIRTY 0x0001
#define SPI_RATE_AT45D0 33000000
#define SPI_MODE_AT45D0 SPI_MODE_3
#define MOUNT_OFFSET_AT45DIB0 0
#define MOUNT_TOP_RESERVE_AT45DIB0 1
#define SPI_RATE_AT45D1 33000000
#define SPI_MODE_AT45D1 SPI_MODE_3
#define MOUNT_OFFSET_AT45DIB1 0
#define MOUNT_TOP_RESERVE_AT45DIB1 1
typedef struct _AT45DIB AT45DIB
struct _AT45DIB
|
|
{
|
|
sf_unit_t dib_page[2];
|
|
uint_fast8_t flags[2];
|
|
int dib_locks[2];
|
|
HANDLE dib_lque;
|
|
uint_fast8_t dib_pshft;
|
|
}
|
|
NUTSERIALFLASH flashAt45dib0
NUTSERIALFLASH flashAt45dib1
Local Variables
spiNode0
static NUTSPINODE spiNode0
spiNode1
static NUTSPINODE spiNode1
static int_fast8_t At45dibAllocate ( NUTSERIALFLASH* sfi, sf_unit_t pgn )
static int At45dibCommand ( NUTSPINODE* node, uint8_t op, uint32_t parm, uint_fast8_t oplen )
static int At45dibCompare ( NUTSPINODE* node, uint8_t op, uint32_t parm, uint_fast8_t oplen, const void* buf, int xlen )
static int At45dibFlash ( NUTSERIALFLASH* sfi, int_fast8_t b )
static void At45dibRelease ( NUTSERIALFLASH* sfi, int b )
static uint8_t At45dibStatus ( NUTSPINODE* node )
static int At45dibTransfer ( NUTSPINODE* node, uint8_t op, uint32_t parm, uint_fast8_t oplen, const void* txbuf, void* rxbuf, int xlen )
static int At45dibTransmitCmd ( NUTSPINODE* node, uint8_t op, uint32_t parm, uint_fast8_t oplen )
static int At45dibUsed ( NUTSPINODE* node, uint8_t op, uint32_t parm, uint_fast8_t oplen, int xlen )
static int At45dibWaitReady ( NUTSPINODE* node, uint32_t tmo )
static int SpiAt45dibCheck ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int cnt )
static int SpiAt45dibCommit ( NUTSERIALFLASH* sfi, sf_unit_t pgn )
static int SpiAt45dibCompare ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int off, const void* data, int len )
static int SpiAt45dibCopy ( NUTSERIALFLASH* sfi, sf_unit_t spg, sf_unit_t dpg )
static int SpiAt45dibErase ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int cnt )
static void SpiAt45dibExit ( NUTSERIALFLASH* sfi )
static int SpiAt45dibInit ( NUTSERIALFLASH* sfi )
static int SpiAt45dibRead ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int off, void* data, int len )
static int SpiAt45dibUsed ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int skip )
static int SpiAt45dibWrite ( NUTSERIALFLASH* sfi, sf_unit_t pgn, int off, const void* data, int len )