The MCUXpresso SDK provides a peripheral driver for the eeprom module of MCUXpresso SDK devices.
Typical use case
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/eeprom
|
static void | EEPROM_SetAutoProgram (EEPROM_Type *base, eeprom_auto_program_t autoProgram) |
| Set EEPROM automatic program feature. More...
|
|
static void | EEPROM_SetPowerDownMode (EEPROM_Type *base, bool enable) |
| Set EEPROM to in/out power down mode. More...
|
|
static void | EEPROM_EnableInterrupt (EEPROM_Type *base, uint32_t mask) |
| Enable EEPROM interrupt. More...
|
|
static void | EEPROM_DisableInterrupt (EEPROM_Type *base, uint32_t mask) |
| Disable EEPROM interrupt. More...
|
|
static uint32_t | EEPROM_GetInterruptStatus (EEPROM_Type *base) |
| Get the status of all interrupt flags for ERPROM. More...
|
|
static uint32_t | EEPROM_GetEnabledInterruptStatus (EEPROM_Type *base) |
| Get the status of enabled interrupt flags for ERPROM. More...
|
|
static void | EEPROM_SetInterruptFlag (EEPROM_Type *base, uint32_t mask) |
| Set interrupt flags manually. More...
|
|
static void | EEPROM_ClearInterruptFlag (EEPROM_Type *base, uint32_t mask) |
| Clear interrupt flags manually. More...
|
|
status_t | EEPROM_WriteWord (EEPROM_Type *base, uint32_t offset, uint32_t data) |
| Write a word data in address of EEPROM. More...
|
|
status_t | EEPROM_WritePage (EEPROM_Type *base, uint32_t pageNum, uint32_t *data) |
| Write a page data into EEPROM. More...
|
|
Enumerator |
---|
kEEPROM_AutoProgramDisable |
Disable auto program.
|
kEEPROM_AutoProgramWriteWord |
Auto program triggered after 1 word is written.
|
kEEPROM_AutoProgramLastWord |
Auto program triggered after last word of a page written.
|
Enumerator |
---|
kEEPROM_ProgramFinishInterruptEnable |
Interrupt while program finished.
|
void EEPROM_Init |
( |
EEPROM_Type * |
base, |
|
|
const eeprom_config_t * |
config, |
|
|
uint32_t |
sourceClock_Hz |
|
) |
| |
This function configures the EEPROM module with the user-defined configuration. This function also sets the internal clock frequency to about 155kHz according to the source clock frequency.
- Parameters
-
base | EEPROM peripheral base address. |
config | The pointer to the configuration structure. |
sourceClock_Hz | EEPROM source clock frequency in Hz. |
- Parameters
-
config | EEPROM config structure pointer. |
void EEPROM_Deinit |
( |
EEPROM_Type * |
base | ) |
|
- Parameters
-
base | EEPROM peripheral base address. |
EEPROM write always needs a program and erase cycle to write the data into EEPROM. This program and erase cycle can be finished automaticlly or manually. If users want to use or disable auto program feature, users can call this API.
- Parameters
-
base | EEPROM peripheral base address. |
autoProgram | EEPROM auto program feature need to set. |
static void EEPROM_SetPowerDownMode |
( |
EEPROM_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
This function make EEPROM eneter or out of power mode. Notice that, users shall not put EEPROM into power down mode while there is still any pending EEPROM operation. While EEPROM is wakes up from power down mode, any EEPROM operation has to be suspended for 100 us.
- Parameters
-
base | EEPROM peripheral base address. |
enable | True means enter to power down mode, false means wake up. |
static void EEPROM_EnableInterrupt |
( |
EEPROM_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | EEPROM peripheral base address. |
mask | EEPROM interrupt enable mask. It is a logic OR of members the enumeration :: eeprom_interrupt_enable_t |
static void EEPROM_DisableInterrupt |
( |
EEPROM_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | EEPROM peripheral base address. |
mask | EEPROM interrupt enable mask. It is a logic OR of members the enumeration :: eeprom_interrupt_enable_t |
static uint32_t EEPROM_GetInterruptStatus |
( |
EEPROM_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | EEPROM peripheral base address. |
- Returns
- EEPROM interrupt flag status
static uint32_t EEPROM_GetEnabledInterruptStatus |
( |
EEPROM_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | EEPROM peripheral base address. |
- Returns
- EEPROM enabled interrupt flag status
static void EEPROM_SetInterruptFlag |
( |
EEPROM_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
This API trigger a interrupt manually, users can no need to wait for hardware trigger interrupt. Call this API will set the corresponding bit in INSTAT register.
- Parameters
-
base | EEPROM peripheral base address. |
mask | EEPROM interrupt flag need to be set. It is a logic OR of members of enumeration:: eeprom_interrupt_enable_t |
static void EEPROM_ClearInterruptFlag |
( |
EEPROM_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
This API clears interrupt flags manually. Call this API will clear the corresponding bit in INSTAT register.
- Parameters
-
base | EEPROM peripheral base address. |
mask | EEPROM interrupt flag need to be cleared. It is a logic OR of members of enumeration:: eeprom_interrupt_enable_t |
status_t EEPROM_WriteWord |
( |
EEPROM_Type * |
base, |
|
|
uint32_t |
offset, |
|
|
uint32_t |
data |
|
) |
| |
Users can write a page or at least a word data into EEPROM address.
- Parameters
-
base | EEPROM peripheral base address. |
offset | Offset from the begining address of EEPROM. This value shall be 4-byte aligned. |
data | Data need be write. |
status_t EEPROM_WritePage |
( |
EEPROM_Type * |
base, |
|
|
uint32_t |
pageNum, |
|
|
uint32_t * |
data |
|
) |
| |
Users can write a page or at least a word data into EEPROM address.
- Parameters
-
base | EEPROM peripheral base address. |
pageNum | Page number to be written. |
data | Data need be write. This array data size shall equals to the page size. |