class I2cChannel
Defined at line 14 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
Public Methods
zx::result<I2cChannel> FromIncoming (fdf::Namespace & incoming, std::string_view parent_name)
Returns an `I2cChannel` that is connected to the i2c fidl service `parent_name` instance found
in the namespace `incoming`.
Defined at line 9 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
zx::result<size_t> ReadSync (uint8_t addr, std::span<uint8_t> read_data)
Performs typical i2c read: Writes `addr` (1 byte) and then reads `read_data.size()` bytes and
puts them in `read_data`. Returns the number of bytes read.
Defined at line 18 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
zx::result<> WriteSync (std::span<const uint8_t> write_data)
Writes `write_data` with no trailing read.
Defined at line 23 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
RetryResult<size_t> ReadSyncRetries (uint8_t addr, std::span<uint8_t> read_data, uint8_t max_retry_count, zx::duration retry_delay)
ReadSync() that will retry `max_retry_count` times. The function will wait for `retry_delay`
between each retry.
Defined at line 27 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
RetryResult<> WriteSyncRetries (std::span<const uint8_t> write_data, size_t max_retry_count, zx::duration retry_delay)
WriteSync() that will retry `max_retry_count` times. The function will wait for `retry_delay`
between each retry.
Defined at line 35 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
void I2cChannel ()
Defined at line 38 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
void I2cChannel (fidl::ClientEnd<fuchsia_hardware_i2c::Device> client)
Defined at line 40 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
void I2cChannel (I2cChannel && other)
Defined at line 43 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
I2cChannel & operator= (I2cChannel && other)
Defined at line 44 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
RetryResult<size_t> WriteReadSyncRetries (std::span<const uint8_t> write_data, std::span<uint8_t> read_data, size_t max_retry_count, zx::duration retry_delay)
WriteSync() that will retry `max_retry_count` times. The function will wait for `retry_delay`
between each retry. Returns the number of bytes read.
Defined at line 45 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
void I2cChannel (const I2cChannel & other)
Defined at line 46 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
I2cChannel & operator= (const I2cChannel & other)
Defined at line 47 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
void ~I2cChannel ()
Defined at line 49 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
zx::result<size_t> WriteReadSync (std::span<const uint8_t> write_data, std::span<uint8_t> read_data)
Writes `write_data` and then reads `read_data.size()` bytes and puts them in `read_data`.
Defined at line 58 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
bool is_valid ()
Defined at line 83 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.h
fidl::WireResult<fuchsia_hardware_i2c::Device::Transfer> Transfer (fidl::VectorView<fuchsia_hardware_i2c::wire::Transaction> transactions)
Defined at line 117 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc
fidl::WireResult<fuchsia_hardware_i2c::Device::GetName> GetName ()
Defined at line 122 of file ../../src/devices/i2c/lib/i2c-channel/i2c-channel.cc