cancel
Showing results for 
Search instead for 
Did you mean: 

unknown type name 'ADC_HandleTypeDef'

Alexander Hoffman
Associate III
Posted on September 20, 2017 at 23:41

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 #hal
4 REPLIES 4
Posted on September 20, 2017 at 23:56

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

Posted on September 21, 2017 at 01:03

Also USE_HAL_DRIVER defined. Confirm HSE_VALUE is consistent with board.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on September 21, 2017 at 18:19

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.

Posted on September 21, 2017 at 18:23

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.