| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros | Functions
fmc.h File Reference

M480 Series Flash Memory Controller Driver Header File. More...

Go to the source code of this file.

## Macros
#define | FMC_APROM_BASE
#define | FMC_APROM_END
#define | FMC_APROM_BANK0_END
#define | FMC_LDROM_BASE
#define | FMC_LDROM_END
#define | FMC_SPROM_BASE
#define | FMC_SPROM_END
#define | FMC_XOM_BASE
#define | FMC_XOMR0_BASE
#define | FMC_XOMR1_BASE
#define | FMC_XOMR2_BASE
#define | FMC_XOMR3_BASE
#define | FMC_CONFIG_BASE
#define | FMC_USER_CONFIG_0
#define | FMC_USER_CONFIG_1
#define | FMC_USER_CONFIG_2
#define | FMC_KPROM_BASE
#define | FMC_OTP_BASE
#define | FMC_FLASH_PAGE_SIZE
#define | FMC_PAGE_ADDR_MASK
#define | FMC_MULTI_WORD_PROG_LEN 512
#define | FMC_APROM_SIZE
#define | FMC_BANK_SIZE
#define | FMC_LDROM_SIZE
#define | FMC_SPROM_SIZE
#define | FMC_OTP_ENTRY_CNT
#define | XOMR0 0UL
#define | XOMR1 1UL
#define | XOMR2 2UL
#define | XOMR3 3UL
#define | IS_BOOT_FROM_LDROM 0x1UL
#define | IS_BOOT_FROM_APROM 0x0UL
#define | FMC_ISPCMD_READ
#define | FMC_ISPCMD_READ_UID
#define | FMC_ISPCMD_READ_ALL1
#define | FMC_ISPCMD_READ_CID
#define | FMC_ISPCMD_READ_DID
#define | FMC_ISPCMD_READ_CKS
#define | FMC_ISPCMD_PROGRAM
#define | FMC_ISPCMD_PAGE_ERASE
#define | FMC_ISPCMD_BANK_ERASE
#define | FMC_ISPCMD_BLOCK_ERASE
#define | FMC_ISPCMD_PROGRAM_MUL
#define | FMC_ISPCMD_RUN_ALL1
#define | FMC_ISPCMD_RUN_CKS
#define | FMC_ISPCMD_VECMAP
#define | FMC_ISPCMD_READ_64
#define | FMC_ISPCMD_PROGRAM_64
#define | READ_ALLONE_YES
#define | READ_ALLONE_NOT
#define | READ_ALLONE_CMD_FAIL
#define | FMC_SET_APROM_BOOT()
#define | FMC_SET_LDROM_BOOT()
#define | FMC_ENABLE_AP_UPDATE()
#define | FMC_DISABLE_AP_UPDATE()
#define | FMC_ENABLE_CFG_UPDATE()
#define | FMC_DISABLE_CFG_UPDATE()
#define | FMC_ENABLE_LD_UPDATE()
#define | FMC_DISABLE_LD_UPDATE()
#define | FMC_ENABLE_SP_UPDATE()
#define | FMC_DISABLE_SP_UPDATE()
#define | FMC_DISABLE_ISP()
#define | FMC_ENABLE_ISP()
#define | FMC_GET_FAIL_FLAG()
#define | FMC_CLR_FAIL_FLAG()

## Functions
__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_ReadUID (uint8_t u8Index)
| Read Unique 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...
void | FMC_Close (void)
| Disable FMC ISP function. More...
int32_t | FMC_ConfigXOM (uint32_t u32XomNum, uint32_t u32XomBase, uint8_t u8XomPage)
| Config XOM Region. More...
int32_t | FMC_Erase (uint32_t u32PageAddr)
| Execute FMC_ISPCMD_PAGE_ERASE command to erase a flash page. The page size is 4096 bytes. More...
int32_t | FMC_Erase_SPROM (void)
| Execute FMC_ISPCMD_PAGE_ERASE command to erase SPROM. The page size is 4096 bytes. More...
int32_t | FMC_Erase_Block (uint32_t u32BlockAddr)
| Execute FMC_ISPCMD_BLOCK_ERASE command to erase a flash block. The block size is 4 pages. More...
int32_t | FMC_Erase_Bank (uint32_t u32BankAddr)
| Execute FMC_ISPCMD_BANK_ERASE command to erase a flash block. More...
int32_t | FMC_EraseXOM (uint32_t u32XomNum)
| Execute Erase XOM Region. More...
int32_t | FMC_GetXOMState (uint32_t u32XomNum)
| Check the XOM is actived or not. 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)
| Execute FMC_ISPCMD_READ command to read a word from flash. More...
int32_t | FMC_Read_64 (uint32_t u32addr, uint32_t *u32data0, uint32_t *u32data1)
| Execute FMC_ISPCMD_READ_64 command to read a double-word from flash. More...
uint32_t | FMC_ReadDataFlashBaseAddr (void)
| Get the base address of Data Flash if enabled. More...
void | FMC_SetBootSource (int32_t i32BootSrc)
| Set boot source from LDROM or APROM after next software reset. More...
void | FMC_Write (uint32_t u32Addr, uint32_t u32Data)
| Execute ISP FMC_ISPCMD_PROGRAM to program a word to flash. More...
int32_t | FMC_Write8Bytes (uint32_t u32addr, uint32_t u32data0, uint32_t u32data1)
| Execute ISP FMC_ISPCMD_PROGRAM_64 to program a double-word to flash. More...
int32_t | FMC_WriteMultiple (uint32_t u32Addr, uint32_t pu32Buf[], uint32_t u32Len)
| Program Multi-Word data into specified address of flash. More...
int32_t | FMC_Write_OTP (uint32_t otp_num, uint32_t low_word, uint32_t high_word)
| Program a 64-bits data to the specified OTP. More...
int32_t | FMC_Read_OTP (uint32_t otp_num, uint32_t *low_word, uint32_t *high_word)
| Read the 64-bits data from the specified OTP. More...
int32_t | FMC_Lock_OTP (uint32_t otp_num)
| Lock the specified OTP. More...
int32_t | FMC_Is_OTP_Locked (uint32_t otp_num)
| Check the OTP is locked or not. More...
int32_t | FMC_ReadConfig (uint32_t u32Config[], uint32_t u32Count)
| Execute FMC_ISPCMD_READ command to read User Configuration. More...
int32_t | FMC_WriteConfig (uint32_t u32Config[], uint32_t u32Count)
| Execute ISP commands to erase then write User Configuration. More...
uint32_t | FMC_GetChkSum (uint32_t u32addr, uint32_t u32count)
| Run CRC32 checksum calculation and get result. More...
uint32_t | FMC_CheckAllOne (uint32_t u32addr, uint32_t u32count)
| Run flash all one verification and get result. More...
int32_t | FMC_SetSPKey (uint32_t key[3], uint32_t kpmax, uint32_t kemax, const int32_t lock_CONFIG, const int32_t lock_SPROM)
| Setup security key. More...
int32_t | FMC_CompareSPKey (uint32_t key[3])
| Execute security key comparison. More...

## Detailed Description

M480 Series Flash Memory Controller Driver Header File.

Version
  V1.00 SPDX-License-Identifier: Apache-2.0

Copyright
  (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.

Definition in file fmc.h.