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

SPI transaction descriptor for full-control transactions. More...

Public Attributes

idfxx::flags< trans_flagsflags = {}
 Per-transaction flags.
 
uint16_t cmd = 0
 Command data (length set by device config or variable_cmd).
 
uint64_t addr = 0
 Address data (length set by device config or variable_addr).
 
std::span< const uint8_ttx_buffer = {}
 Transmit buffer, or empty for no MOSI phase.
 
std::span< uint8_trx_buffer = {}
 Receive buffer, or empty for no MISO phase.
 
size_t length = 0
 Total data length in bits.
 
size_t rx_length = 0
 Receive length in bits (0 = same as length).
 
freq::hertz override_freq {0}
 Override clock speed for this transaction (0 = no override).
 
uint8_t command_bits = 0
 Command length for variable_cmd flag.
 
uint8_t address_bits = 0
 Address length for variable_addr flag.
 
uint8_t dummy_bits = 0
 Dummy length for variable_dummy flag.
 

Detailed Description

SPI transaction descriptor for full-control transactions.

All length fields are in bits.

A transaction is a value type: it can be freely copied, moved, and stored in containers (e.g. std::vector). When passed to the async queue API, the transaction value itself may be dropped or reused once queue_trans() returns — only the buffers referenced by tx_buffer / rx_buffer must remain valid until the returned future signals completion.

Note
For simple byte-oriented transfers, prefer the simple API methods (transmit/receive/transfer) which handle bit-length conversion automatically.

Definition at line 175 of file master.hpp.

Member Data Documentation

◆ addr

uint64_t idfxx::spi::transaction::addr = 0

Address data (length set by device config or variable_addr).

Definition at line 178 of file master.hpp.

◆ address_bits

uint8_t idfxx::spi::transaction::address_bits = 0

Address length for variable_addr flag.

Definition at line 185 of file master.hpp.

◆ cmd

uint16_t idfxx::spi::transaction::cmd = 0

Command data (length set by device config or variable_cmd).

Definition at line 177 of file master.hpp.

◆ command_bits

uint8_t idfxx::spi::transaction::command_bits = 0

Command length for variable_cmd flag.

Definition at line 184 of file master.hpp.

◆ dummy_bits

uint8_t idfxx::spi::transaction::dummy_bits = 0

Dummy length for variable_dummy flag.

Definition at line 186 of file master.hpp.

◆ flags

idfxx::flags<trans_flags> idfxx::spi::transaction::flags = {}

Per-transaction flags.

Definition at line 176 of file master.hpp.

◆ length

size_t idfxx::spi::transaction::length = 0

Total data length in bits.

Definition at line 181 of file master.hpp.

◆ override_freq

freq::hertz idfxx::spi::transaction::override_freq {0}

Override clock speed for this transaction (0 = no override).

Definition at line 183 of file master.hpp.

◆ rx_buffer

std::span<uint8_t> idfxx::spi::transaction::rx_buffer = {}

Receive buffer, or empty for no MISO phase.

Definition at line 180 of file master.hpp.

◆ rx_length

size_t idfxx::spi::transaction::rx_length = 0

Receive length in bits (0 = same as length).

Definition at line 182 of file master.hpp.

◆ tx_buffer

std::span<const uint8_t> idfxx::spi::transaction::tx_buffer = {}

Transmit buffer, or empty for no MOSI phase.

Definition at line 179 of file master.hpp.


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