Page 1 of 1

I2C - which library to use for hardware I2C

Posted: Wed Feb 23, 2022 2:29 am
by i998
Hi All,

What is the correct way to use hardware and software I2C on Maple Mini board with the Roger Clark's core ?

There are
Wire.h (that apparently has an issue 858
Wire_slave.h that was recommended as a solution ( update - tested and works)

and
TwoWire that I use as a hardware I2C as follows (tested and works too):

Code: Select all

    //Setup I2C interface
    TwoWire I2C_FAST=TwoWire(1,I2C_FAST_MODE); //I2C1 
    
    //Instantiate a device library 
    DeviceLibrary  Device = DeviceLibrary(&I2C_FAST, 0x40);  //a pointer to I2C interface and I2C address
    
Just would like to confirm which ones are a right use and which one is for hardware and software I2C?

Regards, i998