![]() |
LPCOpen Platform for LPC112X microcontrollers
112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
|
Various functions for reading and writting to NOR FLASH
Macros | |
#define | FLASH_SIZE (4 << 20) /* 2Mx16 */ |
#define | SECTOR_SIZE (4 << 10) /* 2K words */ |
#define | BLOCK_SIZE (64 << 10) /* 32K words */ |
#define | TOGGLE_BIT (1 << 6) /* DQ6 */ |
Functions | |
void | lpc_norflash_init (void) |
Initialize flash. More... | |
void | lpc_norflash_get_size (UNS_32 *size, UNS_32 *sector_count) |
Return the flash size. More... | |
UNS_32 | lpc_norflash_get_sector_offset (UNS_32 sector) |
Return the sector offset. More... | |
void | lpc_norflash_get_id (UNS_16 *manu_id, UNS_16 *device_id) |
Read manufacturer ID and device ID. More... | |
bool | lpc_norflash_toggle_bit_check (UNS_32 addr) |
Check Toggle Bit is being toggled or not. More... | |
void | lpc_norflash_erase_sector (UNS_32 sec_addr) |
Erase a sector. More... | |
void | lpc_norflash_write_word (UNS_32 addr, UNS_16 data) |
Write data to flash. More... | |
UNS_32 | lpc_norflash_write_buffer (UNS_32 addr, UNS_16 *data, UNS_32 size) |
Write buffer to flash. More... | |
UNS_16 | lpc_norflash_read_word (UNS_32 addr) |
Read data from flash. More... | |
#define BLOCK_SIZE (64 << 10) /* 32K words */ |
Definition at line 49 of file lpc_norflash_sst39vf320.c.
#define FLASH_SIZE (4 << 20) /* 2Mx16 */ |
Definition at line 45 of file lpc_norflash_sst39vf320.c.
#define SECTOR_SIZE (4 << 10) /* 2K words */ |
Definition at line 47 of file lpc_norflash_sst39vf320.c.
#define TOGGLE_BIT (1 << 6) /* DQ6 */ |
Definition at line 51 of file lpc_norflash_sst39vf320.c.
void lpc_norflash_erase_sector | ( | UNS_32 | addr | ) |
Erase a sector.
addr | : Sector address |
Definition at line 122 of file lpc_norflash_sst39vf320.c.
Read manufacturer ID and device ID.
manu_id | : pointer to where to place manufacturer ID |
device_id | : pointer to where to place device ID |
Definition at line 81 of file lpc_norflash_sst39vf320.c.
Return the sector offset.
sector | : Sector number |
Definition at line 76 of file lpc_norflash_sst39vf320.c.
Return the flash size.
size | : pointer to where to place the total size(bytes) |
sector_count | : pointer to where to place the number of sectors |
Definition at line 69 of file lpc_norflash_sst39vf320.c.
void lpc_norflash_init | ( | void | ) |
Read data from flash.
addr | : Address |
Definition at line 154 of file lpc_norflash_sst39vf320.c.
bool lpc_norflash_toggle_bit_check | ( | UNS_32 | addr | ) |
Check Toggle Bit is being toggled or not.
addr | : Address |
Definition at line 110 of file lpc_norflash_sst39vf320.c.
Write buffer to flash.
addr | : Address |
data | : Pointer to data to write |
size | The number of (bytes) |
Definition at line 142 of file lpc_norflash_sst39vf320.c.
Write data to flash.
addr | : Address |
data | : Data value to write |
Definition at line 133 of file lpc_norflash_sst39vf320.c.