LPCOpen Platform for LPC112X microcontrollers  112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
Modules | Functions
BOARD: Board specific NOR Flash drivers

Detailed Description

Modules

 BOARD: Driver for SST39VF320
 

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 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...
 

Function Documentation

void lpc_norflash_erase_sector ( UNS_32  addr)

Erase a sector.

Parameters
addr: Sector address
Returns
Nothing

Definition at line 122 of file lpc_norflash_sst39vf320.c.

void lpc_norflash_get_id ( UNS_16 manu_id,
UNS_16 device_id 
)

Read manufacturer ID and device ID.

Parameters
manu_id: pointer to where to place manufacturer ID
device_id: pointer to where to place device ID
Returns
Nothing

Definition at line 81 of file lpc_norflash_sst39vf320.c.

UNS_32 lpc_norflash_get_sector_offset ( UNS_32  sector)

Return the sector offset.

Parameters
sector: Sector number
Returns
Nothing

Definition at line 76 of file lpc_norflash_sst39vf320.c.

void lpc_norflash_get_size ( UNS_32 size,
UNS_32 sector_count 
)

Return the flash size.

Parameters
size: pointer to where to place the total size(bytes)
sector_count: pointer to where to place the number of sectors
Returns
Nothing

Definition at line 69 of file lpc_norflash_sst39vf320.c.

void lpc_norflash_init ( void  )

Initialize flash.

Returns
Nothing

Definition at line 65 of file lpc_norflash_sst39vf320.c.

UNS_16 lpc_norflash_read_word ( UNS_32  addr)

Read data from flash.

Parameters
addr: Address
Returns
Data value read from the address
Note
addr must be word-aligned.

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.

Parameters
addr: Address
Returns
false(being toggled)/true(stop toggling)
Note
During the Program/Erase operation, any consecutive attempts to read toggle bit will produce alternating "1"s and "0"s, i.e., toggling between 1 and 0. When the Program or Erase operation is completed, this bit will stop toggling. The flash is then ready for the next operation.
This function reads a word at the given address (addr) 2 times, and then checks the toggle bit. If the value of toggle bit are the same, true is returned. Otherwise, false is returned.

Definition at line 110 of file lpc_norflash_sst39vf320.c.

UNS_32 lpc_norflash_write_buffer ( UNS_32  addr,
UNS_16 data,
UNS_32  size 
)

Write buffer to flash.

Parameters
addr: Address
data: Pointer to data to write
sizeThe number of (bytes)
Returns
The number of written bytes
Note
addr must be word-aligned.

Definition at line 142 of file lpc_norflash_sst39vf320.c.

void lpc_norflash_write_word ( UNS_32  addr,
UNS_16  data 
)

Write data to flash.

Parameters
addr: Address
data: Data value to write
Returns
Nothing
Note
addr must be word-aligned.

Definition at line 133 of file lpc_norflash_sst39vf320.c.