Example : I2C

I2C components of OSS-EC

In this section, we will use the OSS-EC I2C component ( I2C IC ) as an example.

  • The software architecture of the OSS-EC is configured to pair with the hardware architecture of the I2C component, as shown in ( fig.1 ).
  • The state of an I2C component is changed by a command from the application as shown in ( fig.2).
  • The interface between the application and PCMP is the argument structure cmd and the return value structure res, as shown in ( fig.3 ).
  • Command sequence ( fig.4 )
  • Data table

Blue label characters are data related to Application & circuit & MPU.

Data table

#define LabelValueData contents
iPCMP_Cyc          1000U PCMP Function call cycle 1000[ms]
iError_times        3UPCMP Error times 3times
iCom_retry_num 3UI2C communication retry 3times
iTemp_low          5.0FJudgment temperature value 5.0[℃] for turning on the heater
iEndianiBigEndian select
iI2C_SDA            D14SDA Pin
iI2C_SCL                D15SCL Pin
iI2C_frequency       4000UFrequency 4kHz