M480 BSP V3.05.006
The Board Support Package for M480 Series
acmp.c
Go to the documentation of this file.
1/**************************************************************************/
9#include "NuMicro.h"
10
11
46void 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
61void 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
NuMicro peripheral access layer header file.
void ACMP_Close(ACMP_T *acmp, uint32_t u32ChNum)
Close analog comparator.
Definition: acmp.c:61
void ACMP_Open(ACMP_T *acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysSel)
Configure the specified ACMP module.
Definition: acmp.c:46
#define ACMP_CTL_HYSSEL_Msk
Definition: acmp_reg.h:345
#define ACMP_CTL_NEGSEL_Msk
Definition: acmp_reg.h:321
#define ACMP_CTL_ACMPEN_Msk
Definition: acmp_reg.h:312
__IO uint32_t CTL[2]
Definition: acmp_reg.h:300