template <class DerivedType, class IntType, size_t AddrIntSize, class ByteOrder = void, class PrinterState = void>
class I2cRegisterBase
Defined at line 29 of file ../../zircon/system/ulib/hwreg-i2c/include/hwreg/i2c.h
An instance of I2cRegisterBase represents a staging copy of a register,
which can be written to the device's register using i2c protocol. It knows the register's
address and stores a value for the register. The actual write/read is done upon calling
ReadFrom()/WriteTo() methods.
All usage rules of RegisterBase applies here with the following exceptions
- AddrIntSize should match the exact number of bytes used for register addressing.
- ReadFrom()/WriteTo() methods will return zx_status_t instead of the class object and hence
cannot be used in method chaining.
Public Members
static const int AddrSize
Public Methods
template <typename T>
DerivedType & ReadFrom (T * reg_io)
Delete base class ReadFrom() and WriteTo() methods and define new ones
which return zx_status_t in case of i2c read/write failure
Defined at line 46 of file ../../zircon/system/ulib/hwreg-i2c/include/hwreg/i2c.h
template <typename T>
DerivedType & WriteTo (T * mmio)
Defined at line 48 of file ../../zircon/system/ulib/hwreg-i2c/include/hwreg/i2c.h
zx_status_t ReadFrom (const fidl::ClientEnd<fuchsia_hardware_i2c::Device> & client)
Defined at line 52 of file ../../zircon/system/ulib/hwreg-i2c/include/hwreg/i2c.h
zx_status_t WriteTo (const fidl::ClientEnd<fuchsia_hardware_i2c::Device> & client)
Defined at line 92 of file ../../zircon/system/ulib/hwreg-i2c/include/hwreg/i2c.h