How to use I2C? #742
-
Hello, How do I instantiate I2C ports in my component? I am using Fprime v1.5.3. Right now, I have this code in my Component:
and my cpp-template creates two functions for I2Cwrite_handle an I2CRead_Handler. Why does it create these two handlers? I thought it would be the same as serial driver where there is one handle for read but you can write in any other functions. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@sheershak-agarwal You should make the port kind |
Beta Was this translation helpful? Give feedback.
@sheershak-agarwal You should make the port kind
output
, then you can call the correct member function in the base class. Since I2C is synchronous, it makes sense that the component sending the transaction would have both operations as output ports.