The I2C class represents an I²C two-wire serial port. Objects representing a given imp’s specific I²C ports are automatically instantiated at start-up and are accessed through the following object properties of the hardware object:
|imp||I²C 1||I²C 2||I²C 3||I²C 4|
|imp003 (Murata part number LBWA1ZV1CD)||hardware.i2cAB||hardware.i2cFG|
|imp004m (Murata part number LBEE5ZZ1MD)||hardware.i2cNM||hardware.i2cQP|
|imp005 (Murata part number LBWA1UZ1GC-901)||hardware.i2cJK||hardware.i2c0|
The imp005’s second I²C bus is accessed via dedicated pins rather than GPIO, hence the slightly different nomenclature.
When implementing I²C using an imp, please note that external pull-ups are required. It is not possible to enable the internal pull-ups when pins are used for I²C.
These peripherals do not support clock-stretching, so any I²C peripheral which must delay before replying to communications from the host will not work with the imp005.
The I2C object has the following member methods: