stepRocker Open Source TMCL  1.00
 All Data Structures Files Functions Variables Typedefs Enumerations Macros
stepRocker.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Project: stepRocker Mini-TMCL (for stepRocker V2.2)
3 
4  Module: stepRocker.h
5  Definitions of globally used data types and macros
6 
7  Copyright (C) 2016 TRINAMIC Motion Control GmbH & Co KG
8  Waterloohain 5
9  D - 22769 Hamburg, Germany
10  http://www.trinamic.com/
11 
12  This program is free software; you can redistribute it and/or modify it
13  freely.
14 
15  This program is distributed "as is" in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17  or FITNESS FOR A PARTICULAR PURPOSE.
18 *******************************************************************************/
19 
31 typedef unsigned char UCHAR;
32 typedef unsigned short USHORT;
33 typedef unsigned int UINT;
34 
35 #define TRUE 1
36 #define FALSE 0
37 
38 #define SW_TYPE_HIGH 0x04
39 #define SW_TYPE_LOW 0x57
40 
41 #define SW_VERSION_HIGH 0x01
42 #define SW_VERSION_LOW 0x00
43 
44 #define N_O_MOTORS 1
45 #define WHICH_262(a) (a)
46 
47 #define DISABLE_DRIVERS() GPIOD_PSOR = BIT2
48 #define ENABLE_DRIVERS() GPIOD_PCOR = BIT2
49 
50 #define LED1_ON() GPIOA_PSOR = BIT5
51 #define LED1_OFF() GPIOA_PCOR = BIT5
52 #define LED1_TOGGLE() GPIOA_PTOR = BIT5
53 
54 #define LED2_ON() GPIOE_PSOR = BIT5
55 #define LED2_OFF() GPIOE_PCOR = BIT5
56 #define LED2_TOGGLE() GPIOE_PTOR = BIT5
57 
58 #define SPI_DEV_EEPROM 0x0001
59 #define SPI_DEV_TMC43xx_0 0x0101
60 
61 #define RAMP_TRAPEZ 0
62 #define RAMP_SSHAPE 1
63 
64 
66 typedef struct
67 {
75 
77 typedef struct
78 {
79  UCHAR IRun;
80  UCHAR IStandby;
81  UCHAR MicrostepResolution;
82  UCHAR SwitchMode;
83  USHORT FreewheelingDelay;
84  UINT StallVMin;
85  USHORT SettingDelay;
86  UCHAR BoostCurrent;
87  UCHAR RampType;
88  UCHAR UnitMode;
89  UCHAR StepDirMode;
90  int EncoderResolution;
91  UINT MaxPositionDeviation;
92  UINT MaxVelocityDeviation;
93  UINT AMax;
94  UINT DMax;
95  UINT AStart;
96  UINT DFinal;
97  UINT DStop;
98  USHORT MotorResolution;
99 } TMotorConfig;
100 
101 typedef struct
102 {
103  UCHAR ClosedLoopMode;
104  UINT GammaVMin;
105  UINT GammaVAdd;
106  UCHAR Gamma;
107  USHORT Beta;
108  int Offset;
109  UCHAR CurrentScalerMinimum;
110  UCHAR CurrentScalerMaximum;
111  UCHAR CurrentScalerStartUp;
112  UINT UpscaleDelay;
113  UINT DownscaleDelay;
114  UINT CorrectionVelocityP;
115  UINT CorrectionVelocityI;
116  UINT CorrectionVelocityIClip;
117  UINT CorrectionVelocityDClk;
118  UINT CorrectionVelocityDClip;
119  UINT PositionCorrectionP;
120  UINT PositionCorrectionTolerance;
121  UINT PositionWindow;
122  UCHAR EncVMeanWait;
123  UCHAR EncVMeanFilter;
124  UINT EncVMeanInt;
125  signed char EncoderCorrectionYOffset;
127 
129 typedef struct
130 {
UCHAR CANReceiveID
CAN receive ID.
Definition: stepRocker.h:71
coolStep configuration data
Definition: stepRocker.h:129
UCHAR SerialHostAddress
RS485 TMCL reply address.
Definition: stepRocker.h:70
Global module settings.
Definition: stepRocker.h:66
UINT ThresholdSpeed
coolStep threshold speed
Definition: stepRocker.h:131
UCHAR HysteresisStart
coolStep hysteresis start
Definition: stepRocker.h:133
UCHAR CANBitrate
CAN bit rate.
Definition: stepRocker.h:73
UCHAR SlowRunCurrent
coolStep slow run current
Definition: stepRocker.h:132
unsigned int UINT
32 bits unsigned
Definition: stepRocker.h:33
UCHAR SerialBitrate
RS485 baud rate (0..7, 0=9600bps)
Definition: stepRocker.h:68
Definition: stepRocker.h:101
UCHAR SerialModuleAddress
RS485 TMCL module address.
Definition: stepRocker.h:69
UCHAR CANSendID
CAN send ID.
Definition: stepRocker.h:72
Motor configuration data.
Definition: stepRocker.h:77
unsigned char UCHAR
8 bits unsigned
Definition: stepRocker.h:31
unsigned short USHORT
16 bits unsigned
Definition: stepRocker.h:32