36 #include <ti/devices/msp432p4xx/inc/msp.h>
40 #ifdef __MCU_HAS_FLCTL__
65 #define FLASH_BURST_PRG_BIT 0x03
68 #define FLASH_PROGRAM_ERROR FLCTL_IFG_PRG_ERR
69 #define FLASH_BENCHMARK_INT FLCTL_IFG_BMRK
70 #define FLASH_ERASE_COMPLETE FLCTL_IFG_ERASE
71 #define FLASH_BRSTPRGM_COMPLETE FLCTL_IFG_PRGB
72 #define FLASH_WRDPRGM_COMPLETE FLCTL_IFG_PRG
73 #define FLASH_POSTVERIFY_FAILED FLCTL_IFG_AVPST
74 #define FLASH_PREVERIFY_FAILED FLCTL_IFG_AVPRE
75 #define FLASH_BRSTRDCMP_COMPLETE FLCTL_IFG_RDBRST
77 #define FLASH_NORMAL_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_0
78 #define FLASH_MARGIN0_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_1
79 #define FLASH_MARGIN1_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_2
80 #define FLASH_PROGRAM_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_3
81 #define FLASH_ERASE_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_4
82 #define FLASH_LEAKAGE_VERIFY_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_5
83 #define FLASH_MARGIN0B_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_9
84 #define FLASH_MARGIN1B_READ_MODE FLCTL_BANK0_RDCTL_RD_MODE_10
86 #define FLASH_PRGBRSTCTLSTAT_BURSTSTATUS_COMPLETE FLCTL_PRGBRST_CTLSTAT_BURST_STATUS_7
88 #define FLASH_BANK0 0x00
89 #define FLASH_BANK1 0x01
90 #define FLASH_DATA_READ 0x00
91 #define FLASH_INSTRUCTION_FETCH 0x01
93 #define FLASH_MAIN_MEMORY_SPACE_BANK0 0x01
94 #define FLASH_MAIN_MEMORY_SPACE_BANK1 0x02
95 #define FLASH_INFO_MEMORY_SPACE_BANK0 0x03
96 #define FLASH_INFO_MEMORY_SPACE_BANK1 0x04
98 #define FLASH_MAIN_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE_0
99 #define FLASH_INFO_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE_1
100 #define FLASH_1_PATTERN FLCTL_RDBRST_CTLSTAT_DATA_CMP
101 #define FLASH_0_PATTERN 0x00
103 #define FLASH_SECTOR0 FLCTL_BANK0_MAIN_WEPROT_PROT0
104 #define FLASH_SECTOR1 FLCTL_BANK0_MAIN_WEPROT_PROT1
105 #define FLASH_SECTOR2 FLCTL_BANK0_MAIN_WEPROT_PROT2
106 #define FLASH_SECTOR3 FLCTL_BANK0_MAIN_WEPROT_PROT3
107 #define FLASH_SECTOR4 FLCTL_BANK0_MAIN_WEPROT_PROT4
108 #define FLASH_SECTOR5 FLCTL_BANK0_MAIN_WEPROT_PROT5
109 #define FLASH_SECTOR6 FLCTL_BANK0_MAIN_WEPROT_PROT6
110 #define FLASH_SECTOR7 FLCTL_BANK0_MAIN_WEPROT_PROT7
111 #define FLASH_SECTOR8 FLCTL_BANK0_MAIN_WEPROT_PROT8
112 #define FLASH_SECTOR9 FLCTL_BANK0_MAIN_WEPROT_PROT9
113 #define FLASH_SECTOR10 FLCTL_BANK0_MAIN_WEPROT_PROT10
114 #define FLASH_SECTOR11 FLCTL_BANK0_MAIN_WEPROT_PROT11
115 #define FLASH_SECTOR12 FLCTL_BANK0_MAIN_WEPROT_PROT12
116 #define FLASH_SECTOR13 FLCTL_BANK0_MAIN_WEPROT_PROT13
117 #define FLASH_SECTOR14 FLCTL_BANK0_MAIN_WEPROT_PROT14
118 #define FLASH_SECTOR15 FLCTL_BANK0_MAIN_WEPROT_PROT15
119 #define FLASH_SECTOR16 FLCTL_BANK0_MAIN_WEPROT_PROT16
120 #define FLASH_SECTOR17 FLCTL_BANK0_MAIN_WEPROT_PROT17
121 #define FLASH_SECTOR18 FLCTL_BANK0_MAIN_WEPROT_PROT18
122 #define FLASH_SECTOR19 FLCTL_BANK0_MAIN_WEPROT_PROT19
123 #define FLASH_SECTOR20 FLCTL_BANK0_MAIN_WEPROT_PROT20
124 #define FLASH_SECTOR21 FLCTL_BANK0_MAIN_WEPROT_PROT21
125 #define FLASH_SECTOR22 FLCTL_BANK0_MAIN_WEPROT_PROT22
126 #define FLASH_SECTOR23 FLCTL_BANK0_MAIN_WEPROT_PROT23
127 #define FLASH_SECTOR24 FLCTL_BANK0_MAIN_WEPROT_PROT24
128 #define FLASH_SECTOR25 FLCTL_BANK0_MAIN_WEPROT_PROT25
129 #define FLASH_SECTOR26 FLCTL_BANK0_MAIN_WEPROT_PROT26
130 #define FLASH_SECTOR27 FLCTL_BANK0_MAIN_WEPROT_PROT27
131 #define FLASH_SECTOR28 FLCTL_BANK0_MAIN_WEPROT_PROT28
132 #define FLASH_SECTOR29 FLCTL_BANK0_MAIN_WEPROT_PROT29
133 #define FLASH_SECTOR30 FLCTL_BANK0_MAIN_WEPROT_PROT30
134 #define FLASH_SECTOR31 FLCTL_BANK0_MAIN_WEPROT_PROT31
136 #define FLASH_NOVER 0
137 #define FLASH_BURSTPOST FLCTL_PRGBRST_CTLSTAT_AUTO_PST
138 #define FLASH_BURSTPRE FLCTL_PRGBRST_CTLSTAT_AUTO_PRE
139 #define FLASH_REGPRE FLCTL_PRG_CTLSTAT_VER_PRE
140 #define FLASH_REGPOST FLCTL_PRG_CTLSTAT_VER_PST
141 #define FLASH_FULLVER (FLCTL_PRGBRST_CTLSTAT_AUTO_PST | \
142 FLCTL_PRGBRST_CTLSTAT_AUTO_PRE | FLCTL_PRG_CTLSTAT_VER_PRE \
143 | FLCTL_PRG_CTLSTAT_VER_PST)
145 #define FLASH_COLLATED_WRITE_MODE 0x01
146 #define FLASH_IMMEDIATE_WRITE_MODE 0x02
148 #define __INFO_FLASH_TECH_START__ 0x00200000
149 #define __INFO_FLASH_TECH_MIDDLE__ 0x00202000
181 uint32_t *sectorNum);
201 uint_fast8_t accessMethod);
221 uint_fast8_t accessMethod);
283 uint32_t sectorMask);
345 uint32_t sectorMask);
446 uint_fast8_t pattern);
944 #endif // __FLASH_H__
uint32_t FlashCtl_getInterruptStatus(void)
Definition: flash.c:1227
uint32_t FlashCtl_getReadMode(uint32_t flashBank)
Definition: flash.c:740
bool FlashCtl_performMassErase(void)
Definition: flash.c:765
bool FlashCtl_setReadMode(uint32_t flashBank, uint32_t readMode)
Definition: flash.c:711
void FlashCtl_setProgramVerification(uint32_t verificationSetting)
Definition: flash.c:1121
uint32_t FlashCtl_isWordProgrammingEnabled(void)
Definition: flash.c:1175
void FlashCtl_enableWordProgramming(uint32_t mode)
Definition: flash.c:1156
uint32_t FlashCtl_getWaitState(uint32_t bank)
Definition: flash.c:1202
void FlashCtl_registerInterrupt(void(*intHandler)(void))
Definition: flash.c:1242
void FlashCtl_enableReadBuffering(uint_fast8_t memoryBank, uint_fast8_t accessMethod)
Definition: flash.c:420
void FlashCtl_getMemoryInfo(uint32_t addr, uint32_t *bankNum, uint32_t *sectorNum)
Definition: flash.c:138
void FlashCtl_initiateSectorErase(uint32_t addr)
Definition: flash.c:963
uint32_t FlashCtl_getEnabledInterruptStatus(void)
Definition: flash.c:1232
void FlashCtl_enableInterrupt(uint32_t flags)
Definition: flash.c:1217
bool FlashCtl_verifyMemory(void *verifyAddr, uint32_t length, uint_fast8_t pattern)
Definition: flash.c:527
void FlashCtl_unregisterInterrupt(void)
Definition: flash.c:1255
void FlashCtl_clearProgramVerification(uint32_t verificationSetting)
Definition: flash.c:1138
bool FlashCtl_programMemory(void *src, void *dest, uint32_t length)
Definition: flash.c:1003
bool FlashCtl_unprotectSector(uint_fast8_t memorySpace, uint32_t sectorMask)
Definition: flash.c:454
void FlashCtl_initiateMassErase(void)
Definition: flash.c:755
uint32_t __FlashCtl_remaskData32Pre(uint32_t data, uint32_t addr)
Definition: flash.c:1390
bool FlashCtl_protectSector(uint_fast8_t memorySpace, uint32_t sectorMask)
Definition: flash.c:481
void FlashCtl_clearInterruptFlag(uint32_t flags)
Definition: flash.c:1237
bool FlashCtl_isSectorProtected(uint_fast8_t memorySpace, uint32_t sector)
Definition: flash.c:508
void FlashCtl_setWaitState(uint32_t bank, uint32_t waitState)
Definition: flash.c:1186
uint32_t __FlashCtl_remaskData32Post(uint32_t data, uint32_t addr)
Definition: flash.c:1342
void __FlashCtl_remaskBurstDataPost(uint32_t addr, uint32_t size)
Definition: flash.c:1503
bool FlashCtl_eraseSector(uint32_t addr)
Definition: flash.c:862
void __FlashCtl_remaskBurstDataPre(uint32_t addr, uint32_t size)
Definition: flash.c:1438
uint8_t __FlashCtl_remaskData8Pre(uint8_t data, uint32_t addr)
Definition: flash.c:1305
void FlashCtl_disableInterrupt(uint32_t flags)
Definition: flash.c:1222
uint8_t __FlashCtl_remaskData8Post(uint8_t data, uint32_t addr)
Definition: flash.c:1268
void FlashCtl_disableWordProgramming(void)
Definition: flash.c:1170
void FlashCtl_disableReadBuffering(uint_fast8_t memoryBank, uint_fast8_t accessMethod)
Definition: flash.c:437