| 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 | Variables
LPC18xx/43xx Simple eeprom example
Peripheral examples

## Detailed Description

Example description
The EEPROM example shows how to use EEPROM interface driver.
The examples allows you to place a small string in a single page of the EEPROM and the string will remain across reset cycles.

To use the example, connect a serial cable to the board's RS232/UART port and start a terminal program to monitor the port. The terminal program on the host PC should be setup for 115K8N1.

Special connection requirements
There are no special connection requirements for this example.

Build procedures:
LPC18xx/43xx example quickstart for Keil uVision4
LPC18xx/43xx example quickstart for IAR EWARM
LPC18xx/43xx example quickstart for Code Red Xpresso

Supported boards and board setup:
Keil 1857 evaluation boards
Keil 4357 evaluation boards

Submitting LPCOpen issues:
Community support for LPCOpen

## Macros
#define | AUTOPROG_ON 1
#define | PAGE_ADDR 0x01/* Page number */
#define | CHKTAG "NxP"
#define | CHKTAG_SIZE 3
#define | ESC_CHAR 27

## Functions
static void | ShowString (char *str)
static uint32_t | MakeString (uint8_t *str)
STATIC void | EEPROM_Read (uint32_t pageOffset, uint32_t pageAddr, uint32_t *ptr, uint32_t size)
STATIC void | EEPROM_Erase (uint32_t pageAddr)
STATIC void | EEPROM_Write (uint32_t pageOffset, uint32_t pageAddr, uint32_t *ptr, uint32_t size)
int | main (void)
| Main program body.

## Variables
uint32_t | buffer [EEPROM_PAGE_SIZE/sizeof(uint32_t)]

## Macro Definition Documentation

#define AUTOPROG_ON 1

Definition at line 67 of file eeprom.c.

#define CHKTAG "NxP"

Definition at line 73 of file eeprom.c.

#define CHKTAG_SIZE 3

Definition at line 74 of file eeprom.c.

#define ESC_CHAR 27

Definition at line 77 of file eeprom.c.

#define PAGE_ADDR 0x01/* Page number */

Definition at line 70 of file eeprom.c.

## Function Documentation

STATIC void EEPROM_Erase | ( | uint32_t | pageAddr | ) |

Definition at line 156 of file eeprom.c.

STATIC void EEPROM_Read | ( | uint32_t | pageOffset,
|  | uint32_t | pageAddr,
|  | uint32_t * | ptr,
|  | uint32_t | size
| ) |  |

Definition at line 146 of file eeprom.c.

STATIC void EEPROM_Write | ( | uint32_t | pageOffset,
|  | uint32_t | pageAddr,
|  | uint32_t * | ptr,
|  | uint32_t | size
| ) |  |

Definition at line 173 of file eeprom.c.

int main | ( | void |  | ) |

Main program body.

Returns
  Does not return

Definition at line 201 of file eeprom.c.

static uint32_t MakeString | ( | uint8_t * | str | ) |
| static

Definition at line 113 of file eeprom.c.

static void ShowString | ( | char * | str | ) |
| static

Definition at line 87 of file eeprom.c.

## Variable Documentation

uint32_t buffer[EEPROM_PAGE_SIZE/sizeof(uint32_t)]

Definition at line 80 of file eeprom.c.