I2C class
I2C wrapper functions for Linux userspace i2c-dev devices.
c-periphery I2C documentation.
Constructors
Properties
Methods
-
dispose(
) → void - Releases all internal native resources.
-
fromJson(
String json) → IsolateAPI -
getErrno(
) → int - Returns the libc errno of the last failure that occurred.
-
getHandle(
) → int - Returns the address of the internal handle.
-
getI2Cfd(
) → int - Returns the file descriptor (for the underlying i2c-dev device) of the I2C handle.
-
getI2Cinfo(
) → String - Returns a string representation of the I2C handle.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readByte(
int address) → int -
Reads a byte from the I2C device with the
address
. -
readByteReg(
int address, int register) → int -
Reads a byte from
register
of the I2C device with theaddress
. -
readBytes(
int address, int len) → List< int> -
Reads
len
bytes from the I2C device with theaddress
. -
readBytesReg(
int address, int register, int len) → List< int> -
Reads
len
bytes fromregister
of the I2C device with theaddress
. -
readWord(
int address, [BitOrder order = BitOrder.msbLast]) → int -
Reads a word from the I2C device with the
address
and the bitorder
]. -
readWordReg(
int address, int register, [BitOrder order = BitOrder.msbLast]) → int -
Reads a word from
register
of the I2C device with theaddress
with the bitorder
. -
setHandle(
int handle) → void - Set the address of the internal handle.
-
toJson(
) → String - Converts a I2C to a JSON string. See constructor isolate for details.
-
toString(
) → String -
A string representation of this object.
inherited
-
transfer(
List< I2Cmsg> data) → NativeI2CmsgHelper - Transfers a list of I2Cmsg.
-
writeByte(
int address, int byteValue) → void -
Writes a
byteValue
to the I2C device with theaddress
. -
writeByteReg(
int address, int register, int byteValue) → void -
Writes a
byteValue
to theregister
of the I2C device with theaddress
. -
writeBytes(
int address, List< int> byteData) → void -
Writes
byteData
to the I2C device with theaddress
. -
writeBytesReg(
int address, int register, List< int> byteData) → void -
Writes
byteData
to theregister
of the I2C device with theaddress
. -
writeWord(
int address, int wordValue, [BitOrder order = BitOrder.msbLast]) → void -
Writes a
wordValue
to the I2C device with theaddress
and the bitorder
. -
writeWordReg(
int address, int register, int wordValue, [BitOrder order = BitOrder.msbLast]) → void -
Writes a
wordValue
to theregister
of the I2C device with theaddress
and the bitorder
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getI2CerrorCode(
int value) → I2CerrorCode -
Converts the native error code
value
to I2CerrorCode. -
i2cMsgFlags2Int(
I2CmsgFlags flag) → int - Converts I2CmsgFlags to the native bit mask value.