![]() |
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
Macros | |
#define | ACMP_ENABLE_OUTPUT_INVERSE(acmp, u32ChNum) |
This macro is used to enable output inverse function. More... | |
#define | ACMP_DISABLE_OUTPUT_INVERSE(acmp, u32ChNum) |
This macro is used to disable output inverse function. More... | |
#define | ACMP_SET_NEG_SRC(acmp, u32ChNum, u32Src) |
This macro is used to select ACMP negative input source. More... | |
#define | ACMP_ENABLE_HYSTERESIS(acmp, u32ChNum) |
This macro is used to enable hysteresis function and set hysteresis to 30mV. More... | |
#define | ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum) |
This macro is used to disable hysteresis function. More... | |
#define | ACMP_CONFIG_HYSTERESIS(acmp, u32ChNum, u32HysSel) |
This macro is used to select hysteresis level. 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_CLR_WAKEUP_INT_FLAG(acmp, u32ChNum) |
This macro is used to clear ACMP wake-up interrupt flag. More... | |
#define | ACMP_ENABLE_WAKEUP(acmp, u32ChNum) |
This macro is used to enable ACMP wake-up function. More... | |
#define | ACMP_DISABLE_WAKEUP(acmp, u32ChNum) |
This macro is used to disable ACMP wake-up function. More... | |
#define | ACMP_SELECT_P(acmp, u32ChNum, u32Pin) |
This macro is used to select ACMP positive input pin. More... | |
#define | ACMP_ENABLE_FILTER(acmp, u32ChNum) |
This macro is used to enable ACMP filter function. More... | |
#define | ACMP_DISABLE_FILTER(acmp, u32ChNum) |
This macro is used to disable ACMP filter function. More... | |
#define | ACMP_SET_FILTER(acmp, u32ChNum, u32Cnt) |
This macro is used to set ACMP filter function. More... | |
#define | ACMP_CRV_SEL(acmp, u32Level) |
This macro is used to select comparator reference voltage. More... | |
#define | ACMP_SELECT_CRV_SRC(acmp, u32Src) |
This macro is used to select the source of CRV. More... | |
#define | ACMP_SELECT_INT_COND(acmp, u32ChNum, u32Cond) |
This macro is used to select ACMP interrupt condition. More... | |
#define | ACMP_ENABLE_WINDOW_LATCH(acmp, u32ChNum) |
This macro is used to enable ACMP window latch mode. More... | |
#define | ACMP_DISABLE_WINDOW_LATCH(acmp, u32ChNum) |
This macro is used to disable ACMP window latch mode. More... | |
#define | ACMP_ENABLE_WINDOW_COMPARE(acmp, u32ChNum) |
This macro is used to enable ACMP window compare mode. More... | |
#define | ACMP_DISABLE_WINDOW_COMPARE(acmp, u32ChNum) |
This macro is used to disable ACMP window compare mode. More... | |
Functions | |
void | ACMP_Open (ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel) |
Configure the specified ACMP module. More... | |
void | ACMP_Close (ACMP_T *acmp, uint32_t u32ChNum) |
Close analog comparator. More... | |
#define ACMP_CLR_INT_FLAG | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_CLR_WAKEUP_INT_FLAG | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_CONFIG_HYSTERESIS | ( | acmp, | |
u32ChNum, | |||
u32HysSel | |||
) |
This macro is used to select hysteresis level.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
[in] | u32HysSel | The hysteresis function option. Including: |
#define ACMP_CRV_SEL | ( | acmp, | |
u32Level | |||
) |
This macro is used to select comparator reference voltage.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32Level | The comparator reference voltage setting. The formula is: comparator reference voltage = CRV source voltage x (1/6 + u32Level/24) The range of u32Level is 0 ~ 15. |
When CRV is selected as ACMP negative input source, the CRV level is determined by CRVCTL (ACMP_VREF[3:0]).
#define ACMP_DISABLE | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_FILTER | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_HYSTERESIS | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_INT | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_OUTPUT_INVERSE | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_WAKEUP | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_WINDOW_COMPARE | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_DISABLE_WINDOW_LATCH | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_FILTER | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_HYSTERESIS | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_INT | ( | acmp, | |
u32ChNum | |||
) |
This macro is used to enable interrupt.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
This macro will set ACMPIE bit of ACMP_CTL register to enable interrupt function. If wake-up function is enabled, the wake-up interrupt will be enabled as well.
#define ACMP_ENABLE_OUTPUT_INVERSE | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_WAKEUP | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_ENABLE_WINDOW_COMPARE | ( | acmp, | |
u32ChNum | |||
) |
This macro is used to enable ACMP window compare mode.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
This macro will set WCMPSEL (ACMP_CTL[18]) to enable ACMP window compare mode. When window compare mode is enabled, user can connect the specific analog voltage source to either the positive inputs of both comparators or the negative inputs of both comparators. The upper bound and lower bound of the designated range are determined by the voltages applied to the other inputs of both comparators. If the output of a comparator is low and the other comparator outputs high, which means two comparators implies the upper and lower bound. User can directly monitor a specific analog voltage source via ACMPWO (ACMP_STATUS[16]).
#define ACMP_ENABLE_WINDOW_LATCH | ( | acmp, | |
u32ChNum | |||
) |
This macro is used to enable ACMP window latch mode.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
This macro will set WLATEN (ACMP_CTL[17]) to enable ACMP window latch mode. When ACMP0/1_WLAT pin is at high level, ACMPO0/1 passes through window latch block; when ACMP0/1_WLAT pin is at low level, the output of window latch block, WLATOUT, is frozen.
#define ACMP_GET_INT_FLAG | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_GET_OUTPUT | ( | acmp, | |
u32ChNum | |||
) |
#define ACMP_SELECT_CRV_SRC | ( | acmp, | |
u32Src | |||
) |
This macro is used to select the source of CRV.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32Src | is the source of CRV. Including: |
The source of CRV can be VDDA or internal reference voltage. The internal reference voltage level is determined by SYS_VREFCTL register.
#define ACMP_SELECT_INT_COND | ( | acmp, | |
u32ChNum, | |||
u32Cond | |||
) |
This macro is used to select ACMP interrupt condition.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
[in] | u32Cond | Comparator interrupt condition selection. Including: |
The ACMP output interrupt condition can be rising edge, falling edge or any edge.
#define ACMP_SELECT_P | ( | acmp, | |
u32ChNum, | |||
u32Pin | |||
) |
This macro is used to select ACMP positive input pin.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
[in] | u32Pin | Comparator positive pin selection. Including: |
This macro will set POSSEL (ACMP_CTL[7:6]) to determine the comparator positive input pin.
#define ACMP_SET_FILTER | ( | acmp, | |
u32ChNum, | |||
u32Cnt | |||
) |
This macro is used to set ACMP filter function.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
[in] | u32Cnt | is comparator filter count setting. |
When ACMP output filter function is enabled, the output sampling count is determined by FILTSEL (ACMP_CTL[15:13]).
#define ACMP_SET_NEG_SRC | ( | acmp, | |
u32ChNum, | |||
u32Src | |||
) |
This macro is used to select ACMP negative input source.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | The ACMP number |
[in] | u32Src | is comparator negative input selection. Including: |
This macro will set NEGSEL (ACMP_CTL[5:4]) to determine the source of negative input.
void ACMP_Close | ( | ACMP_T * | acmp, |
uint32_t | u32ChNum | ||
) |
void ACMP_Open | ( | ACMP_T * | acmp, |
uint32_t | u32ChNum, | ||
uint32_t | u32NegSrc, | ||
uint32_t | u32HysSel | ||
) |
Configure the specified ACMP module.
[in] | acmp | The pointer of the specified ACMP module |
[in] | u32ChNum | Comparator number. |
[in] | u32NegSrc | Comparator negative input selection. Including: |
[in] | u32HysSel | The hysteresis function option. Including: |
Configure hysteresis function, select the source of negative input and enable analog comparator.