LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
IP: EEPROM register block and driver (002)

Detailed Description

Data Structures

struct  IP_EEPROM_002_T
 EEPROM register block structure. More...
 

Macros

#define EEPROM_CMD_ERASE_PRG_PAGE   (6)
 
#define EEPROM_AUTOPROG_OFF   (0)
 
#define EEPROM_AUTOPROG_AFT_1WORDWRITTEN   (1)
 
#define EEPROM_AUTOPROG_AFT_LASTWORDWRITTEN   (2)
 
#define EEPROM_PWRDWN   (1 << 0)
 
#define EEPROM_INT_ENDOFPROG   (1 << 2)
 

Functions

STATIC INLINE void IP_EEPROM_SetCmd (IP_EEPROM_002_T *pEEPROM, uint32_t cmd)
 Select an EEPROM command.
 
STATIC INLINE void IP_EEPROM_SetAutoProg (IP_EEPROM_002_T *pEEPROM, uint32_t mode)
 Set Auto programming mode.
 
STATIC INLINE void IP_EEPROM_SetReadWaitState (IP_EEPROM_002_T *pEEPROM, uint32_t ws)
 Set EEPROM Read Wait State value.
 
STATIC INLINE void IP_EEPROM_SetWaitState (IP_EEPROM_002_T *pEEPROM, uint32_t ws)
 Set EEPROM Wait State value.
 
STATIC INLINE void IP_EEPROM_EnablePowerDown (IP_EEPROM_002_T *pEEPROM)
 Put EEPROM device in power down mode.
 
STATIC INLINE void IP_EEPROM_DisablePowerDown (IP_EEPROM_002_T *pEEPROM)
 Bring EEPROM device out of power down mode.
 
STATIC INLINE void IP_EEPROM_EnableInt (IP_EEPROM_002_T *pEEPROM, uint32_t mask)
 Enable EEPROM interrupt.
 
STATIC INLINE void IP_EEPROM_DisableInt (IP_EEPROM_002_T *pEEPROM, uint32_t mask)
 Disable EEPROM interrupt.
 
STATIC INLINE uint32_t IP_EEPROM_GetIntEnable (IP_EEPROM_002_T *pEEPROM)
 Get the value of the EEPROM interrupt enable register.
 
STATIC INLINE uint32_t IP_EEPROM_GetIntStatus (IP_EEPROM_002_T *pEEPROM)
 Get EEPROM interrupt status.
 
STATIC INLINE void IP_EEPROM_SetIntStatus (IP_EEPROM_002_T *pEEPROM, uint32_t mask)
 Set EEPROM interrupt status.
 
STATIC INLINE void IP_EEPROM_ClearIntStatus (IP_EEPROM_002_T *pEEPROM, uint32_t mask)
 Clear EEPROM interrupt status.
 
void IP_EEPROM_Init (IP_EEPROM_002_T *pEEPROM, uint32_t div)
 Initializes EEPROM.
 
STATIC INLINE void IP_EEPROM_DeInit (IP_EEPROM_002_T *pEEPROM)
 De-initializes EEPROM.
 
void IP_EEPROM_EraseProgramPage (IP_EEPROM_002_T *pEEPROM)
 Erase/Program an EEPROM page.
 
void IP_EEPROM_WaitForIntStatus (IP_EEPROM_002_T *pEEPROM, uint32_t mask)
 Wait for interrupt occurs.
 

Macro Definition Documentation

#define EEPROM_AUTOPROG_AFT_1WORDWRITTEN   (1)

Erase/program cycle is triggered after 1 word is written

Definition at line 76 of file eeprom_002.h.

#define EEPROM_AUTOPROG_AFT_LASTWORDWRITTEN   (2)

Erase/program cycle is triggered after a write to AHB address ending with ......1111100 (last word of a page)

Definition at line 77 of file eeprom_002.h.

#define EEPROM_AUTOPROG_OFF   (0)

Auto programming off

Definition at line 75 of file eeprom_002.h.

#define EEPROM_CMD_ERASE_PRG_PAGE   (6)

EEPROM erase/program command

Definition at line 70 of file eeprom_002.h.

#define EEPROM_INT_ENDOFPROG   (1 << 2)

Definition at line 88 of file eeprom_002.h.

#define EEPROM_PWRDWN   (1 << 0)

Definition at line 83 of file eeprom_002.h.

Function Documentation

STATIC INLINE void IP_EEPROM_ClearIntStatus ( IP_EEPROM_002_T pEEPROM,
uint32_t  mask 
)

Clear EEPROM interrupt status.

Parameters
pEEPROM: pointer to EEPROM peripheral block
mask: interrupt mask (or-ed bits value of EEPROM_INT_*)
Returns
Nothing

Definition at line 215 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_DeInit ( IP_EEPROM_002_T pEEPROM)

De-initializes EEPROM.

Parameters
pEEPROM: pointer to EEPROM peripheral block
Returns
Nothing

Definition at line 233 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_DisableInt ( IP_EEPROM_002_T pEEPROM,
uint32_t  mask 
)

Disable EEPROM interrupt.

Parameters
pEEPROM: pointer to EEPROM peripheral block
mask: interrupt mask (or-ed bits value of EEPROM_INT_*)
Returns
Nothing

Definition at line 173 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_DisablePowerDown ( IP_EEPROM_002_T pEEPROM)

Bring EEPROM device out of power down mode.

Parameters
pEEPROM: pointer to EEPROM peripheral block
Returns
Nothing
Note
Any EEPROM operation has to be suspended for 100us while the EEPROM wakes up.

Definition at line 151 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_EnableInt ( IP_EEPROM_002_T pEEPROM,
uint32_t  mask 
)

Enable EEPROM interrupt.

Parameters
pEEPROM: pointer to EEPROM peripheral block
mask: interrupt mask (or-ed bits value of EEPROM_INT_*)
Returns
Nothing

Definition at line 162 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_EnablePowerDown ( IP_EEPROM_002_T pEEPROM)

Put EEPROM device in power down mode.

Parameters
pEEPROM: pointer to EEPROM peripheral block
Returns
Nothing

Definition at line 140 of file eeprom_002.h.

void IP_EEPROM_EraseProgramPage ( IP_EEPROM_002_T pEEPROM)

Erase/Program an EEPROM page.

Parameters
pEEPROM: pointer to EEPROM peripheral block
Returns
Nothing

Definition at line 61 of file eeprom_002.c.

STATIC INLINE uint32_t IP_EEPROM_GetIntEnable ( IP_EEPROM_002_T pEEPROM)

Get the value of the EEPROM interrupt enable register.

Parameters
pEEPROM: pointer to EEPROM peripheral block
Returns
Or-ed bits value of EEPROM_INT_*

Definition at line 183 of file eeprom_002.h.

STATIC INLINE uint32_t IP_EEPROM_GetIntStatus ( IP_EEPROM_002_T pEEPROM)

Get EEPROM interrupt status.

Parameters
pEEPROM: pointer to EEPROM peripheral block
Returns
Or-ed bits value of EEPROM_INT_*

Definition at line 193 of file eeprom_002.h.

void IP_EEPROM_Init ( IP_EEPROM_002_T pEEPROM,
uint32_t  div 
)

Initializes EEPROM.

Parameters
pEEPROM: pointer to EEPROM peripheral block
div: clock divide value (pre-minus 1)
Returns
Nothing

Definition at line 51 of file eeprom_002.c.

STATIC INLINE void IP_EEPROM_SetAutoProg ( IP_EEPROM_002_T pEEPROM,
uint32_t  mode 
)

Set Auto programming mode.

Parameters
pEEPROM: pointer to EEPROM peripheral block
mode: Auto programming Mode (Value of EEPROM_AUTOPROG_).
Returns
Nothing

Definition at line 108 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_SetCmd ( IP_EEPROM_002_T pEEPROM,
uint32_t  cmd 
)

Select an EEPROM command.

Parameters
pEEPROM: pointer to EEPROM peripheral block
cmd: EEPROM command.
Returns
Nothing
Note
cmd is or-ed bits value of EEPROM_CMD_*

Definition at line 97 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_SetIntStatus ( IP_EEPROM_002_T pEEPROM,
uint32_t  mask 
)

Set EEPROM interrupt status.

Parameters
pEEPROM: pointer to EEPROM peripheral block
mask: interrupt mask (or-ed bits value of EEPROM_INT_*)
Returns
Nothing

Definition at line 204 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_SetReadWaitState ( IP_EEPROM_002_T pEEPROM,
uint32_t  ws 
)

Set EEPROM Read Wait State value.

Parameters
pEEPROM: pointer to EEPROM peripheral block
ws: Wait State value.
Returns
Nothing

Definition at line 119 of file eeprom_002.h.

STATIC INLINE void IP_EEPROM_SetWaitState ( IP_EEPROM_002_T pEEPROM,
uint32_t  ws 
)

Set EEPROM Wait State value.

Parameters
pEEPROM: pointer to EEPROM peripheral block
ws: Wait State value.
Returns
Nothing

Definition at line 130 of file eeprom_002.h.

void IP_EEPROM_WaitForIntStatus ( IP_EEPROM_002_T pEEPROM,
uint32_t  mask 
)

Wait for interrupt occurs.

Parameters
pEEPROM: pointer to EEPROM peripheral block
mask: expected interrupt
Returns
Nothing

Definition at line 69 of file eeprom_002.c.