30 #define FLASH_BURST_PRG_BIT 0x03
33 #define FLASH_PROGRAM_ERROR FLCTL_INTFLAG_PRG_ERR
34 #define FLASH_BENCHMARK_INT FLCTL_INTFLAG_BMRK
35 #define FLASH_BANK1_PARITY_ERROR FLCTL_INTFLAG_PARBNK1
36 #define FLASH_BANK0_PARITY_ERROR FLCTL_INTFLAG_PARBNK0
37 #define FLASH_ERASE_COMPLETE FLCTL_INTFLAG_ERASE
38 #define FLASH_BRSTPRGM_COMPLETE FLCTL_INTFLAG_PRGB
39 #define FLASH_WRDPRGM_COMPLETE FLCTL_INTFLAG_PRG
40 #define FLASH_POSTVERIFY_FAILED FLCTL_INTFLAG_AVPST
41 #define FLASH_PREVERIFY_FAILED FLCTL_INTFLAG_AVPRE
42 #define FLASH_BRSTRDCMP_COMPLETE FLCTL_INTFLAG_RDBRST
44 #define FLASH_NORMAL_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__0
45 #define FLASH_MARGIN0_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__1
46 #define FLASH_MARGIN1_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__2
47 #define FLASH_PROGRAM_VERIFY_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__3
48 #define FLASH_ERASE_VERIFY_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__4
49 #define FLASH_LEAKAGE_VERIFY_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__5
50 #define FLASH_MARGIN0B_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__9
51 #define FLASH_MARGIN1B_READ_MODE FLCTL_RDCTL_BNK0_RD_MODE__10
53 #define FLASH_PRGBRSTCTLSTAT_BURSTSTATUS_COMPLETE 0x70000
55 #define FLASH_BANK0 0x00
56 #define FLASH_BANK1 0x01
57 #define FLASH_DATA_READ 0x00
58 #define FLASH_INSTRUCTION_FETCH 0x01
60 #define FLASH_MAIN_MEMORY_SPACE_BANK0 0x01
61 #define FLASH_MAIN_MEMORY_SPACE_BANK1 0x02
62 #define FLASH_INFO_MEMORY_SPACE_BANK0 0x03
63 #define FLASH_INFO_MEMORY_SPACE_BANK1 0x04
65 #define FLASH_MAIN_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE__0
66 #define FLASH_INFO_SPACE FLCTL_RDBRST_CTLSTAT_MEM_TYPE__1
67 #define FLASH_1_PATTERN FLCTL_RDBRST_CTLSTAT_DATA_CMP
68 #define FLASH_0_PATTERN 0x00
70 #define FLASH_SECTOR0 FLCTL_MAINWEPROT_BNK0_PROT0
71 #define FLASH_SECTOR1 FLCTL_MAINWEPROT_BNK0_PROT1
72 #define FLASH_SECTOR2 FLCTL_MAINWEPROT_BNK0_PROT2
73 #define FLASH_SECTOR3 FLCTL_MAINWEPROT_BNK0_PROT3
74 #define FLASH_SECTOR4 FLCTL_MAINWEPROT_BNK0_PROT4
75 #define FLASH_SECTOR5 FLCTL_MAINWEPROT_BNK0_PROT5
76 #define FLASH_SECTOR6 FLCTL_MAINWEPROT_BNK0_PROT6
77 #define FLASH_SECTOR7 FLCTL_MAINWEPROT_BNK0_PROT7
78 #define FLASH_SECTOR8 FLCTL_MAINWEPROT_BNK0_PROT8
79 #define FLASH_SECTOR9 FLCTL_MAINWEPROT_BNK0_PROT9
80 #define FLASH_SECTOR10 FLCTL_MAINWEPROT_BNK0_PROT10
81 #define FLASH_SECTOR11 FLCTL_MAINWEPROT_BNK0_PROT11
82 #define FLASH_SECTOR12 FLCTL_MAINWEPROT_BNK0_PROT12
83 #define FLASH_SECTOR13 FLCTL_MAINWEPROT_BNK0_PROT13
84 #define FLASH_SECTOR14 FLCTL_MAINWEPROT_BNK0_PROT14
85 #define FLASH_SECTOR15 FLCTL_MAINWEPROT_BNK0_PROT15
86 #define FLASH_SECTOR16 FLCTL_MAINWEPROT_BNK0_PROT16
87 #define FLASH_SECTOR17 FLCTL_MAINWEPROT_BNK0_PROT17
88 #define FLASH_SECTOR18 FLCTL_MAINWEPROT_BNK0_PROT18
89 #define FLASH_SECTOR19 FLCTL_MAINWEPROT_BNK0_PROT19
90 #define FLASH_SECTOR20 FLCTL_MAINWEPROT_BNK0_PROT20
91 #define FLASH_SECTOR21 FLCTL_MAINWEPROT_BNK0_PROT21
92 #define FLASH_SECTOR22 FLCTL_MAINWEPROT_BNK0_PROT22
93 #define FLASH_SECTOR23 FLCTL_MAINWEPROT_BNK0_PROT23
94 #define FLASH_SECTOR24 FLCTL_MAINWEPROT_BNK0_PROT24
95 #define FLASH_SECTOR25 FLCTL_MAINWEPROT_BNK0_PROT25
96 #define FLASH_SECTOR26 FLCTL_MAINWEPROT_BNK0_PROT26
97 #define FLASH_SECTOR27 FLCTL_MAINWEPROT_BNK0_PROT27
98 #define FLASH_SECTOR28 FLCTL_MAINWEPROT_BNK0_PROT28
99 #define FLASH_SECTOR29 FLCTL_MAINWEPROT_BNK0_PROT29
100 #define FLASH_SECTOR30 FLCTL_MAINWEPROT_BNK0_PROT30
101 #define FLASH_SECTOR31 FLCTL_MAINWEPROT_BNK0_PROT31
103 #define FLASH_NOVER 0
104 #define FLASH_BURSTPOST FLCTL_PRGBRST_CTLSTAT_AUTO_PST
105 #define FLASH_BURSTPRE FLCTL_PRGBRST_CTLSTAT_AUTO_PRE
106 #define FLASH_REGPRE FLCTL_PRG_CTLSTAT_VER_PRE
107 #define FLASH_REGPOST FLCTL_PRG_CTLSTAT_VER_PST
108 #define FLASH_FULLVER (FLCTL_PRGBRST_CTLSTAT_AUTO_PST | \
109 FLCTL_PRGBRST_CTLSTAT_AUTO_PRE | FLCTL_PRG_CTLSTAT_VER_PRE \
110 | FLCTL_PRG_CTLSTAT_VER_PST)
112 #define FLASH_COLLATED_WRITE_MODE 0x01
113 #define FLASH_IMMEDIATE_WRITE_MODE 0x02
141 uint_fast8_t accessMethod);
163 uint_fast8_t accessMethod);
183 uint_fast8_t accessMethod);
203 uint_fast8_t accessMethod);
260 uint32_t sectorMask);
317 uint32_t sectorMask);
401 uint_fast8_t pattern);
835 #endif // __FLASH_H__
uint32_t FlashCtl_getInterruptStatus(void)
Definition: flash.c:1018
uint32_t FlashCtl_getReadMode(uint32_t flashBank)
Definition: flash.c:453
bool FlashCtl_setReadMode(uint32_t flashBank, uint32_t readMode)
Definition: flash.c:426
void FlashCtl_setProgramVerification(uint32_t verificationSetting)
Definition: flash.c:910
uint32_t FlashCtl_isWordProgrammingEnabled(void)
Definition: flash.c:964
void FlashCtl_enableReadParityCheck(uint_fast8_t memorySpace, uint_fast8_t accessMethod)
Definition: flash.c:148
void FlashCtl_enableWordProgramming(uint32_t mode)
Definition: flash.c:945
uint32_t FlashCtl_getWaitState(uint32_t bank)
Definition: flash.c:993
void FlashCtl_registerInterrupt(void(*intHandler)(void))
Definition: flash.c:1033
void FlashCtl_disableReadParityCheck(uint_fast8_t memorySpace, uint_fast8_t accessMethod)
Definition: flash.c:179
void FlashCtl_enableReadBuffering(uint_fast8_t memoryBank, uint_fast8_t accessMethod)
Definition: flash.c:210
bool FlashCtl_eraseSector(uint32_t addr, bool verify)
Definition: flash.c:581
uint32_t FlashCtl_getEnabledInterruptStatus(void)
Definition: flash.c:1023
void FlashCtl_enableInterrupt(uint32_t flags)
Definition: flash.c:1008
bool FlashCtl_verifyMemory(void *verifyAddr, uint32_t length, uint_fast8_t pattern)
Definition: flash.c:317
void FlashCtl_unregisterInterrupt(void)
Definition: flash.c:1046
void FlashCtl_clearProgramVerification(uint32_t verificationSetting)
Definition: flash.c:927
bool FlashCtl_unprotectSector(uint_fast8_t memorySpace, uint32_t sectorMask)
Definition: flash.c:244
bool FlashCtl_protectSector(uint_fast8_t memorySpace, uint32_t sectorMask)
Definition: flash.c:271
void FlashCtl_clearInterruptFlag(uint32_t flags)
Definition: flash.c:1028
bool FlashCtl_isSectorProtected(uint_fast8_t memorySpace, uint32_t sector)
Definition: flash.c:298
void FlashCtl_setWaitState(uint32_t bank, uint32_t waitState)
Definition: flash.c:975
bool FlashCtl_programMemory(void *src, void *dest, uint32_t length, uint32_t verify)
Definition: flash.c:668
bool FlashCtl_performMassErase(bool verify)
Definition: flash.c:468
void FlashCtl_disableInterrupt(uint32_t flags)
Definition: flash.c:1013
void FlashCtl_disableWordProgramming(void)
Definition: flash.c:959
void FlashCtl_disableReadBuffering(uint_fast8_t memoryBank, uint_fast8_t accessMethod)
Definition: flash.c:227