#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_flash.h"
#include "../inc/hw_nvmnw.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_ints.h"
#include "../inc/hw_aon_pmctl.h"
#include "../inc/hw_fcfg1.h"
#include "interrupt.h"
#include "debug.h"
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... | |
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... | |