LPCOpen SPIFI FLASH Library (LPCSPIFILIB)
Documentation for the LPCSPIFILIB library
|
Device functions are used to perform LPCSPIFILIB device operations.
Macros | |
#define | spifiDevGetFamilyName spifiDevGetDeviceName |
Functions | |
SPIFI_ERR_T | spifiDevRegister (const SPIFI_FAM_NODE_T *pFamily, SPIFI_DEV_NODE_T *pDevData) |
Add device to family driver. More... | |
static INLINE uint32_t | spifiDevGetCount (const SPIFI_FAM_NODE_T *pFamily) |
Returns the number of supported devices within a family. More... | |
const char * | spifiDevEnumerateName (SPIFI_DEV_ENUMERATOR_T *pContext, uint8_t reset) |
Enumerates the friendly names of supported devices. More... | |
SPIFI_ERR_T | spifiDevInit (const SPIFI_HANDLE_T *pHandle) |
Initialize a detected LPCSPIFILIB device. More... | |
SPIFI_ERR_T | spifiDevDeInit (const SPIFI_HANDLE_T *pHandle) |
De-initialize a detected LPCSPIFILIB device. More... | |
SPIFI_ERR_T | spifiDevSetMemMode (const SPIFI_HANDLE_T *pHandle, uint8_t enMMode) |
Sets or clears memory mode. More... | |
uint8_t | spifiDevGetMemoryMode (const SPIFI_HANDLE_T *pSpifi) |
Return status of memory mode. More... | |
static INLINE SPIFI_ERR_T | spifiDevUnlockDevice (const SPIFI_HANDLE_T *pHandle) |
Full LPCSPIFILIB device unlock. More... | |
static INLINE SPIFI_ERR_T | spifiDevLockDevice (const SPIFI_HANDLE_T *pHandle) |
Full LPCSPIFILIB device lock. More... | |
static INLINE SPIFI_ERR_T | spifiDevUnlockBlock (const SPIFI_HANDLE_T *pHandle, uint32_t block) |
Unlock a single device block. More... | |
static INLINE SPIFI_ERR_T | spifiDevLockBlock (const SPIFI_HANDLE_T *pHandle, uint32_t block) |
Lock a single device block. More... | |
static INLINE SPIFI_ERR_T | spifiDevEraseAll (const SPIFI_HANDLE_T *pHandle) |
Full LPCSPIFILIB device erase. More... | |
static INLINE SPIFI_ERR_T | spifiDevEraseSubBlock (const SPIFI_HANDLE_T *pHandle, uint32_t blknum) |
Erase a sub-block. More... | |
static INLINE SPIFI_ERR_T | spifiDevPageProgram (const SPIFI_HANDLE_T *pHandle, uint32_t addr, uint32_t *writeBuff, uint32_t bytes) |
Program up to a page of data at an address. More... | |
static INLINE SPIFI_ERR_T | spifiDevRead (const SPIFI_HANDLE_T *pHandle, uint32_t addr, uint32_t *readBuff, uint32_t bytes) |
Read data from a LPCSPIFILIB device. More... | |
static INLINE void | spifiDevReset (const SPIFI_HANDLE_T *pHandle) |
Reset the device. More... | |
static INLINE const char * | spifiDevGetDeviceName (const SPIFI_HANDLE_T *pHandle) |
Returns a string pointer to the generic device family name. More... | |
uint32_t | spifiDevGetInfo (const SPIFI_HANDLE_T *pHandle, SPIFI_INFO_ID_T infoId) |
Returns information on the device. More... | |
#define spifiDevGetFamilyName spifiDevGetDeviceName |
Deprecated! Do NOT use for new development
SPIFI_ERR_T spifiDevDeInit | ( | const SPIFI_HANDLE_T * | pHandle | ) |
De-initialize a detected LPCSPIFILIB device.
pHandle | : Pointer to a LPCSPIFILIB device handle |
const char* spifiDevEnumerateName | ( | SPIFI_DEV_ENUMERATOR_T * | pContext, |
uint8_t | reset | ||
) |
Enumerates the friendly names of supported devices.
pContext | : Pointer to a SPIFI_DEV_ENUMERATOR_T context structure |
reset | : 0 enumerates next device, 1 resets list to beginning and returns first device |
|
static |
Full LPCSPIFILIB device erase.
pHandle | : Pointer to a LPCSPIFILIB device handle |
|
static |
Erase a sub-block.
pHandle | : Pointer to a LPCSPIFILIB device handle |
blknum | : Sub-block number to erase |
|
static |
Returns the number of supported devices within a family.
pFamily | : Pointer to a SPIFI_DEV_FAMILY_T family handle |
|
static |
Returns a string pointer to the generic device family name.
pHandle | : Pointer to a LPCSPIFILIB device handle |
uint32_t spifiDevGetInfo | ( | const SPIFI_HANDLE_T * | pHandle, |
SPIFI_INFO_ID_T | infoId | ||
) |
Returns information on the device.
pHandle | : Pointer to a LPCSPIFILIB device handle |
infoId | : Info to get about the device |
uint8_t spifiDevGetMemoryMode | ( | const SPIFI_HANDLE_T * | pSpifi | ) |
Return status of memory mode.
pSpifi | : Base address of SPIFI controller |
SPIFI_ERR_T spifiDevInit | ( | const SPIFI_HANDLE_T * | pHandle | ) |
Initialize a detected LPCSPIFILIB device.
pHandle | : Pointer to a LPCSPIFILIB device handle |
|
static |
Lock a single device block.
pHandle | : Pointer to a LPCSPIFILIB device handle |
block | : Block number to lock |
|
static |
Full LPCSPIFILIB device lock.
pHandle | : Pointer to a LPCSPIFILIB device handle |
|
static |
Program up to a page of data at an address.
pHandle | : Pointer to a LPCSPIFILIB device handle |
addr | : LPCSPIFILIB device address to start write at |
writeBuff | : Address of buffer to write, must be 32-bit aligned |
bytes | : Number of bytes to write, must not exceed page length |
|
static |
Read data from a LPCSPIFILIB device.
pHandle | : Pointer to a LPCSPIFILIB device handle |
addr | : LPCSPIFILIB device address to read from |
readBuff | : Address of buffer to fill, must be 32-bit aligned |
bytes | : Number of bytes to read |
SPIFI_ERR_T spifiDevRegister | ( | const SPIFI_FAM_NODE_T * | pFamily, |
SPIFI_DEV_NODE_T * | pDevData | ||
) |
Add device to family driver.
pFamily | : Pointer to a SPIFI_DEV_FAMILY_T family handle |
pDevData | : Pointer to a persistent SPIFI_DEV_DATA_T device structure |
|
static |
Reset the device.
pHandle | : Pointer to a LPCSPIFILIB device handle |
SPIFI_ERR_T spifiDevSetMemMode | ( | const SPIFI_HANDLE_T * | pHandle, |
uint8_t | enMMode | ||
) |
Sets or clears memory mode.
pHandle | : Pointer to a LPCSPIFILIB device handle |
enMMode | : true to enable memory mode, false to disable |
|
static |
Unlock a single device block.
pHandle | : Pointer to a LPCSPIFILIB device handle |
block | : Block number to unlock |
|
static |
Full LPCSPIFILIB device unlock.
pHandle | : Pointer to a LPCSPIFILIB device handle |