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

Subsystem for TMCL script execution control. More...

#include <TMC9660.hpp>

Collaboration diagram for TMC9660::Script:

Public Member Functions

bool upload (const std::vector< uint32_t > &scriptData) noexcept
 Upload a TMCL script to the TMC9660's internal memory.
 
bool start (uint16_t address=0) noexcept
 Start or restart execution of the stored script.
 
bool stop () noexcept
 Stop execution of the running script.
 
bool step () noexcept
 Execute a single TMCL instruction of the loaded script.
 
bool reset () noexcept
 Reset the TMCL program counter.
 
bool getStatus (uint32_t &status) noexcept
 Query the execution state of the running script.
 
bool readMemory (uint16_t address, uint32_t &value) noexcept
 Read a 32-bit instruction from script memory.
 
bool addBreakpoint (uint16_t address) noexcept
 Add a breakpoint at the given address.
 
bool removeBreakpoint (uint16_t address) noexcept
 Remove a previously set breakpoint.
 
bool clearBreakpoints () noexcept
 Remove all breakpoints from the script.
 
bool getMaxBreakpointCount (uint32_t &count) noexcept
 Query the maximum number of supported breakpoints.
 

Private Member Functions

 Script (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

Subsystem for TMCL script execution control.

Constructor & Destructor Documentation

◆ Script()

TMC9660::Script::Script ( TMC9660 parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ addBreakpoint()

bool TMC9660::Script::addBreakpoint ( uint16_t  address)
noexcept

Add a breakpoint at the given address.

Parameters
addressInstruction address where execution should break.
Returns
true if the breakpoint was set.

◆ clearBreakpoints()

bool TMC9660::Script::clearBreakpoints ( )
noexcept

Remove all breakpoints from the script.

Returns
true if the command succeeded.

◆ getMaxBreakpointCount()

bool TMC9660::Script::getMaxBreakpointCount ( uint32_t &  count)
noexcept

Query the maximum number of supported breakpoints.

Parameters
[out]countMaximum breakpoint count reported by the device.
Returns
true on success.

◆ getStatus()

bool TMC9660::Script::getStatus ( uint32_t &  status)
noexcept

Query the execution state of the running script.

Parameters
[out]statusRaw status value returned by GetStatusScript.
Returns
true if the status value was retrieved successfully.

◆ readMemory()

bool TMC9660::Script::readMemory ( uint16_t  address,
uint32_t &  value 
)
noexcept

Read a 32-bit instruction from script memory.

Parameters
addressInstruction address to read.
[out]valueReturned 32-bit TMCL instruction word.
Returns
true on success.

◆ removeBreakpoint()

bool TMC9660::Script::removeBreakpoint ( uint16_t  address)
noexcept

Remove a previously set breakpoint.

Parameters
addressAddress of the breakpoint to remove.
Returns
true if removed successfully.

◆ reset()

bool TMC9660::Script::reset ( )
noexcept

Reset the TMCL program counter.

Sends the ApplReset command which stops execution and resets the script to the beginning.

◆ start()

bool TMC9660::Script::start ( uint16_t  address = 0)
noexcept

Start or restart execution of the stored script.

Parameters
addressThe address from which to start execution (usually 0 for beginning of script).
Returns
true if the command to start the script was sent.

◆ step()

bool TMC9660::Script::step ( )
noexcept

Execute a single TMCL instruction of the loaded script.

Uses the ApplStep opcode which advances the interpreter by one instruction. Useful for debugging scripts in real time.

◆ stop()

bool TMC9660::Script::stop ( )
noexcept

Stop execution of the running script.

Returns
true if the stop command was sent successfully.

◆ upload()

bool TMC9660::Script::upload ( const std::vector< uint32_t > &  scriptData)
noexcept

Upload a TMCL script to the TMC9660's internal memory.

This enters download mode, writes a series of instructions to the device memory, and exits download mode. The script will typically run on device startup or when triggered.

Parameters
scriptDataVector of 32-bit instructions representing the TMCL script.
Returns
true if the script was uploaded successfully.

Friends And Related Symbol Documentation

◆ TMC9660

friend class TMC9660
friend

Member Data Documentation

◆ driver

TMC9660& TMC9660::Script::driver
private

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