HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
Loading...
Searching...
No Matches
Esp32SPI Class Reference

ESP32 SPI implementation of TMC51x0 communication interface. More...

#include <esp32_tmc51x0_bus.hpp>

Inheritance diagram for Esp32SPI:
[legend]
Collaboration diagram for Esp32SPI:
[legend]

Public Member Functions

 Esp32SPI (spi_host_device_t host, const Esp32SpiPinConfig &pin_config, uint32_t clock_speed_hz=4000000, const tmc51x0::PinActiveLevels &active_levels=tmc51x0::PinActiveLevels{}) noexcept
 Construct ESP32 SPI communication interface with complete pin configuration.
 
void ConfigureActiveLevels (const tmc51x0::PinActiveLevels &active_levels) noexcept
 Configure pin active levels from PinActiveLevels struct.
 
const tmc51x0::PinActiveLevelsGetActiveLevels () const noexcept
 Get current active level configuration.
 
 Esp32SPI (spi_host_device_t host, gpio_num_t mosi_pin, gpio_num_t miso_pin, gpio_num_t sclk_pin, gpio_num_t cs_pin, const tmc51x0::TMC51x0PinConfig &pin_config, uint32_t clock_speed_hz=4000000, const tmc51x0::PinActiveLevels &active_levels=tmc51x0::PinActiveLevels{}) noexcept
 Construct ESP32 SPI communication interface with separate SPI pins and TMC51x0 pin config.
 
 Esp32SPI (spi_host_device_t host, gpio_num_t mosi_pin, gpio_num_t miso_pin, gpio_num_t sclk_pin, gpio_num_t cs_pin, gpio_num_t en_pin, gpio_num_t dir_pin=static_cast< gpio_num_t >(-1), gpio_num_t step_pin=static_cast< gpio_num_t >(-1), uint32_t clock_speed_hz=4000000, const tmc51x0::PinActiveLevels &active_levels=tmc51x0::PinActiveLevels{}) noexcept
 Construct ESP32 SPI communication interface (legacy constructor for backward compatibility)
 
 ~Esp32SPI () noexcept
 Destructor - cleans up SPI resources.
 
bool ApplyPinConfig (const tmc51x0::TMC51x0PinConfig &pin_config) noexcept
 Apply pin configuration structure (handles compound pins automatically)
 
bool SetPinMapping (tmc51x0::TMC51x0CtrlPin pin, gpio_num_t gpio_pin) noexcept
 Set pin mapping for a TMC51x0 control pin.
 
gpio_num_t GetPinMapping (tmc51x0::TMC51x0CtrlPin pin) const noexcept
 Get pin mapping for a TMC51x0 control pin.
 
tmc51x0::Result< void > Initialize () noexcept
 Initialize the SPI interface.
 
tmc51x0::CommMode GetMode () const noexcept
 Get communication mode (always SPI for this interface)
 
bool EnsureInitialized () noexcept
 Ensure SPI interface is initialized, initializing if necessary.
 
tmc51x0::Result< void > Deinitialize () noexcept
 Deinitialize the SPI interface.
 
tmc51x0::Result< void > SpiTransfer (const uint8_t *tx, uint8_t *rx, size_t length) noexcept
 Perform SPI transfer.
 
tmc51x0::Result< void > GpioSet (tmc51x0::TMC51x0CtrlPin pin, tmc51x0::GpioSignal signal) noexcept
 Set GPIO pin state.
 
tmc51x0::Result< tmc51x0::GpioSignalGpioRead (tmc51x0::TMC51x0CtrlPin pin) noexcept
 Read GPIO pin state.
 
void DebugLog (int level, const char *tag, const char *format, va_list args) noexcept
 Debug logging.
 
void DelayMs (uint32_t ms) noexcept
 Delay milliseconds.
 
void DelayUs (uint32_t us) noexcept
 Delay microseconds.
 
tmc51x0::Result< void > SetClkFreq (uint32_t frequency_hz) noexcept
 Set external clock frequency on CLK pin.
 
- Public Member Functions inherited from tmc51x0::SpiCommInterface< Esp32SPI >
 SpiCommInterface () noexcept
 Construct SPI communication interface.
 
 SpiCommInterface (const SpiCommInterface &)=delete
 
void SetDaisyChainLength (uint8_t total_length) noexcept
 Set the total number of devices in the daisy chain.
 
uint8_t GetDaisyChainLength () const noexcept
 Get the total number of devices in the daisy chain.
 
uint8_t AutoDetectChainLength (uint8_t max_devices=8) noexcept
 Auto-detect the daisy chain length by sending a unique command that loops back.
 
CommMode GetMode () const noexcept
 Get communication mode (always SPI for this interface)
 
Result< void > SpiTransfer (const uint8_t *tx, uint8_t *rx, size_t length) noexcept
 Low-level SPI transfer for register read/write.
 
Result< uint32_t > ReadRegister (uint8_t address, uint8_t daisy_chain_position=0) noexcept
 Read a 32-bit register via SPI.
 
Result< void > WriteRegister (uint8_t address, uint32_t value, uint8_t daisy_chain_position=0) noexcept
 Write a 32-bit register via SPI.
 
SpiCommInterfaceoperator= (const SpiCommInterface &)=delete
 
- Public Member Functions inherited from tmc51x0::CommInterface< Derived >
 CommInterface () noexcept=default
 Construct communication interface.
 
CommMode GetMode () const noexcept
 Get the underlying communication mode used by this interface.
 
Result< uint32_t > ReadRegister (uint8_t address, uint8_t address_param=0) noexcept
 Read a 32-bit register from the TMC5160.
 
Result< void > WriteRegister (uint8_t address, uint32_t value, uint8_t address_param=0) noexcept
 Write a 32-bit register to the TMC5160.
 
Result< void > GpioSet (TMC51x0CtrlPin pin, GpioSignal signal) noexcept
 Set GPIO pin signal state (output control)
 
Result< GpioSignalGpioRead (TMC51x0CtrlPin pin) noexcept
 Read GPIO pin signal state (input state)
 
Result< void > GpioSetActive (TMC51x0CtrlPin pin) noexcept
 Set GPIO pin to active state (convenience method)
 
Result< void > GpioSetInactive (TMC51x0CtrlPin pin) noexcept
 Set GPIO pin to inactive state (convenience method)
 
void DelayMs (uint32_t ms) noexcept
 Delay execution for specified milliseconds.
 
void DelayUs (uint32_t us) noexcept
 Delay execution for specified microseconds.
 
Result< void > SetPowerEnabled (bool enabled) noexcept
 Enable/disable power to the TMC51x0 (optional)
 
Result< void > PowerCycle (uint32_t power_off_ms=20, uint32_t power_on_settle_ms=20) noexcept
 Power-cycle the TMC51x0 (optional)
 
Result< void > SetClkFreq (uint32_t frequency_hz) noexcept
 Set external clock frequency on CLK pin (optional)
 
 CommInterface (const CommInterface &)=delete
 
CommInterfaceoperator= (const CommInterface &)=delete
 
void LogDebug (int level, const char *tag, const char *format,...) noexcept
 Public debug logging wrapper for external classes.
 
void LogDebug (LogLevel level, const char *tag, const char *format,...) noexcept
 LogDebug overload that accepts the driver-native LogLevel enum.
 

Private Member Functions

bool SignalToGpioLevel (tmc51x0::TMC51x0CtrlPin pin, tmc51x0::GpioSignal signal) const noexcept
 Convert signal state to physical GPIO level.
 
tmc51x0::GpioSignal GpioLevelToSignal (tmc51x0::TMC51x0CtrlPin pin, bool gpio_level) const noexcept
 Convert physical GPIO level to signal state.
 
bool configureGpioPins () noexcept
 

Private Attributes

tmc51x0::PinActiveLevels active_levels_
 Pin active level configuration storage.
 
spi_host_device_t host_
 
gpio_num_t mosi_pin_
 
gpio_num_t miso_pin_
 
gpio_num_t sclk_pin_
 
gpio_num_t cs_pin_
 
gpio_num_t en_pin_
 
gpio_num_t dir_pin_
 
gpio_num_t step_pin_
 
uint32_t clock_speed_hz_
 
spi_device_handle_t device_handle_
 
SemaphoreHandle_t spi_mutex_ {nullptr}
 
bool initialized_
 
gpio_num_t pin_mapping_ [16] {}
 Pin mapping array: maps TMC51x0CtrlPin enum to ESP32 GPIO numbers.
 

Additional Inherited Members

- Static Public Attributes inherited from tmc51x0::SpiCommInterface< Esp32SPI >
static constexpr size_t kSpiScratchBytes
 
- Protected Member Functions inherited from tmc51x0::SpiCommInterface< Esp32SPI >
 SpiCommInterface (SpiCommInterface &&)=default
 
 ~SpiCommInterface ()=default
 Protected destructor.
 
SpiCommInterfaceoperator= (SpiCommInterface &&)=default
 
- Protected Member Functions inherited from tmc51x0::CommInterface< Derived >
void DebugLog (int level, const char *tag, const char *format, va_list args) noexcept
 Debug logging function for detailed debugging information.
 
 ~CommInterface ()=default
 Protected destructor.
 
 CommInterface (CommInterface &&)=default
 
CommInterfaceoperator= (CommInterface &&)=default
 
- Protected Attributes inherited from tmc51x0::SpiCommInterface< Esp32SPI >
uint8_t total_chain_length_
 Total number of devices in the daisy chain.
 
uint8_t user_specified_chain_length_
 
bool chain_length_verified_
 

Detailed Description

ESP32 SPI implementation of TMC51x0 communication interface.

This class provides SPI communication for the TMC51x0 using ESP-IDF SPI driver with full GPIO pin support.

Pin Configuration Example (ESP32-C6):

Esp32SPI spi(SPI2_HOST,
GPIO_NUM_6, // MOSI
GPIO_NUM_12, // MISO
GPIO_NUM_5, // SCLK
GPIO_NUM_18, // CS
GPIO_NUM_11, // EN (DRV_EN)
-1, // DIR (not used in SPI mode with internal ramp generator)
-1, // STEP (not used in SPI mode with internal ramp generator)
4000000); // 4 MHz SPI clock
// Configure additional pins
spi.SetPinMapping(tmc51x0::TMC51x0CtrlPin::DIAG0, GPIO_NUM_XX); // DIAG0 pin
spi.SetPinMapping(tmc51x0::TMC51x0CtrlPin::DIAG1, GPIO_NUM_XX); // DIAG1 pin
spi.SetPinMapping(tmc51x0::TMC51x0CtrlPin::CLK, GPIO_NUM_10); // CLK pin (GPIO10)
ESP32 SPI implementation of TMC51x0 communication interface.
Definition esp32_tmc51x0_bus.hpp:120

Constructor & Destructor Documentation

◆ Esp32SPI() [1/3]

Esp32SPI::Esp32SPI ( spi_host_device_t host,
const Esp32SpiPinConfig & pin_config,
uint32_t clock_speed_hz = 4000000,
const tmc51x0::PinActiveLevels & active_levels = tmc51x0::PinActiveLevels{} )
inlinenoexcept

Construct ESP32 SPI communication interface with complete pin configuration.

Parameters
hostSPI host device (e.g., SPI2_HOST)
pin_configComplete pin configuration including SPI pins and TMC51x0 control pins
clock_speed_hzSPI clock speed in Hz (max 4 MHz recommended)
active_levelsPin active level configuration (optional, uses datasheet defaults if not provided)

This is the recommended constructor as it allows all GPIO pins (SPI + TMC51x0 control) to be configured in a single structure, making it easier to manage pin assignments.

Note
Compound pins are automatically handled - if you specify dir_pin, ref_right_pin is automatically mapped to the same GPIO (and vice versa). Same for step_pin/ref_left_pin, enc_a_pin/dc_in_pin, enc_b_pin/dc_en_pin, and enc_n_pin/dc_out_pin.
EN pin (DRV_ENN) is active LOW to enable the power stage by default.
Users can override active levels by creating a PinActiveLevels struct, modifying specific pins, and passing it to this constructor.

Example:

// Use defaults
Esp32SPI spi(SPI2_HOST, pin_config);
// Override for custom board
levels.en = true; // Board has inverter on EN pin
Esp32SPI spi(SPI2_HOST, pin_config, 4000000, levels);
Pin active level configuration structure.
Definition tmc51x0_comm_interface.hpp:352
bool en
EN pin (DRV_ENN, pin 28): LOW=enable (active LOW)
Definition tmc51x0_comm_interface.hpp:354

◆ Esp32SPI() [2/3]

Esp32SPI::Esp32SPI ( spi_host_device_t host,
gpio_num_t mosi_pin,
gpio_num_t miso_pin,
gpio_num_t sclk_pin,
gpio_num_t cs_pin,
const tmc51x0::TMC51x0PinConfig & pin_config,
uint32_t clock_speed_hz = 4000000,
const tmc51x0::PinActiveLevels & active_levels = tmc51x0::PinActiveLevels{} )
inlinenoexcept

Construct ESP32 SPI communication interface with separate SPI pins and TMC51x0 pin config.

Parameters
hostSPI host device (e.g., SPI2_HOST)
mosi_pinMOSI GPIO pin
miso_pinMISO GPIO pin
sclk_pinSCLK GPIO pin
cs_pinCS GPIO pin
pin_configTMC51x0 pin configuration structure (handles compound pins automatically)
clock_speed_hzSPI clock speed in Hz (max 4 MHz recommended)
active_levelsPin active level configuration (optional, uses datasheet defaults if not provided)
Note
Compound pins are automatically handled - if you specify dir_pin, ref_right_pin is automatically mapped to the same GPIO (and vice versa). Same for step_pin/ref_left_pin, enc_a_pin/dc_in_pin, enc_b_pin/dc_en_pin, and enc_n_pin/dc_out_pin.
EN pin (DRV_ENN) is active LOW to enable the power stage by default.
This constructor is provided for backward compatibility. Consider using the constructor with Esp32SpiPinConfig for a more unified configuration.

◆ Esp32SPI() [3/3]

Esp32SPI::Esp32SPI ( spi_host_device_t host,
gpio_num_t mosi_pin,
gpio_num_t miso_pin,
gpio_num_t sclk_pin,
gpio_num_t cs_pin,
gpio_num_t en_pin,
gpio_num_t dir_pin = static_cast<gpio_num_t>(-1),
gpio_num_t step_pin = static_cast<gpio_num_t>(-1),
uint32_t clock_speed_hz = 4000000,
const tmc51x0::PinActiveLevels & active_levels = tmc51x0::PinActiveLevels{} )
inlinenoexcept

Construct ESP32 SPI communication interface (legacy constructor for backward compatibility)

Parameters
hostSPI host device (e.g., SPI2_HOST)
mosi_pinMOSI GPIO pin
miso_pinMISO GPIO pin
sclk_pinSCLK GPIO pin
cs_pinCS GPIO pin
en_pinEN control pin (DRV_ENN, active LOW enables power stage)
dir_pinDIR control pin (REFR_DIR, optional - used in external step/dir mode, use -1 if not connected)
step_pinSTEP control pin (REFL_STEP, optional - used in external step/dir mode, use -1 if not connected)
clock_speed_hzSPI clock speed in Hz (max 4 MHz recommended)
active_levelsPin active level configuration (optional, uses datasheet defaults if not provided)
Note
For SPI mode with internal ramp generator (SD_MODE=0), DIR and STEP pins are not used. Pass -1 if not connected.
EN pin (DRV_ENN) is active LOW to enable the power stage by default.
Deprecated
Use constructor with TMC51x0PinConfig struct for better pin management

◆ ~Esp32SPI()

Esp32SPI::~Esp32SPI ( )
inlinenoexcept

Destructor - cleans up SPI resources.

Here is the call graph for this function:

Member Function Documentation

◆ ApplyPinConfig()

bool Esp32SPI::ApplyPinConfig ( const tmc51x0::TMC51x0PinConfig & pin_config)
inlinenoexcept

Apply pin configuration structure (handles compound pins automatically)

Parameters
pin_configPin configuration structure
Returns
true if configuration was applied successfully

This method automatically handles compound pins (pins that share the same physical GPIO):

  • If dir_pin is set, ref_right_pin is automatically mapped to the same GPIO
  • If step_pin is set, ref_left_pin is automatically mapped to the same GPIO
  • If enc_a_pin is set, dc_in_pin is automatically mapped to the same GPIO
  • If enc_b_pin is set, dc_en_pin is automatically mapped to the same GPIO
  • If enc_n_pin is set, dc_out_pin is automatically mapped to the same GPIO

You can override individual mappings using SetPinMapping() if needed.

Here is the call graph for this function:

◆ ConfigureActiveLevels()

void Esp32SPI::ConfigureActiveLevels ( const tmc51x0::PinActiveLevels & active_levels)
inlinenoexcept

Configure pin active levels from PinActiveLevels struct.

Parameters
active_levelsPin active level configuration structure

Allows users to update active levels after construction, useful for runtime configuration or if board setup changes.

Example:

levels.en = true; // Override EN pin active level
spi.ConfigureActiveLevels(levels);

◆ configureGpioPins()

bool Esp32SPI::configureGpioPins ( )
inlineprivatenoexcept

◆ DebugLog()

void Esp32SPI::DebugLog ( int level,
const char * tag,
const char * format,
va_list args )
inlinenoexcept

Debug logging.

◆ Deinitialize()

tmc51x0::Result< void > Esp32SPI::Deinitialize ( )
inlinenoexcept

Deinitialize the SPI interface.

Returns
Result<void> indicating success or error code
Here is the caller graph for this function:

◆ DelayMs()

void Esp32SPI::DelayMs ( uint32_t ms)
inlinenoexcept

Delay milliseconds.

◆ DelayUs()

void Esp32SPI::DelayUs ( uint32_t us)
inlinenoexcept

Delay microseconds.

◆ EnsureInitialized()

bool Esp32SPI::EnsureInitialized ( )
inlinenoexcept

Ensure SPI interface is initialized, initializing if necessary.

Returns
true if initialized (or successfully initialized), false if initialization failed

This is a convenience method that checks initialization status and calls Initialize() if needed. Useful for lazy initialization patterns.

Here is the call graph for this function:

◆ GetActiveLevels()

const tmc51x0::PinActiveLevels & Esp32SPI::GetActiveLevels ( ) const
inlinenoexcept

Get current active level configuration.

Returns
PinActiveLevels struct with current active level settings

◆ GetMode()

tmc51x0::CommMode Esp32SPI::GetMode ( ) const
inlinenoexcept

Get communication mode (always SPI for this interface)

Returns
CommMode::SPI

◆ GetPinMapping()

gpio_num_t Esp32SPI::GetPinMapping ( tmc51x0::TMC51x0CtrlPin pin) const
inlinenoexcept

Get pin mapping for a TMC51x0 control pin.

Parameters
pinTMC51x0 control pin identifier
Returns
ESP32 GPIO pin number, or -1 if not mapped
Here is the caller graph for this function:

◆ GpioLevelToSignal()

tmc51x0::GpioSignal Esp32SPI::GpioLevelToSignal ( tmc51x0::TMC51x0CtrlPin pin,
bool gpio_level ) const
inlineprivatenoexcept

Convert physical GPIO level to signal state.

Parameters
pinThe TMC51x0 control pin
gpio_levelPhysical GPIO level (true=HIGH, false=LOW)
Returns
Signal state (ACTIVE or INACTIVE)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GpioRead()

tmc51x0::Result< tmc51x0::GpioSignal > Esp32SPI::GpioRead ( tmc51x0::TMC51x0CtrlPin pin)
inlinenoexcept

Read GPIO pin state.

Parameters
pinThe TMC51x0 control pin to read
Returns
Result<GpioSignal> containing the signal state, or error code

Supports reading diagnostic pins (DIAG0, DIAG1), reference switch pins (REFL_STEP, REFR_DIR), encoder pins (ENCA, ENCB, ENCN), and CLK pin.

Note
Pin must be mapped using SetPinMapping() before use.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GpioSet()

tmc51x0::Result< void > Esp32SPI::GpioSet ( tmc51x0::TMC51x0CtrlPin pin,
tmc51x0::GpioSignal signal )
inlinenoexcept

Set GPIO pin state.

Parameters
pinThe TMC51x0 control pin to control
signalThe desired signal state (ACTIVE or INACTIVE)
Returns
true if the GPIO was set successfully, false otherwise

Supports all TMC51x0 control pins: EN, DIR, STEP, REFL_STEP, REFR_DIR, ENCA, ENCB, ENCN, DCEN, DCIN, DCO, CLK.

Note
Diagnostic pins (DIAG0, DIAG1) and DCO are read-only and cannot be set.
Encoder pins (ENCA, ENCB, ENCN) are read-only when used as encoder inputs.
Pin must be mapped using SetPinMapping() before use.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

tmc51x0::Result< void > Esp32SPI::Initialize ( )
inlinenoexcept

Initialize the SPI interface.

Returns
Result<void> indicating success or error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetClkFreq()

tmc51x0::Result< void > Esp32SPI::SetClkFreq ( uint32_t frequency_hz)
inlinenoexcept

Set external clock frequency on CLK pin.

Parameters
frequency_hzDesired clock frequency in Hz (0 = use internal clock, set CLK pin to GND)
Returns
true if clock was configured successfully, false if not supported or failed

Internal Clock Mode (frequency_hz = 0):

  • Sets CLK pin to OUTPUT mode and drives it LOW (GND)
  • Enables the internal 12 MHz oscillator
  • Returns true if CLK pin was successfully configured
  • Returns false if CLK pin is not mapped

External Clock Mode (frequency_hz > 0):

  • Currently not implemented (would require PWM generation)
  • Returns false to indicate external clock must be provided by external hardware
  • User should provide external clock signal on CLK pin
Note
CLK pin must be mapped using SetPinMapping() before calling this function.
For internal clock, the driver will use 12 MHz for all timing calculations.
For external clock, the actual frequency must match the frequency_hz parameter.
Here is the call graph for this function:

◆ SetPinMapping()

bool Esp32SPI::SetPinMapping ( tmc51x0::TMC51x0CtrlPin pin,
gpio_num_t gpio_pin )
inlinenoexcept

Set pin mapping for a TMC51x0 control pin.

Parameters
pinTMC51x0 control pin identifier
gpio_pinESP32 GPIO pin number (or -1 to disable/unmap)
Returns
true if pin mapping was set successfully

Use this method to configure additional pins like DIAG0, DIAG1, CLK, encoder pins, etc.

Example:

spi.SetPinMapping(tmc51x0::TMC51x0CtrlPin::DIAG0, GPIO_NUM_XX);
spi.SetPinMapping(tmc51x0::TMC51x0CtrlPin::DIAG1, GPIO_NUM_XX);
spi.SetPinMapping(tmc51x0::TMC51x0CtrlPin::CLK, GPIO_NUM_10);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignalToGpioLevel()

bool Esp32SPI::SignalToGpioLevel ( tmc51x0::TMC51x0CtrlPin pin,
tmc51x0::GpioSignal signal ) const
inlineprivatenoexcept

Convert signal state to physical GPIO level.

Parameters
pinThe TMC51x0 control pin
signalThe signal state (ACTIVE or INACTIVE)
Returns
Physical GPIO level (true=HIGH, false=LOW)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpiTransfer()

tmc51x0::Result< void > Esp32SPI::SpiTransfer ( const uint8_t * tx,
uint8_t * rx,
size_t length )
inlinenoexcept

Perform SPI transfer.

Parameters
txTransmit buffer
rxReceive buffer
lengthNumber of bytes to transfer
Returns
true if successful, false otherwise

Concurrency / RTOS Notes (Important)

  • Single-task assumption (current examples): This implementation assumes the driver is accessed from a single task. If you call into the driver from multiple tasks concurrently, you must add a mutex around spi_device_transmit() (or provide external serialization).
  • Not ISR-safe: spi_device_transmit() may block; do not call this from an ISR.
  • Why serialization matters: The core SPI comm layer uses per-instance scratch buffers and expects SPI transfers to be serialized.

Member Data Documentation

◆ active_levels_

tmc51x0::PinActiveLevels Esp32SPI::active_levels_
private

Pin active level configuration storage.

Stores the PinActiveLevels struct which defines the physical GPIO level (HIGH or LOW) that corresponds to the ACTIVE state for each TMC51x0 control pin. This struct is initialized from the constructor parameter (or defaults).

◆ clock_speed_hz_

uint32_t Esp32SPI::clock_speed_hz_
private

◆ cs_pin_

gpio_num_t Esp32SPI::cs_pin_
private

◆ device_handle_

spi_device_handle_t Esp32SPI::device_handle_
private

◆ dir_pin_

gpio_num_t Esp32SPI::dir_pin_
private

◆ en_pin_

gpio_num_t Esp32SPI::en_pin_
private

◆ host_

spi_host_device_t Esp32SPI::host_
private

◆ initialized_

bool Esp32SPI::initialized_
private

◆ miso_pin_

gpio_num_t Esp32SPI::miso_pin_
private

◆ mosi_pin_

gpio_num_t Esp32SPI::mosi_pin_
private

◆ pin_mapping_

gpio_num_t Esp32SPI::pin_mapping_[16] {}
private

Pin mapping array: maps TMC51x0CtrlPin enum to ESP32 GPIO numbers.

Array indices correspond to TMC51x0CtrlPin enum values. -1 indicates the pin is not mapped.

◆ sclk_pin_

gpio_num_t Esp32SPI::sclk_pin_
private

◆ spi_mutex_

SemaphoreHandle_t Esp32SPI::spi_mutex_ {nullptr}
private

◆ step_pin_

gpio_num_t Esp32SPI::step_pin_
private

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