2018-11-07 06:37 PM
Dear ST Forum Members,
I'm experimenting with
STM32L011K4T6 Nucleo,
with ADC_LowPower Example project, I saw this :
uhADCxConvertedValue = HAL_ADC_GetValue(&AdcHandle);
If I want to use two channels of ADC, what should I modify,
I've done :
//ADCx Channel b GPIO pin configuration
GPIO_InitStruct.Pin = ADCx_CHANNELb_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(ADCx_CHANNELb_GPIO_PORT, &GPIO_InitStruct);
and
/* Definition of ADCx channels */
#define ADCx_CHANNELa ADC_CHANNEL_4
//Open channelb
#define ADCx_CHANNELb ADC_CHANNEL_3
/* Definition of ADCx channels pins */
#define ADCx_CHANNELa_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define ADCx_CHANNELa_GPIO_PORT GPIOA
#define ADCx_CHANNELa_PIN GPIO_PIN_4
// Open another channel (channel b)
#define ADCx_CHANNELb_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define ADCx_CHANNELb_GPIO_PORT GPIOA
#define ADCx_CHANNELb_PIN GPIO_PIN_3
How can I retrieve the result for Channelb ?
Thanks and kind regards.