cancel
Showing results for 
Search instead for 
Did you mean: 

hi2c2 in an external .c

MSole.1
Associate

Hello to all.

I'm coding an I2C comunication and the IDE (1.4.0) create the Private variable I2C_HandleTypeDef hi2c2; and then the function MX_I2C2_Init. Everithing ok.

I'm using an external .c file to handle the I2C communication and how can I access to the hi2c2 from my read/write functions in my .c module?

Thanks in advance, Manu.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Add "extern I2C_HandleTypeDef hi2c2;" either in your .c file, or in an included header.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

Add "extern I2C_HandleTypeDef hi2c2;" either in your .c file, or in an included header.

If you feel a post has answered your question, please click "Accept as Solution".