TMCStepper
Library supporting Trinamic Stepper Drivers for Arduino platforms
Loading...
Searching...
No Matches
TMC2130_bitfields.h
Go to the documentation of this file.
1
16#pragma once
17#pragma pack(push, 1)
18
19struct GCONF_t {
20 constexpr static uint8_t address = 0x00;
21 union {
22 uint32_t sr;
23 struct {
24 bool i_scale_analog : 1, // 2130, 5130
25 internal_rsense : 1, // 2130, 5130
27 enc_commutation : 1, // 2130, 5130
28 shaft : 1,
41 uint16_t : 15; // unused
42 };
43 struct { // TMC5160
44 bool recalibrate : 1,
46 : 1,
48 : 3,
51 : 4,
53 uint32_t : 18; // unused
54 };
55 };
56};
57
59 constexpr static uint8_t address = 0x10;
60 union {
61 uint32_t sr;
62 struct {
63 uint8_t ihold : 5,
64 : 3,
65 irun : 5,
66 : 3,
68 uint16_t : 12; // unused
69 };
70 };
71};
72
73struct GSTAT_t {
74 constexpr static uint8_t address = 0x01;
75 union {
76 uint8_t sr;
77 struct {
78 bool reset : 1,
80 uv_cp : 1,
81 : 5; // unused
82 };
83 };
84};
85
86struct IOIN_t {
87 constexpr static uint8_t address = 0x04;
88 union {
89 uint32_t sr;
90 struct {
91 bool step : 1,
92 dir : 1,
96 dco : 1,
97 : 2; // unused
98 uint16_t : 16; // unused
99 uint8_t version : 8;
100 };
101 };
102};
103
105 constexpr static uint8_t address = 0x11;
106 uint8_t sr;
107};
108
110 constexpr static uint8_t address = 0x13;
111 uint32_t sr : 20;
112};
113
115 constexpr static uint8_t address = 0x14;
116 uint32_t sr : 20;
117};
118
119struct THIGH_t {
120 constexpr static uint8_t address = 0x15;
121 uint32_t sr : 20;
122};
123
124struct XDIRECT_t {
125 constexpr static uint8_t address = 0x2D;
126 union {
127 uint32_t sr;
128 struct {
129 int16_t coil_A : 9,
130 : 7, // unused
132 : 7; // unused
133 };
134 };
135};
136
137struct VDCMIN_t {
138 constexpr static uint8_t address = 0x33;
139 uint32_t sr : 23;
140};
141
143 constexpr static uint8_t address = 0x6C;
144 union {
145 uint32_t sr;
146 struct { // 2130, 5130
147 uint8_t toff : 4,
148 hstrt : 3,
149 hend : 4,
150 : 1; // unused
151 bool disfdcc : 1,
152 rndtf : 1,
153 chm : 1;
154 uint8_t tbl : 2;
155 bool vsense : 1,
158 uint8_t sync : 4,
159 mres : 4;
160 bool intpol : 1,
161 dedge : 1,
163 };
164 struct { // TMC5160
165 uint32_t : 20;
166 uint8_t tpfd : 4;
167 uint16_t : 7;
168 bool diss2vs : 1; // false
169 };
170 };
171};
172
174 constexpr static uint8_t address = 0x6D;
175 union {
176 uint32_t sr;
177 struct {
178 uint8_t semin : 4,
179 : 1, // unused
180 seup : 2,
181 : 1, // unused
182 semax : 4,
183 : 1, // unused
184 sedn : 2;
185 bool seimin : 1;
186 int8_t sgt : 7,
187 : 1; // unused
188 bool sfilt : 1,
189 : 7; // unused
190 };
191 };
192};
193
194struct DCCTRL_t {
195 constexpr static uint8_t address = 0x6E;
196 union {
197 uint32_t sr;
198 struct {
199 uint16_t dc_time : 10,
200 : 6; // unused
201 uint8_t dc_sg : 8,
202 : 8; // unused
203 };
204 };
205};
206
207namespace TMC2130_n {
209 constexpr static uint8_t address = 0x6F;
210 union {
211 uint32_t sr;
212 struct {
213 uint16_t sg_result : 10;
214 uint8_t : 5; // unused
215 bool fsactive : 1;
216 uint8_t cs_actual : 5,
217 : 3; // unused
218 bool stallGuard : 1,
219 ot : 1,
220 otpw : 1,
221 s2ga : 1,
222 s2gb : 1,
223 ola : 1,
224 olb : 1,
225 stst : 1;
226 };
227 };
228 };
229}
230
231struct PWMCONF_t {
232 constexpr static uint8_t address = 0x70;
233 union {
234 uint32_t sr;
235 struct {
236 uint8_t pwm_ampl : 8,
241 uint8_t freewheel : 2;
242 uint16_t : 10; // unused
243 };
244 };
245};
246
248 constexpr static uint8_t address = 0x72;
249 union {
250 uint8_t sr;
251 struct {
252 bool inv : 1,
254 : 6; // unused
255 };
256 };
257};
258
259#pragma pack(pop)
uint8_t bool rndtf
uint8_t bool chm
uint8_t bool disfdcc
static constexpr uint8_t address
int8_t bool sfilt
static constexpr uint8_t address
uint16_t dc_time
uint16_t uint8_t dc_sg
static constexpr uint8_t address
static constexpr uint8_t address
bool multistep_filt
bool i_scale_analog
bool small_hysteresis
bool faststandstill
bool diag1_pushpull
bool diag0_int_pushpull
bool enc_commutation
bool diag1_poscomp_pushpull
uint32_t sr
static constexpr uint8_t address
bool internal_rsense
bool diag1_steps_skipped
static constexpr uint8_t address
static constexpr uint8_t address
bool drv_enn_cfg6
static constexpr uint8_t address
uint32_t sr
uint8_t version
static constexpr uint8_t address
static constexpr uint8_t address
static constexpr uint8_t address
static constexpr uint8_t address
static constexpr uint8_t address
static constexpr uint8_t address
static constexpr uint8_t address
static constexpr uint8_t address