STM32L4xx_HAL_Driver  1.14.0
Configuration of ADC hierarchical scope: multimode

Functions

__STATIC_INLINE void LL_ADC_SetMultimode (ADC_Common_TypeDef *ADCxy_COMMON, uint32_t Multimode)
 Set ADC multimode configuration to operate in independent mode or multimode (for devices with several ADC instances). More...
 
__STATIC_INLINE uint32_t LL_ADC_GetMultimode (ADC_Common_TypeDef *ADCxy_COMMON)
 Get ADC multimode configuration to operate in independent mode or multimode (for devices with several ADC instances). More...
 
__STATIC_INLINE void LL_ADC_SetMultiDMATransfer (ADC_Common_TypeDef *ADCxy_COMMON, uint32_t MultiDMATransfer)
 Set ADC multimode conversion data transfer: no transfer or transfer by DMA. More...
 
__STATIC_INLINE uint32_t LL_ADC_GetMultiDMATransfer (ADC_Common_TypeDef *ADCxy_COMMON)
 Get ADC multimode conversion data transfer: no transfer or transfer by DMA. More...
 
__STATIC_INLINE void LL_ADC_SetMultiTwoSamplingDelay (ADC_Common_TypeDef *ADCxy_COMMON, uint32_t MultiTwoSamplingDelay)
 Set ADC multimode delay between 2 sampling phases. More...
 
__STATIC_INLINE uint32_t LL_ADC_GetMultiTwoSamplingDelay (ADC_Common_TypeDef *ADCxy_COMMON)
 Get ADC multimode delay between 2 sampling phases. CCR DELAY LL_ADC_GetMultiTwoSamplingDelay. More...
 

Detailed Description

Function Documentation

◆ LL_ADC_GetMultiDMATransfer()

__STATIC_INLINE uint32_t LL_ADC_GetMultiDMATransfer ( ADC_Common_TypeDef *  ADCxy_COMMON)

Get ADC multimode conversion data transfer: no transfer or transfer by DMA.

Note
If ADC multimode transfer by DMA is not selected: each ADC uses its own DMA channel, with its individual DMA transfer settings. If ADC multimode transfer by DMA is selected: One DMA channel is used for both ADC (DMA of ADC master) Specifies the DMA requests mode:
  • Limited mode (One shot mode): DMA transfer requests are stopped when number of DMA data transfers (number of ADC conversions) is reached. This ADC mode is intended to be used with DMA mode non-circular.
  • Unlimited mode: DMA transfer requests are unlimited, whatever number of DMA data transfers (number of ADC conversions). This ADC mode is intended to be used with DMA mode circular.
If ADC DMA requests mode is set to unlimited and DMA is set to mode non-circular: when DMA transfers size will be reached, DMA will stop transfers of ADC conversions data ADC will raise an overrun error (overrun flag and interruption if enabled).
How to retrieve multimode conversion data: Whatever multimode transfer by DMA setting: using function LL_ADC_REG_ReadMultiConversionData32(). If ADC multimode transfer by DMA is selected: conversion data is a raw data with ADC master and slave concatenated. A macro is available to get the conversion data of ADC master or ADC slave: see helper macro __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE(). CCR MDMA LL_ADC_GetMultiDMATransfer
CCR DMACFG LL_ADC_GetMultiDMATransfer
Parameters
ADCxy_COMMONADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() )
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_MULTI_REG_DMA_EACH_ADC
  • LL_ADC_MULTI_REG_DMA_LIMIT_RES12_10B
  • LL_ADC_MULTI_REG_DMA_LIMIT_RES8_6B
  • LL_ADC_MULTI_REG_DMA_UNLMT_RES12_10B
  • LL_ADC_MULTI_REG_DMA_UNLMT_RES8_6B

Definition at line 5714 of file stm32l4xx_ll_adc.h.

5715 {
5716  return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_MDMA | ADC_CCR_DMACFG));
5717 }

◆ LL_ADC_GetMultimode()

__STATIC_INLINE uint32_t LL_ADC_GetMultimode ( ADC_Common_TypeDef *  ADCxy_COMMON)

Get ADC multimode configuration to operate in independent mode or multimode (for devices with several ADC instances).

Note
If multimode configuration: the selected ADC instance is either master or slave depending on hardware. Refer to reference manual. CCR DUAL LL_ADC_GetMultimode
Parameters
ADCxy_COMMONADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() )
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_MULTI_INDEPENDENT
  • LL_ADC_MULTI_DUAL_REG_SIMULT
  • LL_ADC_MULTI_DUAL_REG_INTERL
  • LL_ADC_MULTI_DUAL_INJ_SIMULT
  • LL_ADC_MULTI_DUAL_INJ_ALTERN
  • LL_ADC_MULTI_DUAL_REG_SIM_INJ_SIM
  • LL_ADC_MULTI_DUAL_REG_SIM_INJ_ALT
  • LL_ADC_MULTI_DUAL_REG_INT_INJ_SIM

Definition at line 5617 of file stm32l4xx_ll_adc.h.

5618 {
5619  return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_DUAL));
5620 }

◆ LL_ADC_GetMultiTwoSamplingDelay()

__STATIC_INLINE uint32_t LL_ADC_GetMultiTwoSamplingDelay ( ADC_Common_TypeDef *  ADCxy_COMMON)

Get ADC multimode delay between 2 sampling phases. CCR DELAY LL_ADC_GetMultiTwoSamplingDelay.

Parameters
ADCxy_COMMONADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() )
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_MULTI_TWOSMP_DELAY_1CYCLE
  • LL_ADC_MULTI_TWOSMP_DELAY_2CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_3CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_4CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_5CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_6CYCLES (1)
  • LL_ADC_MULTI_TWOSMP_DELAY_7CYCLES (1)
  • LL_ADC_MULTI_TWOSMP_DELAY_8CYCLES (2)
  • LL_ADC_MULTI_TWOSMP_DELAY_9CYCLES (2)
  • LL_ADC_MULTI_TWOSMP_DELAY_10CYCLES (2)
  • LL_ADC_MULTI_TWOSMP_DELAY_11CYCLES (3)
  • LL_ADC_MULTI_TWOSMP_DELAY_12CYCLES (3)
(1) Parameter available only if ADC resolution is 12, 10 or 8 bits.
(2) Parameter available only if ADC resolution is 12 or 10 bits.
(3) Parameter available only if ADC resolution is 12 bits.

Definition at line 5782 of file stm32l4xx_ll_adc.h.

5783 {
5784  return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_DELAY));
5785 }

◆ LL_ADC_SetMultiDMATransfer()

__STATIC_INLINE void LL_ADC_SetMultiDMATransfer ( ADC_Common_TypeDef *  ADCxy_COMMON,
uint32_t  MultiDMATransfer 
)

Set ADC multimode conversion data transfer: no transfer or transfer by DMA.

Note
If ADC multimode transfer by DMA is not selected: each ADC uses its own DMA channel, with its individual DMA transfer settings. If ADC multimode transfer by DMA is selected: One DMA channel is used for both ADC (DMA of ADC master) Specifies the DMA requests mode:
  • Limited mode (One shot mode): DMA transfer requests are stopped when number of DMA data transfers (number of ADC conversions) is reached. This ADC mode is intended to be used with DMA mode non-circular.
  • Unlimited mode: DMA transfer requests are unlimited, whatever number of DMA data transfers (number of ADC conversions). This ADC mode is intended to be used with DMA mode circular.
If ADC DMA requests mode is set to unlimited and DMA is set to mode non-circular: when DMA transfers size will be reached, DMA will stop transfers of ADC conversions data ADC will raise an overrun error (overrun flag and interruption if enabled).
How to retrieve multimode conversion data: Whatever multimode transfer by DMA setting: using function LL_ADC_REG_ReadMultiConversionData32(). If ADC multimode transfer by DMA is selected: conversion data is a raw data with ADC master and slave concatenated. A macro is available to get the conversion data of ADC master or ADC slave: see helper macro __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE().
On this STM32 serie, setting of this feature is conditioned to ADC state: All ADC instances of the ADC common group must be disabled or enabled without conversion on going on group regular. CCR MDMA LL_ADC_SetMultiDMATransfer
CCR DMACFG LL_ADC_SetMultiDMATransfer
Parameters
ADCxy_COMMONADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() )
MultiDMATransferThis parameter can be one of the following values:
  • LL_ADC_MULTI_REG_DMA_EACH_ADC
  • LL_ADC_MULTI_REG_DMA_LIMIT_RES12_10B
  • LL_ADC_MULTI_REG_DMA_LIMIT_RES8_6B
  • LL_ADC_MULTI_REG_DMA_UNLMT_RES12_10B
  • LL_ADC_MULTI_REG_DMA_UNLMT_RES8_6B
Return values
None

Definition at line 5668 of file stm32l4xx_ll_adc.h.

5669 {
5670  MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_MDMA | ADC_CCR_DMACFG, MultiDMATransfer);
5671 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_SetMultimode()

__STATIC_INLINE void LL_ADC_SetMultimode ( ADC_Common_TypeDef *  ADCxy_COMMON,
uint32_t  Multimode 
)

Set ADC multimode configuration to operate in independent mode or multimode (for devices with several ADC instances).

Note
If multimode configuration: the selected ADC instance is either master or slave depending on hardware. Refer to reference manual.
On this STM32 serie, setting of this feature is conditioned to ADC state: All ADC instances of the ADC common group must be disabled. This check can be done with function LL_ADC_IsEnabled() for each ADC instance or by using helper macro __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). CCR DUAL LL_ADC_SetMultimode
Parameters
ADCxy_COMMONADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() )
MultimodeThis parameter can be one of the following values:
  • LL_ADC_MULTI_INDEPENDENT
  • LL_ADC_MULTI_DUAL_REG_SIMULT
  • LL_ADC_MULTI_DUAL_REG_INTERL
  • LL_ADC_MULTI_DUAL_INJ_SIMULT
  • LL_ADC_MULTI_DUAL_INJ_ALTERN
  • LL_ADC_MULTI_DUAL_REG_SIM_INJ_SIM
  • LL_ADC_MULTI_DUAL_REG_SIM_INJ_ALT
  • LL_ADC_MULTI_DUAL_REG_INT_INJ_SIM
Return values
None

Definition at line 5593 of file stm32l4xx_ll_adc.h.

5594 {
5595  MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_DUAL, Multimode);
5596 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_SetMultiTwoSamplingDelay()

__STATIC_INLINE void LL_ADC_SetMultiTwoSamplingDelay ( ADC_Common_TypeDef *  ADCxy_COMMON,
uint32_t  MultiTwoSamplingDelay 
)

Set ADC multimode delay between 2 sampling phases.

Note
The sampling delay range depends on ADC resolution:
  • ADC resolution 12 bits can have maximum delay of 12 cycles.
  • ADC resolution 10 bits can have maximum delay of 10 cycles.
  • ADC resolution 8 bits can have maximum delay of 8 cycles.
  • ADC resolution 6 bits can have maximum delay of 6 cycles.
On this STM32 serie, setting of this feature is conditioned to ADC state: All ADC instances of the ADC common group must be disabled. This check can be done with function LL_ADC_IsEnabled() for each ADC instance or by using helper macro helper macro __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). CCR DELAY LL_ADC_SetMultiTwoSamplingDelay
Parameters
ADCxy_COMMONADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() )
MultiTwoSamplingDelayThis parameter can be one of the following values:
  • LL_ADC_MULTI_TWOSMP_DELAY_1CYCLE
  • LL_ADC_MULTI_TWOSMP_DELAY_2CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_3CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_4CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_5CYCLES
  • LL_ADC_MULTI_TWOSMP_DELAY_6CYCLES (1)
  • LL_ADC_MULTI_TWOSMP_DELAY_7CYCLES (1)
  • LL_ADC_MULTI_TWOSMP_DELAY_8CYCLES (2)
  • LL_ADC_MULTI_TWOSMP_DELAY_9CYCLES (2)
  • LL_ADC_MULTI_TWOSMP_DELAY_10CYCLES (2)
  • LL_ADC_MULTI_TWOSMP_DELAY_11CYCLES (3)
  • LL_ADC_MULTI_TWOSMP_DELAY_12CYCLES (3)
(1) Parameter available only if ADC resolution is 12, 10 or 8 bits.
(2) Parameter available only if ADC resolution is 12 or 10 bits.
(3) Parameter available only if ADC resolution is 12 bits.
Return values
None

Definition at line 5754 of file stm32l4xx_ll_adc.h.

5755 {
5756  MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_DELAY, MultiTwoSamplingDelay);
5757 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)