![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
Supports 4032 byte EEPROM devices.
Data Structures | |
| struct | IP_EEPROM_001_T |
| EEPROM register block structure. More... | |
Macros | |
| #define | EEPROM_PAGE_SIZE 64 |
| #define | EEPROM_PAGE_NUM 63 |
| #define | EEPROM_CMD_8BITS_READ (0) |
| #define | EEPROM_CMD_16BITS_READ (1) |
| #define | EEPROM_CMD_32BITS_READ (2) |
| #define | EEPROM_CMD_8BITS_WRITE (3) |
| #define | EEPROM_CMD_16BITS_WRITE (4) |
| #define | EEPROM_CMD_32BITS_WRITE (5) |
| #define | EEPROM_CMD_ERASE_PRG_PAGE (6) |
| #define | EEPROM_CMD_RDPREFETCH (1 << 3) |
| #define | EEPROM_PWRDWN (1 << 0) |
| #define | EEPROM_INT_ENDOFRW (1 << 26) |
| #define | EEPROM_INT_ENDOFPROG (1 << 28) |
Enumerations | |
| enum | IP_EEPROM_RWSIZE_T { EEPROM_RWSIZE_8BITS = 1, EEPROM_RWSIZE_16BITS = 2, EEPROM_RWSIZE_32BITS = 4 } |
| EEPROM Mode type definition. More... | |
Functions | |
| STATIC INLINE void | IP_EEPROM_SetCmd (IP_EEPROM_001_T *pEEPROM, uint32_t cmd) |
| Select an EEPROM command. | |
| STATIC INLINE void | IP_EEPROM_SetAddr (IP_EEPROM_001_T *pEEPROM, uint32_t pageAddr, uint32_t pageOffset) |
| Set EEPROM address. | |
| STATIC INLINE void | IP_EEPROM_WriteData (IP_EEPROM_001_T *pEEPROM, uint32_t data) |
| Write EEPROM data. | |
| STATIC INLINE uint32_t | IP_EEPROM_ReadData (IP_EEPROM_001_T *pEEPROM) |
| Read EEPROM data. | |
| STATIC INLINE void | IP_EEPROM_SetWaitState (IP_EEPROM_001_T *pEEPROM, uint32_t ws) |
| Set EEPROM wait state. | |
| STATIC INLINE void | IP_EEPROM_EnablePowerDown (IP_EEPROM_001_T *pEEPROM) |
| Put EEPROM device in power down mode. | |
| STATIC INLINE void | IP_EEPROM_DisablePowerDown (IP_EEPROM_001_T *pEEPROM) |
| Bring EEPROM device out of power down mode. | |
| STATIC INLINE void | IP_EEPROM_EnableInt (IP_EEPROM_001_T *pEEPROM, uint32_t mask) |
| Enable EEPROM interrupt. | |
| STATIC INLINE void | IP_EEPROM_DisableInt (IP_EEPROM_001_T *pEEPROM, uint32_t mask) |
| Disable EEPROM interrupt. | |
| STATIC INLINE uint32_t | IP_EEPROM_GetIntEnable (IP_EEPROM_001_T *pEEPROM) |
| Get the value of the EEPROM interrupt enable register. | |
| STATIC INLINE uint32_t | IP_EEPROM_GetIntStatus (IP_EEPROM_001_T *pEEPROM) |
| Get EEPROM interrupt status. | |
| STATIC INLINE void | IP_EEPROM_SetIntStatus (IP_EEPROM_001_T *pEEPROM, uint32_t mask) |
| Set EEPROM interrupt status. | |
| STATIC INLINE void | IP_EEPROM_ClearIntStatus (IP_EEPROM_001_T *pEEPROM, uint32_t mask) |
| Clear EEPROM interrupt status. | |
| void | IP_EEPROM_Init (IP_EEPROM_001_T *pEEPROM, uint32_t div) |
| Initializes EEPROM. | |
| STATIC INLINE void | IP_EEPROM_DeInit (IP_EEPROM_001_T *pEEPROM) |
| De-initializes EEPROM. | |
| void | IP_EEPROM_ErasePageRegister (IP_EEPROM_001_T *pEEPROM) |
| Erase data in page register. | |
| uint32_t | IP_EEPROM_WritePageRegister (IP_EEPROM_001_T *pEEPROM, uint16_t pageOffset, uint8_t *pData, uint8_t wsize, uint32_t byteNum) |
| Write data to page register. | |
| uint32_t | IP_EEPROM_ReadPage (IP_EEPROM_001_T *pEEPROM, uint16_t pageOffset, uint16_t pageAddr, uint8_t *pData, uint8_t rsize, uint32_t byteNum) |
| Read data from non-volatile memory. | |
| void | IP_EEPROM_EraseProgramPage (IP_EEPROM_001_T *pEEPROM, uint16_t pageAddr) |
| Erase/Program an EEPROM page. | |
| void | IP_EEPROM_WaitForIntStatus (IP_EEPROM_001_T *pEEPROM, uint32_t mask) |
| Wait for interrupt occurs. | |
| Status | IP_EEPROM_Write (IP_EEPROM_001_T *pEEPROM, uint16_t pageOffset, uint16_t pageAddr, void *pData, IP_EEPROM_RWSIZE_T wsize, uint32_t byteNum) |
| Write data to EEPROM at specific address. | |
| Status | IP_EEPROM_Read (IP_EEPROM_001_T *pEEPROM, uint16_t pageOffset, uint16_t pageAddr, void *pData, IP_EEPROM_RWSIZE_T rsize, uint32_t byteNum) |
| Read data to EEPROM at specific address. | |
| void | IP_EEPROM_Erase (IP_EEPROM_001_T *pEEPROM, uint16_t pageAddr) |
| Erase a page at the specific address. | |
| #define EEPROM_CMD_16BITS_READ (1) |
EEPROM 16-bit read command
Definition at line 75 of file eeprom_001.h.
| #define EEPROM_CMD_16BITS_WRITE (4) |
EEPROM 16-bit write command
Definition at line 78 of file eeprom_001.h.
| #define EEPROM_CMD_32BITS_READ (2) |
EEPROM 32-bit read command
Definition at line 76 of file eeprom_001.h.
| #define EEPROM_CMD_32BITS_WRITE (5) |
EEPROM 32-bit write command
Definition at line 79 of file eeprom_001.h.
| #define EEPROM_CMD_8BITS_READ (0) |
EEPROM 8-bit read command
Definition at line 74 of file eeprom_001.h.
| #define EEPROM_CMD_8BITS_WRITE (3) |
EEPROM 8-bit write command
Definition at line 77 of file eeprom_001.h.
| #define EEPROM_CMD_ERASE_PRG_PAGE (6) |
EEPROM erase/program command
Definition at line 80 of file eeprom_001.h.
| #define EEPROM_CMD_RDPREFETCH (1 << 3) |
EEPROM read pre-fetch enable
Definition at line 81 of file eeprom_001.h.
| #define EEPROM_INT_ENDOFPROG (1 << 28) |
Definition at line 92 of file eeprom_001.h.
| #define EEPROM_INT_ENDOFRW (1 << 26) |
Definition at line 91 of file eeprom_001.h.
| #define EEPROM_PAGE_NUM 63 |
EEPROM pages
Definition at line 69 of file eeprom_001.h.
| #define EEPROM_PAGE_SIZE 64 |
EEPROM byes per page
Definition at line 68 of file eeprom_001.h.
| #define EEPROM_PWRDWN (1 << 0) |
Definition at line 86 of file eeprom_001.h.
| enum IP_EEPROM_RWSIZE_T |
EEPROM Mode type definition.
Definition at line 97 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_ClearIntStatus | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | mask | ||
| ) |
Clear EEPROM interrupt status.
| pEEPROM | : pointer to EEPROM peripheral block |
| mask | : interrupt mask (or-ed bits value of EEPROM_INT_*) |
Definition at line 242 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_DeInit | ( | IP_EEPROM_001_T * | pEEPROM | ) |
De-initializes EEPROM.
| pEEPROM | : pointer to EEPROM peripheral block |
Definition at line 260 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_DisableInt | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | mask | ||
| ) |
Disable EEPROM interrupt.
| pEEPROM | : pointer to EEPROM peripheral block |
| mask | : interrupt mask (or-ed bits value of EEPROM_INT_*) |
Definition at line 200 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_DisablePowerDown | ( | IP_EEPROM_001_T * | pEEPROM | ) |
Bring EEPROM device out of power down mode.
| pEEPROM | : pointer to EEPROM peripheral block |
Definition at line 178 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_EnableInt | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | mask | ||
| ) |
Enable EEPROM interrupt.
| pEEPROM | : pointer to EEPROM peripheral block |
| mask | : interrupt mask (or-ed bits value of EEPROM_INT_*) |
Definition at line 189 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_EnablePowerDown | ( | IP_EEPROM_001_T * | pEEPROM | ) |
Put EEPROM device in power down mode.
| pEEPROM | : pointer to EEPROM peripheral block |
Definition at line 167 of file eeprom_001.h.
| void IP_EEPROM_Erase | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint16_t | pageAddr | ||
| ) |
Erase a page at the specific address.
| pEEPROM | : pointer to EEPROM peripheral block |
| pageAddr | : EEPROM page address (0-62) |
Definition at line 223 of file eeprom_001.c.
| void IP_EEPROM_ErasePageRegister | ( | IP_EEPROM_001_T * | pEEPROM | ) |
Erase data in page register.
| pEEPROM | : pointer to EEPROM peripheral block |
Definition at line 74 of file eeprom_001.c.
| void IP_EEPROM_EraseProgramPage | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint16_t | pageAddr | ||
| ) |
Erase/Program an EEPROM page.
| pEEPROM | : pointer to EEPROM peripheral block |
| pageAddr | : EEPROM page address (0-62) |
Definition at line 121 of file eeprom_001.c.
| STATIC INLINE uint32_t IP_EEPROM_GetIntEnable | ( | IP_EEPROM_001_T * | pEEPROM | ) |
Get the value of the EEPROM interrupt enable register.
| pEEPROM | : pointer to EEPROM peripheral block |
Definition at line 210 of file eeprom_001.h.
| STATIC INLINE uint32_t IP_EEPROM_GetIntStatus | ( | IP_EEPROM_001_T * | pEEPROM | ) |
Get EEPROM interrupt status.
| pEEPROM | : pointer to EEPROM peripheral block |
Definition at line 220 of file eeprom_001.h.
| void IP_EEPROM_Init | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | div | ||
| ) |
Initializes EEPROM.
| pEEPROM | : pointer to EEPROM peripheral block |
| div | : clock divide value (pre-minus 1) |
Definition at line 51 of file eeprom_001.c.
| Status IP_EEPROM_Read | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint16_t | pageOffset, | ||
| uint16_t | pageAddr, | ||
| void * | pData, | ||
| IP_EEPROM_RWSIZE_T | rsize, | ||
| uint32_t | byteNum | ||
| ) |
Read data to EEPROM at specific address.
| pEEPROM | : pointer to EEPROM peripheral block |
| pageOffset | : offset of data in page register(0 -> EEPROM_PAGE_SIZE-1) |
| pageAddr | : page address (0 ->EEPROM_PAGE_NUM -1 ) |
| pData | : buffer that contain data read from read data register |
| rsize | : Read size:
|
| byteNum | : number read data (bytes) |
Definition at line 193 of file eeprom_001.c.
| STATIC INLINE uint32_t IP_EEPROM_ReadData | ( | IP_EEPROM_001_T * | pEEPROM | ) |
Read EEPROM data.
| pEEPROM | : pointer to EEPROM peripheral block |
Definition at line 146 of file eeprom_001.h.
| uint32_t IP_EEPROM_ReadPage | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint16_t | pageOffset, | ||
| uint16_t | pageAddr, | ||
| uint8_t * | pData, | ||
| uint8_t | rsize, | ||
| uint32_t | byteNum | ||
| ) |
Read data from non-volatile memory.
| pEEPROM | : pointer to EEPROM peripheral block |
| pageOffset | : offset of data in page register(0 -> EEPROM_PAGE_SIZE-1) |
| pageAddr | : page address (0 ->EEPROM_PAGE_NUM -1 ) |
| pData | : buffer that contain data read from read data register |
| rsize | : The number of bytes in each reading (1/2/4 bytes) |
| byteNum | : number of read data (bytes) |
Definition at line 130 of file eeprom_001.c.
| STATIC INLINE void IP_EEPROM_SetAddr | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | pageAddr, | ||
| uint32_t | pageOffset | ||
| ) |
Set EEPROM address.
| pEEPROM | : pointer to EEPROM peripheral block |
| pageAddr | : Page address. |
| pageOffset | : Page address. |
Definition at line 125 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_SetCmd | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | cmd | ||
| ) |
Select an EEPROM command.
| pEEPROM | : pointer to EEPROM peripheral block |
| cmd | : EEPROM command. |
Definition at line 113 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_SetIntStatus | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | mask | ||
| ) |
Set EEPROM interrupt status.
| pEEPROM | : pointer to EEPROM peripheral block |
| mask | : interrupt mask (or-ed bits value of EEPROM_INT_*) |
Definition at line 231 of file eeprom_001.h.
| STATIC INLINE void IP_EEPROM_SetWaitState | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | ws | ||
| ) |
Set EEPROM wait state.
| pEEPROM | : pointer to EEPROM peripheral block |
| ws | : Wait State value. |
Definition at line 157 of file eeprom_001.h.
| void IP_EEPROM_WaitForIntStatus | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | mask | ||
| ) |
Wait for interrupt occurs.
| pEEPROM | : pointer to EEPROM peripheral block |
| mask | : expected interrupt |
Definition at line 61 of file eeprom_001.c.
| Status IP_EEPROM_Write | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint16_t | pageOffset, | ||
| uint16_t | pageAddr, | ||
| void * | pData, | ||
| IP_EEPROM_RWSIZE_T | wsize, | ||
| uint32_t | byteNum | ||
| ) |
Write data to EEPROM at specific address.
| pEEPROM | : pointer to EEPROM peripheral block |
| pageOffset | : offset of data in page register(0 -> EEPROM_PAGE_SIZE-1) |
| pageAddr | : page address (0 ->EEPROM_PAGE_NUM -1 ) |
| pData | : buffer that contain data that will be written to buffer |
| wsize | : Write size:
|
| byteNum | : number written data (bytes) |
Definition at line 163 of file eeprom_001.c.
| STATIC INLINE void IP_EEPROM_WriteData | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint32_t | data | ||
| ) |
Write EEPROM data.
| pEEPROM | : pointer to EEPROM peripheral block |
| data | : EEPROM data. |
Definition at line 136 of file eeprom_001.h.
| uint32_t IP_EEPROM_WritePageRegister | ( | IP_EEPROM_001_T * | pEEPROM, |
| uint16_t | pageOffset, | ||
| uint8_t * | pData, | ||
| uint8_t | wsize, | ||
| uint32_t | byteNum | ||
| ) |
Write data to page register.
| pEEPROM | : pointer to EEPROM peripheral block |
| pageOffset | : offset of data in page register(0 -> EEPROM_PAGE_SIZE-1) |
| pData | : buffer that contain data that will be written to buffer |
| wsize | : The number of bytes in each writting (1/2/4 bytes) |
| byteNum | : number written data (bytes) |
Definition at line 92 of file eeprom_001.c.