M480 BSP  V3.05.001
The Board Support Package for M480 Series
acmp.c
Go to the documentation of this file.
1 /**************************************************************************/
9 #include "NuMicro.h"
10 
11 
46 void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel)
47 {
48  acmp->CTL[u32ChNum] = (acmp->CTL[u32ChNum] & (~(ACMP_CTL_NEGSEL_Msk | ACMP_CTL_HYSSEL_Msk))) | (u32NegSrc | u32HysSel | ACMP_CTL_ACMPEN_Msk);
49 }
50 
61 void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum)
62 {
63  acmp->CTL[u32ChNum] &= (~ACMP_CTL_ACMPEN_Msk);
64 }
65 
66 
67  /* end of group ACMP_EXPORTED_FUNCTIONS */
69  /* end of group ACMP_Driver */
71  /* end of group Standard_Driver */
73 
74 /*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/
75 
void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel)
Configure the specified ACMP module.
Definition: acmp.c:46
NuMicro peripheral access layer header file.
void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum)
Close analog comparator.
Definition: acmp.c:61
#define ACMP_CTL_ACMPEN_Msk
Definition: acmp_reg.h:312
__IO uint32_t CTL[2]
Definition: acmp_reg.h:300
#define ACMP_CTL_NEGSEL_Msk
Definition: acmp_reg.h:321
#define ACMP_CTL_HYSSEL_Msk
Definition: acmp_reg.h:345