STM32F103xB HAL User Manual
|
Defines | |
#define | __LL_ADC_CHANNEL_TO_DECIMAL_NB(__CHANNEL__) (((__CHANNEL__) & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) |
Helper macro to get ADC channel number in decimal format from literals LL_ADC_CHANNEL_x. | |
#define | __LL_ADC_DECIMAL_NB_TO_CHANNEL(__DECIMAL_NB__) |
Helper macro to get ADC channel in literal format LL_ADC_CHANNEL_x from number in decimal format. | |
#define | __LL_ADC_IS_CHANNEL_INTERNAL(__CHANNEL__) (((__CHANNEL__) & ADC_CHANNEL_ID_INTERNAL_CH_MASK) != 0U) |
Helper macro to determine whether the selected channel corresponds to literal definitions of driver. | |
#define | __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(__CHANNEL__) ((__CHANNEL__) & ~ADC_CHANNEL_ID_INTERNAL_CH_MASK) |
Helper macro to convert a channel defined from parameter definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, LL_ADC_CHANNEL_TEMPSENSOR, ...), to its equivalent parameter definition of a ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...). | |
#define | __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) |
Helper macro to determine whether the internal channel selected is available on the ADC instance selected. | |
#define | __LL_ADC_ANALOGWD_CHANNEL_GROUP(__CHANNEL__, __GROUP__) |
Helper macro to define ADC analog watchdog parameter: define a single channel to monitor with analog watchdog from sequencer channel and groups definition. | |
#define | __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION(__ADC_RESOLUTION__, __AWD_THRESHOLD__) ((__AWD_THRESHOLD__) << (0U)) |
Helper macro to set the value of ADC analog watchdog threshold high or low in function of ADC resolution, when ADC resolution is different of 12 bits. | |
#define | __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION(__ADC_RESOLUTION__, __AWD_THRESHOLD_12_BITS__) (__AWD_THRESHOLD_12_BITS__) |
Helper macro to get the value of ADC analog watchdog threshold high or low in function of ADC resolution, when ADC resolution is different of 12 bits. | |
#define | __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE(__ADC_MULTI_MASTER_SLAVE__, __ADC_MULTI_CONV_DATA__) (((__ADC_MULTI_CONV_DATA__) >> POSITION_VAL((__ADC_MULTI_MASTER_SLAVE__))) & ADC_DR_DATA) |
Helper macro to get the ADC multimode conversion data of ADC master or ADC slave from raw value with both ADC conversion data concatenated. | |
#define | __LL_ADC_COMMON_INSTANCE(__ADCx__) (ADC12_COMMON) |
Helper macro to select the ADC common instance to which is belonging the selected ADC instance. | |
#define | __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(__ADCXY_COMMON__) |
Helper macro to check if all ADC instances sharing the same ADC common instance are disabled. | |
#define | __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__) (0xFFFU) |
Helper macro to define the ADC conversion data full-scale digital value corresponding to the selected ADC resolution. | |
#define | __LL_ADC_CALC_DATA_TO_VOLTAGE(__VREFANALOG_VOLTAGE__, __ADC_DATA__, __ADC_RESOLUTION__) |
Helper macro to calculate the voltage (unit: mVolt) corresponding to a ADC conversion data (unit: digital value). | |
#define | __LL_ADC_CALC_TEMPERATURE_TYP_PARAMS(__TEMPSENSOR_TYP_AVGSLOPE__, __TEMPSENSOR_TYP_CALX_V__, __TEMPSENSOR_CALX_TEMP__, __VREFANALOG_VOLTAGE__, __TEMPSENSOR_ADC_DATA__, __ADC_RESOLUTION__) |
Helper macro to calculate the temperature (unit: degree Celsius) from ADC conversion data of internal temperature sensor. |
#define __LL_ADC_ANALOGWD_CHANNEL_GROUP | ( | __CHANNEL__, | |
__GROUP__ | |||
) |
(((__GROUP__) == LL_ADC_GROUP_REGULAR) \ ? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) \ : \ ((__GROUP__) == LL_ADC_GROUP_INJECTED) \ ? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) \ : \ (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) \ )
Helper macro to define ADC analog watchdog parameter: define a single channel to monitor with analog watchdog from sequencer channel and groups definition.
__CHANNEL__ | This parameter can be one of the following values:
(1) For ADC channel read back from ADC register, comparison with internal channel parameter to be done using helper macro __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). |
__GROUP__ | This parameter can be one of the following values: |
Definition at line 1297 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION | ( | __ADC_RESOLUTION__, | |
__AWD_THRESHOLD_12_BITS__ | |||
) | (__AWD_THRESHOLD_12_BITS__) |
Helper macro to get the value of ADC analog watchdog threshold high or low in function of ADC resolution, when ADC resolution is different of 12 bits.
__ADC_RESOLUTION__ | This parameter can be one of the following values: |
__AWD_THRESHOLD_12_BITS__ | Value between Min_Data=0x000 and Max_Data=0xFFF |
Value | between Min_Data=0x000 and Max_Data=0xFFF |
Definition at line 1348 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION | ( | __ADC_RESOLUTION__, | |
__AWD_THRESHOLD__ | |||
) | ((__AWD_THRESHOLD__) << (0U)) |
Helper macro to set the value of ADC analog watchdog threshold high or low in function of ADC resolution, when ADC resolution is different of 12 bits.
__ADC_RESOLUTION__ | This parameter can be one of the following values: |
__AWD_THRESHOLD__ | Value between Min_Data=0x000 and Max_Data=0xFFF |
Value | between Min_Data=0x000 and Max_Data=0xFFF |
Definition at line 1326 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_CALC_DATA_TO_VOLTAGE | ( | __VREFANALOG_VOLTAGE__, | |
__ADC_DATA__, | |||
__ADC_RESOLUTION__ | |||
) |
((__ADC_DATA__) * (__VREFANALOG_VOLTAGE__) \ / __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__) \ )
Helper macro to calculate the voltage (unit: mVolt) corresponding to a ADC conversion data (unit: digital value).
__VREFANALOG_VOLTAGE__ | Analog reference voltage (unit: mV) |
__ADC_DATA__ | ADC conversion data (resolution 12 bits) (unit: digital value). |
__ADC_RESOLUTION__ | This parameter can be one of the following values: |
ADC | conversion data equivalent voltage value (unit: mVolt) |
Definition at line 1478 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_CALC_TEMPERATURE_TYP_PARAMS | ( | __TEMPSENSOR_TYP_AVGSLOPE__, | |
__TEMPSENSOR_TYP_CALX_V__, | |||
__TEMPSENSOR_CALX_TEMP__, | |||
__VREFANALOG_VOLTAGE__, | |||
__TEMPSENSOR_ADC_DATA__, | |||
__ADC_RESOLUTION__ | |||
) |
((( ( \ (int32_t)(((__TEMPSENSOR_TYP_CALX_V__)) \ * 1000) \ - \ (int32_t)((((__TEMPSENSOR_ADC_DATA__) * (__VREFANALOG_VOLTAGE__)) \ / __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__)) \ * 1000) \ ) \ ) / (__TEMPSENSOR_TYP_AVGSLOPE__) \ ) + (__TEMPSENSOR_CALX_TEMP__) \ )
Helper macro to calculate the temperature (unit: degree Celsius) from ADC conversion data of internal temperature sensor.
__TEMPSENSOR_TYP_AVGSLOPE__ | Device datasheet data: Temperature sensor slope typical value (unit: uV/DegCelsius). On STM32F1, refer to device datasheet parameter "Avg_Slope". |
__TEMPSENSOR_TYP_CALX_V__ | Device datasheet data: Temperature sensor voltage typical value (at temperature and Vref+ defined in parameters below) (unit: mV). On STM32F1, refer to device datasheet parameter "V25". |
__TEMPSENSOR_CALX_TEMP__ | Device datasheet data: Temperature at which temperature sensor voltage (see parameter above) is corresponding (unit: mV) |
__VREFANALOG_VOLTAGE__ | Analog voltage reference (Vref+) voltage (unit: mV) |
__TEMPSENSOR_ADC_DATA__ | ADC conversion data of internal temperature sensor (unit: digital value). |
__ADC_RESOLUTION__ | ADC resolution at which internal temperature sensor voltage has been measured. This parameter can be one of the following values: |
Temperature | (unit: degree Celsius) |
Definition at line 1526 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL | ( | __CHANNEL__ | ) | ((__CHANNEL__) & ~ADC_CHANNEL_ID_INTERNAL_CH_MASK) |
Helper macro to convert a channel defined from parameter definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, LL_ADC_CHANNEL_TEMPSENSOR, ...), to its equivalent parameter definition of a ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...).
__CHANNEL__ | This parameter can be one of the following values:
|
Definition at line 1155 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_CHANNEL_TO_DECIMAL_NB | ( | __CHANNEL__ | ) | (((__CHANNEL__) & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) |
Helper macro to get ADC channel number in decimal format from literals LL_ADC_CHANNEL_x.
__CHANNEL__ | This parameter can be one of the following values:
|
Value | between Min_Data=0 and Max_Data=18 |
Definition at line 1003 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_COMMON_INSTANCE | ( | __ADCx__ | ) | (ADC12_COMMON) |
Helper macro to select the ADC common instance to which is belonging the selected ADC instance.
__ADCx__ | ADC instance |
ADC | common register instance |
Definition at line 1399 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_DECIMAL_NB_TO_CHANNEL | ( | __DECIMAL_NB__ | ) |
(((__DECIMAL_NB__) <= 9U) \ ? ( \ ((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ (ADC_SMPR2_REGOFFSET | (((uint32_t) (3U * (__DECIMAL_NB__))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ ) \ : \ ( \ ((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ (ADC_SMPR1_REGOFFSET | (((uint32_t) (3U * ((__DECIMAL_NB__) - 10U))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ ) \ )
Helper macro to get ADC channel in literal format LL_ADC_CHANNEL_x from number in decimal format.
__DECIMAL_NB__,: | Value between Min_Data=0 and Max_Data=18 |
Returned | value can be one of the following values:
(1) For ADC channel read back from ADC register, comparison with internal channel parameter to be done using helper macro __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). |
Definition at line 1040 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_DIGITAL_SCALE | ( | __ADC_RESOLUTION__ | ) | (0xFFFU) |
Helper macro to define the ADC conversion data full-scale digital value corresponding to the selected ADC resolution.
__ADC_RESOLUTION__ | This parameter can be one of the following values: |
ADC | conversion data equivalent voltage value (unit: mVolt) |
Definition at line 1462 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_IS_CHANNEL_INTERNAL | ( | __CHANNEL__ | ) | (((__CHANNEL__) & ADC_CHANNEL_ID_INTERNAL_CH_MASK) != 0U) |
Helper macro to determine whether the selected channel corresponds to literal definitions of driver.
__CHANNEL__ | This parameter can be one of the following values:
|
Value | "0" if the channel corresponds to a parameter definition of a ADC external channel (channel connected to a GPIO pin). Value "1" if the channel corresponds to a parameter definition of a ADC internal channel. |
Definition at line 1096 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE | ( | __ADC_INSTANCE__, | |
__CHANNEL__ | |||
) |
(((__ADC_INSTANCE__) == ADC1) \ ? ( \ ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) \ ) \ : \ (0U) \ )
Helper macro to determine whether the internal channel selected is available on the ADC instance selected.
__ADC_INSTANCE__ | ADC instance |
__CHANNEL__ | This parameter can be one of the following values: (1) On STM32F1, parameter available only on ADC instance: ADC1. |
Value | "0" if the internal channel selected is not available on the ADC instance selected. Value "1" if the internal channel selected is available on the ADC instance selected. |
Definition at line 1180 of file stm32f1xx_ll_adc.h.
#define __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE | ( | __ADCXY_COMMON__ | ) |
(LL_ADC_IsEnabled(ADC1) | \ LL_ADC_IsEnabled(ADC2) )
Helper macro to check if all ADC instances sharing the same ADC common instance are disabled.
__ADCXY_COMMON__ | ADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() ) |
Value | "0" if all ADC instances sharing the same ADC common instance are disabled. Value "1" if at least one ADC instance sharing the same ADC common instance is enabled. |
Definition at line 1444 of file stm32f1xx_ll_adc.h.
Referenced by LL_ADC_CommonInit().
#define __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE | ( | __ADC_MULTI_MASTER_SLAVE__, | |
__ADC_MULTI_CONV_DATA__ | |||
) | (((__ADC_MULTI_CONV_DATA__) >> POSITION_VAL((__ADC_MULTI_MASTER_SLAVE__))) & ADC_DR_DATA) |
Helper macro to get the ADC multimode conversion data of ADC master or ADC slave from raw value with both ADC conversion data concatenated.
__ADC_MULTI_MASTER_SLAVE__ | This parameter can be one of the following values: |
__ADC_MULTI_CONV_DATA__ | Value between Min_Data=0x000 and Max_Data=0xFFF |
Value | between Min_Data=0x000 and Max_Data=0xFFF |
Definition at line 1365 of file stm32f1xx_ll_adc.h.