![]() |
NANO102/112 BSP V3.03.003
The Board Support Package for Nano102/112 Series
|
Macros | |
#define | ACMP_SET_NEG_SRC(acmp, u32ChNum, u32Src) |
This macro is used to enable output inverse. More... | |
#define | ACMP_ENABLE_HYSTERESIS(acmp, u32ChNum) |
This macro is used to enable hysteresis. More... | |
#define | ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum) |
This macro is used to disable hysteresis. More... | |
#define | ACMP_ENABLE_INT(acmp, u32ChNum) |
This macro is used to enable interrupt. More... | |
#define | ACMP_DISABLE_INT(acmp, u32ChNum) |
This macro is used to disable interrupt. More... | |
#define | ACMP_ENABLE(acmp, u32ChNum) |
This macro is used to enable ACMP. More... | |
#define | ACMP_DISABLE(acmp, u32ChNum) |
This macro is used to disable ACMP. More... | |
#define | ACMP_GET_OUTPUT(acmp, u32ChNum) |
This macro is used to get ACMP output value. More... | |
#define | ACMP_GET_INT_FLAG(acmp, u32ChNum) |
This macro is used to get ACMP interrupt flag. More... | |
#define | ACMP_CLR_INT_FLAG(acmp, u32ChNum) |
This macro is used to clear ACMP interrupt flag. More... | |
#define | ACMP_ENABLE_WAKEUP(acmp, u32ChNum) |
This macro is used to enable ACMP wake-up. More... | |
#define | ACMP_DISABLE_WAKEUP(acmp, u32ChNum) |
This macro is used to disable ACMP wake-up. More... | |
#define | ACMP_CRV_SEL(u32Level) |
This macro is used to enable ACMP wake-up. More... | |
#define | ACMP_ENABLE_CRV(acmp) |
This macro is used to enable CRV(comparator reference voltage) More... | |
#define | ACMP_DISABLE_CRV(acmp) |
This macro is used to disable CRV(comparator reference voltage) More... | |
#define | ACMP_SELECT_P(acmp, u32ChNum, u32Src) ((acmp)->CR[(u32ChNum)%2] = ((acmp)->CR[(u32ChNum)%2] & ~ACMP_CR_CPP0SEL_Msk) | (u32Src)) |
This macro is used to select ACMP positive input source for ACMP0. More... | |
#define | ACMP_START_CONV(acmp) |
This macro is used to start ACMP on sigma-delta mode or slope mode. More... | |
Functions | |
void | ACMP_Open (ACMP_T *Acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysteresisEn) |
This function open and configure comparator parameters. More... | |
void | ACMP_Close (ACMP_T *Acmp, uint32_t u32ChNum) |
This function close comparator. More... | |
void | ACMP_SetSigmaDeltaConv (uint32_t u32TimerNum, uint32_t u32TriggerPolarity, uint32_t u32PosPin, uint32_t u32ChargePin) |
This function configure ACMP to sigma-delta mode. More... | |
void | ACMP_SetSlopeConv (uint32_t u32TimerNum, uint32_t u32TriggerPolarity, uint32_t u32PosPin, uint32_t u32ChargePin) |
This function configure ACMP to slope mode. More... | |
#define ACMP_CLR_INT_FLAG | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_CRV_SEL | ( | u32Level | ) |
#define ACMP_DISABLE | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_CRV | ( | acmp | ) |
#define ACMP_DISABLE_HYSTERESIS | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_INT | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_WAKEUP | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_CRV | ( | acmp | ) |
#define ACMP_ENABLE_HYSTERESIS | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_INT | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_WAKEUP | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_GET_INT_FLAG | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_GET_OUTPUT | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_SELECT_P | ( | acmp, | |
u32ChNum, | |||
u32Src | |||
) | ((acmp)->CR[(u32ChNum)%2] = ((acmp)->CR[(u32ChNum)%2] & ~ACMP_CR_CPP0SEL_Msk) | (u32Src)) |
This macro is used to select ACMP positive input source for ACMP0.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
[in] | u32Src | Comparator positive input selection. Including: |
This macro will set CPP0SEL (CR[0]) to determine the comparator positive input source.
#define ACMP_SET_NEG_SRC | ( | acmp, | |
u32ChNum, | |||
u32Src | |||
) |
This macro is used to enable output inverse.
[in] | acmp | The base address of ACMP module |
[in] | u32ChNum | The ACMP number |
[in] | u32Src | is comparator0 negative input selection. Including : |
#define ACMP_START_CONV | ( | acmp | ) |
void ACMP_Close | ( | ACMP_T * | Acmp, |
uint32_t | u32ChNum | ||
) |
void ACMP_Open | ( | ACMP_T * | Acmp, |
uint32_t | u32ChNum, | ||
uint32_t | u32NegSrc, | ||
uint32_t | u32HysteresisEn | ||
) |
This function open and configure comparator parameters.
[in] | Acmp | The base address of ACMP module |
[in] | u32ChNum | comparator number. |
[in] | u32NegSrc | is comparator0 negative input selection. Including :
|
[in] | u32HysteresisEn | is charge or discharge pin selection. Including : |
void ACMP_SetSigmaDeltaConv | ( | uint32_t | u32TimerNum, |
uint32_t | u32TriggerPolarity, | ||
uint32_t | u32PosPin, | ||
uint32_t | u32ChargePin | ||
) |
This function configure ACMP to sigma-delta mode.
[in] | u32TimerNum | is set to 0 to use timer0 and timer1, set to 1 to use timer0 and timer1. Including : |
[in] | u32TriggerPolarity | is set rising trigger or falling trigger. Including : |
[in] | u32PosPin | is comparator0 positive input selection. Including : |
[in] | u32ChargePin | is charge or discharge pin selection. Including : |
void ACMP_SetSlopeConv | ( | uint32_t | u32TimerNum, |
uint32_t | u32TriggerPolarity, | ||
uint32_t | u32PosPin, | ||
uint32_t | u32ChargePin | ||
) |
This function configure ACMP to slope mode.
[in] | u32TimerNum | is set to 0 to use timer0 and timer1, set to 1 to use timer0 and timer1. Including : |
[in] | u32TriggerPolarity | is set rising trigger or falling trigger. Including : |
[in] | u32PosPin | is comparator0 positive input selection. Including : |
[in] | u32ChargePin | is charge or discharge pin selection. Including : |