HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
TMC9660::RAMDebug Namespace Reference

Enumerations

enum class  RamDebugSub : uint8_t {
  Init = 0 , SetSampleCount = 1 , SetPrescaler = 3 , SetChannel = 4 ,
  SetTriggerChannel = 5 , SetTriggerMaskShift = 6 , TriggerStart = 7 , GetState = 8 ,
  ReadSample = 9 , GetInfo = 10 , GetChannelType = 11 , GetChannelAddress = 12 ,
  SetPreTriggerCount = 13 , GetPreTriggerCount = 14
}
 RAMDebug subcommands. More...
 
enum class  InfoSelect : uint8_t {
  MaxChannels = 0 , MaxSamples = 1 , FrequencyHz = 2 , CapturedSamples = 3 ,
  PrescalerOnTrigger = 4
}
 RAMDebug info selections (for subcommand GetInfo) More...
 
enum class  RamDebugState : uint8_t {
  Idle = 0 , Trigger = 1 , Capture = 2 , Complete = 3 ,
  PreTrigger = 4
}
 RAMDebug states (returned by GetState) More...
 
enum class  TriggerType : uint8_t {
  NoTrigger = 0 , RisingEdgeS = 1 , FallingEdgeS = 2 , AnyEdgeS = 3 ,
  RisingEdgeU = 4 , FallingEdgeU = 5 , AnyEdgeU = 6
}
 Trigger types (for TriggerStart) More...
 

Functions

static uint16_t ramDebugOffset (RamDebugSub sub, uint8_t index=0)
 Construct the RAMDebug register offset for a given subcommand and index.
 

Variables

static constexpr uint8_t RAMDEBUG_BLOCK = 31
 Block number for RAMDebug (SPI interface)
 
static constexpr uint8_t RAMDEBUG_UART_CMD = 142
 UART command number for RAMDebug.
 

Enumeration Type Documentation

◆ InfoSelect

enum class TMC9660::RAMDebug::InfoSelect : uint8_t
strong

RAMDebug info selections (for subcommand GetInfo)

Options for retrieving general RAMDebug information.

Enumerator
MaxChannels 

Maximum number of channels supported.

MaxSamples 

Maximum number of samples supported.

FrequencyHz 

RAMDebug frequency in Hz.

CapturedSamples 

Number of samples already captured.

PrescalerOnTrigger 

Prescaler value at the trigger event.

◆ RamDebugState

enum class TMC9660::RAMDebug::RamDebugState : uint8_t
strong

RAMDebug states (returned by GetState)

Represents the current state of the RAMDebug system.

Enumerator
Idle 

RAMDebug is not running and can be configured.

Trigger 

Waiting for the trigger event.

Capture 

Capturing samples after the trigger.

Complete 

Capture is complete, samples can be downloaded.

PreTrigger 

Capturing pretrigger samples.

◆ RamDebugSub

enum class TMC9660::RAMDebug::RamDebugSub : uint8_t
strong

RAMDebug subcommands.

Subcommands used to configure and operate the RAMDebug feature.

Enumerator
Init 

Initialize and reset RAMDebug.

SetSampleCount 

Set the total number of samples to collect.

SetPrescaler 

Set the prescaler (divider = value + 1).

SetChannel 

Configure a capture channel.

SetTriggerChannel 

Configure the trigger channel.

SetTriggerMaskShift 

Set mask and shift before trigger evaluation.

TriggerStart 

Set trigger type and start measurement.

GetState 

Read the current RAMDebug state.

ReadSample 

Read a captured sample by index.

GetInfo 

Read general RAMDebug information.

GetChannelType 

Read the configured channel type.

GetChannelAddress 

Read the configured channel address.

SetPreTriggerCount 

Set the total number of pretrigger samples.

GetPreTriggerCount 

Read the total number of pretrigger samples.

◆ TriggerType

enum class TMC9660::RAMDebug::TriggerType : uint8_t
strong

Trigger types (for TriggerStart)

Defines the trigger types for starting a measurement.

Enumerator
NoTrigger 

No trigger.

RisingEdgeS 

Trigger on signed rising edge.

FallingEdgeS 

Trigger on signed falling edge.

AnyEdgeS 

Trigger on any signed edge.

RisingEdgeU 

Trigger on unsigned rising edge.

FallingEdgeU 

Trigger on unsigned falling edge.

AnyEdgeU 

Trigger on any unsigned edge.

Function Documentation

◆ ramDebugOffset()

static uint16_t TMC9660::RAMDebug::ramDebugOffset ( RamDebugSub  sub,
uint8_t  index = 0 
)
inlinestatic

Construct the RAMDebug register offset for a given subcommand and index.

The offset is: (subcommand << 6) | (index & 0x3F).

Parameters
subSubcommand value.
indexIndex or value parameter (0-63).
Returns
10-bit register offset (upper 4 bits sub, lower 6 bits index).

Variable Documentation

◆ RAMDEBUG_BLOCK

constexpr uint8_t TMC9660::RAMDebug::RAMDEBUG_BLOCK = 31
staticconstexpr

Block number for RAMDebug (SPI interface)

◆ RAMDEBUG_UART_CMD

constexpr uint8_t TMC9660::RAMDebug::RAMDEBUG_UART_CMD = 142
staticconstexpr

UART command number for RAMDebug.