NANO103 BSP V3.01.004
The Board Support Package for Nano103 Series
Macros | Functions
adc.h File Reference

NANO103 series ADC 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 ADC_CH_0_MASK   (1UL << 0)
 
#define ADC_CH_1_MASK   (1UL << 1)
 
#define ADC_CH_2_MASK   (1UL << 2)
 
#define ADC_CH_3_MASK   (1UL << 3)
 
#define ADC_CH_4_MASK   (1UL << 4)
 
#define ADC_CH_5_MASK   (1UL << 5)
 
#define ADC_CH_6_MASK   (1UL << 6)
 
#define ADC_CH_7_MASK   (1UL << 7)
 
#define ADC_CH_12_MASK   (1UL << 12)
 
#define ADC_CH_13_MASK   (1UL << 13)
 
#define ADC_CH_14_MASK   (1UL << 14)
 
#define ADC_CH_15_MASK   (1UL << 15)
 
#define ADC_CH_16_MASK   (1UL << 16)
 
#define ADC_CH_17_MASK   (1UL << 17)
 
#define ADC_ADCHER_CHEN_Msk   (0x3FFFF)
 
#define ADC_PDMADATA_AD_PDMA_Msk   (0xFFF)
 
#define ADC_CMP_LESS_THAN   (0UL)
 
#define ADC_CMP_GREATER_OR_EQUAL_TO   (ADC_CMP0_CMPCOND_Msk)
 
#define ADC_TRIGGER_BY_EXT_PIN   (0UL)
 
#define ADC_TRIGGER_BY_PWM   (ADC_CTL_HWTRGSEL_Msk)
 
#define ADC_LOW_LEVEL_TRIGGER   (0UL << ADC_CTL_HWTRGCOND_Pos)
 
#define ADC_HIGH_LEVEL_TRIGGER   (1UL << ADC_CTL_HWTRGCOND_Pos)
 
#define ADC_FALLING_EDGE_TRIGGER   (2UL << ADC_CTL_HWTRGCOND_Pos)
 
#define ADC_RISING_EDGE_TRIGGER   (3UL << ADC_CTL_HWTRGCOND_Pos)
 
#define ADC_ADF_INT   (ADC_STATUS_ADIF_Msk)
 
#define ADC_CMP0_INT   (ADC_STATUS_ADCMPF0_Msk)
 
#define ADC_CMP1_INT   (ADC_STATUS_ADCMPF1_Msk)
 
#define ADC_INPUT_MODE_SINGLE_END   (0UL << ADC_CTL_DIFF_Pos)
 
#define ADC_INPUT_MODE_DIFFERENTIAL   (1UL << ADC_CTL_DIFF_Pos)
 
#define ADC_OPERATION_MODE_SINGLE   (0UL << ADC_CTL_ADMD_Pos)
 
#define ADC_OPERATION_MODE_SINGLE_CYCLE   (2UL << ADC_CTL_ADMD_Pos)
 
#define ADC_OPERATION_MODE_CONTINUOUS   (3UL << ADC_CTL_ADMD_Pos)
 
#define ADC_RESSEL_6_BIT   (0UL << ADC_CTL_RESSEL_Pos)
 
#define ADC_RESSEL_8_BIT   (1UL << ADC_CTL_RESSEL_Pos)
 
#define ADC_RESSEL_10_BIT   (2UL << ADC_CTL_RESSEL_Pos)
 
#define ADC_RESSEL_12_BIT   (3UL << ADC_CTL_RESSEL_Pos)
 
#define ADC_REFSEL_POWER   (0UL << ADC_CTL_REFSEL_Pos)
 
#define ADC_REFSEL_INT_VREF   (1UL << ADC_CTL_REFSEL_Pos)
 
#define ADC_REFSEL_VREF   (2UL << ADC_CTL_REFSEL_Pos)
 
#define ADC_GET_CONVERSION_DATA(adc, u32ChNum)
 Get the latest ADC conversion data. More...
 
#define ADC_GET_INT_FLAG(adc, u32Mask)
 Return the user-specified interrupt flags. More...
 
#define ADC_CLR_INT_FLAG(adc, u32Mask)
 This macro clear the selected interrupt status bits. More...
 
#define ADC_IS_BUSY(adc)
 Get the busy state of ADC. More...
 
#define ADC_IS_DATA_OVERRUN(adc, u32ChNum)
 Check if the ADC conversion data is over written or not. More...
 
#define ADC_IS_DATA_VALID(adc, u32ChNum)
 Check if the ADC conversion data is valid or not. More...
 
#define ADC_POWER_DOWN(adc)
 Power down ADC module. More...
 
#define ADC_POWER_ON(adc)
 Power on ADC module. More...
 
#define ADC_ENABLE_CMP0(adc, u32ChNum, u32Condition, u32Data, u32MatchCount)
 Configure the comparator 0 and enable it. More...
 
#define ADC_DISABLE_CMP0(adc)
 Disable comparator 0. More...
 
#define ADC_ENABLE_CMP1(adc, u32ChNum, u32Condition, u32Data, u32MatchCount)
 Configure the comparator 1 and enable it. More...
 
#define ADC_DISABLE_CMP1(adc)
 Disable comparator 1. More...
 
#define ADC_SET_INPUT_CHANNEL(adc, u32Mask)
 Set ADC input channel. Enabled channel will be converted while ADC starts. More...
 
#define ADC_START_CONV(adc)
 Start the A/D conversion. More...
 
#define ADC_STOP_CONV(adc)
 Stop the A/D conversion. More...
 
#define ADC_SET_RESOLUTION(adc, u32Resolution)
 Set the resolution of conversion result. More...
 
#define ADC_SET_REF_VOLTAGE(adc, u32Ref)
 Set the reference voltage selection. More...
 
#define ADC_SET_POWERDOWN_MODE(adc, u32Mode, u32CalEn)
 Set power down mode. More...
 
#define ADC_ENABLE_PDMA(adc)
 Enable PDMA transfer. More...
 
#define ADC_DISABLE_PDMA(adc)
 Disable PDMA transfer. More...
 
#define ADC_GET_PDMA_DATA(adc)
 Get PDMA current transfer data. More...
 

Functions

void ADC_Open (ADC_T *adc, uint32_t u32InputMode, uint32_t u32OpMode, uint32_t u32ChMask)
 This API configures ADC module to be ready for convert the input from selected channel. More...
 
void ADC_Close (ADC_T *adc)
 Disable ADC module. More...
 
void ADC_EnableHWTrigger (ADC_T *adc, uint32_t u32Source, uint32_t u32Param)
 Configure the hardware trigger condition and enable hardware trigger. More...
 
void ADC_DisableHWTrigger (ADC_T *adc)
 Disable hardware trigger ADC function. More...
 
void ADC_EnableTimerTrigger (ADC_T *adc, uint32_t u32Source, uint32_t u32PDMACnt)
 Config and enable timer trigger. More...
 
void ADC_DisableTimerTrigger (ADC_T *adc)
 Disable timer trigger ADC function. More...
 
void ADC_SetExtraSampleTime (ADC_T *adc, uint32_t u32ChNum, uint32_t u32SampleTime)
 Configure the hardware trigger condition and enable hardware trigger. More...
 
void ADC_EnableInt (ADC_T *adc, uint32_t u32Mask)
 Enable the interrupt(s) selected by u32Mask parameter. More...
 
void ADC_DisableInt (ADC_T *adc, uint32_t u32Mask)
 Disable the interrupt(s) selected by u32Mask parameter. More...
 

Detailed Description

NANO103 series ADC driver header file.

Version
V1.00
Revision
3
Date
16/01/04 9:46a
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved.

Definition in file adc.h.