| 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
Macros | Functions
CHIP: LPC18xx/40xx EEPROM Driver
LPC18xx/43xx chip specific drivers

## Detailed Description

## Macros
#define | EEPROM_START (0x20040000)
#define | EEPROM_PAGE_SIZE (128)
#define | EEPROM_PAGE_NUM (128)
#define | EEPROM_ADDRESS(page, offset) (EEPROM_START + (EEPROM_PAGE_SIZE * (page)) + offset)

## Functions
void | Chip_EEPROM_Init (LPC_EEPROM_T *pEEPROM)
| Initializes EEPROM.
STATIC INLINE void | Chip_EEPROM_DeInit (LPC_EEPROM_T *pEEPROM)
| De-initializes EEPROM.
STATIC INLINE void | Chip_EEPROM_SetAutoProg (LPC_EEPROM_T *pEEPROM, uint32_t mode)
| Set Auto program mode.
STATIC INLINE void | Chip_EEPROM_SetReadWaitState (LPC_EEPROM_T *pEEPROM, uint32_t ws)
| Set EEPROM Read Wait State.
STATIC INLINE void | Chip_EEPROM_SetWaitState (LPC_EEPROM_T *pEEPROM, uint32_t ws)
| Set EEPROM wait state.
STATIC INLINE void | Chip_EEPROM_SetCmd (LPC_EEPROM_T *pEEPROM, uint32_t cmd)
| Select an EEPROM command.
STATIC INLINE void | Chip_EEPROM_EraseProgramPage (LPC_EEPROM_T *pEEPROM)
| Erase/Program an EEPROM page.
STATIC INLINE void | Chip_EEPROM_WaitForIntStatus (IP_EEPROM_002_T *pEEPROM, uint32_t mask)
| Wait for interrupt occurs.
STATIC INLINE void | Chip_EEPROM_EnablePowerDown (LPC_EEPROM_T *pEEPROM)
| Put EEPROM device in power down mode.
STATIC INLINE void | Chip_EEPROM_DisablePowerDown (LPC_EEPROM_T *pEEPROM)
| Bring EEPROM device out of power down mode.
STATIC INLINE void | Chip_EEPROM_EnableInt (LPC_EEPROM_T *pEEPROM, uint32_t mask)
| Enable EEPROM interrupt.
STATIC INLINE void | Chip_EEPROM_DisableInt (LPC_EEPROM_T *pEEPROM, uint32_t mask)
| Disable EEPROM interrupt.
STATIC INLINE uint32_t | Chip_EEPROM_GetIntEnable (LPC_EEPROM_T *pEEPROM)
| Get the value of the EEPROM interrupt enable register.
STATIC INLINE uint32_t | Chip_EEPROM_GetIntStatus (LPC_EEPROM_T *pEEPROM)
| Get EEPROM interrupt status.
STATIC INLINE void | Chip_EEPROM_SetIntStatus (LPC_EEPROM_T *pEEPROM, uint32_t mask)
| Set EEPROM interrupt status.
STATIC INLINE void | Chip_EEPROM_ClearIntStatus (LPC_EEPROM_T *pEEPROM, uint32_t mask)
| Clear EEPROM interrupt status.

## Macro Definition Documentation

#define EEPROM_ADDRESS | ( |  | page,
|  |  | offset
| ) |  | (EEPROM_START + (EEPROM_PAGE_SIZE * (page)) + offset)

Get the eeprom address

Definition at line 50 of file eeprom_18xx_43xx.h.

#define EEPROM_PAGE_NUM (128)

The number of EEPROM pages. The last page is not writable.

Definition at line 48 of file eeprom_18xx_43xx.h.

#define EEPROM_PAGE_SIZE (128)

EEPROM byes per page

Definition at line 46 of file eeprom_18xx_43xx.h.

#define EEPROM_START (0x20040000)

EEPROM start address

Definition at line 44 of file eeprom_18xx_43xx.h.

## Function Documentation

STATIC INLINE void Chip_EEPROM_ClearIntStatus | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | mask
| ) |  |

Clear EEPROM interrupt status.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  mask | : Interrupt mask (or-ed bits value of EEPROM_INT_*)

Returns
  Nothing

Definition at line 219 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_DeInit | ( | LPC_EEPROM_T * | pEEPROM | ) |

De-initializes EEPROM.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure

Returns
  Nothing

Definition at line 64 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_DisableInt | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | mask
| ) |  |

Disable EEPROM interrupt.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  mask | : Interrupt mask (or-ed bits value of EEPROM_INT_*)

Returns
  Nothing

Definition at line 177 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_DisablePowerDown | ( | LPC_EEPROM_T * | pEEPROM | ) |

Bring EEPROM device out of power down mode.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure

Returns
  Nothing

Definition at line 155 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_EnableInt | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | mask
| ) |  |

Enable EEPROM interrupt.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  mask | : Interrupt mask (or-ed bits value of EEPROM_INT_*)

Returns
  Nothing

Definition at line 166 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_EnablePowerDown | ( | LPC_EEPROM_T * | pEEPROM | ) |

Put EEPROM device in power down mode.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure

Returns
  Nothing

Definition at line 145 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_EraseProgramPage | ( | LPC_EEPROM_T * | pEEPROM | ) |

Erase/Program an EEPROM page.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure

Returns
  Nothing

Definition at line 124 of file eeprom_18xx_43xx.h.

STATIC INLINE uint32_t Chip_EEPROM_GetIntEnable | ( | LPC_EEPROM_T * | pEEPROM | ) |

Get the value of the EEPROM interrupt enable register.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure

Returns
  OR-ed bits value of EEPROM_INT_*

Definition at line 187 of file eeprom_18xx_43xx.h.

STATIC INLINE uint32_t Chip_EEPROM_GetIntStatus | ( | LPC_EEPROM_T * | pEEPROM | ) |

Get EEPROM interrupt status.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure

Returns
  OR-ed bits value of EEPROM_INT_*

Definition at line 197 of file eeprom_18xx_43xx.h.

void Chip_EEPROM_Init | ( | LPC_EEPROM_T * | pEEPROM | ) |

Initializes EEPROM.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure

Returns
  Nothing

Parameters

  pEEPROM | : The base of EEPROM peripheral on the chip

Returns
  Nothing

Definition at line 53 of file eeprom_17xx_40xx.c.

STATIC INLINE void Chip_EEPROM_SetAutoProg | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | mode
| ) |  |

Set Auto program mode.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  mode | : Auto Program Mode (One of EEPROM_AUTOPROG_* value)

Returns
  Nothing

Definition at line 75 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_SetCmd | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | cmd
| ) |  |

Select an EEPROM command.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  cmd | : EEPROM command

Returns
  Nothing

Note
  The cmd is OR-ed bits value of EEPROM_CMD_*

Definition at line 114 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_SetIntStatus | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | mask
| ) |  |

Set EEPROM interrupt status.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  mask | : Interrupt mask (or-ed bits value of EEPROM_INT_*)

Returns
  Nothing

Definition at line 208 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_SetReadWaitState | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | ws
| ) |  |

Set EEPROM Read Wait State.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  ws | : Wait State value

Returns
  Nothing

Note
  Bits 7:0 represents wait state for Read Phase 2 and Bits 15:8 represents wait state for Read Phase1

Definition at line 88 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_SetWaitState | ( | LPC_EEPROM_T * | pEEPROM,
|  | uint32_t | ws
| ) |  |

Set EEPROM wait state.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  ws | : Wait State value

Returns
  Nothing

Note
  Bits 7:0 represents wait state for Phase 3, Bits 15:8 represents wait state for Phase2, and Bits 23:16 represents wait state for Phase1

Definition at line 102 of file eeprom_18xx_43xx.h.

STATIC INLINE void Chip_EEPROM_WaitForIntStatus | ( | IP_EEPROM_002_T * | pEEPROM,
|  | uint32_t | mask
| ) |  |

Wait for interrupt occurs.

Parameters

  pEEPROM | : Pointer to EEPROM peripheral block structure
  mask | : Expected interrupt

Returns
  Nothing

Definition at line 135 of file eeprom_18xx_43xx.h.