![]() |
![]() |
|
CC27xxDriverLibrary
|
|
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... | |
| #define | FLASH_NO_PROTECT 0x00000000 |
| Sector not protected. More... | |
| #define | FLASH_WRITE_PROTECT 0x00000001 |
| Sector is write / erase protected. 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 | FlashGetProtection (uint32_t address) |
| Returns the write/erase protection for a given main flash address. 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 (uint32_t bankSelect) |
| Erase all unprotected sectors in the selected flash main bank. More... | |
| __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.
Referenced by FlashGetProtection().
| #define FAPI_STATUS_INVALID_KEY 0x00000010 |
Invalid random jump protection key.
| #define FLASH_NO_PROTECT 0x00000000 |
Sector not protected.
Referenced by FlashGetProtection().
| #define FLASH_WRITE_PROTECT 0x00000001 |
Sector is write / erase protected.
Referenced by FlashGetProtection().
| __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.
| __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.
| __STATIC_INLINE uint32_t FlashGetProtection | ( | uint32_t | address | ) |
Returns the write/erase protection for a given main flash address.
VIMS WEPRA protects the first 32 sectors of the logical bank 0 main region from program or erase, with 1 bit protecting each sector (sector 0 to sector 31).
VIMS WEPRB0 protects physical bank 0 main region sectors from program and erase. Each bit corresponds to a group of 8 sectors. First 4-bit are reserved if physical Bank 0 is logical bank 0 [CTL.SWAP] = 0.
VIMS WEPRB1 protects physical bank 1 main region sectors from program and erase. Each bit corresponds to a group of 8 sectors. First 4-bit are reserved if physical Bank 1 is logical bank 0 [CTL.SWAP] = 1.
| address | is the memory location to check status for. |
References FAPI_STATUS_ADDRESS_ERROR, FLASH_NO_PROTECT, and FLASH_WRITE_PROTECT.
| __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, and FAPI_STATUS_SUCCESS.
| __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, and FAPI_STATUS_FSM_READY.
| __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, and HapiFlashSectorErase.
| __STATIC_INLINE uint32_t FlashEraseBank | ( | uint32_t | bankSelect | ) |
Erase all unprotected sectors in the selected flash main bank.
This function will erase all unprotected main bank flash sectors. It will not return until the flash sectors has been erased or an error condition occurs.
| bankSelect | The selection between which bank to erase, either |
References FLASH_API_KEY, and HapiFlashBankErase.
| __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, and HapiFlashProgram.