51 #ifndef ti_dl_dl_flashctl__include 52 #define ti_dl_dl_flashctl__include 57 #include <ti/devices/msp/msp.h> 60 #include <ti/driverlib/m0p/dl_sysctl.h> 66 #if (FLASHCTL_SYS_DATAWIDTH == 128) 70 #define DEVICE_HAS_FLASH_128_BIT_WORD 73 #if (FLASHCTL_SYS_WEPROTAWIDTH == 0) 77 #define DEVICE_HAS_NO_CMDWEPROTA 85 #define FLASHCTL_BANK0_ADDRESS (0x00000000) 90 #define FLASHCTL_MAIN_ADDRESS (0x00000000) 95 #define FLASHCTL_NONMAIN_ADDRESS (0x41c00000) 100 #define NUMBER_OF_NONMAIN_SECTORS (1) 105 #define FLASHCTL_DATA_ADDRESS (0x41d00000) 110 #define DL_FLASHCTL_PROGRAM_8_WITHOUT_ECC (0x00000001) 115 #define DL_FLASHCTL_PROGRAM_16_WITHOUT_ECC (0x00000003) 120 #define DL_FLASHCTL_PROGRAM_32_WITHOUT_ECC (0x0000000F) 125 #define DL_FLASHCTL_PROGRAM_64_WITHOUT_ECC (0x000000FF) 130 #define DL_FLASHCTL_PROGRAM_8_WITH_ECC (0x00000101) 135 #define DL_FLASHCTL_PROGRAM_16_WITH_ECC (0x00000103) 140 #define DL_FLASHCTL_PROGRAM_32_WITH_ECC (0x0000010F) 145 #define DL_FLASHCTL_PROGRAM_64_WITH_ECC (0x000001FF) 150 #define DL_FLASHCTL_READ_VERIFY_8_WITHOUT_ECC (0x00000001) 155 #define DL_FLASHCTL_READ_VERIFY_16_WITHOUT_ECC (0x00000003) 160 #define DL_FLASHCTL_READ_VERIFY_32_WITHOUT_ECC (0x0000000F) 165 #define DL_FLASHCTL_READ_VERIFY_64_WITHOUT_ECC (0x000000FF) 170 #define DL_FLASHCTL_READ_VERIFY_8_WITH_ECC (0x00000101) 175 #define DL_FLASHCTL_READ_VERIFY_16_WITH_ECC (0x00000103) 180 #define DL_FLASHCTL_READ_VERIFY_32_WITH_ECC (0x0000010F) 185 #define DL_FLASHCTL_READ_VERIFY_64_WITH_ECC (0x000001FF) 193 #define DL_FLASHCTL_INTERRUPT_DONE (FLASHCTL_MIS_DONE_SET) 202 #define DL_FLASHCTL_COMMAND_TYPE_NO_OPERATION (FLASHCTL_CMDTYPE_COMMAND_NOOP) 207 #define DL_FLASHCTL_COMMAND_TYPE_PROGRAM (FLASHCTL_CMDTYPE_COMMAND_PROGRAM) 212 #define DL_FLASHCTL_COMMAND_TYPE_ERASE (FLASHCTL_CMDTYPE_COMMAND_ERASE) 217 #define DL_FLASHCTL_COMMAND_TYPE_READ_VERIFY \ 218 (FLASHCTL_CMDTYPE_COMMAND_READVERIFY) 223 #define DL_FLASHCTL_COMMAND_TYPE_BLANK_VERIFY \ 224 (FLASHCTL_CMDTYPE_COMMAND_BLANKVERIFY) 229 #define DL_FLASHCTL_COMMAND_TYPE_MODE_CHANGE \ 230 (FLASHCTL_CMDTYPE_COMMAND_MODECHANGE) 235 #define DL_FLASHCTL_COMMAND_TYPE_CLEAR_STATUS \ 236 (FLASHCTL_CMDTYPE_COMMAND_CLEARSTATUS) 242 #define DL_FLASHCTL_SECTOR_SIZE (1024) 292 (FLASHCTL_STATCMD_FAILWEPROT_STATFAIL),
297 FLASHCTL_STATCMD_FAILILLADDR_STATFAIL,
308 FLASHCTL_STATCMD_CMDPASS_STATPASS),
311 FLASHCTL_STATCMD_CMDPASS_STATFAIL),
314 (FLASHCTL_STATCMD_CMDINPROGRESS_STATINPROGRESS)
332 flashctl->GEN.IMASK = FLASHCTL_IMASK_DONE_ENABLED;
343 flashctl->GEN.IMASK = FLASHCTL_IMASK_DONE_DISABLED;
357 const FLASHCTL_Regs *flashctl)
359 return (flashctl->GEN.IMASK == FLASHCTL_IMASK_DONE_ENABLED);
375 const FLASHCTL_Regs *flashctl)
377 return (flashctl->GEN.MIS);
394 const FLASHCTL_Regs *flashctl)
396 return (flashctl->GEN.RIS);
411 const FLASHCTL_Regs *flashctl)
413 return (flashctl->GEN.IIDX);
423 flashctl->GEN.ICLR = FLASHCTL_ICLR_DONE_CLR;
435 const FLASHCTL_Regs *flashctl)
437 return (flashctl->GEN.CMDEXEC == FLASHCTL_CMDEXEC_VAL_EXECUTE);
448 flashctl->GEN.CMDEXEC = FLASHCTL_CMDEXEC_VAL_EXECUTE;
460 flashctl->GEN.CMDCTL |= FLASHCTL_CMDCTL_SSERASEDIS_DISABLE;
472 const FLASHCTL_Regs *flashctl)
474 return ((flashctl->GEN.CMDCTL & FLASHCTL_CMDCTL_SSERASEDIS_MASK) ==
475 FLASHCTL_CMDCTL_SSERASEDIS_DISABLE);
489 flashctl->GEN.CMDCTL &= ~(FLASHCTL_CMDCTL_SSERASEDIS_MASK);
507 FLASHCTL_Regs *flashctl)
509 flashctl->GEN.CMDCTL |= FLASHCTL_CMDCTL_ADDRXLATEOVR_OVERRIDE;
520 const FLASHCTL_Regs *flashctl)
522 return ((flashctl->GEN.CMDCTL & FLASHCTL_CMDCTL_ADDRXLATEOVR_MASK) ==
523 FLASHCTL_CMDCTL_ADDRXLATEOVR_OVERRIDE);
534 FLASHCTL_Regs *flashctl)
536 flashctl->GEN.CMDCTL &= ~(FLASHCTL_CMDCTL_ADDRXLATEOVR_MASK);
551 FLASHCTL_Regs *flashctl)
553 flashctl->GEN.CMDCTL |= FLASHCTL_CMDCTL_ECCGENOVR_OVERRIDE;
564 const FLASHCTL_Regs *flashctl)
566 return ((flashctl->GEN.CMDCTL & FLASHCTL_CMDCTL_ECCGENOVR_MASK) ==
567 FLASHCTL_CMDCTL_ECCGENOVR_OVERRIDE);
579 FLASHCTL_Regs *flashctl)
581 flashctl->GEN.CMDCTL &= ~(FLASHCTL_CMDCTL_ECCGENOVR_MASK);
596 FLASHCTL_Regs *flashctl, DL_FLASHCTL_REGION_SELECT region)
599 (uint32_t) FLASHCTL_CMDCTL_REGIONSEL_MASK);
612 const FLASHCTL_Regs *flashctl)
614 uint32_t region = flashctl->GEN.CMDCTL & FLASHCTL_CMDCTL_REGIONSEL_MASK;
616 return (DL_FLASHCTL_REGION_SELECT)(region);
634 FLASHCTL_Regs *flashctl, DL_FLASHCTL_BANK_SELECT bank)
637 (uint32_t) FLASHCTL_CMDCTL_BANKSEL_MASK);
653 const FLASHCTL_Regs *flashctl)
655 uint32_t bank = flashctl->GEN.CMDCTL & FLASHCTL_CMDCTL_BANKSEL_MASK;
657 return (DL_FLASHCTL_BANK_SELECT)(bank);
690 FLASHCTL_Regs *flashctl, uint32_t byteMask)
692 flashctl->GEN.CMDBYTEN = byteMask;
710 const FLASHCTL_Regs *flashctl)
712 return ((uint32_t) flashctl->GEN.CMDCTL &
713 (uint32_t)(FLASHCTL_CMDBYTEN_VAL_MASK));
741 FLASHCTL_Regs *flashctl, uint8_t index,
const uint32_t *data)
743 volatile uint32_t *pReg = &(flashctl->GEN.CMDDATA0) + index;
768 FLASHCTL_Regs *flashctl, uint8_t index)
770 volatile uint32_t *pReg = &(flashctl->GEN.CMDDATA0);
773 (uint32_t)(*(pReg + index) & (uint32_t) FLASHCTL_CMDDATA0_VAL_MASK));
798 FLASHCTL_Regs *flashctl, uint8_t index,
const uint8_t *data)
800 volatile uint32_t *pReg = &(flashctl->GEN.CMDDATAECC0) + index;
822 FLASHCTL_Regs *flashctl, uint8_t index)
824 volatile uint32_t *pReg = &(flashctl->GEN.CMDDATAECC0);
827 *(pReg + index) & (uint32_t) FLASHCTL_CMDDATAECC0_VAL0_MASK));
851 FLASHCTL_Regs *flashctl, uint32_t address)
853 flashctl->GEN.CMDADDR = address;
869 const FLASHCTL_Regs *flashctl)
871 uint32_t commandStatus =
872 flashctl->GEN.STATCMD &
873 (FLASHCTL_STATCMD_CMDDONE_MASK | FLASHCTL_STATCMD_CMDPASS_MASK |
874 FLASHCTL_STATCMD_CMDINPROGRESS_MASK |
875 FLASHCTL_STATCMD_CMDPASS_STATFAIL);
890 const FLASHCTL_Regs *flashctl)
892 uint32_t commandFailureType =
893 flashctl->GEN.STATCMD &
894 (FLASHCTL_STATCMD_FAILWEPROT_MASK | FLASHCTL_STATCMD_FAILVERIFY_MASK |
895 FLASHCTL_STATCMD_FAILILLADDR_MASK |
896 FLASHCTL_STATCMD_FAILMODE_MASK | FLASHCTL_STATCMD_FAILMISC_MASK);
914 while ((flashctl->GEN.STATCMD & FLASHCTL_STATCMD_CMDDONE_MASK) !=
915 FLASHCTL_STATCMD_CMDDONE_STATDONE) {
919 return ((flashctl->GEN.STATCMD & FLASHCTL_STATCMD_CMDPASS_MASK) ==
920 FLASHCTL_STATCMD_CMDPASS_STATPASS);
939 flashctl->GEN.CMDEXEC = FLASHCTL_CMDEXEC_VAL_EXECUTE;
942 while ((FLASHCTL->GEN.STATCMD & FLASHCTL_STATCMD_CMDINPROGRESS_MASK) ==
943 FLASHCTL_STATCMD_CMDINPROGRESS_STATINPROGRESS) {
963 FLASHCTL_Regs *flashctl, uint32_t addr)
965 return (addr >> (uint32_t) 10);
984 FLASHCTL_Regs *flashctl, uint32_t addr)
988 uint32_t sector, bankSectors, sectorInBank;
996 bankSectors = (mainFlashSize / numBanks);
999 sectorInBank = sector % bankSectors;
1001 sectorInBank = sector;
1004 return sectorInBank;
1023 FLASHCTL_Regs *flashctl, uint32_t waitState)
1025 flashctl->GEN.CFGCMD = waitState;
1036 const FLASHCTL_Regs *flashctl)
1038 return (flashctl->GEN.CFGCMD & FLASHCTL_CFGCMD_WAITSTATE_MASK);
1065 DL_FLASHCTL_COMMAND_SIZE memorySize);
1100 FLASHCTL_Regs *flashctl, uint32_t address,
1101 DL_FLASHCTL_COMMAND_SIZE memorySize);
1146 FLASHCTL_Regs *flashctl);
1212 FLASHCTL_Regs *flashctl);
1264 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
1304 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
1325 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
1355 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
1376 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1406 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1427 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1457 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1485 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
1522 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
1550 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
1587 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
1615 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1652 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1680 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1717 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
1751 uint32_t address,
const uint8_t *data,
const uint8_t *eccCode);
1794 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data,
1795 const uint8_t *eccCode);
1829 uint32_t address,
const uint16_t *data,
const uint8_t *eccCode);
1872 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data,
1873 const uint8_t *eccCode);
1907 uint32_t address,
const uint32_t *data,
const uint8_t *eccCode);
1950 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data,
1951 const uint8_t *eccCode);
1985 uint32_t address,
const uint32_t *data,
const uint8_t *eccCode);
2028 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data,
2029 const uint8_t *eccCode);
2065 FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data,
2066 uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect);
2107 FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data,
2108 uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect);
2150 uint32_t address, uint32_t *data, uint8_t *eccCode, uint32_t dataSize,
2151 DL_FLASHCTL_REGION_SELECT regionSelect);
2198 FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data,
2199 uint8_t *eccCode, uint32_t dataSize,
2200 DL_FLASHCTL_REGION_SELECT regionSelect);
2233 uint32_t address, uint32_t *data, uint32_t dataSize,
2234 DL_FLASHCTL_REGION_SELECT regionSelect);
2271 FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data,
2272 uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect);
2332 DL_FLASHCTL_REGION_SELECT regionSelect);
2343 DL_FLASHCTL_REGION_SELECT regionSelect);
2356 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
2379 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
2392 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
2415 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
2428 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2451 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2464 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2487 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2507 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
2535 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data);
2555 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
2583 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data);
2603 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2631 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2651 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2679 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
2706 uint32_t address,
const uint8_t *data,
const uint8_t *eccCode);
2741 FLASHCTL_Regs *flashctl, uint32_t address,
const uint8_t *data,
2742 const uint8_t *eccCode);
2769 uint32_t address,
const uint16_t *data,
const uint8_t *eccCode);
2804 FLASHCTL_Regs *flashctl, uint32_t address,
const uint16_t *data,
2805 const uint8_t *eccCode);
2832 uint32_t address,
const uint32_t *data,
const uint8_t *eccCode);
2867 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data,
2868 const uint8_t *eccCode);
2895 uint32_t address,
const uint32_t *data,
const uint8_t *eccCode);
2930 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data,
2931 const uint8_t *eccCode);
2999 FLASHCTL_Regs *flashctl, uint32_t address);
3020 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
3048 FLASHCTL_Regs *flashctl, uint32_t address,
const uint32_t *data);
3110 uint32_t address,
const uint32_t *data,
const uint8_t *eccCode);
3141 FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data,
3142 uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect);
3185 FLASHCTL_Regs *flashctl);
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_eraseMemoryFromRAM(FLASHCTL_Regs *flashctl, uint32_t address, DL_FLASHCTL_COMMAND_SIZE memorySize)
Performs an erase on unprotected memory, and executes command from RAM.
__STATIC_INLINE DL_FLASHCTL_BANK_SELECT DL_FlashCTL_getBankSelect(const FLASHCTL_Regs *flashctl)
Get the bank select.
Definition: dl_flashctl.h:652
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryBlockingFromRAM64WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data, uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect)
Programs provided data with hardware generated ECC code, and executes command from RAM...
__STATIC_INLINE uint32_t DL_FlashCTL_getFlashSectorNumber(FLASHCTL_Regs *flashctl, uint32_t addr)
Gets the sector number of the input address over the whole memory map.
Definition: dl_flashctl.h:962
__STATIC_INLINE void DL_FlashCTL_setCommandAddress(FLASHCTL_Regs *flashctl, uint32_t address)
Sets the target address for a command.
Definition: dl_flashctl.h:850
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM64WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Programs 64 bit data with user provided ECC code, and executes command from RAM.
__STATIC_INLINE void DL_Common_updateReg(volatile uint32_t *reg, uint32_t val, uint32_t mask)
Writes value to specified register - retaining bits unaffected by mask.
Definition: dl_common.h:63
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM8WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data, const uint8_t *eccCode)
Programs 8 bit data with user provided ECC code, and executes command from RAM.
void DL_FlashCTL_readVerify32WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 32-bit data in specified address with hardware generated ECC code.
__STATIC_INLINE bool DL_FlashCTL_isStairStepEraseDisabled(const FLASHCTL_Regs *flashctl)
Checks if stair-step erase is disabled.
Definition: dl_flashctl.h:471
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM8(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Programs 8 bit data to unprotected memory at the given address, and executes command from RAM...
void DL_FlashCTL_eraseMemory(FLASHCTL_Regs *flashctl, uint32_t address, DL_FLASHCTL_COMMAND_SIZE memorySize)
Performs an erase on unprotected memory.
void DL_FlashCTL_protectNonMainMemory(FLASHCTL_Regs *flashctl)
Protects all non-main memory from erase/program.
void DL_FlashCTL_programMemory128WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 128 bit data with hardware generated ECC code.
__STATIC_INLINE bool DL_FlashCTL_isOverrideHardwareGeneratedECCEnabled(const FLASHCTL_Regs *flashctl)
Checks if overriding hardware generation of ECC code is enabled.
Definition: dl_flashctl.h:563
void DL_FlashCTL_programMemory32WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 32 bit data with hardware generated ECC code.
__STATIC_INLINE void DL_FlashCTL_clearInterruptStatus(FLASHCTL_Regs *flashctl)
Clear pending flash interrupt.
Definition: dl_flashctl.h:421
void DL_FlashCTL_readVerify64(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 64-bit data in specified address.
Definition: dl_flashctl.h:249
Definition: dl_flashctl.h:281
void DL_FlashCTL_readVerify16(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Verifies 16-bit data in specified address.
void DL_FlashCTL_protectAllMemory(FLASHCTL_Regs *flashctl)
Protects all user memory from erase/program.
void DL_FlashCTL_programMemory128(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 128 bit data to unprotected memory at the given address.
__STATIC_INLINE uint32_t DL_FlashCTL_getEnabledInterruptStatus(const FLASHCTL_Regs *flashctl)
Check interrupt flag of enabled flash interrupt.
Definition: dl_flashctl.h:374
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_factoryResetFromRAM(FLASHCTL_Regs *flashctl)
Performs a factory reset erase on main and non-main memory, and executes command from RAM...
bool DL_FlashCTL_factoryResetMultiBank(FLASHCTL_Regs *flashctl)
Performs a factory reset erase on main and non-main memory.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM16WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data, const uint8_t *eccCode)
Verifies 16-bit data in specified address with user provided ECC code, and executes command from RAM...
bool DL_FlashCTL_massErase(FLASHCTL_Regs *flashctl)
Performs a mass erase on main memory on one bank.
__STATIC_INLINE uint32_t DL_FlashCTL_getWaitState(const FLASHCTL_Regs *flashctl)
Get the number of wait states used by the Flash.
Definition: dl_flashctl.h:1035
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM8WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Verifies 8-bit data in specified address with hardware generated ECC code, and executes command from ...
void DL_FlashCTL_unprotectAllMemory(FLASHCTL_Regs *flashctl)
Unprotects all user memory from erase/program.
void DL_FlashCTL_programMemory8WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data, const uint8_t *eccCode)
Programs 8 bit data with user provided ECC code.
__STATIC_INLINE void DL_FlashCTL_enableStairStepErase(FLASHCTL_Regs *flashctl)
Enable Stair-Step Erase.
Definition: dl_flashctl.h:487
Definition: dl_flashctl.h:279
DL_FLASHCTL_FAIL_TYPE
Definition: dl_flashctl.h:287
__STATIC_INLINE void DL_FlashCTL_setBankSelect(FLASHCTL_Regs *flashctl, DL_FLASHCTL_BANK_SELECT bank)
Set the bank select.
Definition: dl_flashctl.h:633
Definition: dl_flashctl.h:294
DL_FLASHCTL_BANK_SELECT
Definition: dl_flashctl.h:273
DL_FLASHCTL_COMMAND_SIZE
Definition: dl_flashctl.h:247
__STATIC_INLINE bool DL_FlashCTL_isInterruptEnabled(const FLASHCTL_Regs *flashctl)
Check if the flash interrupt is enabled.
Definition: dl_flashctl.h:356
__STATIC_INLINE uint32_t DL_FlashCTL_getCommandByteEnable(const FLASHCTL_Regs *flashctl)
Get the bytes that are enabled for programming data.
Definition: dl_flashctl.h:709
void DL_FlashCTL_readVerify64WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Verifies 64-bit data in specified address with user provided ECC code.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_massEraseFromRAM(FLASHCTL_Regs *flashctl)
Performs a mass erase on main memory, and executes command from RAM.
Definition: dl_flashctl.h:321
void DL_FlashCTL_programMemory32WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Programs 32 bit data with user provided ECC code.
bool DL_FlashCTL_programMemoryBlocking(FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data, uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect)
Programs provided data to unprotected memory at a given address.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM8(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Verifies 8-bit data in specified address, and executes command from RAM.
Definition: dl_flashctl.h:289
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM8WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Programs 8 bit data with hardware generated ECC code, and executes command from RAM.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM64(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 64-bit data in specified address, and executes command from RAM.
DL_FLASHCTL_IIDX
Definition: dl_flashctl.h:319
bool DL_FlashCTL_factoryReset(FLASHCTL_Regs *flashctl)
Performs a factory reset erase on main and non-main memory.
Definition: dl_flashctl.h:268
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM64WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 32-bit data in specified address with hardware generated ECC code, and executes command from...
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM64WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Verifies 64-bit data in specified address with user provided ECC code, and executes command from RAM...
void DL_FlashCTL_protectSector(FLASHCTL_Regs *flashctl, uint32_t addr, DL_FLASHCTL_REGION_SELECT regionSelect)
Sets a given sector to protected from erase/program.
__STATIC_INLINE bool DL_FlashCTL_isCommandExecuted(const FLASHCTL_Regs *flashctl)
Checks if a command execution has been initiated.
Definition: dl_flashctl.h:434
bool DL_FlashCTL_programMemoryBlocking64WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data, uint8_t *eccCode, uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect)
Programs provided data with user provided ECC code.
Definition: dl_flashctl.h:299
Definition: dl_flashctl.h:255
__STATIC_INLINE void DL_FlashCTL_enableOverrideHardwareGeneratedECC(FLASHCTL_Regs *flashctl)
Enable overriding hardware generation of ECC code.
Definition: dl_flashctl.h:550
Definition: dl_flashctl.h:307
void DL_FlashCTL_unprotectMainMemory(FLASHCTL_Regs *flashctl)
Unprotects all main memory from erase/program.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM16(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Programs 16 bit data to unprotected memory at the given address, and executes command from RAM...
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM16WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data, const uint8_t *eccCode)
Programs 16 bit data with user provided ECC code, and executes command from RAM.
void DL_FlashCTL_programMemory8(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Programs 8 bit data to unprotected memory at the given address.
__STATIC_INLINE DL_FLASHCTL_REGION_SELECT DL_FlashCTL_getRegionSelect(const FLASHCTL_Regs *flashctl)
Get the region select.
Definition: dl_flashctl.h:611
__STATIC_INLINE uint8_t DL_FactoryRegion_getNumBanks(void)
Get the number of Flash banks on the device.
Definition: dl_factoryregion.h:235
void DL_FlashCTL_readVerify16WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Verifies 16-bit data in specified address with hardware generated ECC code.
Definition: dl_flashctl.h:313
void DL_FlashCTL_programMemory16(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Programs 16 bit data to unprotected memory at the given address.
void DL_FlashCTL_programMemory16WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Programs 16 bit data with hardware generated ECC code.
__STATIC_INLINE uint32_t DL_FlashCTL_getPendingInterrupt(const FLASHCTL_Regs *flashctl)
Get highest priority pending flash interrupt.
Definition: dl_flashctl.h:410
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM16(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Verifies 16-bit data in specified address, and executes command from RAM.
DL_FLASHCTL_COMMAND_STATUS
Definition: dl_flashctl.h:305
__STATIC_INLINE void DL_FlashCTL_setRegionSelect(FLASHCTL_Regs *flashctl, DL_FLASHCTL_REGION_SELECT region)
Set the region select.
Definition: dl_flashctl.h:595
void DL_FlashCTL_unprotectNonMainMemory(FLASHCTL_Regs *flashctl)
Unprotects all non-main memory from erase/program.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM32WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Programs 32 bit data with user provided ECC code, and executes command from RAM.
__STATIC_INLINE uint16_t DL_FactoryRegion_getMAINFlashSize(void)
Get the size of the MAIN Flash region.
Definition: dl_factoryregion.h:135
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM8WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data, const uint8_t *eccCode)
Verifies 8-bit data in specified address with user provided ECC code, and executes command from RAM...
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM16WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Verifies 16-bit data in specified address with hardware generated ECC code, and executes command from...
Definition: dl_flashctl.h:283
void DL_FlashCTL_protectMainMemory(FLASHCTL_Regs *flashctl)
Protects all main memory from erase/program.
void DL_FlashCTL_readVerify32(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 32-bit data in specified address.
Definition: dl_flashctl.h:275
__STATIC_INLINE uint32_t DL_FlashCTL_getCommandData(FLASHCTL_Regs *flashctl, uint8_t index)
Get the data from a command data register.
Definition: dl_flashctl.h:767
bool DL_FlashCTL_programMemoryBlocking64WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data, uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect)
Programs provided data with hardware generated ECC code.
Definition: dl_flashctl.h:266
void DL_FlashCTL_programMemory8WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Programs 8 bit data with hardware generated ECC code.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM16WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data)
Programs 16 bit data with hardware generated ECC code, and executes command from RAM.
bool DL_FlashCTL_programMemoryBlocking128WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data, uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect)
Programs provided data up to 128-bits with ECC generated while blocking between writes.
__STATIC_INLINE void DL_FlashCTL_executeClearStatus(FLASHCTL_Regs *flashctl)
Sets clear status bit and executes command.
Definition: dl_flashctl.h:934
__STATIC_INLINE void DL_FlashCTL_enableAddressOverrideMode(FLASHCTL_Regs *flashctl)
Enable address override mode.
Definition: dl_flashctl.h:506
void DL_FlashCTL_blankVerify(FLASHCTL_Regs *flashctl, uint32_t address)
Verifies that a flash word is blank.
__STATIC_INLINE void DL_FlashCTL_setWaitState(FLASHCTL_Regs *flashctl, uint32_t waitState)
Set the number of wait states used by the Flash.
Definition: dl_flashctl.h:1022
void DL_FlashCTL_readVerify64WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 64-bit data in specified address with hardware generated ECC code.
#define DL_FLASHCTL_COMMAND_TYPE_CLEAR_STATUS
Clear Status Command Type.
Definition: dl_flashctl.h:235
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM32WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Verifies 32-bit data in specified address with user provided ECC code, and executes command from RAM...
void DL_FlashCTL_programMemory16WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data, const uint8_t *eccCode)
Programs 16 bit data with user provided ECC code.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM32(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 32 bit data to unprotected memory at the given address, and executes command from RAM...
void DL_FlashCTL_readVerify8WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Verifies 8-bit data in specified address with hardware generated ECC code.
void DL_FlashCTL_unprotectSector(FLASHCTL_Regs *flashctl, uint32_t addr, DL_FLASHCTL_REGION_SELECT regionSelect)
Sets a given sector to unprotected from erase/program.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM32WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 32-bit data in specified address with hardware generated ECC code, and executes command from...
__STATIC_INLINE void DL_FlashCTL_setCommandExecute(FLASHCTL_Regs *flashctl)
Initiates a command execution.
Definition: dl_flashctl.h:446
__STATIC_INLINE void DL_FlashCTL_setCommandData(FLASHCTL_Regs *flashctl, uint8_t index, const uint32_t *data)
Set the data for a command data register.
Definition: dl_flashctl.h:740
Definition: dl_flashctl.h:277
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM32WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 32 bit data with hardware generated ECC code, and executes command from RAM.
__STATIC_INLINE uint8_t DL_FlashCTL_getCommandDataECC(FLASHCTL_Regs *flashctl, uint8_t index)
Get the ECC code in the command data ECC register.
Definition: dl_flashctl.h:821
void DL_FlashCTL_readVerify32WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Verifies 32-bit data in specified address with user provided ECC code.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM(FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data, uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect)
Programs provided data to unprotected memory at a given address, and executes command from RAM...
Definition: dl_flashctl.h:301
Factory Region Driver Library.
bool DL_FlashCTL_massEraseMultiBank(FLASHCTL_Regs *flashctl)
Performs a mass erase on main memory, and erases all flash banks.
bool DL_FlashCTL_eraseDataBank(FLASHCTL_Regs *flashctl)
Performs an erase on DATA bank.
Definition: dl_flashctl.h:251
Definition: dl_flashctl.h:259
__STATIC_INLINE DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_getCommandStatus(const FLASHCTL_Regs *flashctl)
Returns the status of the current command.
Definition: dl_flashctl.h:868
__STATIC_INLINE void DL_FlashCTL_disableInterrupt(FLASHCTL_Regs *flashctl)
Disable flash interrupt.
Definition: dl_flashctl.h:341
__STATIC_INLINE bool DL_FlashCTL_waitForCmdDone(const FLASHCTL_Regs *flashctl)
Blocking function that waits for a command execution to finish.
Definition: dl_flashctl.h:911
Definition: dl_flashctl.h:253
__STATIC_INLINE bool DL_FlashCTL_isAddressOverrideModeEnabled(const FLASHCTL_Regs *flashctl)
Checks if address override mode is enabled.
Definition: dl_flashctl.h:519
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_blankVerifyFromRAM(FLASHCTL_Regs *flashctl, uint32_t address)
Verifies that a flash word is blank, and executes command from RAM.
void DL_FlashCTL_programMemory128WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Programs 128 bit data with hardware generated ECC code.
void DL_FlashCTL_readVerify8WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data, const uint8_t *eccCode)
Verifies 8-bit data in specified address with user provided ECC code.
void DL_FlashCTL_unprotectDataMemory(FLASHCTL_Regs *flashctl)
Unprotects all data memory from erase/program.
void DL_FlashCTL_readVerify8(FLASHCTL_Regs *flashctl, uint32_t address, const uint8_t *data)
Verifies 8-bit data in specified address.
void DL_FlashCTL_programMemory64WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 64 bit data with hardware generated ECC code.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM64WithECCGenerated(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 64 bit data with hardware generated ECC code, and executes command from RAM.
Definition: dl_flashctl.h:296
__STATIC_INLINE void DL_FlashCTL_disableOverrideHardwareGeneratedECC(FLASHCTL_Regs *flashctl)
Disable overriding hardware generation of ECC code.
Definition: dl_flashctl.h:578
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryFromRAM64(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 64 bit data to unprotected memory at the given address, and executes command from RAM...
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_programMemoryBlockingFromRAM64WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, uint32_t *data, uint8_t *eccCode, uint32_t dataSize, DL_FLASHCTL_REGION_SELECT regionSelect)
Programs provided data with user provided ECC code, and executes command from RAM.
Definition: dl_flashctl.h:291
void DL_FlashCTL_programMemory32(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 32 bit data to unprotected memory at the given address.
__STATIC_INLINE void DL_FlashCTL_enableInterrupt(FLASHCTL_Regs *flashctl)
Enable flash interrupt.
Definition: dl_flashctl.h:330
DL_FLASHCTL_REGION_SELECT
Definition: dl_flashctl.h:264
void DL_FlashCTL_programMemory64(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Programs 64 bit data to unprotected memory at the given address.
void DL_FlashCTL_programMemory64WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data, const uint8_t *eccCode)
Programs 64 bit data with user provided ECC code.
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_readVerifyFromRAM32(FLASHCTL_Regs *flashctl, uint32_t address, const uint32_t *data)
Verifies 32-bit data in specified address, and executes command from RAM.
Definition: dl_flashctl.h:257
__STATIC_INLINE void DL_FlashCTL_disbleStairStepErase(FLASHCTL_Regs *flashctl)
Disable Stair-Step Erase.
Definition: dl_flashctl.h:458
__STATIC_INLINE void DL_FlashCTL_disableAddressOverrideMode(FLASHCTL_Regs *flashctl)
Disable address override mode.
Definition: dl_flashctl.h:533
DL_FLASHCTL_COMMAND_STATUS DL_FlashCTL_eraseDataBankFromRAM(FLASHCTL_Regs *flashctl)
Performs an erase on DATA bank, and executes command from RAM.
__STATIC_INLINE uint32_t DL_FlashCTL_getFlashSectorNumberInBank(FLASHCTL_Regs *flashctl, uint32_t addr)
Gets the sector number of the input address relative to the bank of the address.
Definition: dl_flashctl.h:983
void DL_FlashCTL_readVerify16WithECCManual(FLASHCTL_Regs *flashctl, uint32_t address, const uint16_t *data, const uint8_t *eccCode)
Verifies 16-bit data in specified address with user provided ECC code.
__STATIC_INLINE DL_FLASHCTL_FAIL_TYPE DL_FlashCTL_getFailureStatus(const FLASHCTL_Regs *flashctl)
Returns the reason a command failed.
Definition: dl_flashctl.h:889
__STATIC_INLINE uint32_t DL_FlashCTL_getRawInterruptStatus(const FLASHCTL_Regs *flashctl)
Check interrupt flag of the flash interrupt.
Definition: dl_flashctl.h:393
Definition: dl_flashctl.h:310
__STATIC_INLINE void DL_FlashCTL_setCommandByteEnable(FLASHCTL_Regs *flashctl, uint32_t byteMask)
Set the bytes to enable for programming data.
Definition: dl_flashctl.h:689
__STATIC_INLINE void DL_FlashCTL_setCommandDataECC(FLASHCTL_Regs *flashctl, uint8_t index, const uint8_t *data)
Set the ECC code in the command data ECC register.
Definition: dl_flashctl.h:797