39 #include <inc/hw_types.h>
49 #undef FlashsafeSizeGet
50 #define FlashsafeSizeGet NOROM_FlashsafeSizeGet
51 #undef FlashsafeSectorSizeGet
52 #define FlashsafeSectorSizeGet NOROM_FlashsafeSectorSizeGet
53 #undef FlashsafePowerModeSet
54 #define FlashsafePowerModeSet NOROM_FlashsafePowerModeSet
55 #undef FlashsafePowerModeGet
56 #define FlashsafePowerModeGet NOROM_FlashsafePowerModeGet
57 #undef FlashsafeProtectionSet
58 #define FlashsafeProtectionSet NOROM_FlashsafeProtectionSet
59 #undef FlashsafeProtectionGet
60 #define FlashsafeProtectionGet NOROM_FlashsafeProtectionGet
61 #undef FlashsafeProtectionSave
62 #define FlashsafeProtectionSave NOROM_FlashsafeProtectionSave
63 #undef FlashsafeCheckFsmForError
64 #define FlashsafeCheckFsmForError NOROM_FlashsafeCheckFsmForError
65 #undef FlashsafeCheckFsmForReady
66 #define FlashsafeCheckFsmForReady NOROM_FlashsafeCheckFsmForReady
67 #undef FlashsafeIntRegister
68 #define FlashsafeIntRegister NOROM_FlashsafeIntRegister
69 #undef FlashsafeIntUnregister
70 #define FlashsafeIntUnregister NOROM_FlashsafeIntUnregister
71 #undef FlashsafeIntEnable
72 #define FlashsafeIntEnable NOROM_FlashsafeIntEnable
73 #undef FlashsafeIntDisable
74 #define FlashsafeIntDisable NOROM_FlashsafeIntDisable
75 #undef FlashsafeIntStatus
76 #define FlashsafeIntStatus NOROM_FlashsafeIntStatus
77 #undef FlashsafeIntClear
78 #define FlashsafeIntClear NOROM_FlashsafeIntClear
79 #undef FlashsafeSectorErase
80 #define FlashsafeSectorErase NOROM_FlashsafeSectorErase
81 #undef FlashsafeProgram
82 #define FlashsafeProgram NOROM_FlashsafeProgram
83 #undef FlashsafeDisableSectorsForWrite
84 #define FlashsafeDisableSectorsForWrite NOROM_FlashsafeDisableSectorsForWrite
116 uint32_t ui32PumpGracePeriode)
124 ASSERT(ui32BankGracePeriode <= 0xFF);
125 ASSERT(ui32PumpGracePeriode <= 0xFFFF);
130 ui32PumpGracePeriode);
146 uint32_t ui32PowerMode;
152 return(ui32PowerMode);
191 uint32_t ui32SectorProtect;
204 return(ui32SectorProtect);
218 uint32_t ui32ErrorReturn;
231 return(ui32ErrorReturn);
405 uint32_t ui32ErrorReturn;
418 return(ui32ErrorReturn);
433 uint32_t ui32ErrorReturn;
442 ui32ErrorReturn =
FlashProgram(pui8DataBuffer, ui32Address, ui32Count);
444 return(ui32ErrorReturn);
uint32_t FlashsafeSectorSizeGet(void)
Get size of a flash sector in no of bytes.
#define FLASH_PWR_OFF_MODE
uint32_t FlashsafeSectorErase(uint32_t ui32SectorAddress)
Erase a flash sector.
static uint32_t FlashSectorSizeGet(void)
Get size of a flash sector in number of bytes.
uint32_t FlashsafeIntEnable(uint32_t ui32IntFlags)
Enables flash controller interrupt sources.
static bool FlashsafeSMPHTryAcquire(void)
Aquire the flash semaphore.
uint32_t FlashProtectionGet(uint32_t ui32SectorAddress)
Get sector protection.
uint32_t FlashsafeCheckFsmForError(void)
Checks if the Flashsafe state machine has detected an error.
uint32_t FlashsafePowerModeGet(void)
Get current configured power mode.
void FlashPowerModeSet(uint32_t ui32PowerMode, uint32_t ui32BankGracePeriode, uint32_t ui32PumpGracePeriode)
Set power mode.
uint32_t FlashsafeProgram(uint8_t *pui8DataBuffer, uint32_t ui32Address, uint32_t ui32Count)
Programs unprotected main bank flash sectors.
uint32_t FlashsafeIntClear(uint32_t ui32IntFlags)
Clears flash controller interrupt source.
#define FLASHSAFE_ACCESS_DENIED
void FlashDisableSectorsForWrite(void)
Disables all sectors for erase and programming on the active bank.
static void FlashIntClear(uint32_t ui32IntFlags)
Clears flash controller interrupt source.
uint32_t FlashsafeIntDisable(uint32_t ui32IntFlags)
Disables individual flash controller interrupt sources.
uint32_t FlashsafeCheckFsmForReady(void)
Checks if the Flash state machine is ready.
static uint32_t FlashIntStatus(void)
Gets the current interrupt status.
#define FSM_REG_WRT_DISABLE
uint32_t FlashPowerModeGet(void)
Get current configured power mode.
uint32_t FlashsafeProtectionSet(uint32_t ui32SectorAddress, uint32_t ui32ProtectMode)
Set sector protection.
#define FAPI_STATUS_SUCCESS
uint32_t FlashsafePowerModeSet(uint32_t ui32PowerMode, uint32_t ui32BankGracePeriode, uint32_t ui32PumpGracePeriode)
Set power mode.
uint32_t FlashSectorErase(uint32_t ui32SectorAddress)
Erase a flash sector.
static uint32_t FlashSizeGet(void)
Get the size of the flash.
#define FSM_REG_WRT_ENABLE
#define FAPI_STATUS_FSM_ERROR
#define FAPI_STATUS_FSM_READY
uint32_t FlashsafeDisableSectorsForWrite(void)
Disables all sectors for erase and programming on the active bank.
uint32_t FlashsafeProtectionGet(uint32_t ui32SectorAddress)
Get sector protection.
uint32_t FlashsafeProtectionSave(uint32_t ui32SectorAddress)
Save sector protection to make it permanent.
uint32_t FlashsafeIntStatus(void)
Gets the current interrupt status.
void IntUnregister(uint32_t ui32Interrupt)
Unregisters the function to be called when an interrupt occurs.
#define FLASHSAFE_ACCESS_OK
uint32_t FlashProtectionSave(uint32_t ui32SectorAddress)
Save sector protection to make it permanent.
#define FLASH_PWR_ACTIVE_MODE
void FlashProtectionSet(uint32_t ui32SectorAddress, uint32_t ui32ProtectMode)
Set sector protection.
#define FLASH_PWR_DEEP_STDBY_MODE
uint32_t FlashsafeSizeGet(void)
Get the size of the flash.
#define FAPI_STATUS_FSM_BUSY
static void FlashsafeSMPHRelease(void)
Release the flash semaphore.
uint32_t FlashsafeIntUnregister(void)
Unregisters the interrupt handler for the flash interrupt.
uint32_t FlashProgram(uint8_t *pui8DataBuffer, uint32_t ui32Address, uint32_t ui32Count)
Programs unprotected main bank flash sectors.
uint32_t FlashsafeIntRegister(void(*pfnHandler)(void))
Registers an interrupt handler for the flash interrupt.
void IntDisable(uint32_t ui32Interrupt)
Disables an interrupt.
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Registers a function to be called when an interrupt occurs.
void IntEnable(uint32_t ui32Interrupt)
Enables an interrupt.