TUKS MCU Introductory course / TUKS-COURSE-THERMOMETER

Fork of TUKS-COURSE-TIMER by TUKS MCU Introductory course

Embed: (wiki syntax)

« Back to documentation index

Initialization and de-initialization functions

Initialization and de-initialization functions
[ADC Exported Functions]

Initialization and Configuration functions. More...

Functions

HAL_StatusTypeDef HAL_ADC_Init (ADC_HandleTypeDef *hadc)
 Initialize the ADC peripheral and regular group according to parameters specified in structure "ADC_InitTypeDef".
HAL_StatusTypeDef HAL_ADC_DeInit (ADC_HandleTypeDef *hadc)
 Deinitialize the ADC peripheral registers to their default reset values, with deinitialization of the ADC MSP.
__weak void HAL_ADC_MspInit (ADC_HandleTypeDef *hadc)
 Initialize the ADC MSP.
__weak void HAL_ADC_MspDeInit (ADC_HandleTypeDef *hadc)
 DeInitialize the ADC MSP.

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Initialize and configure the ADC. 
      (+) De-initialize the ADC. 
         

Function Documentation

HAL_StatusTypeDef HAL_ADC_DeInit ( ADC_HandleTypeDef *  hadc )

Deinitialize the ADC peripheral registers to their default reset values, with deinitialization of the ADC MSP.

Note:
Keep in mind that all ADCs use the same clock: disabling the clock will reset all ADCs.
By default, HAL_ADC_DeInit() sets DEEPPWD: this saves more power by reducing the leakage currents and is particularly interesting before entering STOP 1 or STOP 2 modes.
Parameters:
hadc,:ADC handle
Return values:
HALstatus

Definition at line 563 of file stm32l4xx_hal_adc.c.

HAL_StatusTypeDef HAL_ADC_Init ( ADC_HandleTypeDef *  hadc )

Initialize the ADC peripheral and regular group according to parameters specified in structure "ADC_InitTypeDef".

Note:
As prerequisite, ADC clock must be configured at RCC top level depending on possible clock sources: System/PLLSAI1/PLLSAI2 clocks or AHB clock.
Possibility to update parameters on the fly: this function initializes the ADC MSP (HAL_ADC_MspInit()) only when coming from ADC state reset. Following calls to this function can be used to reconfigure some parameters of ADC_InitTypeDef structure on the fly, without modifying MSP configuration. If ADC MSP has to be modified again, HAL_ADC_DeInit() must be called before HAL_ADC_Init(). The setting of these parameters is conditioned by ADC state. For parameters constraints, see comments of structure "ADC_InitTypeDef".
This function configures the ADC within 2 scopes: scope of entire ADC and scope of regular group. For parameters details, see comments of structure "ADC_InitTypeDef".
Parameters related to common ADC registers (ADC clock mode) are set only if all ADCs are disabled. If this is not the case, these common parameters setting are bypassed without error reporting: it can be the intended behaviour in case of update of a parameter of ADC_InitTypeDef on the fly, without disabling the other ADCs.
Parameters:
hadc,:ADC handle
Return values:
HALstatus

Definition at line 275 of file stm32l4xx_hal_adc.c.

__weak void HAL_ADC_MspDeInit ( ADC_HandleTypeDef *  hadc )

DeInitialize the ADC MSP.

Parameters:
hadc,:ADC handle
Note:
All ADCs use the same clock: disabling the clock will reset all ADCs.
Return values:
None

Definition at line 764 of file stm32l4xx_hal_adc.c.

__weak void HAL_ADC_MspInit ( ADC_HandleTypeDef *  hadc )

Initialize the ADC MSP.

Parameters:
hadc,:ADC handle
Return values:
None

Definition at line 748 of file stm32l4xx_hal_adc.c.