I2C class
I2C wrapper functions for Linux userspace i2c-dev devices.
c-periphery I2C documentation.
- Inheritance
-
- Object
- IsolateAPI
- I2C
Constructors
Properties
Methods
-
dispose(
) → void - Releases all internal native resources.
-
fromJson(
String json) → IsolateAPI -
override
-
getErrno(
) → int - Returns the libc errno of the last failure that occurred.
-
getHandle(
) → int -
Returns the address of the internal handle.
override
-
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.
-
isIsolate(
) → bool -
override
-
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. The optional register parameters bitorder/widthenables 16-bit register. -
readByteReg(
int address, int register, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → int -
Reads a byte from
registerof the I2C device with theaddress. -
readBytes(
int address, int len) → List< int> -
Reads
lenbytes from the I2C device with theaddress. -
readBytesReg(
int address, int register, int len, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → List< int> -
Reads
lenbytes fromregisterof the I2C device with theaddress. -
readWord(
int address, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → int -
Reads a word from the I2C device with the
addressand the bitorder]. -
readWordReg(
int address, int register, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → int -
Reads a word from
registerof the I2C device with theaddresswith the bitorder. -
setHandle(
int handle) → void -
Set the address of the internal handle.
override
-
toJson(
) → String -
Converts a I2C to a JSON string. See constructor isolate for details.
override
-
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
byteValueto the I2C device with theaddress. -
writeByteReg(
int address, int register, int byteValue, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → void -
Writes a
byteValueto theregisterof the I2C device with theaddress. The optional register parameters bitorder/widthenables 16-bit register. -
writeBytes(
int address, List< int> byteData) → void -
Writes
byteDatato the I2C device with theaddress. -
writeBytesReg(
int address, int register, List< int> byteData, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → void -
Writes
byteDatato theregisterof the I2C device with theaddressThe optional register parameters bitorder/widthenables 16-bit registers. -
writeUint8Reg(
int address, int register, Uint8List byteData, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → void -
writeWord(
int address, int wordValue, [BitOrder order = BitOrder.msbLast]) → void -
Writes a
wordValueto the I2C device with theaddressand the bitorder. -
writeWordReg(
int address, int register, int wordValue, [BitOrder order = BitOrder.msbLast, RegisterWidth width = RegisterWidth.bits8]) → void -
Writes a
wordValueto theregisterof the I2C device with theaddressand the bitorder. The optional register parameters bitwidthenables 16-bit register.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getI2CerrorCode(
int value) → I2CerrorCode -
Converts the native error code
valueto I2CerrorCode. -
i2cMsgFlags2Int(
I2CmsgFlags flag) → int - Converts I2CmsgFlags to the native bit mask value.