NANO102/112 BSP V3.03.003
The Board Support Package for Nano102/112 Series
Macros | Functions
acmp.h File Reference

Nano102/112 series Analog Comparator(ACMP) driver header file. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACMP_CR_CN_PIN   (0<<24)
 The comparator reference pin CPN0/1 is selected. More...
 
#define ACMP_CR_CN_CRV   (1<<24)
 The internal comparator reference voltage (CRV) is selected. More...
 
#define ACMP_CR_CN_VREFI   (2<<24)
 The internal reference voltage (VREFI) is selected. More...
 
#define ACMP_CR_CN_AGND   (3<<24)
 The AGND is selected *‍/. More...
 
#define ACMP_CR_ACMP_HYSTERSIS_ENABLE   ACMP_CR_ACMP_HYSEN_Msk
 ACMP hysteresis enable. More...
 
#define ACMP_CR_ACMP_HYSTERSIS_DISABLE   0
 ACMP hysteresis disable. More...
 
#define ACMP_CR_CPP0SEL_PA1   (3UL<<ACMP_CR_CPP0SEL_Pos)
 The comparator positive input select PA1. More...
 
#define ACMP_CR_CPP0SEL_PA2   (2UL<<ACMP_CR_CPP0SEL_Pos)
 The comparator positive input select PA2. More...
 
#define ACMP_CR_CPP0SEL_PA3   (1UL<<ACMP_CR_CPP0SEL_Pos)
 The comparator positive input select PA3. More...
 
#define ACMP_CR_CPP0SEL_PA4   (0UL<<ACMP_CR_CPP0SEL_Pos)
 The comparator positive input select PA4. More...
 
#define ACMP_MODCR0_TMR_TRI_LV_RISING   (0UL<<ACMP_MODCR0_TMR_TRI_LV_Pos)
 The comparator output low to high to enable timer. More...
 
#define ACMP_MODCR0_TMR_TRI_LV_FALLING   (1UL<<ACMP_MODCR0_TMR_TRI_LV_Pos)
 The comparator output high to low to enable timer. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PA1   (0UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PA1. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PA2   (1UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PA2. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PA3   (2UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PA3. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PA4   (3UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PA4. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PA5   (4UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PA5. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PA6   (5UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PA6. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PA14   (6UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PA14. More...
 
#define ACMP_MODCR0_CH_DIS_PINSEL_PF5   (7UL<<ACMP_MODCR0_CH_DIS_PIN_SEL_Pos)
 The charge/discharge pin select PF5. More...
 
#define ACMP_MODCR0_MOD_SEL_NORMAL   (0UL<<ACMP_MODCR0_MOD_SEL_Pos)
 The comparator mode select normal mode. More...
 
#define ACMP_MODCR0_MOD_SEL_SIGAMA_DELTA   (1UL<<ACMP_MODCR0_MOD_SEL_Pos)
 The comparator mode select sigma-delta mode. More...
 
#define ACMP_MODCR0_MOD_SEL_SLOPE   (2UL<<ACMP_MODCR0_MOD_SEL_Pos)
 The comparator mode select slope mode. More...
 
#define ACMP_TIMER01   (0UL<<ACMP_MODCR0_TMR_SEL_Pos)
 ACMP use timer0 and timer1. More...
 
#define ACMP_TIMER23   (1UL<<ACMP_MODCR0_TMR_SEL_Pos)
 ACMP use timer2 and timer3. More...
 
#define ACMP_SET_NEG_SRC(acmp, u32ChNum, u32Src)
 This macro is used to enable output inverse. More...
 
#define ACMP_ENABLE_HYSTERESIS(acmp, u32ChNum)
 This macro is used to enable hysteresis. More...
 
#define ACMP_DISABLE_HYSTERESIS(acmp, u32ChNum)
 This macro is used to disable hysteresis. 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_ENABLE_WAKEUP(acmp, u32ChNum)
 This macro is used to enable ACMP wake-up. More...
 
#define ACMP_DISABLE_WAKEUP(acmp, u32ChNum)
 This macro is used to disable ACMP wake-up. More...
 
#define ACMP_CRV_SEL(u32Level)
 This macro is used to enable ACMP wake-up. 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_SELECT_P(acmp, u32ChNum, u32Src)   ((acmp)->CR[(u32ChNum)%2] = ((acmp)->CR[(u32ChNum)%2] & ~ACMP_CR_CPP0SEL_Msk) | (u32Src))
 This macro is used to select ACMP positive input source for ACMP0. More...
 
#define ACMP_START_CONV(acmp)
 This macro is used to start ACMP on sigma-delta mode or slope mode. More...
 

Functions

void ACMP_Open (ACMP_T *Acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysteresisEn)
 This function open and configure comparator parameters. More...
 
void ACMP_Close (ACMP_T *Acmp, uint32_t u32ChNum)
 This function close comparator. More...
 
void ACMP_SetSigmaDeltaConv (uint32_t u32TimerNum, uint32_t u32TriggerPolarity, uint32_t u32PosPin, uint32_t u32ChargePin)
 This function configure ACMP to sigma-delta mode. More...
 
void ACMP_SetSlopeConv (uint32_t u32TimerNum, uint32_t u32TriggerPolarity, uint32_t u32PosPin, uint32_t u32ChargePin)
 This function configure ACMP to slope mode. More...
 

Detailed Description

Nano102/112 series Analog Comparator(ACMP) driver header file.

Version
V1.00
Revision
18
Date
15/06/16 11:09a
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2013~2014 Nuvoton Technology Corp. All rights reserved.

Definition in file acmp.h.