43#define FMC_APROM_BASE 0x00000000UL
44#define FMC_LDROM_BASE 0x00100000UL
45#define FMC_SPROM_BASE 0x00200000UL
46#define FMC_CONFIG_BASE 0x00300000UL
48#define FMC_CONFIG0_ADDR (FMC_CONFIG_BASE)
49#define FMC_CONFIG1_ADDR (FMC_CONFIG_BASE + 4)
52#define FMC_FLASH_PAGE_SIZE 0x800
53#define FMC_LDROM_SIZE 0x1000
58#define FMC_ISPCTL_BS_LDROM 0x2
59#define FMC_ISPCTL_BS_APROM 0x0
64#define FMC_ISPCMD_READ 0x00
65#define FMC_ISPCMD_PROGRAM 0x21
66#define FMC_ISPCMD_WRITE_8 0x61
67#define FMC_ISPCMD_PAGE_ERASE 0x22
68#define FMC_ISPCMD_READ_CID 0x0B
69#define FMC_ISPCMD_READ_UID 0x04
70#define FMC_ISPCMD_READ_DID 0x0C
71#define FMC_ISPCMD_VECMAP 0x2E
72#define FMC_ISPCMD_CHECKSUM 0x0D
73#define FMC_ISPCMD_CAL_CHECKSUM 0x2D
74#define FMC_ISPCMD_MULTI_PROG 0x27
79#define FMC_FTCTL_OPTIMIZE_DISABLE 0x00
80#define FMC_FTCTL_OPTIMIZE_12MHZ 0x01
81#define FMC_FTCTL_OPTIMIZE_36MHZ 0x02
82#define FMC_FTCTL_OPTIMIZE_60MHZ 0x04
83#define FMC_FTCTL_OPTIMIZE_72MHZ 0x05
85#define FMC_TIMEOUT_READ ((SystemCoreClock/10)*2)
86#define FMC_TIMEOUT_WRITE ((SystemCoreClock/10)*2)
87#define FMC_TIMEOUT_ERASE ((SystemCoreClock/10)*4)
88#define FMC_TIMEOUT_CHKSUM (SystemCoreClock*2)
110#define FMC_ENABLE_ISP() (FMC->ISPCTL |= FMC_ISPCTL_ISPEN_Msk)
118#define FMC_DISABLE_ISP() (FMC->ISPCTL &= ~FMC_ISPCTL_ISPEN_Msk)
127#define FMC_ENABLE_LD_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_LDUEN_Msk)
135#define FMC_DISABLE_LD_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_LDUEN_Msk)
144#define FMC_ENABLE_CFG_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_CFGUEN_Msk)
152#define FMC_DISABLE_CFG_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_CFGUEN_Msk)
162#define FMC_ENABLE_AP_UPDATE() (FMC->ISPCTL |= FMC_ISPCTL_APUEN_Msk)
170#define FMC_DISABLE_AP_UPDATE() (FMC->ISPCTL &= ~FMC_ISPCTL_APUEN_Msk)
179#define FMC_SELECT_NEXT_BOOT(x) (FMC->ISPCTL = (FMC->ISPCTL & ~FMC_ISPCTL_BS_Msk) | ((x) << FMC_ISPCTL_BS_Pos))
187#define FMC_GET_BOOT_STATUS() ((FMC->ISPCTL & FMC_ISPCTL_BS_Msk)?1:0)
208 FMC->ISPADDR = u32PageAddr;
250int32_t
FMC_Write(uint32_t u32Addr, uint32_t u32Data);
251int32_t
FMC_Write8(uint32_t u32Addr, uint32_t u32Data0, uint32_t u32Data1);
252int32_t
FMC_Write256(uint32_t u32Addr, uint32_t *pu32Buf);
#define FMC_ISPSTS_VECMAP_Msk
#define FMC_ISPCMD_VECMAP
#define FMC_TIMEOUT_WRITE
void FMC_DisableLDUpdate(void)
Disable LDROM update function.
void FMC_Close(void)
Disable ISP Functions.
int32_t FMC_Write256(uint32_t u32Addr, uint32_t *pu32Buf)
Program Multi-Word data into specified address of flash.
void FMC_EnableLDUpdate(void)
Enable LDROM update function.
int32_t FMC_ReadConfig(uint32_t *u32Config, uint32_t u32Count)
Read the User Configuration words.
uint32_t FMC_ReadCID(void)
Read company ID.
int32_t FMC_Erase(uint32_t u32Addr)
Flash page erase.
void FMC_DisableFreqOptimizeMode(void)
Disable Flash Access Frequency Optimization Mode.
static __INLINE int32_t FMC_SetVectorPageAddr(uint32_t u32PageAddr)
Set vector mapping address.
void FMC_EnableAPUpdate(void)
Enable APROM update function.
int32_t FMC_Write8(uint32_t u32Addr, uint32_t u32Data0, uint32_t u32Data1)
Program 64-bit data into specified address of flash.
static __INLINE uint32_t FMC_GetVECMAP(void)
Get current vector mapping address.
uint32_t FMC_ReadDataFlashBaseAddr(void)
Get the base address of Data Flash if enabled.
void FMC_EnableFreqOptimizeMode(uint32_t u32Mode)
Enable Flash Access Frequency Optimization Mode.
void FMC_SetBootSource(int32_t i32BootSrc)
Set boot source from LDROM or APROM after next software reset.
int32_t FMC_Write(uint32_t u32Addr, uint32_t u32Data)
Program 32-bit data into specified address of flash.
void FMC_DisableAPUpdate(void)
Disable APROM update function.
uint32_t FMC_Read(uint32_t u32Addr)
Read 32-bit Data from specified address of flash.
uint32_t FMC_ReadPID(void)
Read product ID.
int32_t FMC_GetBootSource(void)
Get the current boot source.
int32_t FMC_WriteConfig(uint32_t *u32Config, uint32_t u32Count)
Write User Configuration.
void FMC_DisableConfigUpdate(void)
Disable User Configuration update function.
void FMC_Open(void)
Enable FMC ISP function.
uint32_t FMC_GetCheckSum(uint32_t u32Addr, int32_t i32Size)
Get Flash Checksum.
void FMC_EnableConfigUpdate(void)
Enable User Configuration update function.
uint32_t FMC_ReadUCID(uint32_t u32Index)
To read UCID.
uint32_t FMC_ReadUID(uint8_t u8Index)
Read Unique ID.