cancel
Showing results for 
Search instead for 
Did you mean: 

error: unknown type name 'SPI_HandleTypeDef'

StanCosgrove
Associate II

Hi i encounter this error while compiling SPI1 at ST7735.h, i dont understand as this error 'SPI_HandleTypeDef' type was generated by .ioc in main.c already and i had call this statement in ST7735.h. Could anyone kindly help?

 

error: unknown type name 'SPI_HandleTypeDef'   --> in st7735.h 

 

// st7735.h
#define ST7735_SPI_PORT hspi1
extern SPI_HandleTypeDef ST7735_SPI_PORT; 

 

2 REPLIES 2
Imen.D
ST Employee

Hello @StanCosgrove ,

Check the settings of "Include Paths" and make sure to define 'USE_HAL_DRIVER' within the project setting.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Yes, you'll need to pull in the top level HAL include files for those definitions to be brought in by the compiler.

ie #include "stm32f0xx_hal.h"

And stm32f0xx_hal_conf.h will need to have the SPI line uncommented.

/* #define HAL_SPI_MODULE_ENABLED */

There's also obviously a processing order, the definitions need to come in before the usage

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..