File nut/dev/at49bv.c


Included Files


Preprocessor definitions

#define FLASH_CHIP_BASE 0x10000000

#define FLASH_CONF_SECTOR 0x6000

#define FLASH_CONF_SIZE 512

#define FLASH_ERASE_WAIT 3000

#define FLASH_CHIP_ERASE_WAIT 50000

#define FLASH_WRITE_POLLS 1000

#define FLASH_UNLOCK( base )

#define FLASH_COMMAND( base, cmd )

#define FLASH_CMD_ERASE 0x80

#define FLASH_CMD_ERASE_CHIP 0x10

#define FLASH_CMD_ERASE_SECTOR 0x30

#define FLASH_CMD_ENTER_ID 0x90

#define FLASH_CMD_EXIT_ID 0xF0

#define FLASH_CMD_PROGRAM 0xA0


Typedef flashdat_t

typedef unsigned short flashdat_t

Typedef flashadr_t

typedef unsigned long flashadr_t

Typedef flashptr_t

typedef volatile flashdat_t* flashptr_t

Local Variables

chip
static flashptr_t chip
Used in: AT49bvReadProtectionRegister()  
  At49bvChipErase()  
  At49bvInit()  
  At49bvSectorErase()  
  At49bvSectorWrite()  

Global Function AT49bvReadProtectionRegister()

unsigned long long AT49bvReadProtectionRegister ( int factory )
Prototyped in: nut/include/dev/at49bv.h
References Variables: chip nut/dev/at49bv.c

Global Function At49bvChipErase()

int At49bvChipErase ( void )
Prototyped in: nut/include/dev/at49bv.h
Calls: At49bvWaitReady() nut/dev/at49bv.c
References Variables: chip nut/dev/at49bv.c

Global Function At49bvInit()

unsigned long At49bvInit ( void )
Prototyped in: nut/include/dev/at49bv.h
References Variables: chip nut/dev/at49bv.c

Global Function At49bvParamRead()

int At49bvParamRead ( unsigned int pos, void* data, unsigned int len )
Prototyped in: nut/include/dev/at49bv.h
Calls: At49bvSectorRead() nut/dev/at49bv.c

Global Function At49bvParamWrite()

int At49bvParamWrite ( unsigned int pos, const void* data, unsigned int len )
Prototyped in: nut/include/dev/at49bv.h
Calls: At49bvSectorErase() nut/dev/at49bv.c
  At49bvSectorRead() nut/dev/at49bv.c
  At49bvSectorWrite() nut/dev/at49bv.c
  free() nut/crt/malloc.c
  malloc() nut/crt/malloc.c
  memcmp() nut/c/string/memcmp.c
  memcpy() nut/c/string/memcpy.c

Global Function At49bvSectorErase()

int At49bvSectorErase ( unsigned int off )
Prototyped in: nut/include/dev/at49bv.h
Calls: At49bvWaitReady() nut/dev/at49bv.c
Called by: At49bvParamWrite() nut/dev/at49bv.c
References Variables: chip nut/dev/at49bv.c

Global Function At49bvSectorRead()

int At49bvSectorRead ( unsigned int off, void* data, unsigned int len )
Prototyped in: nut/include/dev/at49bv.h
Calls: memcpy() nut/c/string/memcpy.c
Called by: At49bvParamRead() nut/dev/at49bv.c
  At49bvParamWrite() nut/dev/at49bv.c

Global Function At49bvSectorWrite()

int At49bvSectorWrite ( unsigned int off, const void* data, unsigned int len )
Prototyped in: nut/include/dev/at49bv.h
Calls: At49bvWaitReady() nut/dev/at49bv.c
Called by: At49bvParamWrite() nut/dev/at49bv.c
References Variables: chip nut/dev/at49bv.c

Local Function At49bvWaitReady()

static int At49bvWaitReady ( flashptr_t addr, flashdat_t data, uint32_t tmo, int poll )
Calls: NutSleep()
Called by: At49bvChipErase() nut/dev/at49bv.c
  At49bvSectorErase() nut/dev/at49bv.c
  At49bvSectorWrite() nut/dev/at49bv.c