How to use I2C?

64 views
Skip to first unread message

sheershak agarwal

unread,
Jun 21, 2021, 11:30:43 AM6/21/21
to F´ Community Group
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:

<!-- Import ports for i2c driver -->
<import_port_type>Drv/I2cDriverPorts/I2cPortAi.xml</import_port_type>
<ports>
        <port name="I2CWrite" data_type="Drv::I2c"  kind="guarded_input">
        </port>
        <port name="I2CRead" data_type="Drv::I2c"  kind="guarded_input">
        </port>
 </ports>

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.

Timothy Canham

unread,
Jun 21, 2021, 11:49:47 AM6/21/21
to F´ Community Group
Re-ask your question on the new GitHub conversations link here: https://github.com/nasa/fprime/discussions

We are trying to consolidate questions there and deprecating this site.

Reply all
Reply to author
Forward
0 new messages