18 struct i2c_rdwr_ioctl_data;
20 namespace duds {
namespace hardware {
namespace interface {
namespace linux {
53 void io(i2c_rdwr_ioctl_data &idat);
65 DevI2c(
const std::string &devname,
int devaddr);
Implementation of the I2c interface using the Linux kernel's user-space support.
DevI2c(const std::string &devname, int devaddr)
Opens the device file for the bus.
virtual void converse(Conversation &conv)
Conducts I2C communication with a device using the Linux i2c-dev driver.
void io(i2c_rdwr_ioctl_data &idat)
Calls ioctl to request the kernel do the I2C communication, the check for error conditions and throw ...
static std::wstring_convert< std::codecvt_utf8< char32_t >, char32_t > conv
String converter; UTF-8 to/from UTF-32.
int addr
The device (slave) address.
~DevI2c()
Closes the device file.
virtual int address() const
Returns the address of the device that this object will attempt to communicate with.
int fd
The file descriptor for the open device.
std::string dev
Stores the device file name for later error reporting.
Represents a two-way conversation with a device.