2016-03-29 12:14 PM
How to use HAL_I2C_Master_Transmit() from outside main.c
This HAL_I2C works when I call it from within main.c. I created some external i2c_routines.c, but have a hard time defining how/where to get and use HAL_I2C_Master_Transmit() from outside main.c. The routines work inside of main.c but I want place them in a separate file. Any help appreciated #hal_i2c_master_transmit()2016-03-29 01:40 PM
So, what problems/errors stumped you when you'd used HAL_I2C_Master_Transmit() in other files? Just don't forget to put
#include ''stm32f4xx_hal.h'' where you want to use it.2016-03-30 03:20 AM
Hi Gerhard,
The header of the common HAL driver file (stm32f4xx_hal.h) includes the common configurations for the whole HAL library. It is the only header file that is included in the user sources and the HAL C sources files to be able to use the HAL resources.
So always with Hal library, if you develop your project application , make sure that you have include the stm32f4xx_hal.h.
-Hannibal-
How to use HAL_I2C_Master_Transmit() from outside main.c
This HAL_I2C works when I call it from within main.c. I created some external i2c_routines.c, but have a hard time defining how/where to get and use HAL_I2C_Master_Transmit() from outside main.c. The routines work inside of main.c but I want place them in a separate file. Any help appreciated