![]() |
![]() |
Module for erasing, programming, verifying and configuring different functionalities of the Flash IP. More...
Data Structures | |
struct | __sFlashCtl_ProtectionRegister |
Macros | |
#define | FLASH_BURST_PRG_BIT 0x03 |
#define | FLASH_PROGRAM_ERROR FLCTL_IFG_PRG_ERR |
#define | FLASH_BENCHMARK_INT FLCTL_IFG_BMRK |
#define | FLASH_ERASE_COMPLETE FLCTL_IFG_ERASE |
#define | FLASH_BRSTPRGM_COMPLETE FLCTL_IFG_PRGB |
#define | FLASH_WRDPRGM_COMPLETE FLCTL_IFG_PRG |
#define | FLASH_POSTVERIFY_FAILED FLCTL_IFG_AVPST |
#define | FLASH_PREVERIFY_FAILED FLCTL_IFG_AVPRE |
#define | FLASH_BRSTRDCMP_COMPLETE FLCTL_IFG_RDBRST |
#define | FLASH_NORMAL_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_0 |
#define | FLASH_MARGIN0_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_1 |
#define | FLASH_MARGIN1_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_2 |
#define | FLASH_PROGRAM_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_3 |
#define | FLASH_ERASE_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_4 |
#define | FLASH_LEAKAGE_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_5 |
#define | FLASH_MARGIN0B_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_9 |
#define | FLASH_MARGIN1B_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_10 |
#define | FLASH_PRGBRSTCTLSTAT_BURSTSTATUS_COMPLETE FLCTL_PRGBRST_CTLSTAT_BURST_STATUS_7 |
#define | FLASH_BANK0 0x00 |
#define | FLASH_BANK1 0x01 |
#define | FLASH_DATA_READ 0x00 |
#define | FLASH_INSTRUCTION_FETCH 0x01 |
#define | FLASH_MAIN_MEMORY_SPACE_BANK0 0x01 |
#define | FLASH_MAIN_MEMORY_SPACE_BANK1 0x02 |
#define | FLASH_INFO_MEMORY_SPACE_BANK0 0x03 |
#define | FLASH_INFO_MEMORY_SPACE_BANK1 0x04 |
#define | FLASH_MAIN_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE_0 |
#define | FLASH_INFO_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE_1 |
#define | FLASH_1_PATTERN FLCTL_RDBRST_CTLSTAT_DATA_CMP |
#define | FLASH_0_PATTERN 0x00 |
#define | FLASH_SECTOR0 FLCTL_BANK0_MAIN_WEPROT_PROT0 |
#define | FLASH_SECTOR1 FLCTL_BANK0_MAIN_WEPROT_PROT1 |
#define | FLASH_SECTOR2 FLCTL_BANK0_MAIN_WEPROT_PROT2 |
#define | FLASH_SECTOR3 FLCTL_BANK0_MAIN_WEPROT_PROT3 |
#define | FLASH_SECTOR4 FLCTL_BANK0_MAIN_WEPROT_PROT4 |
#define | FLASH_SECTOR5 FLCTL_BANK0_MAIN_WEPROT_PROT5 |
#define | FLASH_SECTOR6 FLCTL_BANK0_MAIN_WEPROT_PROT6 |
#define | FLASH_SECTOR7 FLCTL_BANK0_MAIN_WEPROT_PROT7 |
#define | FLASH_SECTOR8 FLCTL_BANK0_MAIN_WEPROT_PROT8 |
#define | FLASH_SECTOR9 FLCTL_BANK0_MAIN_WEPROT_PROT9 |
#define | FLASH_SECTOR10 FLCTL_BANK0_MAIN_WEPROT_PROT10 |
#define | FLASH_SECTOR11 FLCTL_BANK0_MAIN_WEPROT_PROT11 |
#define | FLASH_SECTOR12 FLCTL_BANK0_MAIN_WEPROT_PROT12 |
#define | FLASH_SECTOR13 FLCTL_BANK0_MAIN_WEPROT_PROT13 |
#define | FLASH_SECTOR14 FLCTL_BANK0_MAIN_WEPROT_PROT14 |
#define | FLASH_SECTOR15 FLCTL_BANK0_MAIN_WEPROT_PROT15 |
#define | FLASH_SECTOR16 FLCTL_BANK0_MAIN_WEPROT_PROT16 |
#define | FLASH_SECTOR17 FLCTL_BANK0_MAIN_WEPROT_PROT17 |
#define | FLASH_SECTOR18 FLCTL_BANK0_MAIN_WEPROT_PROT18 |
#define | FLASH_SECTOR19 FLCTL_BANK0_MAIN_WEPROT_PROT19 |
#define | FLASH_SECTOR20 FLCTL_BANK0_MAIN_WEPROT_PROT20 |
#define | FLASH_SECTOR21 FLCTL_BANK0_MAIN_WEPROT_PROT21 |
#define | FLASH_SECTOR22 FLCTL_BANK0_MAIN_WEPROT_PROT22 |
#define | FLASH_SECTOR23 FLCTL_BANK0_MAIN_WEPROT_PROT23 |
#define | FLASH_SECTOR24 FLCTL_BANK0_MAIN_WEPROT_PROT24 |
#define | FLASH_SECTOR25 FLCTL_BANK0_MAIN_WEPROT_PROT25 |
#define | FLASH_SECTOR26 FLCTL_BANK0_MAIN_WEPROT_PROT26 |
#define | FLASH_SECTOR27 FLCTL_BANK0_MAIN_WEPROT_PROT27 |
#define | FLASH_SECTOR28 FLCTL_BANK0_MAIN_WEPROT_PROT28 |
#define | FLASH_SECTOR29 FLCTL_BANK0_MAIN_WEPROT_PROT29 |
#define | FLASH_SECTOR30 FLCTL_BANK0_MAIN_WEPROT_PROT30 |
#define | FLASH_SECTOR31 FLCTL_BANK0_MAIN_WEPROT_PROT31 |
#define | FLASH_NOVER 0 |
#define | FLASH_BURSTPOST FLCTL_PRGBRST_CTLSTAT_AUTO_PST |
#define | FLASH_BURSTPRE FLCTL_PRGBRST_CTLSTAT_AUTO_PRE |
#define | FLASH_REGPRE FLCTL_PRG_CTLSTAT_VER_PRE |
#define | FLASH_REGPOST FLCTL_PRG_CTLSTAT_VER_PST |
#define | FLASH_FULLVER |
#define | FLASH_COLLATED_WRITE_MODE 0x01 |
#define | FLASH_IMMEDIATE_WRITE_MODE 0x02 |
#define | __INFO_FLASH_TECH_START__ 0x00200000 |
#define | __INFO_FLASH_TECH_MIDDLE__ 0x00202000 |
#define | FLASH_A_BURST_PRG_BIT 0x03 |
#define | FLASH_A_SECTOR_SIZE 4096 |
#define | FLASH_A_PROGRAM_ERROR FLCTL_A_IFG_PRG_ERR |
#define | FLASH_A_BENCHMARK_INT FLCTL_A_IFG_BMRK |
#define | FLASH_A_ERASE_COMPLETE FLCTL_A_IFG_ERASE |
#define | FLASH_A_BRSTPRGM_COMPLETE FLCTL_A_IFG_PRGB |
#define | FLASH_A_WRDPRGM_COMPLETE FLCTL_A_IFG_PRG |
#define | FLASH_A_POSTVERIFY_FAILED FLCTL_A_IFG_AVPST |
#define | FLASH_A_PREVERIFY_FAILED FLCTL_A_IFG_AVPRE |
#define | FLASH_A_BRSTRDCMP_COMPLETE FLCTL_A_IFG_RDBRST |
#define | FLASH_A_NORMAL_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_0 |
#define | FLASH_A_MARGIN0_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_1 |
#define | FLASH_A_MARGIN1_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_2 |
#define | FLASH_A_PROGRAM_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_3 |
#define | FLASH_A_ERASE_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_4 |
#define | FLASH_A_LEAKAGE_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_5 |
#define | FLASH_A_MARGIN0B_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_9 |
#define | FLASH_A_MARGIN1B_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_10 |
#define | FLASH_A_PRGBRSTCTLSTAT_BURSTSTATUS_COMPLETE FLCTL_A_PRGBRST_CTLSTAT_BURST_STATUS_7 |
#define | FLASH_A_BANK0 0x00 |
#define | FLASH_A_BANK1 0x01 |
#define | FLASH_A_DATA_READ 0x00 |
#define | FLASH_A_INSTRUCTION_FETCH 0x01 |
#define | FLASH_A_MAIN_MEMORY_SPACE_BANK0 0x01 |
#define | FLASH_A_MAIN_MEMORY_SPACE_BANK1 0x02 |
#define | FLASH_A_INFO_MEMORY_SPACE_BANK0 0x03 |
#define | FLASH_A_INFO_MEMORY_SPACE_BANK1 0x04 |
#define | FLASH_A_MAIN_SPACE FLCTL_A_RDBRST_CTLSTAT_MEM_TYPE_0 |
#define | FLASH_A_INFO_SPACE FLCTL_A_RDBRST_CTLSTAT_MEM_TYPE_1 |
#define | FLASH_A_1_PATTERN FLCTL_A_RDBRST_CTLSTAT_DATA_CMP |
#define | FLASH_A_0_PATTERN 0x00 |
#define | FLASH_A_SECTOR0 FLCTL_A_BANK0_MAIN_WEPROT_PROT0 |
#define | FLASH_A_SECTOR1 FLCTL_A_BANK0_MAIN_WEPROT_PROT1 |
#define | FLASH_A_SECTOR2 FLCTL_A_BANK0_MAIN_WEPROT_PROT2 |
#define | FLASH_A_SECTOR3 FLCTL_A_BANK0_MAIN_WEPROT_PROT3 |
#define | FLASH_A_SECTOR4 FLCTL_A_BANK0_MAIN_WEPROT_PROT4 |
#define | FLASH_A_SECTOR5 FLCTL_A_BANK0_MAIN_WEPROT_PROT5 |
#define | FLASH_A_SECTOR6 FLCTL_A_BANK0_MAIN_WEPROT_PROT6 |
#define | FLASH_A_SECTOR7 FLCTL_A_BANK0_MAIN_WEPROT_PROT7 |
#define | FLASH_A_SECTOR8 FLCTL_A_BANK0_MAIN_WEPROT_PROT8 |
#define | FLASH_A_SECTOR9 FLCTL_A_BANK0_MAIN_WEPROT_PROT9 |
#define | FLASH_A_SECTOR10 FLCTL_A_BANK0_MAIN_WEPROT_PROT10 |
#define | FLASH_A_SECTOR11 FLCTL_A_BANK0_MAIN_WEPROT_PROT11 |
#define | FLASH_A_SECTOR12 FLCTL_A_BANK0_MAIN_WEPROT_PROT12 |
#define | FLASH_A_SECTOR13 FLCTL_A_BANK0_MAIN_WEPROT_PROT13 |
#define | FLASH_A_SECTOR14 FLCTL_A_BANK0_MAIN_WEPROT_PROT14 |
#define | FLASH_A_SECTOR15 FLCTL_A_BANK0_MAIN_WEPROT_PROT15 |
#define | FLASH_A_SECTOR16 FLCTL_A_BANK0_MAIN_WEPROT_PROT16 |
#define | FLASH_A_SECTOR17 FLCTL_A_BANK0_MAIN_WEPROT_PROT17 |
#define | FLASH_A_SECTOR18 FLCTL_A_BANK0_MAIN_WEPROT_PROT18 |
#define | FLASH_A_SECTOR19 FLCTL_A_BANK0_MAIN_WEPROT_PROT19 |
#define | FLASH_A_SECTOR20 FLCTL_A_BANK0_MAIN_WEPROT_PROT20 |
#define | FLASH_A_SECTOR21 FLCTL_A_BANK0_MAIN_WEPROT_PROT21 |
#define | FLASH_A_SECTOR22 FLCTL_A_BANK0_MAIN_WEPROT_PROT22 |
#define | FLASH_A_SECTOR23 FLCTL_A_BANK0_MAIN_WEPROT_PROT23 |
#define | FLASH_A_SECTOR24 FLCTL_A_BANK0_MAIN_WEPROT_PROT24 |
#define | FLASH_A_SECTOR25 FLCTL_A_BANK0_MAIN_WEPROT_PROT25 |
#define | FLASH_A_SECTOR26 FLCTL_A_BANK0_MAIN_WEPROT_PROT26 |
#define | FLASH_A_SECTOR27 FLCTL_A_BANK0_MAIN_WEPROT_PROT27 |
#define | FLASH_A_SECTOR28 FLCTL_A_BANK0_MAIN_WEPROT_PROT28 |
#define | FLASH_A_SECTOR29 FLCTL_A_BANK0_MAIN_WEPROT_PROT29 |
#define | FLASH_A_SECTOR30 FLCTL_A_BANK0_MAIN_WEPROT_PROT30 |
#define | FLASH_A_SECTOR31 FLCTL_A_BANK0_MAIN_WEPROT_PROT31 |
#define | FLASH_A_NOVER 0 |
#define | FLASH_A_BURSTPOST FLCTL_A_PRGBRST_CTLSTAT_AUTO_PST |
#define | FLASH_A_BURSTPRE FLCTL_A_PRGBRST_CTLSTAT_AUTO_PRE |
#define | FLASH_A_REGPRE FLCTL_A_PRG_CTLSTAT_VER_PRE |
#define | FLASH_A_REGPOST FLCTL_A_PRG_CTLSTAT_VER_PST |
#define | FLASH_A_FULLVER |
#define | FLASH_A_COLLATED_WRITE_MODE 0x01 |
#define | FLASH_A_IMMEDIATE_WRITE_MODE 0x02 |
#define | __INFO_FLASH_A_TECH_START__ 0x00200000 |
#define | __INFO_FLASH_A_TECH_MIDDLE__ 0x00204000 |
Typedefs | |
typedef struct __sFlashCtl_ProtectionRegister | __FlashCtl_ProtectionRegister |
Functions | |
void | FlashCtl_getMemoryInfo (uint32_t addr, uint32_t *sectorNum, uint32_t *bankNum) |
void | FlashCtl_enableReadBuffering (uint_fast8_t memoryBank, uint_fast8_t accessMethod) |
void | FlashCtl_disableReadBuffering (uint_fast8_t memoryBank, uint_fast8_t accessMethod) |
bool | FlashCtl_unprotectSector (uint_fast8_t memorySpace, uint32_t sectorMask) |
bool | FlashCtl_protectSector (uint_fast8_t memorySpace, uint32_t sectorMask) |
bool | FlashCtl_isSectorProtected (uint_fast8_t memorySpace, uint32_t sector) |
bool | FlashCtl_verifyMemory (void *verifyAddr, uint32_t length, uint_fast8_t pattern) |
bool | FlashCtl_performMassErase (void) |
void | FlashCtl_initiateMassErase (void) |
bool | FlashCtl_eraseSector (uint32_t addr) |
bool | FlashCtl_programMemory (void *src, void *dest, uint32_t length) |
void | FlashCtl_setProgramVerification (uint32_t verificationSetting) |
void | FlashCtl_clearProgramVerification (uint32_t verificationSetting) |
void | FlashCtl_enableWordProgramming (uint32_t mode) |
void | FlashCtl_disableWordProgramming (void) |
uint32_t | FlashCtl_isWordProgrammingEnabled (void) |
bool | FlashCtl_setReadMode (uint32_t flashBank, uint32_t readMode) |
uint32_t | FlashCtl_getReadMode (uint32_t flashBank) |
void | FlashCtl_setWaitState (uint32_t bank, uint32_t waitState) |
uint32_t | FlashCtl_getWaitState (uint32_t bank) |
void | FlashCtl_enableInterrupt (uint32_t flags) |
void | FlashCtl_disableInterrupt (uint32_t flags) |
uint32_t | FlashCtl_getEnabledInterruptStatus (void) |
uint32_t | FlashCtl_getInterruptStatus (void) |
void | FlashCtl_clearInterruptFlag (uint32_t flags) |
void | FlashCtl_registerInterrupt (void(*intHandler)(void)) |
void | FlashCtl_unregisterInterrupt (void) |
void | FlashCtl_initiateSectorErase (uint32_t addr) |
uint8_t | __FlashCtl_remaskData8Post (uint8_t data, uint32_t addr) |
uint8_t | __FlashCtl_remaskData8Pre (uint8_t data, uint32_t addr) |
uint32_t | __FlashCtl_remaskData32Post (uint32_t data, uint32_t addr) |
uint32_t | __FlashCtl_remaskData32Pre (uint32_t data, uint32_t addr) |
void | __FlashCtl_remaskBurstDataPost (uint32_t addr, uint32_t size) |
void | __FlashCtl_remaskBurstDataPre (uint32_t addr, uint32_t size) |
void | FlashCtl_A_getMemoryInfo (uint32_t addr, uint32_t *sectorNum, uint32_t *bankNum) |
void | FlashCtl_A_enableReadBuffering (uint_fast8_t memoryBank, uint_fast8_t accessMethod) |
void | FlashCtl_A_disableReadBuffering (uint_fast8_t memoryBank, uint_fast8_t accessMethod) |
bool | FlashCtl_A_protectMemory (uint32_t startAddr, uint32_t endAddr) |
bool | FlashCtl_A_unprotectMemory (uint32_t startAddr, uint32_t endAddr) |
bool | FlashCtl_A_isMemoryRangeProtected (uint32_t startAddr, uint32_t endAddr) |
bool | FlashCtl_A_isMemoryProtected (uint32_t addr) |
bool | FlashCtl_A_verifyMemory (void *verifyAddr, uint32_t length, uint_fast8_t pattern) |
bool | FlashCtl_A_performMassErase (void) |
void | FlashCtl_A_initiateMassErase (void) |
bool | FlashCtl_A_eraseSector (uint32_t addr) |
bool | FlashCtl_A_programMemory (void *src, void *dest, uint32_t length) |
void | FlashCtl_A_setProgramVerification (uint32_t verificationSetting) |
void | FlashCtl_A_clearProgramVerification (uint32_t verificationSetting) |
void | FlashCtl_A_enableWordProgramming (uint32_t mode) |
void | FlashCtl_A_disableWordProgramming (void) |
uint32_t | FlashCtl_A_isWordProgrammingEnabled (void) |
bool | FlashCtl_A_setReadMode (uint32_t flashBank, uint32_t readMode) |
uint32_t | FlashCtl_A_getReadMode (uint32_t flashBank) |
void | FlashCtl_A_setWaitState (uint32_t bank, uint32_t waitState) |
uint32_t | FlashCtl_A_getWaitState (uint32_t bank) |
void | FlashCtl_A_enableInterrupt (uint32_t flags) |
void | FlashCtl_A_disableInterrupt (uint32_t flags) |
uint32_t | FlashCtl_A_getEnabledInterruptStatus (void) |
uint32_t | FlashCtl_A_getInterruptStatus (void) |
void | FlashCtl_A_clearInterruptFlag (uint32_t flags) |
void | FlashCtl_A_registerInterrupt (void(*intHandler)(void)) |
void | FlashCtl_A_unregisterInterrupt (void) |
void | FlashCtl_A_initiateSectorErase (uint32_t addr) |
uint8_t | __FlashCtl_A_remaskData8Post (uint8_t data, uint32_t addr) |
uint8_t | __FlashCtl_A_remaskData8Pre (uint8_t data, uint32_t addr) |
uint32_t | __FlashCtl_A_remaskData32Post (uint32_t data, uint32_t addr) |
uint32_t | __FlashCtl_A_remaskData32Pre (uint32_t data, uint32_t addr) |
void | __FlashCtl_A_remaskBurstDataPost (uint32_t addr, uint32_t size) |
void | __FlashCtl_A_remaskBurstDataPre (uint32_t addr, uint32_t size) |
Module for erasing, programming, verifying and configuring different functionalities of the Flash IP.
Furthermore, when using the FlashCtl APIs, the user must take special consideration of where the API is being executed. For the critical APIs (such as erase and program), the DriverLib APIs are required to be executed from either SRAM or ROM (using the ROM_ prefix). Due to the verification requirements of the flash controller, running these APIs out of Flash is not currently supported.
Below is a very brief code example showing how to unprotect a sector and issue a mass erase with the FlashCtl module:
#define FLASH_BURST_PRG_BIT 0x03 |
#define FLASH_PROGRAM_ERROR FLCTL_IFG_PRG_ERR |
#define FLASH_BENCHMARK_INT FLCTL_IFG_BMRK |
#define FLASH_ERASE_COMPLETE FLCTL_IFG_ERASE |
#define FLASH_BRSTPRGM_COMPLETE FLCTL_IFG_PRGB |
#define FLASH_WRDPRGM_COMPLETE FLCTL_IFG_PRG |
#define FLASH_POSTVERIFY_FAILED FLCTL_IFG_AVPST |
#define FLASH_PREVERIFY_FAILED FLCTL_IFG_AVPRE |
#define FLASH_BRSTRDCMP_COMPLETE FLCTL_IFG_RDBRST |
#define FLASH_NORMAL_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_0 |
#define FLASH_MARGIN0_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_1 |
#define FLASH_MARGIN1_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_2 |
#define FLASH_PROGRAM_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_3 |
#define FLASH_ERASE_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_4 |
Referenced by FlashCtl_verifyMemory().
#define FLASH_LEAKAGE_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_5 |
#define FLASH_MARGIN0B_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_9 |
#define FLASH_MARGIN1B_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_10 |
#define FLASH_PRGBRSTCTLSTAT_BURSTSTATUS_COMPLETE FLCTL_PRGBRST_CTLSTAT_BURST_STATUS_7 |
#define FLASH_BANK0 0x00 |
Referenced by __FlashCtl_remaskBurstDataPost(), __FlashCtl_remaskBurstDataPre(), __FlashCtl_remaskData32Post(), __FlashCtl_remaskData32Pre(), __FlashCtl_remaskData8Post(), __FlashCtl_remaskData8Pre(), FlashCtl_disableReadBuffering(), FlashCtl_enableReadBuffering(), FlashCtl_getMemoryInfo(), FlashCtl_getReadMode(), FlashCtl_getWaitState(), FlashCtl_setReadMode(), FlashCtl_setWaitState(), and FlashCtl_verifyMemory().
#define FLASH_BANK1 0x01 |
Referenced by __FlashCtl_remaskBurstDataPost(), __FlashCtl_remaskBurstDataPre(), __FlashCtl_remaskData32Post(), __FlashCtl_remaskData32Pre(), __FlashCtl_remaskData8Post(), __FlashCtl_remaskData8Pre(), FlashCtl_disableReadBuffering(), FlashCtl_enableReadBuffering(), FlashCtl_getMemoryInfo(), FlashCtl_getReadMode(), FlashCtl_getWaitState(), FlashCtl_setReadMode(), FlashCtl_setWaitState(), and FlashCtl_verifyMemory().
#define FLASH_DATA_READ 0x00 |
Referenced by FlashCtl_disableReadBuffering(), and FlashCtl_enableReadBuffering().
#define FLASH_INSTRUCTION_FETCH 0x01 |
Referenced by FlashCtl_disableReadBuffering(), and FlashCtl_enableReadBuffering().
#define FLASH_MAIN_MEMORY_SPACE_BANK0 0x01 |
Referenced by FlashCtl_isSectorProtected(), FlashCtl_protectSector(), and FlashCtl_unprotectSector().
#define FLASH_MAIN_MEMORY_SPACE_BANK1 0x02 |
Referenced by FlashCtl_isSectorProtected(), FlashCtl_protectSector(), and FlashCtl_unprotectSector().
#define FLASH_INFO_MEMORY_SPACE_BANK0 0x03 |
Referenced by FlashCtl_isSectorProtected(), FlashCtl_protectSector(), and FlashCtl_unprotectSector().
#define FLASH_INFO_MEMORY_SPACE_BANK1 0x04 |
Referenced by FlashCtl_isSectorProtected(), FlashCtl_protectSector(), and FlashCtl_unprotectSector().
#define FLASH_MAIN_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE_0 |
Referenced by FlashCtl_eraseSector(), FlashCtl_initiateSectorErase(), and FlashCtl_verifyMemory().
#define FLASH_INFO_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE_1 |
Referenced by FlashCtl_eraseSector(), FlashCtl_initiateSectorErase(), and FlashCtl_verifyMemory().
#define FLASH_1_PATTERN FLCTL_RDBRST_CTLSTAT_DATA_CMP |
Referenced by FlashCtl_eraseSector(), FlashCtl_performMassErase(), and FlashCtl_verifyMemory().
#define FLASH_0_PATTERN 0x00 |
Referenced by FlashCtl_verifyMemory().
#define FLASH_SECTOR0 FLCTL_BANK0_MAIN_WEPROT_PROT0 |
#define FLASH_SECTOR1 FLCTL_BANK0_MAIN_WEPROT_PROT1 |
#define FLASH_SECTOR2 FLCTL_BANK0_MAIN_WEPROT_PROT2 |
#define FLASH_SECTOR3 FLCTL_BANK0_MAIN_WEPROT_PROT3 |
#define FLASH_SECTOR4 FLCTL_BANK0_MAIN_WEPROT_PROT4 |
#define FLASH_SECTOR5 FLCTL_BANK0_MAIN_WEPROT_PROT5 |
#define FLASH_SECTOR6 FLCTL_BANK0_MAIN_WEPROT_PROT6 |
#define FLASH_SECTOR7 FLCTL_BANK0_MAIN_WEPROT_PROT7 |
#define FLASH_SECTOR8 FLCTL_BANK0_MAIN_WEPROT_PROT8 |
#define FLASH_SECTOR9 FLCTL_BANK0_MAIN_WEPROT_PROT9 |
#define FLASH_SECTOR10 FLCTL_BANK0_MAIN_WEPROT_PROT10 |
#define FLASH_SECTOR11 FLCTL_BANK0_MAIN_WEPROT_PROT11 |
#define FLASH_SECTOR12 FLCTL_BANK0_MAIN_WEPROT_PROT12 |
#define FLASH_SECTOR13 FLCTL_BANK0_MAIN_WEPROT_PROT13 |
#define FLASH_SECTOR14 FLCTL_BANK0_MAIN_WEPROT_PROT14 |
#define FLASH_SECTOR15 FLCTL_BANK0_MAIN_WEPROT_PROT15 |
#define FLASH_SECTOR16 FLCTL_BANK0_MAIN_WEPROT_PROT16 |
#define FLASH_SECTOR17 FLCTL_BANK0_MAIN_WEPROT_PROT17 |
#define FLASH_SECTOR18 FLCTL_BANK0_MAIN_WEPROT_PROT18 |
#define FLASH_SECTOR19 FLCTL_BANK0_MAIN_WEPROT_PROT19 |
#define FLASH_SECTOR20 FLCTL_BANK0_MAIN_WEPROT_PROT20 |
#define FLASH_SECTOR21 FLCTL_BANK0_MAIN_WEPROT_PROT21 |
#define FLASH_SECTOR22 FLCTL_BANK0_MAIN_WEPROT_PROT22 |
#define FLASH_SECTOR23 FLCTL_BANK0_MAIN_WEPROT_PROT23 |
#define FLASH_SECTOR24 FLCTL_BANK0_MAIN_WEPROT_PROT24 |
#define FLASH_SECTOR25 FLCTL_BANK0_MAIN_WEPROT_PROT25 |
#define FLASH_SECTOR26 FLCTL_BANK0_MAIN_WEPROT_PROT26 |
#define FLASH_SECTOR27 FLCTL_BANK0_MAIN_WEPROT_PROT27 |
#define FLASH_SECTOR28 FLCTL_BANK0_MAIN_WEPROT_PROT28 |
#define FLASH_SECTOR29 FLCTL_BANK0_MAIN_WEPROT_PROT29 |
#define FLASH_SECTOR30 FLCTL_BANK0_MAIN_WEPROT_PROT30 |
#define FLASH_SECTOR31 FLCTL_BANK0_MAIN_WEPROT_PROT31 |
#define FLASH_NOVER 0 |
#define FLASH_BURSTPOST FLCTL_PRGBRST_CTLSTAT_AUTO_PST |
Referenced by FlashCtl_clearProgramVerification(), and FlashCtl_setProgramVerification().
#define FLASH_BURSTPRE FLCTL_PRGBRST_CTLSTAT_AUTO_PRE |
Referenced by FlashCtl_clearProgramVerification(), and FlashCtl_setProgramVerification().
#define FLASH_REGPRE FLCTL_PRG_CTLSTAT_VER_PRE |
Referenced by FlashCtl_clearProgramVerification(), and FlashCtl_setProgramVerification().
#define FLASH_REGPOST FLCTL_PRG_CTLSTAT_VER_PST |
Referenced by FlashCtl_clearProgramVerification(), and FlashCtl_setProgramVerification().
#define FLASH_FULLVER |
#define FLASH_COLLATED_WRITE_MODE 0x01 |
Referenced by FlashCtl_enableWordProgramming(), and FlashCtl_isWordProgrammingEnabled().
#define FLASH_IMMEDIATE_WRITE_MODE 0x02 |
Referenced by FlashCtl_enableWordProgramming(), FlashCtl_isWordProgrammingEnabled(), and FlashCtl_programMemory().
#define __INFO_FLASH_TECH_START__ 0x00200000 |
#define __INFO_FLASH_TECH_MIDDLE__ 0x00202000 |
#define FLASH_A_BURST_PRG_BIT 0x03 |
#define FLASH_A_SECTOR_SIZE 4096 |
#define FLASH_A_PROGRAM_ERROR FLCTL_A_IFG_PRG_ERR |
#define FLASH_A_BENCHMARK_INT FLCTL_A_IFG_BMRK |
#define FLASH_A_ERASE_COMPLETE FLCTL_A_IFG_ERASE |
#define FLASH_A_BRSTPRGM_COMPLETE FLCTL_A_IFG_PRGB |
#define FLASH_A_WRDPRGM_COMPLETE FLCTL_A_IFG_PRG |
#define FLASH_A_POSTVERIFY_FAILED FLCTL_A_IFG_AVPST |
#define FLASH_A_PREVERIFY_FAILED FLCTL_A_IFG_AVPRE |
#define FLASH_A_BRSTRDCMP_COMPLETE FLCTL_A_IFG_RDBRST |
#define FLASH_A_NORMAL_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_0 |
#define FLASH_A_MARGIN0_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_1 |
#define FLASH_A_MARGIN1_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_2 |
#define FLASH_A_PROGRAM_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_3 |
#define FLASH_A_ERASE_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_4 |
Referenced by FlashCtl_A_verifyMemory().
#define FLASH_A_LEAKAGE_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_5 |
#define FLASH_A_MARGIN0B_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_9 |
#define FLASH_A_MARGIN1B_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_10 |
#define FLASH_A_PRGBRSTCTLSTAT_BURSTSTATUS_COMPLETE FLCTL_A_PRGBRST_CTLSTAT_BURST_STATUS_7 |
#define FLASH_A_BANK0 0x00 |
Referenced by __FlashCtl_A_remaskBurstDataPost(), __FlashCtl_A_remaskBurstDataPre(), __FlashCtl_A_remaskData32Post(), __FlashCtl_A_remaskData32Pre(), __FlashCtl_A_remaskData8Post(), __FlashCtl_A_remaskData8Pre(), FlashCtl_A_disableReadBuffering(), FlashCtl_A_enableReadBuffering(), FlashCtl_A_getMemoryInfo(), FlashCtl_A_getReadMode(), FlashCtl_A_getWaitState(), FlashCtl_A_setReadMode(), FlashCtl_A_setWaitState(), and FlashCtl_A_verifyMemory().
#define FLASH_A_BANK1 0x01 |
Referenced by __FlashCtl_A_remaskBurstDataPost(), __FlashCtl_A_remaskBurstDataPre(), __FlashCtl_A_remaskData32Post(), __FlashCtl_A_remaskData32Pre(), __FlashCtl_A_remaskData8Post(), __FlashCtl_A_remaskData8Pre(), FlashCtl_A_disableReadBuffering(), FlashCtl_A_enableReadBuffering(), FlashCtl_A_getMemoryInfo(), FlashCtl_A_getReadMode(), FlashCtl_A_getWaitState(), FlashCtl_A_setReadMode(), FlashCtl_A_setWaitState(), and FlashCtl_A_verifyMemory().
#define FLASH_A_DATA_READ 0x00 |
Referenced by FlashCtl_A_disableReadBuffering(), and FlashCtl_A_enableReadBuffering().
#define FLASH_A_INSTRUCTION_FETCH 0x01 |
Referenced by FlashCtl_A_disableReadBuffering(), and FlashCtl_A_enableReadBuffering().
#define FLASH_A_MAIN_MEMORY_SPACE_BANK0 0x01 |
#define FLASH_A_MAIN_MEMORY_SPACE_BANK1 0x02 |
#define FLASH_A_INFO_MEMORY_SPACE_BANK0 0x03 |
#define FLASH_A_INFO_MEMORY_SPACE_BANK1 0x04 |
#define FLASH_A_MAIN_SPACE FLCTL_A_RDBRST_CTLSTAT_MEM_TYPE_0 |
Referenced by FlashCtl_A_eraseSector(), FlashCtl_A_initiateSectorErase(), and FlashCtl_A_verifyMemory().
#define FLASH_A_INFO_SPACE FLCTL_A_RDBRST_CTLSTAT_MEM_TYPE_1 |
Referenced by FlashCtl_A_eraseSector(), FlashCtl_A_initiateSectorErase(), and FlashCtl_A_verifyMemory().
#define FLASH_A_1_PATTERN FLCTL_A_RDBRST_CTLSTAT_DATA_CMP |
Referenced by FlashCtl_A_eraseSector(), FlashCtl_A_performMassErase(), and FlashCtl_A_verifyMemory().
#define FLASH_A_0_PATTERN 0x00 |
Referenced by FlashCtl_A_verifyMemory().
#define FLASH_A_SECTOR0 FLCTL_A_BANK0_MAIN_WEPROT_PROT0 |
#define FLASH_A_SECTOR1 FLCTL_A_BANK0_MAIN_WEPROT_PROT1 |
#define FLASH_A_SECTOR2 FLCTL_A_BANK0_MAIN_WEPROT_PROT2 |
#define FLASH_A_SECTOR3 FLCTL_A_BANK0_MAIN_WEPROT_PROT3 |
#define FLASH_A_SECTOR4 FLCTL_A_BANK0_MAIN_WEPROT_PROT4 |
#define FLASH_A_SECTOR5 FLCTL_A_BANK0_MAIN_WEPROT_PROT5 |
#define FLASH_A_SECTOR6 FLCTL_A_BANK0_MAIN_WEPROT_PROT6 |
#define FLASH_A_SECTOR7 FLCTL_A_BANK0_MAIN_WEPROT_PROT7 |
#define FLASH_A_SECTOR8 FLCTL_A_BANK0_MAIN_WEPROT_PROT8 |
#define FLASH_A_SECTOR9 FLCTL_A_BANK0_MAIN_WEPROT_PROT9 |
#define FLASH_A_SECTOR10 FLCTL_A_BANK0_MAIN_WEPROT_PROT10 |
#define FLASH_A_SECTOR11 FLCTL_A_BANK0_MAIN_WEPROT_PROT11 |
#define FLASH_A_SECTOR12 FLCTL_A_BANK0_MAIN_WEPROT_PROT12 |
#define FLASH_A_SECTOR13 FLCTL_A_BANK0_MAIN_WEPROT_PROT13 |
#define FLASH_A_SECTOR14 FLCTL_A_BANK0_MAIN_WEPROT_PROT14 |
#define FLASH_A_SECTOR15 FLCTL_A_BANK0_MAIN_WEPROT_PROT15 |
#define FLASH_A_SECTOR16 FLCTL_A_BANK0_MAIN_WEPROT_PROT16 |
#define FLASH_A_SECTOR17 FLCTL_A_BANK0_MAIN_WEPROT_PROT17 |
#define FLASH_A_SECTOR18 FLCTL_A_BANK0_MAIN_WEPROT_PROT18 |
#define FLASH_A_SECTOR19 FLCTL_A_BANK0_MAIN_WEPROT_PROT19 |
#define FLASH_A_SECTOR20 FLCTL_A_BANK0_MAIN_WEPROT_PROT20 |
#define FLASH_A_SECTOR21 FLCTL_A_BANK0_MAIN_WEPROT_PROT21 |
#define FLASH_A_SECTOR22 FLCTL_A_BANK0_MAIN_WEPROT_PROT22 |
#define FLASH_A_SECTOR23 FLCTL_A_BANK0_MAIN_WEPROT_PROT23 |
#define FLASH_A_SECTOR24 FLCTL_A_BANK0_MAIN_WEPROT_PROT24 |
#define FLASH_A_SECTOR25 FLCTL_A_BANK0_MAIN_WEPROT_PROT25 |
#define FLASH_A_SECTOR26 FLCTL_A_BANK0_MAIN_WEPROT_PROT26 |
#define FLASH_A_SECTOR27 FLCTL_A_BANK0_MAIN_WEPROT_PROT27 |
#define FLASH_A_SECTOR28 FLCTL_A_BANK0_MAIN_WEPROT_PROT28 |
#define FLASH_A_SECTOR29 FLCTL_A_BANK0_MAIN_WEPROT_PROT29 |
#define FLASH_A_SECTOR30 FLCTL_A_BANK0_MAIN_WEPROT_PROT30 |
#define FLASH_A_SECTOR31 FLCTL_A_BANK0_MAIN_WEPROT_PROT31 |
#define FLASH_A_NOVER 0 |
#define FLASH_A_BURSTPOST FLCTL_A_PRGBRST_CTLSTAT_AUTO_PST |
Referenced by FlashCtl_A_clearProgramVerification(), and FlashCtl_A_setProgramVerification().
#define FLASH_A_BURSTPRE FLCTL_A_PRGBRST_CTLSTAT_AUTO_PRE |
Referenced by FlashCtl_A_clearProgramVerification(), and FlashCtl_A_setProgramVerification().
#define FLASH_A_REGPRE FLCTL_A_PRG_CTLSTAT_VER_PRE |
Referenced by FlashCtl_A_clearProgramVerification(), and FlashCtl_A_setProgramVerification().
#define FLASH_A_REGPOST FLCTL_A_PRG_CTLSTAT_VER_PST |
Referenced by FlashCtl_A_clearProgramVerification(), and FlashCtl_A_setProgramVerification().
#define FLASH_A_FULLVER |
#define FLASH_A_COLLATED_WRITE_MODE 0x01 |
Referenced by FlashCtl_A_enableWordProgramming(), and FlashCtl_A_isWordProgrammingEnabled().
#define FLASH_A_IMMEDIATE_WRITE_MODE 0x02 |
#define __INFO_FLASH_A_TECH_START__ 0x00200000 |
#define __INFO_FLASH_A_TECH_MIDDLE__ 0x00204000 |
typedef struct __sFlashCtl_ProtectionRegister __FlashCtl_ProtectionRegister |
void FlashCtl_getMemoryInfo | ( | uint32_t | addr, |
uint32_t * | sectorNum, | ||
uint32_t * | bankNum | ||
) |
Calculates the flash bank and sector number given an address. Stores the results into the two pointers given as parameters. The user must provide a valid memory address (an address in SRAM for example will give an invalid result).
addr | Address to calculate the bank/sector information for |
sectorNum | The sector number will be stored in here after the function completes. |
sectorNum | The bank number will be stored in here after the function completes. |
References FLASH_BANK0, FLASH_BANK1, and SysCtl_getFlashSize().
void FlashCtl_enableReadBuffering | ( | uint_fast8_t | memoryBank, |
uint_fast8_t | accessMethod | ||
) |
Enables read buffering on accesses to a specified bank of flash memory
memoryBank | is the value of the memory bank to enable read buffering. Must be only one of the following values:
|
accessMethod | is the value of the access type to enable read buffering. Must be only one of the following values:
|
References ASSERT, FLASH_BANK0, FLASH_BANK1, FLASH_DATA_READ, and FLASH_INSTRUCTION_FETCH.
void FlashCtl_disableReadBuffering | ( | uint_fast8_t | memoryBank, |
uint_fast8_t | accessMethod | ||
) |
Disables read buffering on accesses to a specified bank of flash memory
memoryBank | is the value of the memory bank to disable read buffering. Must be only one of the following values:
|
accessMethod | is the value of the access type to disable read buffering. Must ne only one of the following values:
|
References ASSERT, FLASH_BANK0, FLASH_BANK1, FLASH_DATA_READ, and FLASH_INSTRUCTION_FETCH.
bool FlashCtl_unprotectSector | ( | uint_fast8_t | memorySpace, |
uint32_t | sectorMask | ||
) |
Disables program protection on the given sector mask. This setting can be applied on a sector-wise bases on a given memory space (INFO or MAIN).
memorySpace | is the value of the memory bank to disable program protection. Must be only one of the following values:
|
sectorMask | is a bit mask of the sectors to disable program protection. Must be a bitfield of the following values:
|
References ASSERT, FLASH_INFO_MEMORY_SPACE_BANK0, FLASH_INFO_MEMORY_SPACE_BANK1, FLASH_MAIN_MEMORY_SPACE_BANK0, FLASH_MAIN_MEMORY_SPACE_BANK1, and FlashCtl_isSectorProtected().
bool FlashCtl_protectSector | ( | uint_fast8_t | memorySpace, |
uint32_t | sectorMask | ||
) |
Enables program protection on the given sector mask. This setting can be applied on a sector-wise bases on a given memory space (INFO or MAIN).
memorySpace | is the value of the memory bank to enable program protection. Must be only one of the following values:
|
sectorMask | is a bit mask of the sectors to enable program protection. Must be a bitfield of the following values:
|
References ASSERT, FLASH_INFO_MEMORY_SPACE_BANK0, FLASH_INFO_MEMORY_SPACE_BANK1, FLASH_MAIN_MEMORY_SPACE_BANK0, FLASH_MAIN_MEMORY_SPACE_BANK1, and FlashCtl_isSectorProtected().
bool FlashCtl_isSectorProtected | ( | uint_fast8_t | memorySpace, |
uint32_t | sector | ||
) |
Returns the sector protection for given sector mask and memory space
memorySpace | is the value of the memory bank to check for program protection. Must be only one of the following values:
|
sector | is the sector to check for program protection. Must be one of the following values:
|
Note that flash sector sizes are 4KB and the number of sectors may vary depending on the specific device. Also, for INFO memory space, only sectors FLASH_SECTOR0 and FLASH_SECTOR1 will exist.
References ASSERT, FLASH_INFO_MEMORY_SPACE_BANK0, FLASH_INFO_MEMORY_SPACE_BANK1, FLASH_MAIN_MEMORY_SPACE_BANK0, and FLASH_MAIN_MEMORY_SPACE_BANK1.
Referenced by FlashCtl_protectSector(), and FlashCtl_unprotectSector().
bool FlashCtl_verifyMemory | ( | void * | verifyAddr, |
uint32_t | length, | ||
uint_fast8_t | pattern | ||
) |
Verifies a given segment of memory based off either a high (1) or low (0) state.
verifyAddr | Start address where verification will begin |
length | Length in bytes to verify based off the pattern |
pattern | The pattern which verification will check versus. This can either be a low pattern (each register will be checked versus a pattern of 32 zeros, or a high pattern (each register will be checked versus a pattern of 32 ones). Valid values are: FLASH_0_PATTERN, FLASH_1_PATTERN |
References __INFO_FLASH_TECH_MIDDLE__, __INFO_FLASH_TECH_START__, ASSERT, CPU_primask(), FLASH_0_PATTERN, FLASH_1_PATTERN, FLASH_BANK0, FLASH_BANK1, FLASH_ERASE_VERIFY_READ_MODE, FLASH_INFO_SPACE, FLASH_MAIN_SPACE, FLASH_PROGRAM_VERIFY_READ_MODE, FlashCtl_getReadMode(), FlashCtl_getWaitState(), FlashCtl_setReadMode(), FlashCtl_setWaitState(), HWREG32, HWREG8, Interrupt_disableMaster(), Interrupt_enableMaster(), and SysCtl_getFlashSize().
Referenced by FlashCtl_eraseSector(), and FlashCtl_performMassErase().
bool FlashCtl_performMassErase | ( | void | ) |
Performs a mass erase on all unprotected flash sectors. Protected sectors are ignored.
References __INFO_FLASH_TECH_START__, CPU_primask(), FLASH_1_PATTERN, FlashCtl_eraseSector(), FlashCtl_verifyMemory(), Interrupt_disableMaster(), Interrupt_enableMaster(), and SysCtl_getFlashSize().
void FlashCtl_initiateMassErase | ( | void | ) |
Initiates a mass erase and returns control back to the program. This is a non-blocking function, however it is the user's responsibility to perform the necessary verification requirements after the interrupt is set to signify completion.
bool FlashCtl_eraseSector | ( | uint32_t | addr | ) |
Erases a sector of MAIN or INFO flash memory.
addr | The start of the sector to erase. Note that with flash, the minimum allowed size that can be erased is a flash sector (which is 4KB on the MSP432 family). If an address is provided to this function which is not on a 4KB boundary, the entire sector will still be erased. |
References __INFO_FLASH_TECH_START__, CPU_primask(), FLASH_1_PATTERN, FLASH_INFO_SPACE, FLASH_MAIN_SPACE, FlashCtl_verifyMemory(), Interrupt_disableMaster(), Interrupt_enableMaster(), SysCtl_FlashTLV_Info::maxErasePulses, SysCtl_getFlashSize(), SysCtl_getTLVInfo(), and TLV_TAG_FLASHCTL.
Referenced by FlashCtl_performMassErase().
bool FlashCtl_programMemory | ( | void * | src, |
void * | dest, | ||
uint32_t | length | ||
) |
Program a portion of flash memory with the provided data
src | Pointer to the data source to program into flash |
dest | Pointer to the destination in flash to program |
length | Length in bytes to program |
References CPU_primask(), FLASH_IMMEDIATE_WRITE_MODE, FlashCtl_disableWordProgramming(), FlashCtl_enableWordProgramming(), Interrupt_disableMaster(), Interrupt_enableMaster(), SysCtl_FlashTLV_Info::maxProgramPulses, SysCtl_getTLVInfo(), and TLV_TAG_FLASHCTL.
void FlashCtl_setProgramVerification | ( | uint32_t | verificationSetting | ) |
Setups pre/post verification of burst and regular flash programming instructions. Note that this API is for advanced users that are programming their own flash drivers. The program/erase APIs are not affected by this setting and take care of the verification requirements.
verificationSetting | Verification setting to set. This value can be a bitwise OR of the following values:
|
References FLASH_BURSTPOST, FLASH_BURSTPRE, FLASH_REGPOST, and FLASH_REGPRE.
void FlashCtl_clearProgramVerification | ( | uint32_t | verificationSetting | ) |
Clears pre/post verification of burst and regular flash programming instructions. Note that this API is for advanced users that are programming their own flash drivers. The program/erase APIs are not affected by this setting and take care of the verification requirements.
verificationSetting | Verification setting to clear. This value can be a bitwise OR of the following values:
|
References FLASH_BURSTPOST, FLASH_BURSTPRE, FLASH_REGPOST, and FLASH_REGPRE.
void FlashCtl_enableWordProgramming | ( | uint32_t | mode | ) |
Enables word programming of flash memory.
This function will enable word programming of the flash memory and set the mode of behavior when the flash write occurs.
mode | The mode specifies the behavior of the flash controller when programming words to flash. In FLASH_IMMEDIATE_WRITE_MODE, the program operation happens immediately on the write to flash while in FLASH_COLLATED_WRITE_MODE the write will be delayed until a full 128-bits have been collated. Possible values include:
|
Refer to the user's guide for further documentation.
References FLASH_COLLATED_WRITE_MODE, and FLASH_IMMEDIATE_WRITE_MODE.
Referenced by FlashCtl_programMemory().
void FlashCtl_disableWordProgramming | ( | void | ) |
Disables word programming of flash memory.
Refer to FlashCtl_enableWordProgramming and the user's guide for description on the difference between full word and immediate programming
Referenced by FlashCtl_programMemory().
uint32_t FlashCtl_isWordProgrammingEnabled | ( | void | ) |
Returns if word programming mode is enabled (and if it is, the specific mode)
Refer to FlashCtl_enableWordProgramming and the user's guide for description on the difference between full word and immediate programming
References FLASH_COLLATED_WRITE_MODE, and FLASH_IMMEDIATE_WRITE_MODE.
bool FlashCtl_setReadMode | ( | uint32_t | flashBank, |
uint32_t | readMode | ||
) |
Sets the flash read mode to be used by default flash read operations. Note that the proper wait states must be set prior to entering this function.
flashBank | Flash bank to set read mode for. Valid values are:
|
readMode | The read mode to set. Valid values are:
|
References ASSERT, FLASH_BANK0, and FLASH_BANK1.
Referenced by __FlashCtl_remaskBurstDataPost(), __FlashCtl_remaskBurstDataPre(), __FlashCtl_remaskData32Post(), __FlashCtl_remaskData32Pre(), __FlashCtl_remaskData8Post(), __FlashCtl_remaskData8Pre(), and FlashCtl_verifyMemory().
uint32_t FlashCtl_getReadMode | ( | uint32_t | flashBank | ) |
Gets the flash read mode to be used by default flash read operations.
flashBank | Flash bank to set read mode for. Valid values are:
|
References ASSERT, FLASH_BANK0, and FLASH_BANK1.
Referenced by __FlashCtl_remaskBurstDataPost(), __FlashCtl_remaskBurstDataPre(), __FlashCtl_remaskData32Post(), __FlashCtl_remaskData32Pre(), __FlashCtl_remaskData8Post(), __FlashCtl_remaskData8Pre(), and FlashCtl_verifyMemory().
void FlashCtl_setWaitState | ( | uint32_t | bank, |
uint32_t | waitState | ||
) |
Changes the number of wait states that are used by the flash controller for read operations. When changing frequency ranges of the clock, this functions must be used in order to allow for readable flash memory.
waitState | The number of wait states to set. Note that only bits 0-3 are used. |
flashBank | Flash bank to set wait state for. Valid values are:
|
References ASSERT, FLASH_BANK0, and FLASH_BANK1.
Referenced by __FlashCtl_remaskBurstDataPost(), __FlashCtl_remaskBurstDataPre(), __FlashCtl_remaskData32Post(), __FlashCtl_remaskData32Pre(), __FlashCtl_remaskData8Post(), __FlashCtl_remaskData8Pre(), and FlashCtl_verifyMemory().
uint32_t FlashCtl_getWaitState | ( | uint32_t | bank | ) |
Returns the set number of flash wait states for the given flash bank.
flashBank | Flash bank to set wait state for. Valid values are:
|
References ASSERT, FLASH_BANK0, and FLASH_BANK1.
Referenced by __FlashCtl_remaskBurstDataPost(), __FlashCtl_remaskBurstDataPre(), __FlashCtl_remaskData32Post(), __FlashCtl_remaskData32Pre(), __FlashCtl_remaskData8Post(), __FlashCtl_remaskData8Pre(), and FlashCtl_verifyMemory().
void FlashCtl_enableInterrupt | ( | uint32_t | flags | ) |
Enables individual flash control interrupt sources.
flags | is a bit mask of the interrupt sources to be enabled. Must be a logical OR of:
|
This function enables the indicated flash system interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
void FlashCtl_disableInterrupt | ( | uint32_t | flags | ) |
Disables individual flash system interrupt sources.
flags | is a bit mask of the interrupt sources to be disabled. Must be a logical OR of:
|
This function disables the indicated flash system interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
uint32_t FlashCtl_getEnabledInterruptStatus | ( | void | ) |
Gets the current interrupt status masked with the enabled interrupts. This function is useful to call in ISRs to get a list of pending interrupts that are actually enabled and could have caused the ISR.
References FlashCtl_getInterruptStatus().
uint32_t FlashCtl_getInterruptStatus | ( | void | ) |
Gets the current interrupt status.
Referenced by FlashCtl_getEnabledInterruptStatus().
void FlashCtl_clearInterruptFlag | ( | uint32_t | flags | ) |
Clears flash system interrupt sources.
flags | is a bit mask of the interrupt sources to be cleared. Must be a logical OR of:
|
The specified flash system interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep it from being called again immediately upon exit.
void FlashCtl_registerInterrupt | ( | void(*)(void) | intHandler | ) |
Registers an interrupt handler for flash clock system interrupt.
intHandler | is a pointer to the function to be called when the clock system interrupt occurs. |
This function registers the handler to be called when a clock system interrupt occurs. This function enables the global interrupt in the interrupt controller; specific flash controller interrupts must be enabled via FlashCtl_enableInterrupt(). It is the interrupt handler's responsibility to clear the interrupt source via FlashCtl_clearInterruptFlag().
References INT_FLCTL, Interrupt_enableInterrupt(), and Interrupt_registerInterrupt().
void FlashCtl_unregisterInterrupt | ( | void | ) |
Unregisters the interrupt handler for the flash system.
This function unregisters the handler to be called when a clock system interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
References INT_FLCTL, Interrupt_disableInterrupt(), and Interrupt_unregisterInterrupt().
void FlashCtl_initiateSectorErase | ( | uint32_t | addr | ) |
Initiates a sector erase of MAIN or INFO flash memory. Note that this function simply initaites the sector erase, but does no verification which is required by the flash controller. The user must manually set and enable interrupts on the flash controller to fire on erase completion and then use the FlashCtl_verifyMemory function to verify that the sector was actually erased
addr | The start of the sector to erase. Note that with flash, the minimum allowed size that can be erased is a flash sector (which is 4KB on the MSP432 family). If an address is provided to this function which is not on a 4KB boundary, the entire sector will still be erased. |
References __INFO_FLASH_TECH_START__, FLASH_INFO_SPACE, FLASH_MAIN_SPACE, and SysCtl_getFlashSize().
uint8_t __FlashCtl_remaskData8Post | ( | uint8_t | data, |
uint32_t | addr | ||
) |
uint8_t __FlashCtl_remaskData8Pre | ( | uint8_t | data, |
uint32_t | addr | ||
) |
uint32_t __FlashCtl_remaskData32Post | ( | uint32_t | data, |
uint32_t | addr | ||
) |
uint32_t __FlashCtl_remaskData32Pre | ( | uint32_t | data, |
uint32_t | addr | ||
) |
void __FlashCtl_remaskBurstDataPost | ( | uint32_t | addr, |
uint32_t | size | ||
) |
void __FlashCtl_remaskBurstDataPre | ( | uint32_t | addr, |
uint32_t | size | ||
) |
void FlashCtl_A_getMemoryInfo | ( | uint32_t | addr, |
uint32_t * | sectorNum, | ||
uint32_t * | bankNum | ||
) |
Calculates the flash bank and sector number given an address. Stores the results into the two pointers given as parameters. The user must provide a valid memory address (an address in SRAM for example will give an invalid result).
addr | Address to calculate the bank/sector information for |
sectorNum | The sector number will be stored in here after the function completes. |
sectorNum | The bank number will be stored in here after the function completes. |
References FLASH_A_BANK0, FLASH_A_BANK1, FLASH_A_SECTOR_SIZE, and SysCtl_A_getFlashSize().
void FlashCtl_A_enableReadBuffering | ( | uint_fast8_t | memoryBank, |
uint_fast8_t | accessMethod | ||
) |
Enables read buffering on accesses to a specified bank of flash memory
memoryBank | is the value of the memory bank to enable read buffering. Must be only one of the following values:
|
accessMethod | is the value of the access type to enable read buffering. Must be only one of the following values:
|
References ASSERT, FLASH_A_BANK0, FLASH_A_BANK1, FLASH_A_DATA_READ, and FLASH_A_INSTRUCTION_FETCH.
void FlashCtl_A_disableReadBuffering | ( | uint_fast8_t | memoryBank, |
uint_fast8_t | accessMethod | ||
) |
Disables read buffering on accesses to a specified bank of flash memory
memoryBank | is the value of the memory bank to disable read buffering. Must be only one of the following values:
|
accessMethod | is the value of the access type to disable read buffering. Must ne only one of the following values:
|
References ASSERT, FLASH_A_BANK0, FLASH_A_BANK1, FLASH_A_DATA_READ, and FLASH_A_INSTRUCTION_FETCH.
bool FlashCtl_A_protectMemory | ( | uint32_t | startAddr, |
uint32_t | endAddr | ||
) |
Enables protection on the given flash memory range from writes. Note that this function only works on flash memory and giving in an address to ROM or SRAM will result in unreliable behavior.
startAddr | is the start address of the memory to protect |
endAddr | is the end address of the memory to protect |
References __INFO_FLASH_A_TECH_START__, FLASH_A_SECTOR_SIZE, SysCtl_A_getFlashSize(), and SysCtl_A_getInfoFlashSize().
Referenced by FlashCtl_A_performMassErase().
bool FlashCtl_A_unprotectMemory | ( | uint32_t | startAddr, |
uint32_t | endAddr | ||
) |
Disables protection on the given flash memory range from writes. Note that this function only works on flash memory and giving in an address to ROM or SRAM will result in unreliable behavior.
startAddr | is the start address of the memory to unprotect |
endAddr | is the end address of the memory to unprotect |
References __INFO_FLASH_A_TECH_START__, FLASH_A_SECTOR_SIZE, SysCtl_A_getFlashSize(), and SysCtl_A_getInfoFlashSize().
bool FlashCtl_A_isMemoryRangeProtected | ( | uint32_t | startAddr, |
uint32_t | endAddr | ||
) |
Scans over the given memory range and returns false if any of the inclusive memory addresses is protect from writes.
startAddr | is the start address to scan |
endAddr | is the end address to scan |
References FLASH_A_SECTOR_SIZE, and FlashCtl_A_isMemoryProtected().
bool FlashCtl_A_isMemoryProtected | ( | uint32_t | addr | ) |
Scans over the given memory range and returns false if any of the inclusive memory addresses is protect from writes.
startAddr | is the start address to scan |
endAddr | is the end address to scan |
References __INFO_FLASH_A_TECH_START__, FLASH_A_SECTOR_SIZE, SysCtl_A_getFlashSize(), and SysCtl_A_getInfoFlashSize().
Referenced by FlashCtl_A_isMemoryRangeProtected(), and FlashCtl_A_performMassErase().
bool FlashCtl_A_verifyMemory | ( | void * | verifyAddr, |
uint32_t | length, | ||
uint_fast8_t | pattern | ||
) |
Verifies a given segment of memory based off either a high (1) or low (0) state.
verifyAddr | Start address where verification will begin |
length | Length in bytes to verify based off the pattern |
pattern | The pattern which verification will check versus. This can either be a low pattern (each register will be checked versus a pattern of 32 zeros, or a high pattern (each register will be checked versus a pattern of 32 ones). Valid values are: FLASH_A_0_PATTERN, FLASH_A_1_PATTERN |
References __INFO_FLASH_A_TECH_MIDDLE__, __INFO_FLASH_A_TECH_START__, ASSERT, CPU_primask(), FLASH_A_0_PATTERN, FLASH_A_1_PATTERN, FLASH_A_BANK0, FLASH_A_BANK1, FLASH_A_ERASE_VERIFY_READ_MODE, FLASH_A_INFO_SPACE, FLASH_A_MAIN_SPACE, FLASH_A_PROGRAM_VERIFY_READ_MODE, FlashCtl_A_getReadMode(), FlashCtl_A_getWaitState(), FlashCtl_A_setReadMode(), FlashCtl_A_setWaitState(), HWREG32, HWREG8, Interrupt_disableMaster(), Interrupt_enableMaster(), and SysCtl_A_getFlashSize().
Referenced by FlashCtl_A_eraseSector(), and FlashCtl_A_performMassErase().
bool FlashCtl_A_performMassErase | ( | void | ) |
Performs a mass erase on all unprotected flash sectors. Protected sectors are ignored.
References __INFO_FLASH_A_TECH_START__, CPU_primask(), FLASH_A_1_PATTERN, FLASH_A_SECTOR_SIZE, FlashCtl_A_isMemoryProtected(), FlashCtl_A_protectMemory(), FlashCtl_A_verifyMemory(), Interrupt_disableMaster(), Interrupt_enableMaster(), SysCtl_A_FlashTLV_Info::maxErasePulses, SysCtl_A_getFlashSize(), SysCtl_A_getInfoFlashSize(), SysCtl_A_getTLVInfo, and TLV_TAG_FLASHCTL.
void FlashCtl_A_initiateMassErase | ( | void | ) |
Initiates a mass erase and returns control back to the program. This is a non-blocking function, however it is the user's responsibility to perform the necessary verification requirements after the interrupt is set to signify completion.
bool FlashCtl_A_eraseSector | ( | uint32_t | addr | ) |
Erases a sector of MAIN or INFO flash memory.
addr | The start of the sector to erase. Note that with flash, the minimum allowed size that can be erased is a flash sector (which is 4KB on the MSP432 family). If an address is provided to this function which is not on a 4KB boundary, the entire sector will still be erased. |
References __INFO_FLASH_A_TECH_START__, CPU_primask(), FLASH_A_1_PATTERN, FLASH_A_INFO_SPACE, FLASH_A_MAIN_SPACE, FLASH_A_SECTOR_SIZE, FlashCtl_A_verifyMemory(), Interrupt_disableMaster(), Interrupt_enableMaster(), SysCtl_A_FlashTLV_Info::maxErasePulses, SysCtl_A_getFlashSize(), SysCtl_A_getTLVInfo, and TLV_TAG_FLASHCTL.
bool FlashCtl_A_programMemory | ( | void * | src, |
void * | dest, | ||
uint32_t | length | ||
) |
Program a portion of flash memory with the provided data
src | Pointer to the data source to program into flash |
dest | Pointer to the destination in flash to program |
length | Length in bytes to program |
References CPU_primask(), FLASH_A_IMMEDIATE_WRITE_MODE, FlashCtl_A_disableWordProgramming(), FlashCtl_A_enableWordProgramming(), Interrupt_disableMaster(), Interrupt_enableMaster(), SysCtl_A_FlashTLV_Info::maxProgramPulses, SysCtl_A_getTLVInfo, and TLV_TAG_FLASHCTL.
void FlashCtl_A_setProgramVerification | ( | uint32_t | verificationSetting | ) |
Setups pre/post verification of burst and regular flash programming instructions. Note that this API is for advanced users that are programming their own flash drivers. The program/erase APIs are not affected by this setting and take care of the verification requirements.
verificationSetting | Verification setting to set. This value can be a bitwise OR of the following values:
|
References FLASH_A_BURSTPOST, FLASH_A_BURSTPRE, FLASH_A_REGPOST, and FLASH_A_REGPRE.
void FlashCtl_A_clearProgramVerification | ( | uint32_t | verificationSetting | ) |
Clears pre/post verification of burst and regular flash programming instructions. Note that this API is for advanced users that are programming their own flash drivers. The program/erase APIs are not affected by this setting and take care of the verification requirements.
verificationSetting | Verification setting to clear. This value can be a bitwise OR of the following values:
|
References FLASH_A_BURSTPOST, FLASH_A_BURSTPRE, FLASH_A_REGPOST, and FLASH_A_REGPRE.
void FlashCtl_A_enableWordProgramming | ( | uint32_t | mode | ) |
Enables word programming of flash memory.
This function will enable word programming of the flash memory and set the mode of behavior when the flash write occurs.
mode | The mode specifies the behavior of the flash controller when programming words to flash. In FLASH_A_IMMEDIATE_WRITE_MODE, the program operation happens immediately on the write to flash while in FLASH_A_COLLATED_WRITE_MODE the write will be delayed until a full 128-bits have been collated. Possible values include:
|
Refer to the user's guide for further documentation.
References FLASH_A_COLLATED_WRITE_MODE, and FLASH_A_IMMEDIATE_WRITE_MODE.
Referenced by FlashCtl_A_programMemory().
void FlashCtl_A_disableWordProgramming | ( | void | ) |
Disables word programming of flash memory.
Refer to FlashCtl_A_enableWordProgramming and the user's guide for description on the difference between full word and immediate programming
Referenced by FlashCtl_A_programMemory().
uint32_t FlashCtl_A_isWordProgrammingEnabled | ( | void | ) |
Returns if word programming mode is enabled (and if it is, the specific mode)
Refer to FlashCtl_A_enableWordProgramming and the user's guide for description on the difference between full word and immediate programming
References FLASH_A_COLLATED_WRITE_MODE, and FLASH_A_IMMEDIATE_WRITE_MODE.
bool FlashCtl_A_setReadMode | ( | uint32_t | flashBank, |
uint32_t | readMode | ||
) |
Sets the flash read mode to be used by default flash read operations. Note that the proper wait states must be set prior to entering this function.
flashBank | Flash bank to set read mode for. Valid values are:
|
readMode | The read mode to set. Valid values are:
|
References ASSERT, FLASH_A_BANK0, and FLASH_A_BANK1.
Referenced by __FlashCtl_A_remaskBurstDataPost(), __FlashCtl_A_remaskBurstDataPre(), __FlashCtl_A_remaskData32Post(), __FlashCtl_A_remaskData32Pre(), __FlashCtl_A_remaskData8Post(), __FlashCtl_A_remaskData8Pre(), and FlashCtl_A_verifyMemory().
uint32_t FlashCtl_A_getReadMode | ( | uint32_t | flashBank | ) |
Gets the flash read mode to be used by default flash read operations.
flashBank | Flash bank to set read mode for. Valid values are:
|
References ASSERT, FLASH_A_BANK0, and FLASH_A_BANK1.
Referenced by __FlashCtl_A_remaskBurstDataPost(), __FlashCtl_A_remaskBurstDataPre(), __FlashCtl_A_remaskData32Post(), __FlashCtl_A_remaskData32Pre(), __FlashCtl_A_remaskData8Post(), __FlashCtl_A_remaskData8Pre(), and FlashCtl_A_verifyMemory().
void FlashCtl_A_setWaitState | ( | uint32_t | bank, |
uint32_t | waitState | ||
) |
Changes the number of wait states that are used by the flash controller for read operations. When changing frequency ranges of the clock, this functions must be used in order to allow for readable flash memory.
waitState | The number of wait states to set. Note that only bits 0-3 are used. |
flashBank | Flash bank to set wait state for. Valid values are:
|
References ASSERT, FLASH_A_BANK0, and FLASH_A_BANK1.
Referenced by __FlashCtl_A_remaskBurstDataPost(), __FlashCtl_A_remaskBurstDataPre(), __FlashCtl_A_remaskData32Post(), __FlashCtl_A_remaskData32Pre(), __FlashCtl_A_remaskData8Post(), __FlashCtl_A_remaskData8Pre(), and FlashCtl_A_verifyMemory().
uint32_t FlashCtl_A_getWaitState | ( | uint32_t | bank | ) |
Returns the set number of flash wait states for the given flash bank.
flashBank | Flash bank to set wait state for. Valid values are:
|
References ASSERT, FLASH_A_BANK0, and FLASH_A_BANK1.
Referenced by __FlashCtl_A_remaskBurstDataPost(), __FlashCtl_A_remaskBurstDataPre(), __FlashCtl_A_remaskData32Post(), __FlashCtl_A_remaskData32Pre(), __FlashCtl_A_remaskData8Post(), __FlashCtl_A_remaskData8Pre(), and FlashCtl_A_verifyMemory().
void FlashCtl_A_enableInterrupt | ( | uint32_t | flags | ) |
Enables individual flash control interrupt sources.
flags | is a bit mask of the interrupt sources to be enabled. Must be a logical OR of:
|
This function enables the indicated flash system interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
void FlashCtl_A_disableInterrupt | ( | uint32_t | flags | ) |
Disables individual flash system interrupt sources.
flags | is a bit mask of the interrupt sources to be disabled. Must be a logical OR of:
|
This function disables the indicated flash system interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
uint32_t FlashCtl_A_getEnabledInterruptStatus | ( | void | ) |
Gets the current interrupt status masked with the enabled interrupts. This function is useful to call in ISRs to get a list of pending interrupts that are actually enabled and could have caused the ISR.
References FlashCtl_A_getInterruptStatus().
uint32_t FlashCtl_A_getInterruptStatus | ( | void | ) |
Gets the current interrupt status.
Referenced by FlashCtl_A_getEnabledInterruptStatus().
void FlashCtl_A_clearInterruptFlag | ( | uint32_t | flags | ) |
Clears flash system interrupt sources.
flags | is a bit mask of the interrupt sources to be cleared. Must be a logical OR of:
|
The specified flash system interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep it from being called again immediately upon exit.
void FlashCtl_A_registerInterrupt | ( | void(*)(void) | intHandler | ) |
Registers an interrupt handler for flash clock system interrupt.
intHandler | is a pointer to the function to be called when the clock system interrupt occurs. |
This function registers the handler to be called when a clock system interrupt occurs. This function enables the global interrupt in the interrupt controller; specific flash controller interrupts must be enabled via FlashCtl_A_enableInterrupt(). It is the interrupt handler's responsibility to clear the interrupt source via FlashCtl_A_clearInterruptFlag().
References INT_FLCTL, Interrupt_enableInterrupt(), and Interrupt_registerInterrupt().
void FlashCtl_A_unregisterInterrupt | ( | void | ) |
Unregisters the interrupt handler for the flash system.
This function unregisters the handler to be called when a clock system interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
References INT_FLCTL, Interrupt_disableInterrupt(), and Interrupt_unregisterInterrupt().
void FlashCtl_A_initiateSectorErase | ( | uint32_t | addr | ) |
Initiates a sector erase of MAIN or INFO flash memory. Note that this function simply initaites the sector erase, but does no verification which is required by the flash controller. The user must manually set and enable interrupts on the flash controller to fire on erase completion and then use the FlashCtl_A_verifyMemory function to verify that the sector was actually erased
addr | The start of the sector to erase. Note that with flash, the minimum allowed size that can be erased is a flash sector (which is 4KB on the MSP432 family). If an address is provided to this function which is not on a 4KB boundary, the entire sector will still be erased. |
References __INFO_FLASH_A_TECH_START__, FLASH_A_INFO_SPACE, FLASH_A_MAIN_SPACE, and SysCtl_A_getFlashSize().
uint8_t __FlashCtl_A_remaskData8Post | ( | uint8_t | data, |
uint32_t | addr | ||
) |
uint8_t __FlashCtl_A_remaskData8Pre | ( | uint8_t | data, |
uint32_t | addr | ||
) |
uint32_t __FlashCtl_A_remaskData32Post | ( | uint32_t | data, |
uint32_t | addr | ||
) |
uint32_t __FlashCtl_A_remaskData32Pre | ( | uint32_t | data, |
uint32_t | addr | ||
) |
void __FlashCtl_A_remaskBurstDataPost | ( | uint32_t | addr, |
uint32_t | size | ||
) |
void __FlashCtl_A_remaskBurstDataPre | ( | uint32_t | addr, |
uint32_t | size | ||
) |