This describes the portable bit-banged version of the I2C driver.
Each I2C transaction consists of the following steps:
>i2c(or none at all)
i2c-xfer(can be 0)
i2c>(or none at all)
: i2c-init ( -- ) \ initialise bit-banged I2C : i2c-addr ( u -- ) \ start a new I2C transaction : i2c-xfer ( u -- nak ) \ prepare for the reply : >i2c ( u -- ) \ send one byte out to the I2C bus : i2c> ( -- u ) \ read one byte back from the I2C bus : i2c. ( -- ) \ scan and report all I2C devices on the bus
SDA constants should be defined before including this driver,
if you want to use I2C on other pins than the default