Manually include hal library files
Hello!
I know that this is not a new topic, and maybe somewhere (even in this forum) someone already answered this question multiple times, but still.....
I crawled the forum looking for advice about using the HAL without CUBE, because where I work they have a nice proprietary c++ hal and I was starting to port it for STM32.
C++ classes would operate on top of the hal, but I'd like the possibility to, say, instantiate an UART class without previous cube initialization, and so on with other peripherals (timers, adc, dac ecc).
I followed the following steps but I'm stuck (no compilation errors but no autocomplete, like the IDE knows the files are there but doesn't really know...):
- Created new STM32CubeIDE project with Cube (i wanted to keep the clock tree init)
- Created a Usart class
- Included "stm32l4xx_hal.h"
- Manually uncommented (this is temporary) the line " #define HAL_USART_MODULE_ENABLED"
- Copied the necessary files in the driver folder with the others (usart/usart ex .c/.h)
My idea is to have an header file that will be included in "stm32l4xx_hal_conf.h" (manually added, 'cause cube obviously erases it) where basically I can activate/deactivate the various peripherals like cube does (comment/uncomment above).
I'm no include-wizard so I can't figure out what's the correct way to do this. Any pointers?
Thank you!