| 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
ACMP_Open
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.h
NuMicro peripheral access layer header file.
ACMP_T
Definition: acmp_reg.h:26
ACMP_Close
void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum)
Close analog comparator.
Definition: acmp.c:61
ACMP_CTL_ACMPEN_Msk
#define ACMP_CTL_ACMPEN_Msk
Definition: acmp_reg.h:312
ACMP_T::CTL
__IO uint32_t CTL[2]
Definition: acmp_reg.h:300
ACMP_CTL_NEGSEL_Msk
#define ACMP_CTL_NEGSEL_Msk
Definition: acmp_reg.h:321
ACMP_CTL_HYSSEL_Msk
#define ACMP_CTL_HYSSEL_Msk
Definition: acmp_reg.h:345