Device class used to abstract SMBus-compliant peripherals.
More...
Device class used to abstract SMBus-compliant peripherals.
◆ SMBusDevice() [1/2]
io.treehopper.SMBusDevice.SMBusDevice |
( |
byte |
address, |
|
|
I2c |
I2CModule |
|
) |
| |
Construct an SMBus peripheral with a communication rate of 100 kHz.
- Parameters
-
address | the address of the peripheral |
I2CModule | the I2c module to use |
◆ SMBusDevice() [2/2]
io.treehopper.SMBusDevice.SMBusDevice |
( |
byte |
address, |
|
|
I2c |
I2cModule, |
|
|
int |
rateKHz |
|
) |
| |
Construct an SMBus peripheral.
- Parameters
-
address | the address of the peripheral |
I2cModule | the I2c module to use |
rateKHz | the data rate, in kHz, to use |
◆ readBufferData()
byte [] io.treehopper.SMBusDevice.readBufferData |
( |
byte |
register, |
|
|
int |
numBytes |
|
) |
| |
Read a byte array from the given register.
- Parameters
-
register | the register to read from |
numBytes | the number of bytes to read |
- Returns
- the data read
◆ readByte()
byte io.treehopper.SMBusDevice.readByte |
( |
| ) |
|
Read a single byte from the device.
- Returns
- the byte read
◆ readByteData()
byte io.treehopper.SMBusDevice.readByteData |
( |
byte |
register | ) |
|
Read a byte from the specified register.
- Parameters
-
register | the register to read from |
- Returns
- the byte read
◆ readData()
byte [] io.treehopper.SMBusDevice.readData |
( |
byte |
numBytesToRead | ) |
|
Read data directly from the device.
- Parameters
-
numBytesToRead | the number of bytes to read |
- Returns
- the read data
◆ readWord()
short io.treehopper.SMBusDevice.readWord |
( |
| ) |
|
Read a little-endian 16-bit word from the device.
- Returns
- the 16-bit value read from the device
◆ readWordBE()
short io.treehopper.SMBusDevice.readWordBE |
( |
| ) |
|
Read a big-endian 16-bit word from the device.
- Returns
- the 16-bit value read from the device
◆ readWordData()
short io.treehopper.SMBusDevice.readWordData |
( |
byte |
register | ) |
|
Read a little-endian 16-bit word from the given register.
- Parameters
-
register | the register to read from |
- Returns
- the 16-bit word
◆ readWordDataBE()
short io.treehopper.SMBusDevice.readWordDataBE |
( |
byte |
register | ) |
|
Read a big-endian 16-bit word from the given register.
- Parameters
-
register | the register to read from |
- Returns
- the 16-bit word
◆ writeBufferData()
void io.treehopper.SMBusDevice.writeBufferData |
( |
byte |
register, |
|
|
byte [] |
buffer |
|
) |
| |
Write a byte array to the given register.
- Parameters
-
register | the register to write to |
buffer | the byte array to write |
◆ writeByte()
void io.treehopper.SMBusDevice.writeByte |
( |
byte |
data | ) |
|
Write a byte to the device.
- Parameters
-
◆ writeByteData()
void io.treehopper.SMBusDevice.writeByteData |
( |
byte |
register, |
|
|
byte |
data |
|
) |
| |
Write a byte to the specified register.
- Parameters
-
register | the register to write to |
data | the data to write |
◆ writeData()
void io.treehopper.SMBusDevice.writeData |
( |
byte [] |
data | ) |
|
Write data directly to the device.
- Parameters
-
data | the data to write to the device |
◆ writeWord()
void io.treehopper.SMBusDevice.writeWord |
( |
short |
data | ) |
|
Write a little-endian 16-bit word to the device.
- Parameters
-
data | the 16-bit value to write to the device |
◆ writeWordBE()
void io.treehopper.SMBusDevice.writeWordBE |
( |
short |
data | ) |
|
Write a big-endian 16-bit word to the device.
- Parameters
-
data | the 16-bit value to write to the device |
◆ writeWordData()
void io.treehopper.SMBusDevice.writeWordData |
( |
byte |
register, |
|
|
int |
data |
|
) |
| |
Write a little-endian 16-bit word to the given register.
- Parameters
-
register | the register to write to |
data | the data to write |
◆ writeWordDataBE()
void io.treehopper.SMBusDevice.writeWordDataBE |
( |
byte |
register, |
|
|
int |
data |
|
) |
| |
Write a big-endian 16-bit word to the given register.
- Parameters
-
register | the register to write the word to |
data | the data to write |
The documentation for this class was generated from the following file:
- F:/Git/treehopper-sdk/Java/api/treehopper/src/main/java/io/treehopper/SMBusDevice.java