#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>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. | |
| void Lpc177x_8x_EepromInit | ( | void | ) |
Initialize EEPROM.
Initialize the eeprom memeory. Therefore enable power and setup clocks
| none |
References LPC_EEPROM, NUT_HWCLK_CPU, and NutArchClockGet().
Referenced by Lpc177x_8x_EepromRead(), and Lpc177x_8x_EepromWrite().
| int Lpc177x_8x_EepromRead | ( | uint16_t | addr, |
| void * | buff, | ||
| size_t | size | ||
| ) |
Read data from EEPROM at specific address.
| address | EEPROM address that start to write data, it must be in range 0..0x1000 |
| buff | buffer to place the read data in |
| size | number of bytes to be read |
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().
| int Lpc177x_8x_EepromWrite | ( | uint16_t | addr, |
| const void * | buff, | ||
| size_t | size | ||
| ) |
Write data to EEPROM at specific address.
| address | EEPROM address that start to write data, it must be in range 0..0x1000 |
| buff | buffer that contain data that will be written to buffer |
| size | number of bytes to be written |
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().