Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
110
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

HAL ADC Generic Driver

UM1725

4 HAL ADC Generic Driver

4.1ADC Firmware driver registers structures

4.1.1ADC_InitTypeDef

Data Fields

uint32_t ClockPrescaler

uint32_t Resolution

uint32_t DataAlign

uint32_t ScanConvMode

uint32_t EOCSelection

uint32_t ContinuousConvMode

uint32_t DMAContinuousRequests

uint32_t NbrOfConversion

uint32_t DiscontinuousConvMode

uint32_t NbrOfDiscConversion

uint32_t ExternalTrigConv

uint32_t ExternalTrigConvEdge

Field Documentation

uint32_t ADC_InitTypeDef::ClockPrescaler

Select the frequency of the clock to the ADC. The clock is common for all the ADCs. This parameter can be a value of ADC_ClockPrescaler

uint32_t ADC_InitTypeDef::Resolution

Configures the ADC resolution dual mode. This parameter can be a value of

ADC_Resolution

uint32_t ADC_InitTypeDef::DataAlign

Specifies whether the ADC data alignment is left or right. This parameter can be a value of ADC_data_align

uint32_t ADC_InitTypeDef::ScanConvMode

Specifies whether the conversion is performed in Scan (multi channels) or Single (one channel) mode. This parameter can be set to ENABLE or DISABLE

uint32_t ADC_InitTypeDef::EOCSelection

Specifies whether the EOC flag is set at the end of single channel conversion or at the end of all conversions. This parameter can be a value of ADC_EOCSelection

uint32_t ADC_InitTypeDef::ContinuousConvMode

Specifies whether the conversion is performed in Continuous or Single mode. This parameter can be set to ENABLE or DISABLE.

uint32_t ADC_InitTypeDef::DMAContinuousRequests

Specifies whether the DMA requests is performed in Continuous or in Single mode. This parameter can be set to ENABLE or DISABLE.

uint32_t ADC_InitTypeDef::NbrOfConversion

Specifies the number of ADC conversions that will be done using the sequencer for regular channel group. This parameter must be a number between Min_Data = 1 and Max_Data = 16.

100/900

DOCID025834 Rev 2

UM1725

HAL ADC Generic Driver

 

uint32_t ADC_InitTypeDef::DiscontinuousConvMode

 

Specifies whether the conversion is performed in Discontinuous or not for regular

 

channels. This parameter can be set to ENABLE or DISABLE.

 

uint32_t ADC_InitTypeDef::NbrOfDiscConversion

 

Specifies the number of ADC discontinuous conversions that will be done using the

 

sequencer for regular channel group. This parameter must be a number between

 

Min_Data = 1 and Max_Data = 8.

 

uint32_t ADC_InitTypeDef::ExternalTrigConv

 

Selects the external event used to trigger the conversion start of regular group. If set

 

to ADC_SOFTWARE_START, external triggers are disabled. This parameter can be a

 

value of ADC_External_trigger_Source_Regular Note: This parameter can be

 

modified only if there is no conversion is ongoing.

 

uint32_t ADC_InitTypeDef::ExternalTrigConvEdge

 

Selects the external trigger edge of regular group. If trigger is set to

 

ADC_SOFTWARE_START, this parameter is discarded. This parameter can be a

 

value of ADC_External_trigger_edge_Regular Note: This parameter can be

 

modified only if there is no conversion is ongoing.

4.1.2ADC_HandleTypeDef

Data Fields

ADC_TypeDef * Instance

ADC_InitTypeDef Init

__IO uint32_t NbrOfCurrentConversionRank

DMA_HandleTypeDef * DMA_Handle

HAL_LockTypeDef Lock

__IO HAL_ADC_StateTypeDef State

__IO uint32_t ErrorCode

Field Documentation

ADC_TypeDef* ADC_HandleTypeDef::Instance

Register base address

ADC_InitTypeDef ADC_HandleTypeDef::Init

ADC required parameters

__IO uint32_t ADC_HandleTypeDef::NbrOfCurrentConversionRank

ADC number of current conversion rank

DMA_HandleTypeDef* ADC_HandleTypeDef::DMA_Handle

Pointer DMA Handler

HAL_LockTypeDef ADC_HandleTypeDef::Lock

ADC locking object

__IO HAL_ADC_StateTypeDef ADC_HandleTypeDef::State

ADC communication state

__IO uint32_t ADC_HandleTypeDef::ErrorCode

ADC Error code

4.1.3ADC_ChannelConfTypeDef

DOCID025834 Rev 2

101/900

HAL ADC Generic Driver

UM1725

Data Fields

 

uint32_t Channel

uint32_t Rank

uint32_t SamplingTime

uint32_t Offset

Field Documentation

uint32_t ADC_ChannelConfTypeDef::Channel

The ADC channel to configure. This parameter can be a value of ADC_channels

uint32_t ADC_ChannelConfTypeDef::Rank

The rank in the regular group sequencer. This parameter must be a number between Min_Data = 1 and Max_Data = 16

uint32_t ADC_ChannelConfTypeDef::SamplingTime

The sample time value to be set for the selected channel. This parameter can be a value of ADC_sampling_times

uint32_t ADC_ChannelConfTypeDef::Offset

Reserved for future use, can be set to 0

4.1.4ADC_AnalogWDGConfTypeDef

Data Fields

uint32_t WatchdogMode

uint32_t HighThreshold

uint32_t LowThreshold

uint32_t Channel

uint32_t ITMode

uint32_t WatchdogNumber

Field Documentation

uint32_t ADC_AnalogWDGConfTypeDef::WatchdogMode

Configures the ADC analog watchdog mode. This parameter can be a value of

ADC_analog_watchdog_selection

uint32_t ADC_AnalogWDGConfTypeDef::HighThreshold

Configures the ADC analog watchdog High threshold value. This parameter must be

a 12-bit value.

uint32_t ADC_AnalogWDGConfTypeDef::LowThreshold

Configures the ADC analog watchdog High threshold value. This parameter must be

a 12-bit value.

uint32_t ADC_AnalogWDGConfTypeDef::Channel

Configures ADC channel for the analog watchdog. This parameter has an effect only if watchdog mode is configured on single channel This parameter can be a value of

ADC_channels

uint32_t ADC_AnalogWDGConfTypeDef::ITMode

Specifies whether the analog watchdog is configured is interrupt mode or in polling mode. This parameter can be set to ENABLE or DISABLE

uint32_t ADC_AnalogWDGConfTypeDef::WatchdogNumber

Reserved for future use, can be set to 0

102/900

DOCID025834 Rev 2

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]