2024-06-02 9:15 PM
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;
2024-06-03 11:34 AM
Hello @StanCosgrove ,
Check the settings of "Include Paths" and make sure to define 'USE_HAL_DRIVER' within the project setting.
2024-06-03 11:44 AM - edited 2024-06-03 11:45 AM
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