Data Structures | |
struct | XMC_FLASH_BMI_STRING_t |
Enumerations | |
enum | XMC_FLASH_BMI_t |
enum | XMC_FLASH_EVENT_t |
enum | XMC_FLASH_MARGIN_t |
enum | XMC_FLASH_PROTECTION_t |
enum | XMC_FLASH_STATUS_t |
Flash is a non volatile memory module used to store instruction code or constant data. The flash low level driver provides support to the following functionalities of flash memory.
#define XMC_FLASH_BMI_VALID (uint32_t)(0x1 << 31) |
This is always 0 in UCB. The copy of this BMI word in DSRAM1 has this ?BMI Valid? bit set to 1 after SSW has validated the XOR checksum
#define XMC_FLASH_BYTES_PER_PAGE (256UL) |
Number of bytes in a page
#define XMC_FLASH_BYTES_PER_UCB (1024UL) |
Number of bytes in a user configurable block Note : Total number of Sectors depends on the flash size of the controller. So while using these macros for flash operations ensure that sector is available, other may lead to flash error.
#define XMC_FLASH_PHY_SECTOR_0 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x00000UL) |
Starting address of non cached physical sector0
#define XMC_FLASH_PHY_SECTOR_10 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x80000UL) |
Starting address of non cached physical sector10
#define XMC_FLASH_PHY_SECTOR_11 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0xC0000UL) |
Starting address of non cached physical sector11
#define XMC_FLASH_PHY_SECTOR_12 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x100000UL) |
Starting address of non cached physical sector12
#define XMC_FLASH_PHY_SECTOR_13 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x140000UL) |
Starting address of non cached physical sector13
#define XMC_FLASH_PHY_SECTOR_14 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x180000UL) |
Starting address of non cached physical sector14
#define XMC_FLASH_PHY_SECTOR_15 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x1C0000UL) |
Starting address of non cached physical sector15
#define XMC_FLASH_PHY_SECTOR_4 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x10000UL) |
Starting address of non cached physical sector4
#define XMC_FLASH_PHY_SECTOR_8 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x20000UL) |
Starting address of non cached physical sector8
#define XMC_FLASH_PHY_SECTOR_9 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x40000UL) |
Starting address of non cached physical sector9
#define XMC_FLASH_SECTOR_0 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x00000UL) |
Starting address of sector0
#define XMC_FLASH_SECTOR_1 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x04000UL) |
Starting address of sector1
#define XMC_FLASH_SECTOR_10 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x80000UL) |
Starting address of sector10
#define XMC_FLASH_SECTOR_11 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0xC0000UL) |
Starting address of sector11
#define XMC_FLASH_SECTOR_12 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x100000UL) |
Starting address of sector12
#define XMC_FLASH_SECTOR_13 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x140000UL) |
Starting address of sector13
#define XMC_FLASH_SECTOR_14 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x180000UL) |
Starting address of sector14
#define XMC_FLASH_SECTOR_15 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x1C0000UL) |
Starting address of sector15
#define XMC_FLASH_SECTOR_2 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x08000UL) |
Starting address of sector2
#define XMC_FLASH_SECTOR_3 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x0C000UL) |
Starting address of sector3
#define XMC_FLASH_SECTOR_4 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x10000UL) |
Starting address of sector4
#define XMC_FLASH_SECTOR_5 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x14000UL) |
Starting address of sector5
#define XMC_FLASH_SECTOR_6 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x18000UL) |
Starting address of sector6
#define XMC_FLASH_SECTOR_7 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x1C000UL) |
Starting address of sector7
#define XMC_FLASH_SECTOR_8 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x20000UL) |
Starting address of sector8
#define XMC_FLASH_SECTOR_9 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x40000UL) |
Starting address of sector9
#define XMC_FLASH_UCB0 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x0000UL) |
Starting address of User Configurable Block 0
#define XMC_FLASH_UCB1 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x0400UL) |
Starting address of User Configurable Block 1
#define XMC_FLASH_UCB2 (uint32_t *)(XMC_FLASH_UNCACHED_BASE + 0x0800UL) |
Starting address of User Configurable Block 2
#define XMC_FLASH_UNCACHED_BASE (0x0C000000U) |
Non cached flash starting address of for XMC4 family of microcontrollers
#define XMC_FLASH_WORDS_PER_PAGE (64UL) |
Number of words in a page (256 bytes / 4 bytes = 64 words)
enum XMC_FLASH_BMI_t |
BMI Word configuration
enum XMC_FLASH_EVENT_t |
Provides the options to select flash operational events
enum XMC_FLASH_MARGIN_t |
Provides the options to select sectors for write protection and select global read protection. The members can be combined using 'OR' operator for multiple selection.
enum XMC_FLASH_STATUS_t |
Defines the return status of the API.
void XMC_FLASH_ClearStatus | ( | void | ) |
None |
void XMC_FLASH_ConfirmProtection | ( | uint8_t | user | ) |
user | ID number of the user configuration block (UCB). Range: [0 to 2] |
void XMC_FLASH_DisableDoubleBitErrorTrap | ( | void | ) |
None |
void XMC_FLASH_DisableDynamicIdle | ( | void | ) |
None |
void XMC_FLASH_DisableEvent | ( | const uint32_t | event_msk | ) |
event_msk | ORed values of XMC_FLASH_EVENT_t enumeration |
void XMC_FLASH_DisableSleepRequest | ( | void | ) |
None |
void XMC_FLASH_DisableWaitStateForECC | ( | void | ) |
None |
void XMC_FLASH_EnableDoubleBitErrorTrap | ( | void | ) |
None |
void XMC_FLASH_EnableDynamicIdle | ( | void | ) |
None |
void XMC_FLASH_EnableEvent | ( | const uint32_t | event_msk | ) |
event_msk | ORed values of XMC_FLASH_EVENT_t enumeration |
void XMC_FLASH_EnableSleepRequest | ( | void | ) |
None |
void XMC_FLASH_EnableWaitStateForECC | ( | void | ) |
None |
void XMC_FLASH_ErasePhysicalSector | ( | uint32_t * | sector_start_address | ) |
sector_start_address | Pointer to the starting address of physical sector. Use XMC_FLASH_SECTOR_x MACRO defined in xmc4_flash.h file. |
void XMC_FLASH_EraseSector | ( | uint32_t * | address | ) |
address | Pointer to the starting address of the page to be erased. |
void XMC_FLASH_EraseUCB | ( | uint32_t * | ucb_sector_start_address | ) |
ucb_sector_start_address | Pointer to the starting address of physical sector. Use XMC_FLASH_UCBx MACRO defined in xmc4_flash.h file. |
uint32_t XMC_FLASH_GetStatus | ( | void | ) |
None |
void XMC_FLASH_InstallBMI | ( | XMC_FLASH_BMI_STRING_t *const | bmi_string | ) |
bmi_string | BMI string configuration |
void XMC_FLASH_InstallProtection | ( | uint8_t | user, |
uint32_t | protection_mask, | ||
uint32_t | password_0, | ||
uint32_t | password_1 | ||
) |
user | ID number of the user configuration block (UCB). Range: [0 to 2] |
protection_mask | ORed values of XMC_FLASH_PROTECTION_t enum type, for which sectors the protection has to be enabled. |
password_0 | First password for protection. Range: [0 to 4294967295] |
password_1 | Second password for protection. Range: [0 to 4294967295] |
bool XMC_FLASH_IsBusy | ( | void | ) |
None |
void XMC_FLASH_ProgramPage | ( | uint32_t * | address, |
const uint32_t * | data | ||
) |
address | Pointer to the starting address of flash page from where the programming starts. |
data | Pointer to the source address where targeted data is located. |
void XMC_FLASH_RepairPhysicalSector | ( | void | ) |
None |
void XMC_FLASH_Reset | ( | void | ) |
None |
void XMC_FLASH_ResumeProtection | ( | void | ) |
None |
void XMC_FLASH_SetMargin | ( | const XMC_FLASH_MARGIN_t | margin | ) |
margin | PFLASH margin selection. Use type XMC_FLASH_MARGIN_t. |
void XMC_FLASH_SetWaitStates | ( | uint32_t | num_wait_states | ) |
num_wait_states | number of wait states for initial read access Range: [0 to 15] |
bool XMC_FLASH_VerifyReadProtection | ( | uint32_t | password_0, |
uint32_t | password_1 | ||
) |
password_0 | First password used for protection. Range: [0 to 4294967295] |
password_1 | Second password used for protection. Range: [0 to 4294967295] |
bool XMC_FLASH_VerifyWriteProtection | ( | uint32_t | user, |
uint32_t | protection_mask, | ||
uint32_t | password_0, | ||
uint32_t | password_1 | ||
) |
user | ID number of the user configuration block (UCB). Range: [0 to 2] |
protection_mask | ORed values of XMC_FLASH_PROTECTION_t enum type, for which sectors the protection has to be verified. |
password_0 | First password used for protection. Range: [0 to 4294967295] |
password_1 | Second password used for protection. Range: [0 to 4294967295] |
void XMC_PREFETCH_DisableInstructionBuffer | ( | void | ) |
None |
void XMC_PREFETCH_EnableInstructionBuffer | ( | void | ) |
None |
void XMC_PREFETCH_InvalidateInstructionBuffer | ( | void | ) |
None |