![]() |
![]() |
|
CC23x0r2DriverLibrary
|
|
Macros | |
| #define | FAPI_STATUS_SUCCESS 0x00000000 |
| Function completed successfully. More... | |
| #define | FAPI_STATUS_FSM_BUSY 0x00000001 |
| FSM is Busy. More... | |
| #define | FAPI_STATUS_FSM_READY 0x00000002 |
| FSM is Ready. More... | |
| #define | FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH 0x00000003 |
| Incorrect parameter value. More... | |
| #define | FAPI_STATUS_FSM_ERROR 0x00000004 |
| Flash program/erase operation failed. More... | |
| #define | FAPI_STATUS_ADDRESS_ERROR 0x00000005 |
| Address range or alignment error. More... | |
| #define | FAPI_STATUS_INVALID_KEY 0x00000010 |
| Invalid random jump protection key. More... | |
Functions | |
| __STATIC_INLINE uint32_t | FlashGetSectorSize (void) |
| Get size of a flash sector in number of bytes. More... | |
| __STATIC_INLINE uint32_t | FlashGetSize (void) |
| Get the size of the flash. More... | |
| __STATIC_INLINE uint32_t | FlashCheckFsmForError (void) |
| Checks if the Flash state machine has detected an error. More... | |
| __STATIC_INLINE uint32_t | FlashCheckFsmForReady (void) |
| Checks if the Flash state machine is ready. More... | |
| __STATIC_INLINE uint32_t | FlashEraseSector (uint32_t sectorAddress) |
| Erase a flash sector. More... | |
| __STATIC_INLINE uint32_t | FlashEraseBank (void) |
| __STATIC_INLINE uint32_t | FlashProgram (uint8_t *dataBuffer, uint32_t address, uint32_t count) |
| Programs unprotected flash sectors in the main bank. More... | |
| #define FAPI_STATUS_SUCCESS 0x00000000 |
Function completed successfully.
Referenced by FlashCheckFsmForError().
| #define FAPI_STATUS_FSM_BUSY 0x00000001 |
FSM is Busy.
Referenced by FlashCheckFsmForReady().
| #define FAPI_STATUS_FSM_READY 0x00000002 |
FSM is Ready.
Referenced by FlashCheckFsmForReady().
| #define FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH 0x00000003 |
Incorrect parameter value.
| #define FAPI_STATUS_FSM_ERROR 0x00000004 |
Flash program/erase operation failed.
Referenced by FlashCheckFsmForError().
| #define FAPI_STATUS_ADDRESS_ERROR 0x00000005 |
Address range or alignment error.
| #define FAPI_STATUS_INVALID_KEY 0x00000010 |
Invalid random jump protection key.
| __STATIC_INLINE uint32_t FlashGetSectorSize | ( | void | ) |
Get size of a flash sector in number of bytes.
This function will return the size of a flash sector in number of bytes.
References FLASH_MAIN_SECTOR_SIZE.
| __STATIC_INLINE uint32_t FlashGetSize | ( | void | ) |
Get the size of the flash.
This function returns the size of the flash main bank in number of bytes.
References FLASH_MAIN_SIZE.
| __STATIC_INLINE uint32_t FlashCheckFsmForError | ( | void | ) |
Checks if the Flash state machine has detected an error.
This function returns the status of the Flash State Machine indicating if an error is detected or not. Primary use is to check if an Erase or Program operation has failed.
References FAPI_STATUS_FSM_ERROR, FAPI_STATUS_SUCCESS, FLASH_BASE, FLASH_O_STATCMD, FLASH_STATCMD_CMDPASS_M, and HWREG.
| __STATIC_INLINE uint32_t FlashCheckFsmForReady | ( | void | ) |
Checks if the Flash state machine is ready.
This function returns the status of the Flash State Machine indicating if it is ready to accept a new command or not. Primary use is to check if an Erase or Program operation has finished.
References FAPI_STATUS_FSM_BUSY, FAPI_STATUS_FSM_READY, FLASH_BASE, FLASH_O_STATCMD, FLASH_STATCMD_CMDDONE_M, and HWREG.
| __STATIC_INLINE uint32_t FlashEraseSector | ( | uint32_t | sectorAddress | ) |
Erase a flash sector.
This function will erase the specified flash sector. The function will not return until the flash sector has been erased or an error condition occurred. If flash top sector is erased the function will program the the device security data bytes with default values. The device security data located in the customer configuration area of the flash top sector, must have valid values at all times. These values affect the configuration of the device during boot.
| sectorAddress | is the starting address in flash of the sector to be erased. |
References FLASH_API_KEY, HapiFlashSectorErase, HWREG, VIMS_BASE, VIMS_CCHCTRL_CCHEN_DISABLE, VIMS_CCHCTRL_CCHMPEN_DISABLE, VIMS_CCHCTRL_CCHPFEN_DISABLE, and VIMS_O_CCHCTRL.
| __STATIC_INLINE uint32_t FlashEraseBank | ( | void | ) |
| __STATIC_INLINE uint32_t FlashProgram | ( | uint8_t * | dataBuffer, |
| uint32_t | address, | ||
| uint32_t | count | ||
| ) |
Programs unprotected flash sectors in the main bank.
This function programs a sequence of bytes into the on-chip flash. Programming each location consists of the result of an AND operation of the new data and the existing data; in other words bits that contain 1 can remain 1 or be changed to 0, but bits that are 0 cannot be changed to 1. Therefore, a byte can be programmed multiple times as long as these rules are followed; if a program operation attempts to change a 0 bit to a 1 bit, that bit will not have its value changed.
This function does not return until the data has been programmed or a programming error occurs.
The dataBuffer pointer can not point to flash.
| dataBuffer | is a pointer to the data to be programmed. |
| address | is the starting address in flash to be programmed. |
| count | is the number of bytes to be programmed. |
References FLASH_API_KEY, HapiFlashProgram, HWREG, VIMS_BASE, VIMS_CCHCTRL_CCHEN_DISABLE, VIMS_CCHCTRL_CCHMPEN_DISABLE, VIMS_CCHCTRL_CCHPFEN_DISABLE, and VIMS_O_CCHCTRL.