MCUXpresso SDK API Reference Manual
Rev 2.12.1
NXP Semiconductors
|
Data Structures | |
struct | lpspi_flash_driver_interface_t |
Interface for the external flash driver via SPI NOR/EEPROM. More... | |
Macros | |
#define | kROM_StatusGroup_LPSPI 4 |
ROM Group number for LPSPI status codes. More... | |
Enumerations | |
enum | { kStatus_ROM_LPSPI_Busy = MAKE_STATUS(kROM_StatusGroup_LPSPI, 0), kStatus_ROM_LPSPI_Error = MAKE_STATUS(kROM_StatusGroup_LPSPI, 1), kStatus_ROM_LPSPI_Idle = MAKE_STATUS(kROM_StatusGroup_LPSPI, 2), kStatus_ROM_LPSPI_OutOfRange = MAKE_STATUS(kROM_StatusGroup_LPSPI, 3) } |
Status for the LPSPI driver. More... | |
enum | { EepormCmd_GeneralRead = false, EepormCmd_FastRead = true } |
The type of Read eeprom command. More... | |
enum | eraseOptions_t { kSize_ErasePage = 0x1, kSize_Erase4K = 0x2 } |
The length, given in bytes to be erased. More... | |
Functions | |
status_t | SPI_EepromInit (uint32_t baudRate) |
Initialize SPI NOR/EEPROM. More... | |
status_t | SPI_EepromRead (uint8_t *dest, uint32_t length, uint32_t address, bool requestFastRead) |
Read data via SPI NOR/EEPROM. More... | |
status_t | SPI_EepromWrite (uint8_t *data, uint32_t length, uint32_t address) |
Write data via SPI NOR/EEPROM. More... | |
status_t | SPI_EepromErase (uint32_t address, eraseOptions_t option) |
Erase data via SPI NOR/EEPROM. More... | |
void | SPI_EepromFinalize (void) |
De-initialize LPSPI. | |
struct lpspi_flash_driver_interface_t |
#define kROM_StatusGroup_LPSPI 4 |
anonymous enum |
anonymous enum |
enum eraseOptions_t |
status_t SPI_EepromInit | ( | uint32_t | baudRate | ) |
baudRate | Config baudrate for SPI. |
kStatus_Fail | EEPROM initialization failed. |
kStatus_InvalidArgument | Invalid input parameter. |
kStatus_ROM_LPSPI_Busy | LPSPI transfer is busy. |
kStatus_Success | The eeprom is initialized successfully. |
status_t SPI_EepromRead | ( | uint8_t * | dest, |
uint32_t | length, | ||
uint32_t | address, | ||
bool | requestFastRead | ||
) |
dest | A pointer to the buffer of data that is to be read from eeprom. |
length | The length, given in bytes to be read. |
address | The start address of the desired eeprom memory to be read. |
requestFastRead | The type of Read eeprom command. FALSE: Use the general Read command to read eeprom TRUE: Use Fast Read command to read data from eeprom. |
kStatus_Fail | Failed to read data from eeprom. |
kStatus_Success | Read data from eeprom successfully. |
kStatus_InvalidArgument | Invalid input parameter. |
kStatus_ROM_LPSPI_Busy | LPSPI transfer is busy. |
status_t SPI_EepromWrite | ( | uint8_t * | data, |
uint32_t | length, | ||
uint32_t | address | ||
) |
data | A pointer to the source buffer of data that is to be programmed into the eeprom. |
length | The length, given in bytes to be programmed. |
address | The start address of the desired eeprom memory to be programed. |
kStatus_Fail | Failed to write data to eeprom. |
kStatus_Success | Successfully write data to eeprom. |
kStatus_InvalidArgument | Invalid input parameter. |
kStatus_ROM_LPSPI_Busy | LPSPI transfer is busy. |
status_t SPI_EepromErase | ( | uint32_t | address, |
eraseOptions_t | option | ||
) |
address | The start address of the desired eeprom memory to be erased. |
option | The length, given in bytes to be erased. |
kStatus_Fail | Failed to erase data frome the eeprom. |
kStatus_Success | Erase data from eeprom successfully. |
kStatus_InvalidArgument | Invalid input parameter. |
kStatus_ROM_LPSPI_Busy | LPSPI transfer is busy. |