Functions | |
static uint32_t | FlashSectorSizeGet (void) |
Get size of a flash sector in number of bytes. More... | |
static uint32_t | FlashSizeGet (void) |
Get the size of the flash. More... | |
void | FlashPowerModeSet (uint32_t ui32PowerMode, uint32_t ui32BankGracePeriod, uint32_t ui32PumpGracePeriod) |
Set power mode. More... | |
uint32_t | FlashPowerModeGet (void) |
Get current configured power mode. More... | |
void | FlashProtectionSet (uint32_t ui32SectorAddress, uint32_t ui32ProtectMode) |
Set sector protection. More... | |
uint32_t | FlashProtectionGet (uint32_t ui32SectorAddress) |
Get sector protection. More... | |
uint32_t | FlashProtectionSave (uint32_t ui32SectorAddress) |
Save sector protection to make it permanent. More... | |
static uint32_t | FlashCheckFsmForError (void) |
Checks if the Flash state machine has detected an error. More... | |
static uint32_t | FlashCheckFsmForReady (void) |
Checks if the Flash state machine is ready. More... | |
static void | FlashIntRegister (void(*pfnHandler)(void)) |
Registers an interrupt handler for the flash interrupt in the dynamic interrupt table. More... | |
static void | FlashIntUnregister (void) |
Unregisters the interrupt handler for the flash interrupt in the dynamic interrupt table. More... | |
static void | FlashIntEnable (uint32_t ui32IntFlags) |
Enables flash controller interrupt sources. More... | |
static void | FlashIntDisable (uint32_t ui32IntFlags) |
Disables individual flash controller interrupt sources. More... | |
static uint32_t | FlashIntStatus (void) |
Gets the current interrupt status. More... | |
static void | FlashIntClear (uint32_t ui32IntFlags) |
Clears flash controller interrupt source. More... | |
uint32_t | FlashSectorErase (uint32_t ui32SectorAddress) |
Erase a flash sector. More... | |
uint32_t | FlashProgram (uint8_t *pui8DataBuffer, uint32_t ui32Address, uint32_t ui32Count) |
Programs unprotected flash sectors in the main bank. More... | |
uint32_t | FlashProgram4X (uint8_t *pui8DataBuffer, uint32_t ui32Address, uint32_t ui32Count) |
uint32_t | FlashProgramNowait (uint32_t ui32StartAddress, uint8_t *pui8DataBuffer, uint8_t ui8NoOfBytes) |
Starts programming within unprotected main bank flash sector and returns. More... | |
bool | FlashEfuseReadRow (uint32_t *pui32EfuseData, uint32_t ui32RowAddress) |
Reads efuse data from specified row. More... | |
void | FlashDisableSectorsForWrite (void) |
Disables all sectors for erase and programming on the active bank. More... | |
Enumerations | |
enum | tFlashStateCommandsType { FAPI_PROGRAM_FOURWORD = 0x0021, FAPI_PROGRAM_TWOWORD = 0x0011, FAPI_PROGRAM_ONEWORD = 0x0001, FAPI_ERASE_SECTOR = 0x0042, FAPI_ERASE_BANK = 0x0052, FAPI_CLEAR_STATUS = 0x0005, FAPI_READVERIFY = 0x0003 } |
Defined values for Flash State Machine commands. More... | |
|
inlinestatic |
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.
Referenced by FlashProgram(), FlashProgram4X(), and FlashSectorErase().
|
inlinestatic |
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.
Referenced by FlashProgram(), FlashProgram4X(), and FlashSectorErase().
void FlashDisableSectorsForWrite | ( | void | ) |
Disables all sectors for erase and programming on the active bank.
This function is depreciated
Referenced by FlashIntClear().
bool FlashEfuseReadRow | ( | uint32_t * | pui32EfuseData, |
uint32_t | ui32RowAddress | ||
) |
Reads efuse data from specified row.
This function will read one efuse row. It is assumed that any previous efuse operation has finished.
pui32EfuseData | is pointer to variable to be updated with efuse data. |
ui32RowAddress | is the efuse row number to be read. First row is row number 0. |
false
: OK status.true
: Error status Referenced by FlashIntClear().
|
inlinestatic |
Clears flash controller interrupt source.
The flash controller interrupt source is cleared, so that it no longer asserts. This must be done in the interrupt handler to keep it from being called again immediately upon exit.
ui32IntFlags | is the bit mask of the interrupt sources to be cleared. Can be any of: |
|
inlinestatic |
Disables individual flash controller interrupt sources.
This function disables the flash controller interrupt sources.
ui32IntFlags | is the bit mask of the interrupt sources to be disabled. The parameter is the bitwise OR of any of the following:
|
|
inlinestatic |
Enables flash controller interrupt sources.
This function enables the flash controller interrupt sources.
ui32IntFlags | is the bit mask of the interrupt sources to be enabled. The parameter is the bitwise OR of any of the following:
|
|
inlinestatic |
Registers an interrupt handler for the flash interrupt in the dynamic interrupt table.
This function registers a function as the interrupt handler for a specific interrupt and enables the corresponding interrupt in the interrupt controller.
Specific FLASH interrupts must be enabled via FlashIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source.
pfnHandler | is a pointer to the function to be called when the flash interrupt occurs. |
|
inlinestatic |
Gets the current interrupt status.
This function returns the interrupt status for the Flash.
|
inlinestatic |
Unregisters the interrupt handler for the flash interrupt in the dynamic interrupt table.
This function does the actual unregistering of the interrupt handler. It clears the handler to be called when a FLASH interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
uint32_t FlashPowerModeGet | ( | void | ) |
Get current configured power mode.
This function is depreciated
Referenced by FlashSizeGet().
void FlashPowerModeSet | ( | uint32_t | ui32PowerMode, |
uint32_t | ui32BankGracePeriod, | ||
uint32_t | ui32PumpGracePeriod | ||
) |
Set power mode.
This function is depreciated
ui32PowerMode | is the wanted power mode. The defined flash power modes are:
|
ui32BankGracePeriod | is the starting count value for the bank grace period down counter. |
ui32PumpGracePeriod | is the starting count value for the pump grace period down counter. |
Referenced by FlashSizeGet().
uint32_t FlashProgram | ( | uint8_t * | pui8DataBuffer, |
uint32_t | ui32Address, | ||
uint32_t | ui32Count | ||
) |
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 pui8DataBuffer
pointer can not point to flash.
pui8DataBuffer | is a pointer to the data to be programmed. |
ui32Address | is the starting address in flash to be programmed. |
ui32Count | is the number of bytes to be programmed. |
Referenced by FlashIntClear(), FlashProtectionSave(), and FlashSectorErase().
uint32_t FlashProgram4X | ( | uint8_t * | pui8DataBuffer, |
uint32_t | ui32Address, | ||
uint32_t | ui32Count | ||
) |
Referenced by FlashIntClear().
uint32_t FlashProgramNowait | ( | uint32_t | ui32StartAddress, |
uint8_t * | pui8DataBuffer, | ||
uint8_t | ui8NoOfBytes | ||
) |
Starts programming within unprotected main bank flash sector and returns.
This function is depreciated
The pui8DataBuffer
pointer can not point to flash.
ui32StartAddress | is the start address in flash to program. |
pui8DataBuffer | is a pointer to the data to be programmed. |
ui8NoOfBytes | is the number of bytes to program. |
Referenced by FlashIntClear().
uint32_t FlashProtectionGet | ( | uint32_t | ui32SectorAddress | ) |
Get sector protection.
This return the protection mode for the specified flash bank sector.
ui32SectorAddress | is the start address of the desired sector. |
Referenced by FlashProtectionSave(), and FlashSizeGet().
uint32_t FlashProtectionSave | ( | uint32_t | ui32SectorAddress | ) |
Save sector protection to make it permanent.
This function will save the current protection mode for the specified flash bank sector.
This function must only be executed from ROM or SRAM.
ui32SectorAddress | is the start address of the sector to be protected. |
Referenced by FlashSizeGet().
void FlashProtectionSet | ( | uint32_t | ui32SectorAddress, |
uint32_t | ui32ProtectMode | ||
) |
Set sector protection.
This function will set the specified protection on specified flash bank sector. A sector can either have no protection or have write protection which guards for both program and erase of that sector. Sector protection can only be changed from FLASH_NO_PROTECT to FLASH_WRITE_PROTECT! After write protecting a sector this sector can only be set back to unprotected by a device reset.
ui32SectorAddress | is the start address of the sector to protect. |
ui32ProtectMode | is the enumerated sector protection mode. |
Referenced by FlashSizeGet().
uint32_t FlashSectorErase | ( | uint32_t | ui32SectorAddress | ) |
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.
ui32SectorAddress | is the starting address in flash of the sector to be erased. |
Referenced by FlashIntClear().
|
inlinestatic |
Get size of a flash sector in number of bytes.
This function will return the size of a flash sector in number of bytes.
Referenced by FlashProgram(), FlashProgram4X(), FlashProtectionGet(), FlashProtectionSave(), FlashProtectionSet(), FlashSectorErase(), and FlashSizeGet().
|
inlinestatic |
Get the size of the flash.
This function returns the size of the flash main bank in number of bytes.
Referenced by FlashProgram(), FlashProgram4X(), and FlashSectorErase().
#define DUMPWORD_INSTR 0x04 |
Referenced by FlashEfuseReadRow().
#define FAPI_STATUS_ADDRESS_ALIGN_ERROR 0x00000006 |
Referenced by FlashProtectionGet(), FlashProtectionSave(), and FlashSectorErase().
#define FAPI_STATUS_ADDRESS_ERROR 0x00000005 |
Referenced by FlashProgram(), FlashProgram4X(), FlashProtectionGet(), FlashProtectionSave(), and FlashSectorErase().
#define FAPI_STATUS_BANK_NUM_ERROR 0x00000007 |
#define FAPI_STATUS_FSM_BUSY 0x00000001 |
Referenced by FlashCheckFsmForReady(), FlashProgram(), FlashProgram4X(), and FlashSectorErase().
#define FAPI_STATUS_FSM_ERROR 0x00000004 |
Referenced by FlashCheckFsmForError().
#define FAPI_STATUS_FSM_READY 0x00000002 |
Referenced by FlashCheckFsmForReady().
#define FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH 0x00000003 |
#define FAPI_STATUS_NOSUPPORT_ERROR 0x00000008 |
Referenced by FlashPowerModeGet(), and FlashProgramNowait().
#define FAPI_STATUS_SUCCESS 0x00000000 |
Referenced by FlashCheckFsmForError(), FlashProgram(), FlashProgram4X(), and FlashSectorErase().
#define FAPI_STATUS_UNPROTECT_ERROR 0x00000009 |
Referenced by FlashProtectionSave().
#define FBFALLBACK_ACTIVE 3 |
#define FBFALLBACK_DEEP_STDBY 1 |
#define FBFALLBACK_SLEEP 0 |
#define FCFG1_OFFSET 0x0800 |
#define FLASH_INT_FSM_DONE 0x00400000 |
#define FLASH_INT_RV 0x00010000 |
#define FLASH_NO_PROTECT 0x00000000 |
Referenced by FlashProtectionGet().
#define FLASH_PWR_ACTIVE_MODE 0x00000000 |
#define FLASH_PWR_DEEP_STDBY_MODE 0x00000002 |
#define FLASH_PWR_OFF_MODE 0x00000001 |
#define FLASH_WRITE_PROTECT 0x00000001 |
Referenced by FlashProtectionGet(), FlashProtectionSave(), and FlashProtectionSet().
#define FLASHWORD_MASKBIT (0x03) |
Referenced by FlashCopyOneFlashWordToHW().
#define FLASHWORD_SHIFTBIT (2) |
Referenced by FlashCopyOneFlashWordToHW().
#define FLASHWORDSIZE_FOUR (0x40) |
Referenced by FlashProgram(), and FlashProgram4X().
#define FLASHWORDSIZE_ONE (0x10) |
Referenced by FlashCopyOneFlashWordToHW().
#define FLASHWORDSIZE_TWO (0x20) |
Referenced by FlashProgram(), and FlashProgram4X().
#define FSM_REG_WRT_DISABLE 2 |
#define FSM_REG_WRT_ENABLE 5 |
#define FW_PWRMODE_DEPRECATED 0x00000002 |
#define FW_WRT_TRIMMED 0x00000001 |
Defined values for Flash State Machine commands.