MraaI2c class

The I2C MRAA API

An I2C context represents a master on an iI2C bus and that context can communicate to multiple I2C slaves by configuring the address. It is considered best practice to make sure the address is correct before doing any calls on I2C, in case another application changed the address on that bus. Multiple instances of the same bus can exist.

Constructors

MraaI2c(MraaImpl _impl, bool _noJsonLoading)
Construction

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

address(MraaI2cContext context, int address) MraaReturnCode
Address - mraa_i2c_address
frequency(MraaI2cContext context, MraaI2cMode mode) MraaReturnCode
Frequency - mraa_i2c_frequency
initialise(int bus) MraaI2cContext
Initialise - mraa_i2c_init
initialiseRaw(int bus) MraaI2cContext
Initialise raw - mraa_i2c_init_raw
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(MraaI2cContext context, Pointer<Uint8> data, int length) int
Read - mraa_i2c_read
readByte(MraaI2cContext context) int
Read byte = mraa_i2C_read_byte
readByteData(MraaI2cContext context, int register) int
Read byte data - mraa_i2c_read_byte_data
readBytesData(MraaI2cContext context, int command, Pointer<Uint8> data, int length) int
Read bytes data - mraa_i2c_read_bytes_data
readWordData(MraaI2cContext context, int register) int
Read word data - mraa_i2c_read_word_data
stop(MraaI2cContext context) MraaReturnCode
Stop - mraa_i2c_stop
toString() String
A string representation of this object.
inherited
write(MraaI2cContext context, Pointer<Uint8> data, int length) MraaReturnCode
Write - mraa_i2c_write
writeByte(MraaI2cContext context, int data) MraaReturnCode
Write byte - mraa_i2c_write_byte
writeByteData(MraaI2cContext context, int data, int command) MraaReturnCode
Write byte data - mraa_write_byte_data
writeWordData(MraaI2cContext context, int data, int command) MraaReturnCode
Write word data - mraa_write_byte_data

Operators

operator ==(Object other) bool
The equality operator.
inherited