SPI_STATUS structure - status flags returned with each SPI datagram.
More...
#include <tmc51x0_comm_interface.hpp>
|
| bool | HasError () const noexcept |
| | Check if any error flags are set.
|
| |
| bool | ResetFlag () const noexcept |
| | Get reset flag (bit 0)
|
| |
| bool | DriverError () const noexcept |
| | Get driver error flag (bit 1)
|
| |
| bool | StallGuard2 () const noexcept |
| | Get StallGuard2 flag (bit 2)
|
| |
| bool | Standstill () const noexcept |
| | Get standstill flag (bit 3)
|
| |
| bool | VelocityReached () const noexcept |
| | Get velocity reached flag (bit 4)
|
| |
| bool | PositionReached () const noexcept |
| | Get position reached flag (bit 5)
|
| |
| bool | StopLeft () const noexcept |
| | Get stop left switch flag (bit 6)
|
| |
| bool | StopRight () const noexcept |
| | Get stop right switch flag (bit 7)
|
| |
| void | FormatStatusBits (char *out, size_t cap) const noexcept |
| | Format status bits as compact string (bit names and values)
|
| |
| const char * | ToString () const noexcept |
| | Format status flags as human-readable string.
|
| |
|
| static SpiStatus | FromByte (uint8_t status_byte) noexcept |
| | Extract SPI_STATUS from response byte.
|
| |
|
| uint8_t | value |
| | Raw SPI_STATUS byte value.
|
| |
SPI_STATUS structure - status flags returned with each SPI datagram.
Per datasheet section 4.1.2, SPI_STATUS is transmitted with each SPI access in bits 39 to 32 (byte 0 of response). New status information becomes latched at the end of each access and is available with the next SPI transfer.
◆ DriverError()
| bool tmc51x0::SpiStatus::DriverError |
( |
| ) |
const |
|
inlinenoexcept |
Get driver error flag (bit 1)
- Returns
- true if driver error occurred
◆ FormatStatusBits()
| void tmc51x0::SpiStatus::FormatStatusBits |
( |
char * | out, |
|
|
size_t | cap ) const |
|
inlinenoexcept |
Format status bits as compact string (bit names and values)
- Parameters
-
| out | Destination buffer |
| cap | Destination capacity in bytes |
Output format: "RST:0 STST:0 VEL:0 POS:0 STOP_L:0 STOP_R:0 SG2:0 DRV_ERR:0"
- Note
- No heap allocation (embedded-friendly).
◆ FromByte()
| static SpiStatus tmc51x0::SpiStatus::FromByte |
( |
uint8_t | status_byte | ) |
|
|
inlinestaticnoexcept |
Extract SPI_STATUS from response byte.
- Parameters
-
| status_byte | Byte 0 from SPI response (bits 39-32) |
- Returns
- SpiStatus structure with parsed bits
◆ HasError()
| bool tmc51x0::SpiStatus::HasError |
( |
| ) |
const |
|
inlinenoexcept |
Check if any error flags are set.
- Returns
- true if driver_error is set (reset_flag is informational, not an error)
Note: Reset flag indicates the chip was reset (normal on power-up) and is cleared when read. Only driver_error indicates an actual error condition.
◆ PositionReached()
| bool tmc51x0::SpiStatus::PositionReached |
( |
| ) |
const |
|
inlinenoexcept |
Get position reached flag (bit 5)
- Returns
- true if target position reached (motion controller only)
◆ ResetFlag()
| bool tmc51x0::SpiStatus::ResetFlag |
( |
| ) |
const |
|
inlinenoexcept |
Get reset flag (bit 0)
- Returns
- true if reset has occurred
◆ StallGuard2()
| bool tmc51x0::SpiStatus::StallGuard2 |
( |
| ) |
const |
|
inlinenoexcept |
Get StallGuard2 flag (bit 2)
- Returns
- true if StallGuard flag is active
◆ Standstill()
| bool tmc51x0::SpiStatus::Standstill |
( |
| ) |
const |
|
inlinenoexcept |
Get standstill flag (bit 3)
- Returns
- true if motor is in standstill
◆ StopLeft()
| bool tmc51x0::SpiStatus::StopLeft |
( |
| ) |
const |
|
inlinenoexcept |
Get stop left switch flag (bit 6)
- Returns
- true if stop left switch is active (motion controller only)
◆ StopRight()
| bool tmc51x0::SpiStatus::StopRight |
( |
| ) |
const |
|
inlinenoexcept |
Get stop right switch flag (bit 7)
- Returns
- true if stop right switch is active (motion controller only)
◆ ToString()
| const char * tmc51x0::SpiStatus::ToString |
( |
| ) |
const |
|
inlinenoexcept |
Format status flags as human-readable string.
- Returns
- String describing active flags (for debug logging)
Note: Reset flag is informational (normal on power-up), not an error
◆ VelocityReached()
| bool tmc51x0::SpiStatus::VelocityReached |
( |
| ) |
const |
|
inlinenoexcept |
Get velocity reached flag (bit 4)
- Returns
- true if target velocity reached (motion controller only)
◆ value
| uint8_t tmc51x0::SpiStatus::value |
Raw SPI_STATUS byte value.
The documentation for this struct was generated from the following file: