71 | ( ( ( ADC_Config->
TrgSel ) & 7 ) << ADC_CR_TRIG_Pos )
72 | ( ( ( ADC_Config->
ExtTrgPolSel ) & 3 ) << ADC_CR_ETRGP_Pos )
73 | ( ( ( ADC_Config->
ConvModSel ) & 3 ) << ADC_CR_MDSEL_Pos )
77 ADCx->PREDR = ( ADC_Config->
InClkDiv & ADC_PREDR_PRED_Msk );
79 ADCx->SAMR = ( ADC_Config->
SamplingClk & ADC_SAMR_SAMCK_Msk );
132 tempreg = ADC_IESR_EOSIEN_Msk;
135 tempreg = ADC_IESR_EOCIEN_Msk;
138 tempreg = ADC_IESR_OVRUNIEN_Msk;
141 tempreg = ADC_IESR_STBIEN_Msk;
150 ADCx->IESR = ( ( ADCx->IESR & ADC_INT_STATUS_MSK ) | tempreg );
154 ADCx->IESR = ( ( ADCx->IESR & ADC_INT_STATUS_MSK ) & ( ~tempreg ) );
183 if( DataShiftRight > ADC_OVSCR_OVSHT_ShiftRight8Bit )
185 DataShiftRight = ADC_OVSCR_OVSHT_NoShift;
188 | ( ( ( OvSampRatio ) & 7 ) << ADC_OVSCR_OVSMPR_Pos )
189 | ( ( DataShiftRight ) << ADC_OVSCR_OVSHT_Pos )
191 ADCx->OVSCR = tempreg;
215 ADCx->CHSELR = Channels;
256 while( !ADCInt_GetStbFg() ) {}
282 switch( ADCInt_status )
285 tempreg = ADC_IESR_EOSIFLAG_Msk;
288 tempreg = ADC_IESR_EOCIFLAG_Msk;
291 tempreg = ADC_IESR_OVRUNIFLAG_Msk;
294 tempreg = ADC_IESR_STBIFLAG_Msk;
297 tempreg = ADC_IESR_EOSIFLAG_Msk | ADC_IESR_EOCIFLAG_Msk | ADC_IESR_OVRUNIFLAG_Msk | ADC_IESR_STBIFLAG_Msk;
303 ADCx->IESR = ( ADCx->IESR & ADC_INT_STATUS_MSK ) | tempreg;
317 return ( uint8_t )( ( ADCx->IESR ) & ( ~ADC_INT_STATUS_MSK ) );
331 adc_value = ADCx->DR;
332 return ADC_DR_RESULT( adc_value );
HAL_Status_Type HAL_ADC_Init(ADC_Type *ADCx, ADC_CFG_Type *ADC_Config)
Initialize the ADC peripheral with the specified parameters.
uint8_t HAL_ADC_GetStatus(ADC_Type *ADCx)
Get ADC interrupt status.
void HAL_SCU_Peripheral_EnableClock2(uint32_t u32PeriClk2, uint32_t u32Ind)
Set Each Peripheral Clock.
uint16_t HAL_ADC_GetData(ADC_Type *ADCx)
Get Result conversion from A/D data register.
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_ChannelSel(ADC_Type *ADCx, uint32_t Channels)
Select ADC Channels to conversion (Ex: ADC_AN0 | ADC_AN5 | ADC_AN14 | ADC_AVDD)
HAL_Status_Type HAL_ADC_ConfigInterrupt(ADC_Type *ADCx, ADC_INT_Type ADCIntCfg, FunctionalState NewState)
ADC interrupt configuration.
HAL_Status_Type HAL_ADC_ClearStatus(ADC_Type *ADCx, ADC_INT_STATUS_Type ADCInt_status)
Clear ADC interrupt status.
HAL_Status_Type HAL_ADC_OvSamplingConfig(ADC_Type *ADCx, ADC_OV_SAMPLING_RATIO OvSampRatio, ADC_OVSCR_OVSHT_Enum DataShiftRight)
ADC oversampling configuration.
HAL_Status_Type HAL_ADC_RdyCmd(ADC_Type *ADCx)
Ready procedure for ADC conversion.
Contains all macro definitions and function prototypes support for adc firmware library on A31L12x.
Contains all macro definitions and function prototypes support for scu firmware library on A31L12x.