![]() |
MINI58_BSP V3.01.005
The Board Support Package for Mini58 Series MCU
|
Macros | |
#define | FMC_SET_APROM_BOOT() (FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk) |
#define | FMC_SET_LDROM_BOOT() (FMC->ISPCTL |= FMC_ISPCTL_BS_Msk) |
#define | FMC_DISABLE_AP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk) |
#define | FMC_DISABLE_SP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_SPUEN_Msk) |
#define | FMC_DISABLE_CFG_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk) |
#define | FMC_DISABLE_LD_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk) |
#define | FMC_DISABLE_ISP() (FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk) |
#define | FMC_ENABLE_AP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk) |
#define | FMC_ENABLE_SP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_SPUEN_Msk) |
#define | FMC_ENABLE_LD_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) |
#define | FMC_ENABLE_CFG_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) |
#define | FMC_ENABLE_ISP() (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) |
#define | FMC_GET_FAIL_FLAG() ((FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) ? 1 : 0) |
Functions | |
void | FMC_Close (void) |
Disable all FMC functions. More... | |
int32_t | FMC_Erase (uint32_t u32PageAddr) |
Erase a page. The page size is 512 bytes. More... | |
int32_t | FMC_GetBootSource (void) |
get the current boot source More... | |
void | FMC_Open (void) |
Enable FMC ISP function. More... | |
uint32_t | FMC_Read (uint32_t u32Addr) |
Read a word from specified flash address. More... | |
uint32_t | FMC_ReadCID (void) |
Read company ID. More... | |
uint32_t | FMC_ReadPID (void) |
Read product ID. More... | |
uint32_t | FMC_ReadUCID (uint32_t u32Index) |
This function reads one of the four UCID. More... | |
uint32_t | FMC_ReadUID (uint32_t u32Index) |
This function reads one of the three UID. More... | |
uint32_t | FMC_ReadDataFlashBaseAddr (void) |
Get the base address of Data Flash if enabled. More... | |
void | FMC_SetVectorPageAddr (uint32_t u32PageAddr) |
This function will force re-map assigned flash page to CPU address 0x0. More... | |
uint32_t | FMC_GetVectorPageAddr (void) |
Obtain the current vector page address setting. More... | |
int32_t | FMC_Write (uint32_t u32Addr, uint32_t u32Data) |
Writes a word data to specified flash address. 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... | |
int32_t | FMC_GetCRC32Sum (uint32_t addr, uint32_t count, uint32_t *chksum) |
Calculate and read the CRC32 checksum of a specified flash area. More... | |
Variables | |
int32_t | g_FMC_i32ErrCode |
#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_DISABLE_SP_UPDATE | ( | ) | (FMC->ISPCTL &= ~FMC_ISPCTL_SPUEN_Msk) |
#define FMC_ENABLE_AP_UPDATE | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk) |
#define FMC_ENABLE_CFG_UPDATE | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk) |
#define FMC_ENABLE_ISP | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk) |
#define FMC_ENABLE_LD_UPDATE | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk) |
#define FMC_ENABLE_SP_UPDATE | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_SPUEN_Msk) |
#define FMC_GET_FAIL_FLAG | ( | ) | ((FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) ? 1 : 0) |
#define FMC_SET_APROM_BOOT | ( | ) | (FMC->ISPCTL &= ~FMC_ISPCTL_BS_Msk) |
#define FMC_SET_LDROM_BOOT | ( | ) | (FMC->ISPCTL |= FMC_ISPCTL_BS_Msk) |
int32_t FMC_Erase | ( | uint32_t | u32PageAddr | ) |
Erase a page. The page size is 512 bytes.
[in] | u32PageAddr | Flash page address. Must be a 512-byte aligned address. |
0 | Success |
-1 | Erase failed or time-out |
Definition at line 51 of file fmc.c.
int32_t FMC_GetBootSource | ( | void | ) |
int32_t FMC_GetCRC32Sum | ( | uint32_t | addr, |
uint32_t | count, | ||
uint32_t * | chksum | ||
) |
Calculate and read the CRC32 checksum of a specified flash area.
[in] | addr | Start address of the flash area to be executed CRC32 checksum calculation. |
[in] | count | Number of bytes to be calculated. |
[out] | chksum | If success, it will contain the result of CRC32 checksum calculation. |
0 | Success |
-1 | Timeout or error. |
uint32_t FMC_GetVectorPageAddr | ( | void | ) |
uint32_t FMC_Read | ( | uint32_t | u32Addr | ) |
Read a word from specified flash address.
[in] | u32Addr | Flash word address. Must be a word aligned address. |
To read word data from Flash include APROM, LDROM, Data Flash, and CONFIG.
Definition at line 100 of file fmc.c.
uint32_t FMC_ReadCID | ( | void | ) |
int32_t FMC_ReadConfig | ( | uint32_t * | u32Config, |
uint32_t | u32Count | ||
) |
uint32_t FMC_ReadDataFlashBaseAddr | ( | void | ) |
uint32_t FMC_ReadPID | ( | void | ) |
uint32_t FMC_ReadUCID | ( | uint32_t | u32Index | ) |
uint32_t FMC_ReadUID | ( | uint32_t | u32Index | ) |
void FMC_SetVectorPageAddr | ( | uint32_t | u32PageAddr | ) |
int32_t FMC_Write | ( | uint32_t | u32Addr, |
uint32_t | u32Data | ||
) |
int32_t FMC_WriteConfig | ( | uint32_t * | u32Config, |
uint32_t | u32Count | ||
) |