36 #include <ti/devices/msp432p4xx/inc/msp.h>
40 #ifdef __MCU_HAS_FLCTL_A__
65 #define FLASH_A_BURST_PRG_BIT 0x03
66 #define FLASH_A_SECTOR_SIZE 4096
69 #define FLASH_A_PROGRAM_ERROR FLCTL_A_IFG_PRG_ERR
70 #define FLASH_A_BENCHMARK_INT FLCTL_A_IFG_BMRK
71 #define FLASH_A_ERASE_COMPLETE FLCTL_A_IFG_ERASE
72 #define FLASH_A_BRSTPRGM_COMPLETE FLCTL_A_IFG_PRGB
73 #define FLASH_A_WRDPRGM_COMPLETE FLCTL_A_IFG_PRG
74 #define FLASH_A_POSTVERIFY_FAILED FLCTL_A_IFG_AVPST
75 #define FLASH_A_PREVERIFY_FAILED FLCTL_A_IFG_AVPRE
76 #define FLASH_A_BRSTRDCMP_COMPLETE FLCTL_A_IFG_RDBRST
78 #define FLASH_A_NORMAL_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_0
79 #define FLASH_A_MARGIN0_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_1
80 #define FLASH_A_MARGIN1_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_2
81 #define FLASH_A_PROGRAM_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_3
82 #define FLASH_A_ERASE_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_4
83 #define FLASH_A_LEAKAGE_VERIFY_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_5
84 #define FLASH_A_MARGIN0B_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_9
85 #define FLASH_A_MARGIN1B_READ_MODE FLCTL_A_BANK0_RDCTL_RD_MODE_10
87 #define FLASH_A_PRGBRSTCTLSTAT_BURSTSTATUS_COMPLETE FLCTL_A_PRGBRST_CTLSTAT_BURST_STATUS_7
89 #define FLASH_A_BANK0 0x00
90 #define FLASH_A_BANK1 0x01
91 #define FLASH_A_DATA_READ 0x00
92 #define FLASH_A_INSTRUCTION_FETCH 0x01
94 #define FLASH_A_MAIN_MEMORY_SPACE_BANK0 0x01
95 #define FLASH_A_MAIN_MEMORY_SPACE_BANK1 0x02
96 #define FLASH_A_INFO_MEMORY_SPACE_BANK0 0x03
97 #define FLASH_A_INFO_MEMORY_SPACE_BANK1 0x04
99 #define FLASH_A_MAIN_SPACE FLCTL_A_RDBRST_CTLSTAT_MEM_TYPE_0
100 #define FLASH_A_INFO_SPACE FLCTL_A_RDBRST_CTLSTAT_MEM_TYPE_1
101 #define FLASH_A_1_PATTERN FLCTL_A_RDBRST_CTLSTAT_DATA_CMP
102 #define FLASH_A_0_PATTERN 0x00
104 #define FLASH_A_SECTOR0 FLCTL_A_BANK0_MAIN_WEPROT_PROT0
105 #define FLASH_A_SECTOR1 FLCTL_A_BANK0_MAIN_WEPROT_PROT1
106 #define FLASH_A_SECTOR2 FLCTL_A_BANK0_MAIN_WEPROT_PROT2
107 #define FLASH_A_SECTOR3 FLCTL_A_BANK0_MAIN_WEPROT_PROT3
108 #define FLASH_A_SECTOR4 FLCTL_A_BANK0_MAIN_WEPROT_PROT4
109 #define FLASH_A_SECTOR5 FLCTL_A_BANK0_MAIN_WEPROT_PROT5
110 #define FLASH_A_SECTOR6 FLCTL_A_BANK0_MAIN_WEPROT_PROT6
111 #define FLASH_A_SECTOR7 FLCTL_A_BANK0_MAIN_WEPROT_PROT7
112 #define FLASH_A_SECTOR8 FLCTL_A_BANK0_MAIN_WEPROT_PROT8
113 #define FLASH_A_SECTOR9 FLCTL_A_BANK0_MAIN_WEPROT_PROT9
114 #define FLASH_A_SECTOR10 FLCTL_A_BANK0_MAIN_WEPROT_PROT10
115 #define FLASH_A_SECTOR11 FLCTL_A_BANK0_MAIN_WEPROT_PROT11
116 #define FLASH_A_SECTOR12 FLCTL_A_BANK0_MAIN_WEPROT_PROT12
117 #define FLASH_A_SECTOR13 FLCTL_A_BANK0_MAIN_WEPROT_PROT13
118 #define FLASH_A_SECTOR14 FLCTL_A_BANK0_MAIN_WEPROT_PROT14
119 #define FLASH_A_SECTOR15 FLCTL_A_BANK0_MAIN_WEPROT_PROT15
120 #define FLASH_A_SECTOR16 FLCTL_A_BANK0_MAIN_WEPROT_PROT16
121 #define FLASH_A_SECTOR17 FLCTL_A_BANK0_MAIN_WEPROT_PROT17
122 #define FLASH_A_SECTOR18 FLCTL_A_BANK0_MAIN_WEPROT_PROT18
123 #define FLASH_A_SECTOR19 FLCTL_A_BANK0_MAIN_WEPROT_PROT19
124 #define FLASH_A_SECTOR20 FLCTL_A_BANK0_MAIN_WEPROT_PROT20
125 #define FLASH_A_SECTOR21 FLCTL_A_BANK0_MAIN_WEPROT_PROT21
126 #define FLASH_A_SECTOR22 FLCTL_A_BANK0_MAIN_WEPROT_PROT22
127 #define FLASH_A_SECTOR23 FLCTL_A_BANK0_MAIN_WEPROT_PROT23
128 #define FLASH_A_SECTOR24 FLCTL_A_BANK0_MAIN_WEPROT_PROT24
129 #define FLASH_A_SECTOR25 FLCTL_A_BANK0_MAIN_WEPROT_PROT25
130 #define FLASH_A_SECTOR26 FLCTL_A_BANK0_MAIN_WEPROT_PROT26
131 #define FLASH_A_SECTOR27 FLCTL_A_BANK0_MAIN_WEPROT_PROT27
132 #define FLASH_A_SECTOR28 FLCTL_A_BANK0_MAIN_WEPROT_PROT28
133 #define FLASH_A_SECTOR29 FLCTL_A_BANK0_MAIN_WEPROT_PROT29
134 #define FLASH_A_SECTOR30 FLCTL_A_BANK0_MAIN_WEPROT_PROT30
135 #define FLASH_A_SECTOR31 FLCTL_A_BANK0_MAIN_WEPROT_PROT31
137 #define FLASH_A_NOVER 0
138 #define FLASH_A_BURSTPOST FLCTL_A_PRGBRST_CTLSTAT_AUTO_PST
139 #define FLASH_A_BURSTPRE FLCTL_A_PRGBRST_CTLSTAT_AUTO_PRE
140 #define FLASH_A_REGPRE FLCTL_A_PRG_CTLSTAT_VER_PRE
141 #define FLASH_A_REGPOST FLCTL_A_PRG_CTLSTAT_VER_PST
142 #define FLASH_A_FULLVER (FLCTL_A_PRGBRST_CTLSTAT_AUTO_PST | \
143 FLCTL_A_PRGBRST_CTLSTAT_AUTO_PRE | FLCTL_A_PRG_CTLSTAT_VER_PRE \
144 | FLCTL_A_PRG_CTLSTAT_VER_PST)
146 #define FLASH_A_COLLATED_WRITE_MODE 0x01
147 #define FLASH_A_IMMEDIATE_WRITE_MODE 0x02
150 #define __INFO_FLASH_A_TECH_START__ 0x00200000
151 #define __INFO_FLASH_A_TECH_MIDDLE__ 0x00204000
204 uint32_t *sectorNum);
224 uint_fast8_t accessMethod);
244 uint_fast8_t accessMethod);
353 uint_fast8_t pattern);
499 uint32_t verificationSetting);
851 #endif // __FLASH_A_H__
uint32_t FlashCtl_A_getWaitState(uint32_t bank)
Definition: flash_a.c:1414
uint32_t B0_MAIN_R7
Definition: flash_a.h:162
void FlashCtl_A_initiateSectorErase(uint32_t addr)
Definition: flash_a.c:1170
uint32_t B1_MAIN_R4
Definition: flash_a.h:167
uint32_t B0_MAIN_R3
Definition: flash_a.h:158
void FlashCtl_A_setProgramVerification(uint32_t verificationSetting)
Definition: flash_a.c:1331
void __FlashCtl_A_remaskBurstDataPost(uint32_t addr, uint32_t size)
Definition: flash_a.c:1712
bool FlashCtl_A_isMemoryProtected(uint32_t addr)
Definition: flash_a.c:422
void FlashCtl_A_enableInterrupt(uint32_t flags)
Definition: flash_a.c:1431
void FlashCtl_A_unregisterInterrupt(void)
Definition: flash_a.c:1469
uint32_t B1_MAIN_R0
Definition: flash_a.h:163
bool FlashCtl_A_programMemory(void *src, void *dest, uint32_t length)
Definition: flash_a.c:1213
uint32_t B1_MAIN_R7
Definition: flash_a.h:170
uint32_t B0_INFO_R0
Definition: flash_a.h:171
uint32_t B0_MAIN_R5
Definition: flash_a.h:160
uint32_t B1_MAIN_R1
Definition: flash_a.h:164
void FlashCtl_A_setWaitState(uint32_t bank, uint32_t waitState)
Definition: flash_a.c:1396
uint32_t FlashCtl_A_isWordProgrammingEnabled(void)
Definition: flash_a.c:1385
uint32_t __FlashCtl_A_remaskData32Pre(uint32_t data, uint32_t addr)
Definition: flash_a.c:1600
void FlashCtl_A_enableWordProgramming(uint32_t mode)
Definition: flash_a.c:1366
uint8_t __FlashCtl_A_remaskData8Post(uint8_t data, uint32_t addr)
Definition: flash_a.c:1482
void FlashCtl_A_initiateMassErase(void)
Definition: flash_a.c:929
uint32_t FlashCtl_A_getReadMode(uint32_t flashBank)
Definition: flash_a.c:912
void FlashCtl_A_getMemoryInfo(uint32_t addr, uint32_t *bankNum, uint32_t *sectorNum)
Definition: flash_a.c:104
bool FlashCtl_A_performMassErase(void)
Definition: flash_a.c:940
void FlashCtl_A_enableReadBuffering(uint_fast8_t memoryBank, uint_fast8_t accessMethod)
Definition: flash_a.c:388
bool FlashCtl_A_setReadMode(uint32_t flashBank, uint32_t readMode)
Definition: flash_a.c:883
uint32_t B0_MAIN_R0
Definition: flash_a.h:155
uint32_t FlashCtl_A_getEnabledInterruptStatus(void)
Definition: flash_a.c:1446
uint8_t __FlashCtl_A_remaskData8Pre(uint8_t data, uint32_t addr)
Definition: flash_a.c:1517
void FlashCtl_A_registerInterrupt(void(*intHandler)(void))
Definition: flash_a.c:1456
bool FlashCtl_A_verifyMemory(void *verifyAddr, uint32_t length, uint_fast8_t pattern)
Definition: flash_a.c:699
struct __sFlashCtl_ProtectionRegister __FlashCtl_ProtectionRegister
void FlashCtl_A_clearInterruptFlag(uint32_t flags)
Definition: flash_a.c:1451
uint32_t B0_MAIN_R6
Definition: flash_a.h:161
uint32_t B1_MAIN_R5
Definition: flash_a.h:168
bool FlashCtl_A_eraseSector(uint32_t addr)
Definition: flash_a.c:1064
void FlashCtl_A_clearProgramVerification(uint32_t verificationSetting)
Definition: flash_a.c:1348
bool FlashCtl_A_isMemoryRangeProtected(uint32_t startAddr, uint32_t endAddr)
Definition: flash_a.c:467
uint32_t B0_MAIN_R1
Definition: flash_a.h:156
uint32_t B1_INFO_R0
Definition: flash_a.h:172
uint32_t B0_MAIN_R4
Definition: flash_a.h:159
uint32_t FlashCtl_A_getInterruptStatus(void)
Definition: flash_a.c:1441
uint32_t B1_MAIN_R3
Definition: flash_a.h:166
uint32_t __FlashCtl_A_remaskData32Post(uint32_t data, uint32_t addr)
Definition: flash_a.c:1552
bool FlashCtl_A_protectMemory(uint32_t startAddr, uint32_t endAddr)
Definition: flash_a.c:592
bool FlashCtl_A_unprotectMemory(uint32_t startAddr, uint32_t endAddr)
Definition: flash_a.c:485
uint32_t B1_MAIN_R2
Definition: flash_a.h:165
void FlashCtl_A_disableReadBuffering(uint_fast8_t memoryBank, uint_fast8_t accessMethod)
Definition: flash_a.c:405
uint32_t B0_MAIN_R2
Definition: flash_a.h:157
void __FlashCtl_A_remaskBurstDataPre(uint32_t addr, uint32_t size)
Definition: flash_a.c:1648
Definition: flash_a.h:153
void FlashCtl_A_disableInterrupt(uint32_t flags)
Definition: flash_a.c:1436
void FlashCtl_A_disableWordProgramming(void)
Definition: flash_a.c:1380
uint32_t B1_MAIN_R6
Definition: flash_a.h:169