![]() |
M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
|
Macros | |
#define | FMC_ENABLE_ISP() (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) |
Enable ISP Function. More... | |
#define | FMC_DISABLE_ISP() (FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk) |
Disable ISP Function. More... | |
#define | FMC_ENABLE_LD_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) |
Enable LDROM Update Function. More... | |
#define | FMC_DISABLE_LD_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk) |
Disable LDROM Update Function. More... | |
#define | FMC_ENABLE_CFG_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) |
Enable User Configuration Update Function. More... | |
#define | FMC_DISABLE_CFG_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk) |
Disable User Configuration Update Function. More... | |
#define | FMC_ENABLE_AP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk) |
Enable APROM Update Function. More... | |
#define | FMC_DISABLE_AP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk) |
Disable APROM Update Function. More... | |
#define | FMC_SELECT_NEXT_BOOT(x) (FMC->ISPCTL = (FMC->ISPCTL & ~FMC_ISPCTL_BS_Msk) | ((x) << FMC_ISPCTL_BS_Pos)) |
Next Booting Selection function. More... | |
#define | FMC_GET_BOOT_STATUS() ((FMC->ISPCTL & FMC_ISPCTL_BS_Msk)?1:0) |
Get MCU Booting Status. More... | |
Functions | |
static __INLINE void | FMC_Write (uint32_t u32Addr, uint32_t u32Data) |
Program 32-bit data into specified address of flash. More... | |
static __INLINE void | FMC_Write8 (uint32_t u32Addr, uint32_t u32Data0, uint32_t u32Data1) |
Program 64-bit data into specified address of flash. More... | |
static __INLINE uint32_t | FMC_Read (uint32_t u32Addr) |
Read 32-bit Data from specified address of flash. More... | |
static __INLINE int32_t | FMC_Erase (uint32_t u32Addr) |
Flash page erase. More... | |
static __INLINE uint32_t | FMC_ReadUID (uint8_t u8Index) |
Read Unique ID. More... | |
static __INLINE uint32_t | FMC_ReadCID (void) |
Read company ID. More... | |
static __INLINE uint32_t | FMC_ReadPID (void) |
Read product ID. More... | |
static __INLINE uint32_t | FMC_ReadUCID (uint32_t u32Index) |
To read UCID. More... | |
static __INLINE void | FMC_SetVectorPageAddr (uint32_t u32PageAddr) |
Set vector mapping address. More... | |
static __INLINE uint32_t | FMC_GetVECMAP (void) |
Get current vector mapping address. More... | |
static __INLINE uint32_t | FMC_GetCheckSum (uint32_t u32Addr, int32_t i32Size) |
Get Flash Checksum. More... | |
static __INLINE void | FMC_Write256 (uint32_t u32Addr, uint32_t *pu32Buf) |
Program Multi-Word data into specified address of flash. More... | |
void | FMC_Open (void) |
Enable FMC ISP function. More... | |
void | FMC_Close (void) |
Disable ISP Functions. More... | |
void | FMC_EnableAPUpdate (void) |
Enable APROM update function. More... | |
void | FMC_DisableAPUpdate (void) |
Disable APROM update function. More... | |
void | FMC_EnableConfigUpdate (void) |
Enable User Configuration update function. More... | |
void | FMC_DisableConfigUpdate (void) |
Disable User Configuration update function. More... | |
void | FMC_EnableLDUpdate (void) |
Enable LDROM update function. More... | |
void | FMC_DisableLDUpdate (void) |
Disable LDROM update function. More... | |
int32_t | FMC_ReadConfig (uint32_t *u32Config, uint32_t u32Count) |
Read the User Configuration words. More... | |
int32_t | FMC_WriteConfig (uint32_t *u32Config, uint32_t u32Count) |
Write User Configuration. More... | |
void | FMC_SetBootSource (int32_t i32BootSrc) |
Set boot source from LDROM or APROM after next software reset. More... | |
int32_t | FMC_GetBootSource (void) |
Get the current boot source. More... | |
uint32_t | FMC_ReadDataFlashBaseAddr (void) |
Get the base address of Data Flash if enabled. More... | |
void | FMC_EnableFreqOptimizeMode (uint32_t u32Mode) |
Enable Flash Access Frequency Optimization Mode. More... | |
void | FMC_DisableFreqOptimizeMode (void) |
Disable Flash Access Frequency Optimization Mode. More... | |
#define FMC_DISABLE_AP_UPDATE | ( | ) | (FMC->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk) |
#define FMC_DISABLE_CFG_UPDATE | ( | ) | (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk) |
#define FMC_DISABLE_ISP | ( | ) | (FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk) |
#define FMC_DISABLE_LD_UPDATE | ( | ) | (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk) |
#define FMC_ENABLE_AP_UPDATE | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk) |
#define FMC_ENABLE_CFG_UPDATE | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) |
Enable User Configuration Update Function.
None |
This function will set CFGUEN bit of ISPCTL control register to enable User Configuration update function. User needs to set CFGUEN bit before they can update User Configuration area. Enable CONFIG Update Function
#define FMC_ENABLE_ISP | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) |
#define FMC_ENABLE_LD_UPDATE | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) |
#define FMC_GET_BOOT_STATUS | ( | ) | ((FMC->ISPCTL & FMC_ISPCTL_BS_Msk)?1:0) |
#define FMC_SELECT_NEXT_BOOT | ( | x | ) | (FMC->ISPCTL = (FMC->ISPCTL & ~FMC_ISPCTL_BS_Msk) | ((x) << FMC_ISPCTL_BS_Pos)) |
Next Booting Selection function.
[in] | x | Booting from APROM(0)/LDROM(1) |
This function will set MCU next booting from LDROM/APROM.
void FMC_Close | ( | void | ) |
void FMC_DisableAPUpdate | ( | void | ) |
void FMC_DisableConfigUpdate | ( | void | ) |
void FMC_DisableFreqOptimizeMode | ( | void | ) |
void FMC_DisableLDUpdate | ( | void | ) |
void FMC_EnableAPUpdate | ( | void | ) |
void FMC_EnableConfigUpdate | ( | void | ) |
void FMC_EnableFreqOptimizeMode | ( | uint32_t | u32Mode | ) |
Enable Flash Access Frequency Optimization Mode.
[in] | u32Mode | Optimize flash access cycle mode |
This function will set FOM bit fields of FTCTL register to set flash access frequency optimization mode.
void FMC_EnableLDUpdate | ( | void | ) |
|
static |
int32_t FMC_GetBootSource | ( | void | ) |
Get the current boot source.
None |
0 | This chip is currently booting from APROM |
1 | This chip is currently booting from LDROM |
|
static |
|
static |
void FMC_Open | ( | void | ) |
Enable FMC ISP function.
None |
ISPEN bit of ISPCTL must be set before we can use ISP commands. Therefore, To use all FMC function APIs, user needs to call FMC_Open() first to enable ISP functions.
|
static |
Read 32-bit Data from specified address of flash.
[in] | u32Addr | Flash address include APROM, LDROM, Data Flash, and CONFIG |
To read word data from Flash include APROM, LDROM, Data Flash, and CONFIG.
Definition at line 303 of file fmc.h.
|
static |
int32_t FMC_ReadConfig | ( | uint32_t * | u32Config, |
uint32_t | u32Count | ||
) |
Read the User Configuration words.
[out] | u32Config | The word buffer to store the User Configuration data. |
[in] | u32Count | The word count to be read. |
0 | Success |
-1 | Failed |
This function is used to read the settings of user configuration. if u32Count = 1, Only CONFIG0 will be returned to the buffer specified by u32Config. if u32Count = 2, Both CONFIG0 and CONFIG1 will be returned.
Definition at line 230 of file fmc.c.
uint32_t FMC_ReadDataFlashBaseAddr | ( | void | ) |
|
static |
|
static |
|
static |
void FMC_SetBootSource | ( | int32_t | i32BootSrc | ) |
Set boot source from LDROM or APROM after next software reset.
[in] | i32BootSrc | 1: Boot from LDROM, 0: Boot from APROM |
This function is used to switch APROM boot or LDROM boot. User need to call FMC_SetBootSource to select boot source first, then use CPU reset or System Reset Request to reset system.
|
static |
Set vector mapping address.
[in] | u32PageAddr | The page address to remap to address 0x0. The address must be page alignment. |
This function is used to set VECMAP to map specified page to vector page (0x0).
|
static |
Program 32-bit data into specified address of flash.
[in] | u32Addr | Flash address include APROM, LDROM, Data Flash, and CONFIG |
[in] | u32Data | 32-bit Data to program |
To program word data into Flash include APROM, LDROM, Data Flash, and CONFIG. The corresponding functions in CONFIG are listed in FMC section of Technical Reference Manual.
Definition at line 242 of file fmc.h.
|
static |
Program Multi-Word data into specified address of flash.
[in] | u32Addr | Flash address include APROM, LDROM, Data Flash, and CONFIG |
[in] | pu32Buf | A data pointer is point to a data buffer start address; |
To program multi-words data into Flash include APROM, LDROM, Data Flash, and CONFIG. The corresponding functions in CONFIG are listed in FMC section of Technical Reference Manual.
|
static |
Program 64-bit data into specified address of flash.
[in] | u32Addr | Flash address include APROM, LDROM, Data Flash, and CONFIG |
[in] | u32Data0 | 32-bit Data to program |
[in] | u32Data1 | 32-bit Data to program |
To program two words data into Flash include APROM, LDROM, Data Flash, and CONFIG. The corresponding functions in CONFIG are listed in FMC section of Technical Reference Manual.
int32_t FMC_WriteConfig | ( | uint32_t * | u32Config, |
uint32_t | u32Count | ||
) |
Write User Configuration.
[in] | u32Config | The word buffer to store the User Configuration data. |
[in] | u32Count | The word count to program to User Configuration. |
0 | Success |
-1 | Failed |
User must enable User Configuration update before writing it. User must erase User Configuration before writing it. User Configuration is also be page erase. User needs to backup necessary data before erase User Configuration.
Definition at line 255 of file fmc.c.