Custom Library Compilation Error
Hi All,
I am pretty to new to all of this and I am in the process of learning to create my own library. I am using the STM32F446 Nucleo board with a BNO055 IMU. I am very familiar with the BNO055 and I have successfully used it with Arduino, but now the time is to move on. I am using a Windows 10 machine with the latest version of SW4STM32. So, to my problem:
I want to setup a header and a source file to deal with the I2C communication functions, so I have called them I2C.h and I2C.c. They are in the respective Inc and Src folders in the project, they are not in the their own folders. I have attached the header and the source file because there is no code formating functionality on the forum, or none that I can find. If there is please let me know how to code format, for direct me with a link.
When I compile this it gives me the following error: “‘hi2c1’ undeclared (first use in this function) | I2C.c | C/C++ Problem”
I could understand if it were one of the variable that I have declared incorrectly, but it is a TypeDef defined by CubeMX! Another anomoly is that if I declare there function prototypes and I define them in main.c, they run perfectly! Can any body help shed some light on this please, is this perhaps a linking issue rather than a coding error? I hope the post is not too detailed and if you need more info, please let me know.
Thanks,
Dylan