|
Treehopper C# API
|
I2c master device More...
Public Member Functions | |
| Task< byte[]> | SendReceiveAsync (byte address, byte[] dataToWrite, byte numBytesToRead) |
| Perform an I2c transaction to a peripheral slave device using this port. More... | |
Properties | |
| double | Speed [get, set] |
| The speed, in KHz, that the bus should be operated at. More... | |
| bool | Enabled [get, set] |
| Whether this I2c port should be enabled or disabled More... | |
I2c master device
This interface is used as a contract for I2C devices.
For documentation on Treehopper's I2C peripheral, consult HardwareI2C
| Task<byte[]> SendReceiveAsync | ( | byte | address, |
| byte [] | dataToWrite, | ||
| byte | numBytesToRead | ||
| ) |
Perform an I2c transaction to a peripheral slave device using this port.
| address | The 7-bit address of the slave. Valid range is 0-127. |
| dataToWrite | A byte array of the data to write to the device. |
| numBytesToRead | The number of bytes to read and return. |
Implemented in HardwareI2C, and I2cMuxPort.
|
getset |
The speed, in KHz, that the bus should be operated at.
The default is 100 KHz for most modules.
|
getset |
Whether this I2c port should be enabled or disabled