Mini51 BSP  V3.02.002
The Board Support Package for Mini51 Series
Macros | Functions
ACMP Exported Functions

Macros

#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. More...
 
#define ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum)
 This macro is used to disable hysteresis function. 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_SELECT_P(acmp, u32ChNum, u32Pin)
 This macro is used to select the V+ pin of ACMP. More...
 
#define ACMP_CRV_SEL(acmp, u32Level)
 This macro is used to set the level of CRV(Comparator Reference Voltage) 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_ENABLE_FALLING_EDGE_TRIGGER(acmp, u32ChNum)
 This macro is used to enable ACMP falling edge trigger Timer/PWM. More...
 
#define ACMP_DISABLE_FALLING_EDGE_TRIGGER(acmp, u32ChNum)
 This macro is used to disable ACMP falling edge trigger Timer/PWM. More...
 
#define ACMP_ENABLE_RISING_EDGE_TRIGGER(acmp, u32ChNum)
 This macro is used to enable ACMP rising edge trigger Timer/PWM. More...
 
#define ACMP_DISABLE_RISING_EDGE_TRIGGER(acmp, u32ChNum)
 This macro is used to disable ACMP rising edge trigger Timer/PWM. More...
 

Functions

void ACMP_Open (ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysteresisEn)
 Configure the specified ACMP module. More...
 
void ACMP_Close (ACMP_T *acmp, uint32_t u32ChNum)
 This function close comparator. More...
 

Detailed Description

Macro Definition Documentation

◆ ACMP_CLR_INT_FLAG

#define ACMP_CLR_INT_FLAG (   acmp,
  u32ChNum 
)

This macro is used to clear ACMP interrupt flag.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 190 of file acmp.h.

◆ ACMP_CRV_SEL

#define ACMP_CRV_SEL (   acmp,
  u32Level 
)

◆ ACMP_DISABLE

#define ACMP_DISABLE (   acmp,
  u32ChNum 
)

This macro is used to disable ACMP.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 163 of file acmp.h.

◆ ACMP_DISABLE_CRV

#define ACMP_DISABLE_CRV (   acmp)

This macro is used to disable CRV(Comparator Reference Voltage)

Parameters
[in]acmpThe base address of ACMP module
Returns
None

Definition at line 242 of file acmp.h.

◆ ACMP_DISABLE_FALLING_EDGE_TRIGGER

#define ACMP_DISABLE_FALLING_EDGE_TRIGGER (   acmp,
  u32ChNum 
)

This macro is used to disable ACMP falling edge trigger Timer/PWM.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 260 of file acmp.h.

◆ ACMP_DISABLE_HYSTERESIS

#define ACMP_DISABLE_HYSTERESIS (   acmp,
  u32ChNum 
)

This macro is used to disable hysteresis function.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 126 of file acmp.h.

◆ ACMP_DISABLE_INT

#define ACMP_DISABLE_INT (   acmp,
  u32ChNum 
)

This macro is used to disable interrupt.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 144 of file acmp.h.

◆ ACMP_DISABLE_RISING_EDGE_TRIGGER

#define ACMP_DISABLE_RISING_EDGE_TRIGGER (   acmp,
  u32ChNum 
)

This macro is used to disable ACMP rising edge trigger Timer/PWM.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1

Definition at line 277 of file acmp.h.

◆ ACMP_ENABLE

#define ACMP_ENABLE (   acmp,
  u32ChNum 
)

This macro is used to enable ACMP.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number
Returns
None

Definition at line 154 of file acmp.h.

◆ ACMP_ENABLE_CRV

#define ACMP_ENABLE_CRV (   acmp)

This macro is used to enable CRV(Comparator Reference Voltage)

Parameters
[in]acmpThe base address of ACMP module
Returns
None

Definition at line 235 of file acmp.h.

◆ ACMP_ENABLE_FALLING_EDGE_TRIGGER

#define ACMP_ENABLE_FALLING_EDGE_TRIGGER (   acmp,
  u32ChNum 
)

This macro is used to enable ACMP falling edge trigger Timer/PWM.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 251 of file acmp.h.

◆ ACMP_ENABLE_HYSTERESIS

#define ACMP_ENABLE_HYSTERESIS (   acmp,
  u32ChNum 
)

This macro is used to enable hysteresis function.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 117 of file acmp.h.

◆ ACMP_ENABLE_INT

#define ACMP_ENABLE_INT (   acmp,
  u32ChNum 
)

This macro is used to enable interrupt.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 135 of file acmp.h.

◆ ACMP_ENABLE_RISING_EDGE_TRIGGER

#define ACMP_ENABLE_RISING_EDGE_TRIGGER (   acmp,
  u32ChNum 
)

This macro is used to enable ACMP rising edge trigger Timer/PWM.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
None

Definition at line 269 of file acmp.h.

◆ ACMP_GET_INT_FLAG

#define ACMP_GET_INT_FLAG (   acmp,
  u32ChNum 
)

This macro is used to get ACMP interrupt flag.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
ACMP interrupt occurred or not

Definition at line 181 of file acmp.h.

◆ ACMP_GET_OUTPUT

#define ACMP_GET_OUTPUT (   acmp,
  u32ChNum 
)

This macro is used to get ACMP output value.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
Returns
1 or 0

Definition at line 172 of file acmp.h.

◆ ACMP_SELECT_P

#define ACMP_SELECT_P (   acmp,
  u32ChNum,
  u32Pin 
)

This macro is used to select the V+ pin of ACMP.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
[in]u32PinThe input pin. For channel 0, valid values are ACMP_CH0_POSPIN_P15, ACMP_CH0_POSPIN_P10, ACMP_CH0_POSPIN_P12, and ACMP_CH0_POSPIN_P13. For channel 1, valid values are , ACMP_CH1_POSPIN_P31, ACMP_CH1_POSPIN_P32, ACMP_CH1_POSPIN_P34, and ACMP_CH1_POSPIN_P35.
Returns
None
Note
Except this setting, multi-function pin also needs to be configured

Definition at line 204 of file acmp.h.

◆ ACMP_SET_NEG_SRC

#define ACMP_SET_NEG_SRC (   acmp,
  u32ChNum,
  u32Src 
)

This macro is used to select ACMP negative input source.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumThe ACMP number, ether 0 or 1
[in]u32Srcis comparator negative input selection. Including :
Returns
None
Note
The V- setting is shared by both comparators if input source is not coming from PIN

Definition at line 101 of file acmp.h.

Function Documentation

◆ ACMP_Close()

void ACMP_Close ( ACMP_T acmp,
uint32_t  u32ChNum 
)

This function close comparator.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumcomparator number.
Returns
None

Definition at line 80 of file acmp.c.

◆ ACMP_Open()

void ACMP_Open ( ACMP_T acmp,
uint32_t  u32ChNum,
uint32_t  u32NegSrc,
uint32_t  u32HysteresisEn 
)

Configure the specified ACMP module.

Parameters
[in]acmpThe base address of ACMP module
[in]u32ChNumcomparator number.
[in]u32NegSrcis comparator negative input selection. Including:
[in]u32HysteresisEnis the hysteresis function option. Including:
Returns
None

Definition at line 64 of file acmp.c.