Configure a channel to be assigned to ADC group injected.
1633 HAL_StatusTypeDef tmp_hal_status =
HAL_OK;
1634 uint32_t tmpOffsetShifted;
1635 uint32_t tmp_config_internal_channel;
1636 uint32_t tmp_adc_is_conversion_on_going_regular;
1637 uint32_t tmp_adc_is_conversion_on_going_injected;
1638 __IO uint32_t wait_loop_index = 0;
1640 uint32_t tmp_JSQR_ContextQueueBeingBuilt = 0U;
1654 if (hadc->Init.ScanConvMode != ADC_SCAN_DISABLE)
1706 if ((hadc->Init.ScanConvMode == ADC_SCAN_DISABLE) ||
1716 if (sConfigInjected->
InjectedRank == ADC_INJECTED_RANK_1)
1725 tmp_JSQR_ContextQueueBeingBuilt = (ADC_JSQR_RK(sConfigInjected->
InjectedChannel, ADC_INJECTED_RANK_1)
1732 tmp_JSQR_ContextQueueBeingBuilt = (ADC_JSQR_RK(sConfigInjected->
InjectedChannel, ADC_INJECTED_RANK_1));
1735 MODIFY_REG(hadc->Instance->JSQR, ADC_JSQR_FIELDS, tmp_JSQR_ContextQueueBeingBuilt);
1737 hadc->InjectionConfig.ContextQueue = tmp_JSQR_ContextQueueBeingBuilt;
1753 if (hadc->InjectionConfig.ChannelCount == 0U)
1761 hadc->InjectionConfig.ContextQueue = 0x00000000U;
1790 tmp_JSQR_ContextQueueBeingBuilt &= ~ADC_JSQR_RK(ADC_SQR3_SQ10, sConfigInjected->
InjectedRank);
1796 hadc->InjectionConfig.ChannelCount--;
1801 hadc->InjectionConfig.ContextQueue |= tmp_JSQR_ContextQueueBeingBuilt;
1805 if (hadc->InjectionConfig.ChannelCount == 0U)
1807 MODIFY_REG(hadc->Instance->JSQR, ADC_JSQR_FIELDS, hadc->InjectionConfig.ContextQueue);
1824 ADC_CFGR_JQM | ADC_CFGR_JDISCEN,
1833 ADC_CFGR_JQM | ADC_CFGR_JDISCEN,
1849 if ((tmp_adc_is_conversion_on_going_regular == 0UL)
1850 && (tmp_adc_is_conversion_on_going_injected == 0UL)
1860 SET_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO);
1864 CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO);
1874 SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG);
1876 tmp_hal_status = HAL_ERROR;
1880 CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO);
1890 assert_param(!(READ_BIT(hadc->Instance->CFGR2, ADC_CFGR2_ROVSE | ADC_CFGR2_TROVS) == (ADC_CFGR2_ROVSE | ADC_CFGR2_TROVS)));
1909 CLEAR_BIT(hadc->Instance->CFGR2, ADC_CFGR2_JOVSE);
1912 #if defined(ADC_SMPR1_SMPPLUS) 1939 tmpOffsetShifted = ADC_OFFSET_SHIFT_RESOLUTION(hadc, sConfigInjected->
InjectedOffset);
2003 && ((tmp_config_internal_channel & LL_ADC_PATH_INTERNAL_TEMPSENSOR) == 0UL))
2005 if (ADC_TEMPERATURE_SENSOR_INSTANCE(hadc))
2008 LL_ADC_PATH_INTERNAL_TEMPSENSOR | tmp_config_internal_channel);
2015 wait_loop_index = ((LL_ADC_DELAY_TEMPSENSOR_STAB_US / 10UL) * (SystemCoreClock / (100000UL * 2UL)));
2016 while (wait_loop_index != 0UL)
2023 && ((tmp_config_internal_channel & LL_ADC_PATH_INTERNAL_VBAT) == 0UL))
2025 if (ADC_BATTERY_VOLTAGE_INSTANCE(hadc))
2028 LL_ADC_PATH_INTERNAL_VBAT | tmp_config_internal_channel);
2032 && ((tmp_config_internal_channel & LL_ADC_PATH_INTERNAL_VREFINT) == 0UL))
2034 if (ADC_VREFINT_INSTANCE(hadc))
2037 LL_ADC_PATH_INTERNAL_VREFINT | tmp_config_internal_channel);
2050 return tmp_hal_status;
__STATIC_INLINE uint32_t LL_ADC_IsEnabled(ADC_TypeDef *ADCx)
Get the selected ADC instance enable state.
__STATIC_INLINE uint32_t LL_ADC_GetOffsetChannel(ADC_TypeDef *ADCx, uint32_t Offsety)
Get for the ADC selected offset number 1, 2, 3 or 4: Channel to which the offset programmed will be a...
__STATIC_INLINE void LL_ADC_SetChannelSingleDiff(ADC_TypeDef *ADCx, uint32_t Channel, uint32_t SingleDiff)
Set mode single-ended or differential input of the selected ADC channel.
uint32_t ExternalTrigInjecConvEdge
uint32_t InjectedSamplingTime
uint32_t InjectedSingleDiff
uint32_t InjectedOffsetNumber
__STATIC_INLINE void LL_ADC_SetOffsetState(ADC_TypeDef *ADCx, uint32_t Offsety, uint32_t OffsetState)
Set for the ADC selected offset number 1, 2, 3 or 4: force offset state disable or enable without mod...
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
FunctionalState AutoInjectedConv
__STATIC_INLINE void LL_ADC_SetChannelSamplingTime(ADC_TypeDef *ADCx, uint32_t Channel, uint32_t SamplingTime)
Set sampling time of the selected ADC channel Unit: ADC clock cycles.
FunctionalState InjectedDiscontinuousConvMode
__STATIC_INLINE uint32_t LL_ADC_INJ_IsConversionOngoing(ADC_TypeDef *ADCx)
Get ADC group injected conversion state. CR JADSTART LL_ADC_INJ_IsConversionOngoing.
uint32_t InjectedNbrOfConversion
__STATIC_INLINE uint32_t LL_ADC_GetCommonPathInternalCh(ADC_Common_TypeDef *ADCxy_COMMON)
Get parameter common to several ADC: measurement path to internal channels (VrefInt, temperature sensor, ...).
ADC_InjOversamplingTypeDef InjecOversampling
__STATIC_INLINE void LL_ADC_SetOffset(ADC_TypeDef *ADCx, uint32_t Offsety, uint32_t Channel, uint32_t OffsetLevel)
Set ADC selected offset number 1, 2, 3 or 4.
FunctionalState QueueInjectedContext
__STATIC_INLINE uint32_t LL_ADC_REG_IsConversionOngoing(ADC_TypeDef *ADCx)
Get ADC group regular conversion state. CR ADSTART LL_ADC_REG_IsConversionOngoing.
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
FunctionalState InjecOversamplingMode
__STATIC_INLINE void LL_ADC_SetCommonPathInternalCh(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t PathInternal)
Set parameter common to several ADC: measurement path to internal channels (VrefInt, temperature sensor, ...).
__STATIC_INLINE void LL_ADC_SetSamplingTimeCommonConfig(ADC_TypeDef *ADCx, uint32_t SamplingTimeCommonConfig)
Set ADC sampling time common configuration impacting settings of sampling time channel wise...
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
uint32_t ExternalTrigInjecConv