![]() |
NUC472_NUC442_BSP V3.03.005
The Board Support Package for NUC472/NUC442
|
Macros | |
#define | SYS_CLEAR_BOD_INT_FLAG() (SYS->BODCTL |= SYS_BODCTL_BODINTF_Msk) |
Clear Brown-out detector interrupt flag. More... | |
#define | SYS_CLEAR_BOD_LPM() (SYS->BODCTL &= ~SYS_BODCTL_BODLPM_Msk) |
Set Brown-out detector function to normal mode. More... | |
#define | SYS_DISABLE_BOD() (SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk) |
Disable Brown-out detector function. More... | |
#define | SYS_ENABLE_BOD() (SYS->BODCTL |= SYS_BODCTL_BODEN_Msk) |
Enable Brown-out detector function. More... | |
#define | SYS_GET_BOD_INT_FLAG() (SYS->BODCTL & SYS_BODCTL_BODINTF_Msk) |
Get Brown-out detector interrupt flag. More... | |
#define | SYS_GET_BOD_OUTPUT() (SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) |
Get Brown-out detector status. More... | |
#define | SYS_DISABLE_BOD_RST() (SYS->BODCTL &= ~SYS_BODCTL_BODRSTEN_Msk) |
Disable Brown-out detector interrupt function. More... | |
#define | SYS_ENABLE_BOD_RST() (SYS->BODCTL |= SYS_BODCTL_BODRSTEN_Msk) |
Enable Brown-out detector reset function. More... | |
#define | SYS_SET_BOD_LPM() (SYS->BODCTL |= SYS_BODCTL_BODLPM_Msk) |
Set Brown-out detector function low power mode. More... | |
#define | SYS_SET_BOD_LEVEL(u32Level) (SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | u32Level) |
Set Brown-out detector voltage level. More... | |
#define | SYS_IS_BOD_RST() (SYS->RSTSTS & SYS_RSTSTS_BODRF_Msk) |
Get reset source is from Brown-out detector reset. More... | |
#define | SYS_IS_CPU_RST() (SYS->RSTSTS & SYS_RSTSTS_CPURF_Msk) |
Get reset source is from CPU reset. More... | |
#define | SYS_IS_LVR_RST() (SYS->RSTSTS & SYS_RSTSTS_LVRF_Msk) |
Get reset source is from LVR Reset. More... | |
#define | SYS_IS_POR_RST() (SYS->RSTSTS & SYS_RSTSTS_PORF_Msk) |
Get reset source is from Power-on Reset. More... | |
#define | SYS_IS_RSTPIN_RST() (SYS->RSTSTS & SYS_RSTSTS_PINRF_Msk) |
Get reset source is from reset pin reset. More... | |
#define | SYS_IS_SYSTEM_RST() (SYS->RSTSTS & SYS_RSTSTS_SYSRF_Msk) |
Get reset source is from system reset. More... | |
#define | SYS_IS_WDT_RST() (SYS->RSTSTS & SYS_RSTSTS_WDTRF_Msk) |
Get reset source is from window watch dog reset. More... | |
#define | SYS_DISABLE_LVR() (SYS->BODCTL &= ~SYS_BODCTL_LVREN_Msk) |
Disable Low-Voltage-Reset function. More... | |
#define | SYS_ENABLE_LVR() (SYS->BODCTL |= SYS_BODCTL_LVREN_Msk) |
Enable Low-Voltage-Reset function. More... | |
#define | SYS_DISABLE_POR() (SYS->PORCTL = 0x5AA5) |
Disable Power-on Reset function. More... | |
#define | SYS_ENABLE_POR() (SYS->PORCTL = 0) |
Enable Power-on Reset function. More... | |
#define | SYS_CLEAR_RST_SOURCE(u32RstSrc) (SYS->RSTSTS = u32RstSrc ) |
Clear reset source flag. More... | |
Functions | |
void | SYS_ClearResetSrc (uint32_t u32RstSrc) |
This function clear the selected system reset source. More... | |
uint32_t | SYS_GetBODStatus () |
This function get Brown-out detector output status. More... | |
uint32_t | SYS_GetResetSrc (void) |
This function get the system reset source register value. More... | |
uint32_t | SYS_IsRegLocked (void) |
This function check register write-protection bit setting. More... | |
void | SYS_LockReg (void) |
This function enable register write-protection function. More... | |
void | SYS_UnlockReg (void) |
This function disable register write-protection function. More... | |
uint32_t | SYS_ReadPDID (void) |
This function get product ID. More... | |
void | SYS_ResetChip (void) |
This function reset chip. More... | |
void | SYS_ResetCPU (void) |
This function reset CPU. More... | |
void | SYS_ResetModule (uint32_t u32ModuleIndex) |
This function reset selected modules. More... | |
void | SYS_EnableBOD (int32_t i32Mode, uint32_t u32BODLevel) |
This function configure BOD function. Configure BOD reset or interrupt mode and set Brown-out voltage level. Enable Brown-out function. More... | |
void | SYS_DisableBOD (void) |
This function disable BOD function. More... | |
#define SYS_CLEAR_BOD_INT_FLAG | ( | ) | (SYS->BODCTL |= SYS_BODCTL_BODINTF_Msk) |
#define SYS_CLEAR_BOD_LPM | ( | ) | (SYS->BODCTL &= ~SYS_BODCTL_BODLPM_Msk) |
#define SYS_CLEAR_RST_SOURCE | ( | u32RstSrc | ) | (SYS->RSTSTS = u32RstSrc ) |
Clear reset source flag.
[in] | u32RstSrc | is reset source. Including: |
This macro clear reset source flag.
#define SYS_DISABLE_BOD | ( | ) | (SYS->BODCTL &= ~SYS_BODCTL_BODEN_Msk) |
#define SYS_DISABLE_BOD_RST | ( | ) | (SYS->BODCTL &= ~SYS_BODCTL_BODRSTEN_Msk) |
#define SYS_DISABLE_LVR | ( | ) | (SYS->BODCTL &= ~SYS_BODCTL_LVREN_Msk) |
#define SYS_DISABLE_POR | ( | ) | (SYS->PORCTL = 0x5AA5) |
#define SYS_ENABLE_BOD | ( | ) | (SYS->BODCTL |= SYS_BODCTL_BODEN_Msk) |
#define SYS_ENABLE_BOD_RST | ( | ) | (SYS->BODCTL |= SYS_BODCTL_BODRSTEN_Msk) |
#define SYS_ENABLE_LVR | ( | ) | (SYS->BODCTL |= SYS_BODCTL_LVREN_Msk) |
#define SYS_ENABLE_POR | ( | ) | (SYS->PORCTL = 0) |
#define SYS_GET_BOD_INT_FLAG | ( | ) | (SYS->BODCTL & SYS_BODCTL_BODINTF_Msk) |
#define SYS_GET_BOD_OUTPUT | ( | ) | (SYS->BODCTL & SYS_BODCTL_BODOUT_Msk) |
Get Brown-out detector status.
None |
0 | System voltage is higher than BOD_VL setting or BOD_EN is 0. |
>=1 | System voltage is lower than BOD_VL setting. |
This macro get Brown-out detector output status. If the BOD_EN is 0, this function always return 0.
#define SYS_IS_BOD_RST | ( | ) | (SYS->RSTSTS & SYS_RSTSTS_BODRF_Msk) |
Get reset source is from Brown-out detector reset.
None |
0 | Previous reset source is not from Brown-out detector reset |
>=1 | Previous reset source is from Brown-out detector reset |
This macro get previous reset source is from Brown-out detect reset or not.
#define SYS_IS_CPU_RST | ( | ) | (SYS->RSTSTS & SYS_RSTSTS_CPURF_Msk) |
#define SYS_IS_LVR_RST | ( | ) | (SYS->RSTSTS & SYS_RSTSTS_LVRF_Msk) |
#define SYS_IS_POR_RST | ( | ) | (SYS->RSTSTS & SYS_RSTSTS_PORF_Msk) |
#define SYS_IS_RSTPIN_RST | ( | ) | (SYS->RSTSTS & SYS_RSTSTS_PINRF_Msk) |
#define SYS_IS_SYSTEM_RST | ( | ) | (SYS->RSTSTS & SYS_RSTSTS_SYSRF_Msk) |
#define SYS_IS_WDT_RST | ( | ) | (SYS->RSTSTS & SYS_RSTSTS_WDTRF_Msk) |
Get reset source is from window watch dog reset.
None |
0 | Previous reset source is not from window watch dog reset |
>=1 | Previous reset source is from window watch dog reset |
This macro get previous reset source is from window watch dog reset.
#define SYS_SET_BOD_LEVEL | ( | u32Level | ) | (SYS->BODCTL = (SYS->BODCTL & ~SYS_BODCTL_BODVL_Msk) | u32Level) |
Set Brown-out detector voltage level.
[in] | u32Level | is Brown-out voltage level. Including : |
This macro set Brown-out detector voltage level.
#define SYS_SET_BOD_LPM | ( | ) | (SYS->BODCTL |= SYS_BODCTL_BODLPM_Msk) |
void SYS_ClearResetSrc | ( | uint32_t | u32RstSrc | ) |
This function clear the selected system reset source.
[in] | u32RstSrc | is system reset source. Including: |
void SYS_DisableBOD | ( | void | ) |
void SYS_EnableBOD | ( | int32_t | i32Mode, |
uint32_t | u32BODLevel | ||
) |
This function configure BOD function. Configure BOD reset or interrupt mode and set Brown-out voltage level. Enable Brown-out function.
[in] | i32Mode | is reset or interrupt mode. Including : |
[in] | u32BODLevel | is Brown-out voltage level. Including : |
uint32_t SYS_GetBODStatus | ( | void | ) |
uint32_t SYS_GetResetSrc | ( | void | ) |
uint32_t SYS_IsRegLocked | ( | void | ) |
void SYS_LockReg | ( | void | ) |
uint32_t SYS_ReadPDID | ( | void | ) |
void SYS_ResetChip | ( | void | ) |
void SYS_ResetCPU | ( | void | ) |
void SYS_ResetModule | ( | uint32_t | u32ModuleIndex | ) |
This function reset selected modules.
[in] | u32ModuleIndex | is module index. Including :
|