idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::i2c::operation Struct Reference

Describes a single operation in a custom I2C transaction sequence. More...

Public Attributes

operation_command command
 The operation to perform.
 
bool ack_check = true
 (write) Whether to check for ACK.
 
std::span< const uint8_twrite_data
 (write) Data to send.
 
std::span< uint8_tread_data
 (read) Buffer to receive into.
 
ack_value ack_type = ack_value::ack
 (read) ACK value to send after reading.
 

Detailed Description

Describes a single operation in a custom I2C transaction sequence.

Use with master_device::execute_operations() to perform arbitrary START / WRITE / READ / STOP sequences.

For write operations, set command to operation_command::write and populate write_data. For read operations, set command to operation_command::read, populate read_data, and set ack_type (must be ack_value::nack if the next operation is a STOP).

Definition at line 133 of file master.hpp.

Member Data Documentation

◆ ack_check

bool idfxx::i2c::operation::ack_check = true

(write) Whether to check for ACK.

Definition at line 135 of file master.hpp.

◆ ack_type

ack_value idfxx::i2c::operation::ack_type = ack_value::ack

(read) ACK value to send after reading.

Definition at line 138 of file master.hpp.

◆ command

operation_command idfxx::i2c::operation::command

The operation to perform.

Definition at line 134 of file master.hpp.

◆ read_data

std::span<uint8_t> idfxx::i2c::operation::read_data

(read) Buffer to receive into.

Definition at line 137 of file master.hpp.

◆ write_data

std::span<const uint8_t> idfxx::i2c::operation::write_data

(write) Data to send.

Definition at line 136 of file master.hpp.


The documentation for this struct was generated from the following file: