| NUC029FAE_BSP V3.02.000 The Board Support Package for NUC029FAE MCU

Macros | Functions | Variables
FMC Exported Functions
NUC029FAE Device Driver » FMC Driver » FMC Exported Constants
Collaboration diagram for FMC Exported Functions:

## Macros
#define | FMC_SET_APROM_BOOT() (FMC->ISPCON &= ~FMC_ISPCON_BS_Msk)
#define | FMC_SET_LDROM_BOOT() (FMC->ISPCON |= FMC_ISPCON_BS_Msk)
#define | FMC_DISABLE_AP_UPDATE() (FMC->ISPCON &= ~FMC_ISPCON_APUEN_Msk)
#define | FMC_DISABLE_CFG_UPDATE() (FMC->ISPCON &= ~FMC_ISPCON_CFGUEN_Msk)
#define | FMC_DISABLE_LD_UPDATE() (FMC->ISPCON &= ~FMC_ISPCON_LDUEN_Msk)
#define | FMC_DISABLE_ISP() (FMC->ISPCON &= ~FMC_ISPCON_ISPEN_Msk)
#define | FMC_ENABLE_AP_UPDATE() (FMC->ISPCON |= FMC_ISPCON_APUEN_Msk)
#define | FMC_ENABLE_LD_UPDATE() (FMC->ISPCON |= FMC_ISPCON_LDUEN_Msk)
#define | FMC_ENABLE_CFG_UPDATE() (FMC->ISPCON |= FMC_ISPCON_CFGUEN_Msk)
#define | FMC_ENABLE_ISP() (FMC->ISPCON |= FMC_ISPCON_ISPEN_Msk)
#define | FMC_GET_FAIL_FLAG() ((FMC->ISPCON & FMC_ISPCON_ISPFF_Msk) ? 1 : 0)

## Functions
void | FMC_SetBootSource (int32_t i32BootSrc)
| Set boot source of next software reset. More...
void | FMC_Close (void)
| Disable all FMC functions. More...
void | FMC_DisableAPUpdate (void)
| Disable APROM update function. More...
void | FMC_DisableConfigUpdate (void)
| Disable User Configuration update function. More...
void | FMC_DisableLDUpdate (void)
| Disable LDROM update function. More...
void | FMC_EnableAPUpdate (void)
| Enable APROM update function. More...
void | FMC_EnableConfigUpdate (void)
| Enable User Configuration update function. More...
void | FMC_EnableLDUpdate (void)
| Enable LDROM update function. 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...
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...

## Variables
int32_t | g_FMC_i32ErrCode

## Detailed Description

## Macro Definition Documentation

## ◆ FMC_DISABLE_AP_UPDATE

#define FMC_DISABLE_AP_UPDATE | ( |  | ) | (FMC->ISPCON &= ~FMC_ISPCON_APUEN_Msk)

Disable APROM update

Definition at line 67 of file fmc.h.

## ◆ FMC_DISABLE_CFG_UPDATE

#define FMC_DISABLE_CFG_UPDATE | ( |  | ) | (FMC->ISPCON &= ~FMC_ISPCON_CFGUEN_Msk)

Disable User Config update

Definition at line 68 of file fmc.h.

## ◆ FMC_DISABLE_ISP

#define FMC_DISABLE_ISP | ( |  | ) | (FMC->ISPCON &= ~FMC_ISPCON_ISPEN_Msk)

Disable ISP function

Definition at line 70 of file fmc.h.

## ◆ FMC_DISABLE_LD_UPDATE

#define FMC_DISABLE_LD_UPDATE | ( |  | ) | (FMC->ISPCON &= ~FMC_ISPCON_LDUEN_Msk)

Disable LDROM update

Definition at line 69 of file fmc.h.

## ◆ FMC_ENABLE_AP_UPDATE

#define FMC_ENABLE_AP_UPDATE | ( |  | ) | (FMC->ISPCON |= FMC_ISPCON_APUEN_Msk)

Enable APROM update

Definition at line 71 of file fmc.h.

## ◆ FMC_ENABLE_CFG_UPDATE

#define FMC_ENABLE_CFG_UPDATE | ( |  | ) | (FMC->ISPCON |= FMC_ISPCON_CFGUEN_Msk)

Enable User Config update

Definition at line 73 of file fmc.h.

## ◆ FMC_ENABLE_ISP

#define FMC_ENABLE_ISP | ( |  | ) | (FMC->ISPCON |= FMC_ISPCON_ISPEN_Msk)

Enable ISP function

Definition at line 74 of file fmc.h.

## ◆ FMC_ENABLE_LD_UPDATE

#define FMC_ENABLE_LD_UPDATE | ( |  | ) | (FMC->ISPCON |= FMC_ISPCON_LDUEN_Msk)

Enable LDROM update

Definition at line 72 of file fmc.h.

## ◆ FMC_GET_FAIL_FLAG

#define FMC_GET_FAIL_FLAG | ( |  | ) | ((FMC->ISPCON & FMC_ISPCON_ISPFF_Msk) ? 1 : 0)

Get ISP fail flag

Definition at line 75 of file fmc.h.

## ◆ FMC_SET_APROM_BOOT

#define FMC_SET_APROM_BOOT | ( |  | ) | (FMC->ISPCON &= ~FMC_ISPCON_BS_Msk)

Select booting from APROM

Definition at line 65 of file fmc.h.

## ◆ FMC_SET_LDROM_BOOT

#define FMC_SET_LDROM_BOOT | ( |  | ) | (FMC->ISPCON |= FMC_ISPCON_BS_Msk)

Select booting from LDROM

Definition at line 66 of file fmc.h.

## Function Documentation

## ◆ FMC_Close()

void FMC_Close | ( | void |  | ) |

Disable all FMC functions.

Definition at line 49 of file fmc.c.

## ◆ FMC_DisableAPUpdate()

void FMC_DisableAPUpdate | ( | void |  | ) |

Disable APROM update function.

Definition at line 58 of file fmc.c.

## ◆ FMC_DisableConfigUpdate()

void FMC_DisableConfigUpdate | ( | void |  | ) |

Disable User Configuration update function.

Definition at line 67 of file fmc.c.

Here is the caller graph for this function:

## ◆ FMC_DisableLDUpdate()

void FMC_DisableLDUpdate | ( | void |  | ) |

Disable LDROM update function.

Definition at line 76 of file fmc.c.

## ◆ FMC_EnableAPUpdate()

void FMC_EnableAPUpdate | ( | void |  | ) |

Enable APROM update function.

Definition at line 85 of file fmc.c.

## ◆ FMC_EnableConfigUpdate()

void FMC_EnableConfigUpdate | ( | void |  | ) |

Enable User Configuration update function.

Definition at line 94 of file fmc.c.

Here is the caller graph for this function:

## ◆ FMC_EnableLDUpdate()

void FMC_EnableLDUpdate | ( | void |  | ) |

Enable LDROM update function.

Definition at line 103 of file fmc.c.

## ◆ FMC_Erase()

int32_t FMC_Erase | ( | uint32_t | u32PageAddr | ) |

Erase a page. The page size is 512 bytes.

Parameters

  u32PageAddr | Flash page address. Must be a 512-byte aligned address.

Return values

  0 | Success
  -1 | Erase failed

Definition at line 115 of file fmc.c.

Here is the caller graph for this function:

## ◆ FMC_GetBootSource()

int32_t FMC_GetBootSource | ( | void |  | ) |

get the current boot source

Return values

  0 | This chip is currently booting from APROM
  1 | This chip is currently booting from LDROM

Definition at line 139 of file fmc.c.

## ◆ FMC_Open()

void FMC_Open | ( | void |  | ) |

Enable FMC ISP function.

Definition at line 151 of file fmc.c.

## ◆ FMC_Read()

uint32_t FMC_Read | ( | uint32_t | u32Addr | ) |

Read a word from specified flash address.

Parameters

  u32Addr | Flash word address. Must be a word aligned address.

Return values

  The | word data stored in the flash address "u32Addr".

Definition at line 162 of file fmc.c.

Here is the caller graph for this function:

## ◆ FMC_ReadCID()

uint32_t FMC_ReadCID | ( | void |  | ) |

Read company ID.

Return values

  The | company ID.

Definition at line 184 of file fmc.c.

## ◆ FMC_ReadConfig()

int32_t FMC_ReadConfig | ( | uint32_t * | u32Config,
|  | uint32_t | u32Count
| ) |  |

Read the User Configuration words.

Parameters

  u32Config | The word array to store data.
  u32Count | Maximum length of "u32Config".

Return values

  0 | Success
  -1 | Failed

Definition at line 326 of file fmc.c.

Here is the call graph for this function:

## ◆ FMC_ReadDataFlashBaseAddr()

uint32_t FMC_ReadDataFlashBaseAddr | ( | void |  | ) |

Get the base address of Data Flash if enabled.

Return values

  The | base address of Data Flash

Definition at line 272 of file fmc.c.

## ◆ FMC_ReadPID()

uint32_t FMC_ReadPID | ( | void |  | ) |

Read product ID.

Return values

  The | product ID.

Definition at line 205 of file fmc.c.

## ◆ FMC_ReadUCID()

uint32_t FMC_ReadUCID | ( | uint32_t | u32Index | ) |

This function reads one of the four UCID.

Parameters

  u32Index | index of the UCID to read. u32Index must be 0, 1, 2, or 3.

Return values

  The | UCID.

Definition at line 227 of file fmc.c.

## ◆ FMC_ReadUID()

uint32_t FMC_ReadUID | ( | uint32_t | u32Index | ) |

This function reads one of the three UID.

Parameters

  u32Index | index of the UID to read. u32Index must be 0, 1, or 2.

Return values

  The | UID.

Definition at line 250 of file fmc.c.

## ◆ FMC_SetBootSource()

void FMC_SetBootSource | ( | int32_t | i32BootSrc | ) |

Set boot source of next software reset.

Parameters

  i32BootSrc | 1: will boot from LDROM; 0: will boot from APROM

Return values

  None |

Definition at line 37 of file fmc.c.

## ◆ FMC_SetVectorPageAddr()

void FMC_SetVectorPageAddr | ( | uint32_t | u32PageAddr | ) |

This function will force re-map assigned flash page to CPU address 0x0.

Parameters

  u32PageAddr | address of the page to be mapped to CPU address 0x0.

Definition at line 282 of file fmc.c.

## ◆ FMC_Write()

int32_t FMC_Write | ( | uint32_t | u32Addr,
|  | uint32_t | u32Data
| ) |  |

Writes a word data to specified flash address.

Parameters

  u32Addr | destination address
  u32Data | word data to be written

Definition at line 300 of file fmc.c.

Here is the caller graph for this function:

## ◆ FMC_WriteConfig()

int32_t FMC_WriteConfig | ( | uint32_t * | u32Config,
|  | uint32_t | u32Count
| ) |  |

Write User Configuration.

Parameters

  u32Config | The word array to store data.
  u32Count | Maximum length of "u32Config".

Return values

  0 | Success
  -1 | Failed

Definition at line 343 of file fmc.c.

Here is the call graph for this function:

## Variable Documentation

## ◆ g_FMC_i32ErrCode

int32_t g_FMC_i32ErrCode

Definition at line 30 of file fmc.c.