思澈科技软件开发工具包  2.20

Functions

HAL_StatusTypeDef HAL_ADC_ConfigChannel (ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *sConfig)
 Configures the the selected channel to be linked to the regular group. More...
 
uint32_t HAL_ADC_SetFreq (ADC_HandleTypeDef *hadc, uint32_t freq)
 Set ADC sampling frequency. More...
 

Detailed Description

Function Documentation

◆ HAL_ADC_ConfigChannel()

HAL_StatusTypeDef HAL_ADC_ConfigChannel ( ADC_HandleTypeDef hadc,
ADC_ChannelConfTypeDef sConfig 
)

Configures the the selected channel to be linked to the regular group.

Note
In case of usage of internal measurement channels: VrefInt/Vbat/TempSensor. Sampling time constraints must be respected (sampling time can be adjusted in function of ADC clock frequency and sampling time setting). Refer to device datasheet for timings values, parameters TS_vrefint, TS_vbat, TS_temp (values rough order: 5us to 17us). These internal paths can be be disabled using function HAL_ADC_DeInit().
Possibility to update parameters on the fly: This function initializes channel into regular group, following calls to this function can be used to reconfigure some parameters of structure "ADC_ChannelConfTypeDef" on the fly, without reseting the ADC. The setting of these parameters is conditioned to ADC state. For parameters constraints, see comments of structure "ADC_ChannelConfTypeDef".
Parameters
hadcADC handle
sConfigStructure of ADC channel for regular group.
Return values
HALstatus

◆ HAL_ADC_SetFreq()

uint32_t HAL_ADC_SetFreq ( ADC_HandleTypeDef hadc,
uint32_t  freq 
)

Set ADC sampling frequency.

Parameters
hadcADC handle.
freqfrequence want to be set.
Return values
actualwork frequency, 0 if fail.