70 ADCx->CR = ( 1 << ADC_CR_ADCEN_Pos );
73 | ( 1 << ADC_CR_ADCEN_Pos )
74 | ( ( ( ADC_Config->
TrgSel ) & 7 ) << ADC_CR_TRIG_Pos )
75 | ( ( ( ADC_Config->
RefSel ) & 1 ) << ADC_CR_REFSEL_Pos )
76 | ( 1 << ADC_CR_ADCIFLAG_Pos )
80 ADCx->PREDR = ( ADC_Config->
InClkDiv & ADC_PREDR_PRED_Msk );
127 tempreg &= ~( 1 << ADC_CR_ADCIEN_Pos );
131 tempreg |= ( 1 << ADC_CR_ADCIEN_Pos );
158 temp_reg = ADCx->CR & ( uint32_t )( ~ADC_CR_ADSEL_Msk );
159 temp_reg |= ( uint32_t )( Channel & ADC_CR_ADSEL_Msk );
180 ADCx->CR |= ( 1 << ADC_CR_ADST_Pos );
202 ADCx->CR &= ~( 1 << ADC_CR_ADST_Pos );
225 tempreg |= ( 1 << ADC_CR_ADCIFLAG_Pos );
244 tempreg &= ( 1 << ADC_CR_ADCIFLAG_Pos );
260 adc_value = ADCx->DR;
262 return ADC_DR_RESULT( adc_value );
void HAL_SCU_Peripheral_EnableClock2(uint32_t u32PeriClk2, uint32_t u32Ind)
Set Each Peripheral Clock.
HAL_Status_Type HAL_ADC_Init(ADC_Type *ADCx, ADC_CFG_Type *ADC_Config)
Initialize the ADC peripheral with the specified parameters.
uint16_t HAL_ADC_GetData(ADC_Type *ADCx)
Get Result conversion from A/D data register.
HAL_Status_Type HAL_ADC_ConfigInterrupt(ADC_Type *ADCx, FunctionalState NewState)
ADC interrupt configuration.
HAL_Status_Type HAL_ADC_ChannelSel(ADC_Type *ADCx, uint32_t Channel)
Select ADC Channel Number.
HAL_Status_Type HAL_ADC_Stop(ADC_Type *ADCx)
Stop A/D conversion If this function called after a conversion cycle starts, the current conversion i...
uint32_t HAL_ADC_GetStatus(ADC_Type *ADCx)
Get ADC channel status.
Contains all macro definitions and function prototypes support for adc firmware library on A31G11x.
HAL_Status_Type HAL_ADC_Start(ADC_Type *ADCx)
Start A/D conversion.
HAL_Status_Type HAL_ADC_DeInit(ADC_Type *ADCx)
Close ADC.
HAL_Status_Type HAL_ADC_ClearStatus(ADC_Type *ADCx)
Clear ADC channel status.
Contains all macro definitions and function prototypes support for scu firmware library on A31G11x.