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

UM1725

 

HAL ADC Generic Driver

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

HAL status

Notes

 

This function is used to configure the global features of the

 

 

ADC ( ClockPrescaler, Resolution, Data Alignment and

 

 

number of conversion), however, the rest of the configuration

 

 

parameters are specific to the regular channels group (scan

 

 

mode activation, continuous mode activation, External trigger

 

 

source and edge, DMA continuous request after the last

 

 

transfer and End of conversion selection).

4.2.8HAL_ADC_DeInit

Function Name

HAL_StatusTypeDef HAL_ADC_DeInit (ADC_HandleTypeDef *

 

hadc)

Function Description

Deinitializes the ADCx peripheral registers to their default reset

 

values.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

HAL status

4.2.9HAL_ADC_MspInit

Function Name

void HAL_ADC_MspInit (ADC_HandleTypeDef * hadc)

Function Description

Initializes the ADC MSP.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

None

4.2.10HAL_ADC_MspDeInit

Function Name

void HAL_ADC_MspDeInit (ADC_HandleTypeDef * hadc)

Function Description

DeInitializes the ADC MSP.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

None

4.2.11HAL_ADC_Start

Function Name

HAL_StatusTypeDef HAL_ADC_Start (ADC_HandleTypeDef *

 

hadc)

Function Description

Enables ADC and starts conversion of the regular channels.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

HAL status

4.2.12HAL_ADC_Stop

DOCID025834 Rev 2

107/900

HAL ADC Generic Driver

 

UM1725

Function Name

HAL_StatusTypeDef HAL_ADC_Stop (ADC_HandleTypeDef *

 

hadc)

Function Description

Disables ADC and stop conversion of regular channels.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

HAL status.

Notes

Caution: This function will stop also injected channels.

4.2.13HAL_ADC_PollForConversion

Function Name

HAL_StatusTypeDef HAL_ADC_PollForConversion

 

(ADC_HandleTypeDef * hadc, uint32_t Timeout)

Function Description

Poll for regular conversion complete.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

 

 

Timeout: Timeout value in millisecond.

Return values

 

HAL status

Notes

 

ADC conversion flags EOS (end of sequence) and EOC (end

 

 

of conversion) are cleared by this function.

This function cannot be used in a particular setup: ADC configured in DMA mode and polling for end of each conversion (ADC init parameter "EOCSelection" set to ADC_EOC_SINGLE_CONV). In this case, DMA resets the flag EOC and polling cannot be performed on each conversion. Nevertheless, polling can still be performed on the complete sequence.

4.2.14HAL_ADC_PollForEvent

Function Name

HAL_StatusTypeDef HAL_ADC_PollForEvent

 

(ADC_HandleTypeDef * hadc, uint32_t EventType, uint32_t

 

Timeout)

Function Description

Poll for conversion event.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

 

EventType: the ADC event type. This parameter can be one

 

 

of the following values: ADC_AWD_EVENT: ADC Analog

 

 

watch Dog event.ADC_OVR_EVENT: ADC Overrun event.

 

Timeout: Timeout value in millisecond.

Return values

 

HAL status

4.2.15HAL_ADC_Start_IT

Function Name

HAL_StatusTypeDef HAL_ADC_Start_IT (ADC_HandleTypeDef

 

* hadc)

Function Description

Enables the interrupt and starts ADC conversion of regular

 

channels.

108/900

DOCID025834 Rev 2

UM1725

 

HAL ADC Generic Driver

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

HAL status.

4.2.16HAL_ADC_Stop_IT

Function Name

HAL_StatusTypeDef HAL_ADC_Stop_IT (ADC_HandleTypeDef

 

* hadc)

Function Description

Disables the interrupt and stop ADC conversion of regular

 

channels.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

HAL status.

Notes

 

Caution: This function will stop also injected channels.

4.2.17HAL_ADC_IRQHandler

Function Name

void HAL_ADC_IRQHandler (ADC_HandleTypeDef * hadc)

Function Description

Handles ADC interrupt request.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

None

4.2.18HAL_ADC_Start_DMA

Function Name

HAL_StatusTypeDef HAL_ADC_Start_DMA

 

(ADC_HandleTypeDef * hadc, uint32_t * pData, uint32_t

 

Length)

Function Description

Enables ADC DMA request after last transfer (Single-ADC mode)

 

and enables ADC peripheral.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

 

pData: The destination Buffer address.

 

Length: The length of data to be transferred from ADC

 

 

peripheral to memory.

Return values

 

HAL status

4.2.19HAL_ADC_Stop_DMA

Function Name

HAL_StatusTypeDef HAL_ADC_Stop_DMA

 

 

(ADC_HandleTypeDef * hadc)

 

Function Description

Disables ADC DMA (Single-ADC mode) and disables ADC

 

 

peripheral.

 

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

HAL status

 

 

 

DOCID025834 Rev 2

109/900

HAL ADC Generic Driver

UM1725

4.2.20HAL_ADC_GetValue

Function Name

uint32_t HAL_ADC_GetValue (ADC_HandleTypeDef * hadc)

Function Description

Gets the converted value from data register of regular channel.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

Converted value

4.2.21HAL_ADC_ConvCpltCallback

Function Name

void HAL_ADC_ConvCpltCallback (ADC_HandleTypeDef *

 

hadc)

Function Description

Regular conversion complete callback in non blocking mode.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

None

4.2.22HAL_ADC_ConvHalfCpltCallback

Function Name

void HAL_ADC_ConvHalfCpltCallback (ADC_HandleTypeDef *

 

hadc)

Function Description

Regular conversion half DMA transfer callback in non blocking

 

mode.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

None

4.2.23HAL_ADC_LevelOutOfWindowCallback

Function Name

void HAL_ADC_LevelOutOfWindowCallback

 

(ADC_HandleTypeDef * hadc)

Function Description

Analog watchdog callback in non blocking mode.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

None

4.2.24HAL_ADC_ErrorCallback

Function Name

void HAL_ADC_ErrorCallback (ADC_HandleTypeDef * hadc)

Function Description

Error ADC callback.

Parameters

 

hadc: pointer to a ADC_HandleTypeDef structure that

 

 

contains the configuration information for the specified ADC.

Return values

 

None

4.2.25HAL_ADC_ConfigChannel

110/900

DOCID025834 Rev 2

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