HF-TMC9660 Driver 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
tmc9660::TMC9660< CommType >::StopEvents Struct Reference

Configure automatic stop/latch behaviour for deviation, switches. More...

#include <tmc9660.hpp>

Collaboration diagram for tmc9660::TMC9660< CommType >::StopEvents:
[legend]

Classes

struct  StopEventsConfig
 Configuration structure for stop events auto-configuration. More...
 

Public Member Functions

bool enableDeviationStop (uint32_t max_vel_error, uint32_t max_pos_error, bool softStop=true) noexcept
 Stop when ramp target deviates from actual > thresholds.
 
bool configureReferenceSwitches (uint8_t mask, bool invert_l, bool invert_r, bool invert_h, bool swap_lr) noexcept
 Configure reference / limit-switch inputs.
 
bool getAndClearLatchedPosition (int32_t &pos) noexcept
 Read and clear the latched position from a switch event.
 
bool configureAuto (const StopEventsConfig &config) noexcept
 Auto-configure stop events parameters.
 

Private Member Functions

 StopEvents (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

template<typename CommType>
struct tmc9660::TMC9660< CommType >::StopEvents

Configure automatic stop/latch behaviour for deviation, switches.

Constructor & Destructor Documentation

◆ StopEvents()

template<typename CommType >
tmc9660::TMC9660< CommType >::StopEvents::StopEvents ( TMC9660 & parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ configureAuto()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::StopEvents::configureAuto ( const StopEventsConfig & config)
noexcept

Auto-configure stop events parameters.

Configures deviation stop thresholds and reference switch settings based on high-level requirements.

Parameters
configStop events configuration (see StopEventsConfig)
Returns
true if all configurations succeeded, false otherwise

◆ configureReferenceSwitches()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::StopEvents::configureReferenceSwitches ( uint8_t mask,
bool invert_l,
bool invert_r,
bool invert_h,
bool swap_lr )
noexcept

Configure reference / limit-switch inputs.

Parameters
maskBit-mask 0…7 ; see REFERENCE_SWITCH_ENABLE.
invert_l,R,Hinvert individual polarities.
swap_lrswap left/right wiring.

Configure reference and limit switch inputs.

Parameters
maskBit mask of switches to enable (see REFERENCE_SWITCH_ENABLE).
invert_lInvert left switch polarity.
invert_rInvert right switch polarity.
invert_hInvert home switch polarity.
swap_lrSwap left and right wiring.
Returns
true on success
See also
REFERENCE_SWITCH_* parameters in the datasheet. REFERENCE_SWITCH_*
Datasheet REFERENCE_SWITCH_ENABLE

◆ enableDeviationStop()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::StopEvents::enableDeviationStop ( uint32_t max_vel_error,
uint32_t max_pos_error,
bool softStop = true )
noexcept

Stop when ramp target deviates from actual > thresholds.

Stop when ramp target deviates from actual values beyond the allowed thresholds.

Parameters
max_vel_errorMaximum allowed velocity error.
max_pos_errorMaximum allowed position error.
soft_stopUse soft stop instead of immediate stop when true.
Returns
true on success
See also
EVENT_STOP_SETTINGS and STOP_ON_*_DEVIATION in the datasheet. STOP_ON_*_DEVIATION + EVENT_STOP_SETTINGS
Datasheet EVENT_STOP_SETTINGS

◆ getAndClearLatchedPosition()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::StopEvents::getAndClearLatchedPosition ( int32_t & pos)
noexcept

Read and clear the latched position from a switch event.

Parameters
[out]posLatched position value.
Returns
true on success
See also
LATCH_POSITION / RAMPER_LATCHED in the datasheet. LATCH_POSITION / RAMPER_LATCHED
Datasheet LATCH_POSITION

Friends And Related Symbol Documentation

◆ TMC9660

template<typename CommType >
friend class TMC9660
friend

Member Data Documentation

◆ driver

template<typename CommType >
TMC9660& tmc9660::TMC9660< CommType >::StopEvents::driver
private

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