Nut/OS  5.0.5
API Reference
lpc177x_8x_eeprom.c File Reference
#include <inttypes.h>
#include <sys/timer.h>
#include <arch/cm3.h>
#include <arch/cm3/nxp/lpc177x_8x.h>
#include <arch/cm3/nxp/lpc177x_8x_clk.h>
#include <arch/cm3/nxp/lpc177x_8x_eeprom.h>
Include dependency graph for lpc177x_8x_eeprom.c:

Functions

void Lpc177x_8x_EepromInit (void)
 Initialize EEPROM.
int Lpc177x_8x_EepromRead (uint16_t addr, void *buff, size_t size)
 Read data from EEPROM at specific address.
int Lpc177x_8x_EepromWrite (uint16_t addr, const void *buff, size_t size)
 Write data to EEPROM at specific address.

Function Documentation

void Lpc177x_8x_EepromInit ( void  )

Initialize EEPROM.

Initialize the eeprom memeory. Therefore enable power and setup clocks

Parameters:
none
Returns:
none

References LPC_EEPROM, NUT_HWCLK_CPU, and NutArchClockGet().

Referenced by Lpc177x_8x_EepromRead(), and Lpc177x_8x_EepromWrite().

Here is the call graph for this function:

int Lpc177x_8x_EepromRead ( uint16_t  addr,
void *  buff,
size_t  size 
)

Read data from EEPROM at specific address.

Parameters:
addressEEPROM address that start to write data, it must be in range 0..0x1000
buffbuffer to place the read data in
sizenumber of bytes to be read
Returns:
none

References _BV, EEPROM_CMD_8_BIT_READ, EEPROM_CMD_RDPREFETCH, EEPROM_ENDOF_PROG, EEPROM_ENDOF_RW, EEPROM_PAGE_ADRESS, EEPROM_PAGE_NUM, EEPROM_PAGE_NUM_MASK, EEPROM_PAGE_OFFSET, EEPROM_PAGE_OFFSET_MASK, EEPROM_PAGE_SIZE, EEPROM_SIZE, Lpc177x_8x_EepromInit(), and LPC_EEPROM.

Referenced by NutNvMemLoad().

Here is the call graph for this function:

int Lpc177x_8x_EepromWrite ( uint16_t  addr,
const void *  buff,
size_t  size 
)

Write data to EEPROM at specific address.

Parameters:
addressEEPROM address that start to write data, it must be in range 0..0x1000
buffbuffer that contain data that will be written to buffer
sizenumber of bytes to be written
Returns:
none

References _BV, EEPROM_CMD_8_BIT_WRITE, EEPROM_CMD_ERASE_PRG_PAGE, EEPROM_ENDOF_PROG, EEPROM_ENDOF_RW, EEPROM_PAGE_ADRESS, EEPROM_PAGE_NUM, EEPROM_PAGE_NUM_MASK, EEPROM_PAGE_OFFSET, EEPROM_PAGE_OFFSET_MASK, EEPROM_PAGE_SIZE, EEPROM_SIZE, Lpc177x_8x_EepromInit(), and LPC_EEPROM.

Referenced by NutNvMemSave().

Here is the call graph for this function: