| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Functions
BOARD: Board specific NOR Flash drivers
BOARD: Common board components used with board drivers

## Detailed Description

## Modules
| BOARD: Driver for SST39VF320

## Functions
void | lpc_norflash_init (void)
| Initialize flash.
void | lpc_norflash_get_size (UNS_32 *size, UNS_32 *sector_count)
| Return the flash size.
UNS_32 | lpc_norflash_get_sector_offset (UNS_32 sector)
| Return the sector offset.
void | lpc_norflash_get_id (UNS_16 *manu_id, UNS_16 *device_id)
| Read manufacturer ID and device ID.
bool | lpc_norflash_toggle_bit_check (UNS_32 addr)
| Check Toggle Bit is being toggled or not.
void | lpc_norflash_erase_sector (UNS_32 addr)
| Erase a sector.
void | lpc_norflash_write_word (UNS_32 addr, UNS_16 data)
| Write data to flash.
UNS_32 | lpc_norflash_write_buffer (UNS_32 addr, UNS_16 *data, UNS_32 size)
| Write buffer to flash.
UNS_16 | lpc_norflash_read_word (UNS_32 addr)
| Read data from flash.

## 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
  size | The 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.