stepRocker servo Open Source TMCL  1.00
 All Data Structures Files Functions Variables Typedefs Enumerations Macros
Functions | Variables
Commands.c File Reference

Mini TMCL interpreter. More...

#include <stdlib.h>
#include <stddef.h>
#include "derivative.h"
#include "bits.h"
#include "stepRocker.h"
#include "Commands.h"
#include "Globals.h"
#include "RS485.h"
#include "SysTick.h"
#include "TMC429.h"
#include "TMC262.h"
#include "Eeprom.h"
#include "IO.h"
#include "Can.h"
#include "USB.h"
Include dependency graph for Commands.c:

Functions

static void RotateRight (void)
 Command ROR (see TMCL manual) More...
 
static void RotateLeft (void)
 Command ROL. More...
 
static void MotorStop (void)
 Command MST. More...
 
static void MoveToPosition (void)
 Command MVP. More...
 
static void SetAxisParameter (void)
 Command SAP. More...
 
static void GetAxisParameter (void)
 Command GAP. More...
 
static void GetVersion (void)
 Command 136 (get version) More...
 
static void Boot (void)
 Enter bootloader mode. More...
 
static void SoftwareReset (void)
 TMCL software reset command. More...
 
static void ExecuteActualCommand (void)
 Execute actual TMCL command. More...
 
void InitTMCL (void)
 Initialize TMCL interpreter. More...
 
void ProcessCommand (void)
 Fetch and execute TMCL commands. More...
 

Variables

static UCHAR UARTCmd [9]
 RS485 command buffer.
 
static UCHAR UARTCount
 RS485 commnd byte counter.
 
static UCHAR TMCLCommandState
 State of the interpreter.
 
static TTMCLCommand ActualCommand
 TMCL command to be executed (with all parameters)
 
static TTMCLReply ActualReply
 Reply of last executed TMCL command.
 
static UCHAR TMCLReplyFormat
 format of next reply (RF_NORMAL or RF_SPECIAL)
 
static UCHAR SpecialReply [9]
 buffer for special replies
 
static UCHAR SpeedChangedFlag [N_O_MOTORS]
 TRUE when motor max. speed has been changed by ROL/ROR command.
 
static UCHAR ResetRequested
 TRUE after executing the software reset command.
 
static UCHAR ExtendedCANFrame
 TRUE when extended CAN frame used.
 
char VersionString []
 Imported version string.
 

Detailed Description

Mini TMCL interpreter.

Author
Trinamic Motion Control GmbH & Co KG
Version
2.20

This file all functions necessary to implement a small TMCL interpreter.

Function Documentation

static void Boot ( void  )
static

Enter bootloader mode.

Special command for exiting TMCL and calling the boot loader.

Here is the call graph for this function:

Here is the caller graph for this function:

ExecuteActualCommand ( void  )
static

Execute actual TMCL command.

Execute the TMCL command that must have been written to the global variable "ActualCommand" before.

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetAxisParameter ( void  )
static

Command GAP.

GAP (Get Axis Parameter) command (see TMCL manual).

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetVersion ( void  )
static

Command 136 (get version)

Get the version number (when type==0) or the version string (when type==1).

Here is the caller graph for this function:

InitTMCL ( void  )

Initialize TMCL interpreter.

Intialise the TMCL interpreter. Must be called once at startup.

Here is the caller graph for this function:

static void MotorStop ( void  )
static

Command MST.

MST (Motor StoP) command (see TMCL manual).

Here is the call graph for this function:

Here is the caller graph for this function:

static void MoveToPosition ( void  )
static

Command MVP.

MVP (Move To Position) command (see TMCL manual).

Here is the call graph for this function:

Here is the caller graph for this function:

ProcessCommand ( void  )

Fetch and execute TMCL commands.

This is the main function for fetching and executing TMCL commands and has to be called periodically from the main loop.

Here is the call graph for this function:

Here is the caller graph for this function:

static void RotateLeft ( void  )
static

Command ROL.

ROL (ROtate Left) command (see TMCL manual).

Here is the call graph for this function:

Here is the caller graph for this function:

static void RotateRight ( void  )
static

Command ROR (see TMCL manual)

ROR (ROtate Right) command (see TMCL manual).

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetAxisParameter ( void  )
static

Command SAP.

SAP (Set Axis Parameter) command (see TMCL manual).

Here is the call graph for this function:

Here is the caller graph for this function:

static void SoftwareReset ( void  )
static

TMCL software reset command.

Issue a TMCL software reset.

Here is the caller graph for this function: