5#define _ADC_Source_Clock 12000000
11 uint32_t ADC_Source_Clock_DIV;
21 if(ADC_Source_Clock_DIV>256)
24 ADC_Source_Clock_DIV = 256;
26 printf(
"\nADC Clock Initial Fail!\n");
50 SYS->PA_L_MFP &= ~SYS_PA_L_MFP_PA0_MFP_Msk;
66 uint32_t ADC_Raw_Data;
Nano100 series peripheral access layer header file. This file contains all the peripheral register's ...
#define _ADC_Source_Clock
#define ADC_OPERATION_MODE_SINGLE_CYCLE
#define ADC_INPUT_MODE_SINGLE_END
#define ADC_RESSEL_12_BIT
#define ADC_GET_CONVERSION_DATA(adc, u32ChNum)
Get the latest ADC conversion data.
#define ADC_CLR_INT_FLAG(adc, u32Mask)
This macro clear the selected interrupt status bits.
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.
#define ADC_GET_INT_FLAG(adc, u32Mask)
Return the user-specified interrupt flags.
#define ADC_POWER_ON(adc)
Power on ADC module.
#define ADC_SET_REF_VOLTAGE(adc, u32Ref)
Set the reference voltage selection.
#define ADC_SET_RESOLUTION(adc, u32Resolution)
Set the resolution of conversion result.
#define ADC_IS_BUSY(adc)
Get the busy state of ADC.
#define ADC_START_CONV(adc)
Start the A/D conversion.
#define CLK_ADC_CLK_DIVIDER(x)
#define CLK_CLKSEL1_ADC_S_HXT
void CLK_EnableModuleClock(uint32_t u32ModuleIdx)
This function enable module clock.
void CLK_DisableModuleClock(uint32_t u32ModuleIdx)
This function disable module clock.
void CLK_SetModuleClock(uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv)
This function set selected module clock source and module clock divider.
#define GPIO_DISABLE_DIGITAL_PATH(gpio, u32PinMask)
Disable I/O Digital Input Path.
#define GPIO_ENABLE_DIGITAL_PATH(gpio, u32PinMask)
Enable I/O Digital Input Path.
#define ADC
Pointer to ADC register structure.
#define PA
Pointer to GPIO port A register structure.
#define SYS
Pointer to SYS register structure.
#define SYS_PA_L_MFP_PA0_MFP_ADC_CH0
__STATIC_INLINE void SYS_LockReg(void)
Enable register write-protection function.
void SYS_ResetModule(uint32_t u32ModuleIndex)
This function reset selected modules.
__STATIC_INLINE void SYS_UnlockReg(void)
Disable register write-protection function.
#define TRUE
Boolean true, define to use in API parameters or return value.
#define FALSE
Boolean false, define to use in API parameters or return value.
#define BIT0
Bit 0 mask of an 32 bit integer.
uint32_t Open_Volume_Knob_Fail
void Close_Volume_Knob(void)
void Open_Volume_Knob(void)
uint32_t Get_Volume_Knob(void)