2017-09-20 02:41 PM
Hi,
I am trying to add the ADC handles into a struct that is in a seperate header file. For some reason I cannot get the ADC handles' typedef to be located after including stm32f4xx_hal.h.
My struct looks is as follows
typedef struct mouse_device{
const ADC_HandleTypeDef* adc_x; const ADC_HandleTypeDef* adc_y;signed long x_cal;
signed long y_cal;mouse_buf_t mouse_buf;
} mouse_device_t;And at the top of the header I have only one include and that is &sharpinclude 'stm32f4xx_hal.h'
I am a little confused as to why it does not work as after tracing though the headers the stm32f4xx_hal leads to the adc header which contains the typedef.
Cheers#include #adc #hal2017-09-20 02:56 PM
Hello!
Inside 'stm32f4xx_hal_conf.h' the definition #define HAL_ADC_MODULE_ENABLED must be uncommented to include the stm32f4xx_hal_adc.h which contains the typedef.
Regards
vf
2017-09-20 04:03 PM
Also USE_HAL_DRIVER defined. Confirm HSE_VALUE is consistent with board.
2017-09-21 11:19 AM
Thanks for the reply. The ADC is indeed enabled. I am using the ADC handles in my main.c but in this header they cannot be resolved.
2017-09-21 11:23 AM
The Hal driver is being used yes. I imagine the HSE values should match. All of the config code as well as the ADC handles were generated using cube.