Base I2c interface.
#include <I2c.h>
|
virtual | ~I2c () |
|
virtual void | speed (double value)=0 |
| Set the speed, in kHz, to use. More...
|
|
virtual double | speed ()=0 |
| Gets the current speed, in kHz. More...
|
|
virtual void | enabled (bool value)=0 |
| Sets whether the module is enabled. More...
|
|
virtual bool | enabled ()=0 |
| Gets whether the module is enabled. More...
|
|
virtual std::vector< uint8_t > | sendReceive (uint8_t address, std::vector< uint8_t > data, size_t numBytesToRead=0)=0 |
| Send and/or receive data with the i2c module. More...
|
|
◆ ~I2c()
◆ enabled() [1/2]
virtual void enabled |
( |
bool |
value | ) |
|
|
pure virtual |
◆ enabled() [2/2]
◆ sendReceive()
virtual std::vector<uint8_t> sendReceive |
( |
uint8_t |
address, |
|
|
std::vector< uint8_t > |
data, |
|
|
size_t |
numBytesToRead = 0 |
|
) |
| |
|
pure virtual |
- Parameters
-
[in] | address | the address of the slave i2c board you wish to communicate with |
[in] | data | a vector containing the bytes to write |
[in] | numBytesToRead | the number of bytes to read from the board |
- Returns
- the read data, or nullptr.
Implemented in HardwareI2c.
◆ speed() [1/2]
virtual void speed |
( |
double |
value | ) |
|
|
pure virtual |
◆ speed() [2/2]
The documentation for this class was generated from the following file:
- F:/Git/treehopper-sdk/C++/API/inc/I2c.h