TMCStepper
TMC5130_bitfields.h
Go to the documentation of this file.
1 #pragma once
2 #pragma pack(push, 1)
3 
4 struct SLAVECONF_t {
5  constexpr static uint8_t address = 0x03;
6  union {
7  uint16_t sr : 12;
8  struct {
9  uint8_t slaveaddr : 8;
10  uint8_t senddelay : 4;
11  };
12  };
13 };
14 
15 namespace TMC5130_n {
16  struct IOIN_t {
17  constexpr static uint8_t address = 0x04;
18  union {
19  uint32_t sr;
20  struct {
21  bool refl_step : 1,
22  refr_dir : 1,
26  enc_n_dco : 1,
27  sd_mode : 1,
28  swcomp_in : 1;
29  uint16_t : 16;
30  uint8_t version : 8;
31  };
32  };
33  };
34 }
35 
36 struct OUTPUT_t {
37  constexpr static uint8_t address = 0x04;
38  bool sr : 1;
39 };
40 
41 struct X_COMPARE_t {
42  constexpr static uint8_t address = 0x05;
43  uint32_t sr;
44 };
45 
46 struct RAMPMODE_t {
47  constexpr static uint8_t address = 0x20;
48  uint8_t sr : 2;
49 };
50 
51 struct XACTUAL_t {
52  constexpr static uint8_t address = 0x21;
53  uint32_t sr;
54 };
55 
56 struct VSTART_t {
57  constexpr static uint8_t address = 0x23;
58  uint32_t sr : 18;
59 };
60 
61 struct A1_t {
62  constexpr static uint8_t address = 0x24;
63  uint16_t sr : 16;
64 };
65 
66 struct V1_t {
67  constexpr static uint8_t address = 0x25;
68  uint32_t sr : 20;
69 };
70 
71 struct AMAX_t {
72  constexpr static uint8_t address = 0x26;
73  uint16_t sr : 16;
74 };
75 
76 struct VMAX_t {
77  constexpr static uint8_t address = 0x27;
78  uint32_t sr : 23;
79 };
80 
81 struct DMAX_t {
82  constexpr static uint8_t address = 0x28;
83  uint16_t sr : 16;
84 };
85 
86 struct D1_t {
87  constexpr static uint8_t address = 0x2A;
88  uint16_t sr : 16;
89 };
90 
91 struct VSTOP_t {
92  constexpr static uint8_t address = 0x2B;
93  uint32_t sr : 18;
94 };
95 
96 struct TZEROWAIT_t {
97  constexpr static uint8_t address = 0x2C;
98  uint16_t sr : 16;
99 };
100 
101 struct SW_MODE_t {
102  constexpr static uint8_t address = 0x34;
103  union {
104  uint16_t sr : 12;
105  struct {
106  bool stop_l_enable : 1,
110  swap_lr : 1,
116  sg_stop : 1,
118  };
119  };
120 };
121 
122 struct RAMP_STAT_t {
123  constexpr static uint8_t address = 0x35;
124  union {
125  uint16_t sr : 14;
126  struct {
127  bool status_stop_l : 1,
137  vzero : 1,
141  };
142  };
143 };
144 
145 struct ENCMODE_t {
146  constexpr static uint8_t address = 0x38;
147  union {
148  uint16_t sr : 11;
149  struct {
150  bool pol_a : 1,
151  pol_b : 1,
152  pol_n : 1,
154  clr_cont : 1,
155  clr_once : 1,
156  pos_edge : 1,
157  neg_edge : 1,
161  };
162  };
163 };
164 
165 struct ENC_CONST_t {
166  constexpr static uint8_t address = 0x3A;
167  uint32_t sr;
168 };
169 
170 struct MSLUT0_t {
171  constexpr static uint8_t address = 0x60;
172  uint32_t sr;
173 };
174 
175 struct MSLUT1_t {
176  constexpr static uint8_t address = 0x61;
177  uint32_t sr;
178 };
179 
180 struct MSLUT2_t {
181  constexpr static uint8_t address = 0x62;
182  uint32_t sr;
183 };
184 
185 struct MSLUT3_t {
186  constexpr static uint8_t address = 0x63;
187  uint32_t sr;
188 };
189 
190 struct MSLUT4_t {
191  constexpr static uint8_t address = 0x64;
192  uint32_t sr;
193 };
194 
195 struct MSLUT5_t {
196  constexpr static uint8_t address = 0x65;
197  uint32_t sr;
198 };
199 
200 struct MSLUT6_t {
201  constexpr static uint8_t address = 0x66;
202  uint32_t sr;
203 };
204 
205 struct MSLUT7_t {
206  constexpr static uint8_t address = 0x67;
207  uint32_t sr;
208 };
209 
210 struct MSLUTSEL_t {
211  constexpr static uint8_t address = 0x68;
212  union {
213  uint32_t sr;
214  struct {
215  uint8_t w0 : 2,
216  w1 : 2,
217  w2 : 2,
218  w3 : 2,
219  x1 : 8,
220  x2 : 8,
221  x3 : 8;
222  };
223  };
224 };
225 
226 struct MSLUTSTART_t {
227  constexpr static uint8_t address = 0x69;
228  union {
229  uint32_t sr : 24;
230  struct {
231  uint8_t start_sin : 8,
232  : 8,
233  start_sin90 : 8;
234  };
235  };
236 };
237 
238 #pragma pack(pop)
RAMP_STAT_t::status_latch_r
bool status_latch_r
Definition: TMC5130_bitfields.h:130
ENCMODE_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:146
ENCMODE_t::pol_b
bool pol_b
Definition: TMC5130_bitfields.h:151
TMC5130_n
Definition: TMC5130_bitfields.h:15
MSLUTSEL_t::w1
uint8_t w1
Definition: TMC5130_bitfields.h:216
RAMP_STAT_t
Definition: TMC5130_bitfields.h:122
DMAX_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:83
SW_MODE_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:102
V1_t
Definition: TMC5130_bitfields.h:66
TZEROWAIT_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:98
X_COMPARE_t
Definition: TMC5130_bitfields.h:41
MSLUT3_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:187
VSTART_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:57
RAMPMODE_t
Definition: TMC5130_bitfields.h:46
ENCMODE_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:148
TZEROWAIT_t
Definition: TMC5130_bitfields.h:96
V1_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:68
SW_MODE_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:104
SW_MODE_t::latch_l_active
bool latch_l_active
Definition: TMC5130_bitfields.h:111
DMAX_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:82
RAMP_STAT_t::status_sg
bool status_sg
Definition: TMC5130_bitfields.h:140
XACTUAL_t
Definition: TMC5130_bitfields.h:51
VSTOP_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:93
MSLUT5_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:196
OUTPUT_t::sr
bool sr
Definition: TMC5130_bitfields.h:38
OUTPUT_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:37
RAMP_STAT_t::status_stop_r
bool status_stop_r
Definition: TMC5130_bitfields.h:128
SLAVECONF_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:5
MSLUTSEL_t::x1
uint8_t x1
Definition: TMC5130_bitfields.h:219
AMAX_t
Definition: TMC5130_bitfields.h:71
MSLUT6_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:201
MSLUT1_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:177
MSLUT0_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:172
RAMP_STAT_t::t_zerowait_active
bool t_zerowait_active
Definition: TMC5130_bitfields.h:138
TMC5130_n::IOIN_t::enca_dcin_cfg5
bool enca_dcin_cfg5
Definition: TMC5130_bitfields.h:24
SW_MODE_t::stop_l_enable
bool stop_l_enable
Definition: TMC5130_bitfields.h:106
ENCMODE_t::pos_edge
bool pos_edge
Definition: TMC5130_bitfields.h:156
TMC5130_n::IOIN_t::enc_n_dco
bool enc_n_dco
Definition: TMC5130_bitfields.h:26
MSLUTSEL_t::x2
uint8_t x2
Definition: TMC5130_bitfields.h:220
ENCMODE_t::latch_x_act
bool latch_x_act
Definition: TMC5130_bitfields.h:159
SLAVECONF_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:7
A1_t
Definition: TMC5130_bitfields.h:61
MSLUTSTART_t
Definition: TMC5130_bitfields.h:226
SW_MODE_t::latch_r_active
bool latch_r_active
Definition: TMC5130_bitfields.h:113
RAMPMODE_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:47
SW_MODE_t::en_latch_encoder
bool en_latch_encoder
Definition: TMC5130_bitfields.h:115
D1_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:87
ENCMODE_t::pol_a
bool pol_a
Definition: TMC5130_bitfields.h:150
D1_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:88
SW_MODE_t
Definition: TMC5130_bitfields.h:101
TMC5130_n::IOIN_t::sd_mode
bool sd_mode
Definition: TMC5130_bitfields.h:27
TMC5130_n::IOIN_t::refr_dir
bool refr_dir
Definition: TMC5130_bitfields.h:22
SW_MODE_t::swap_lr
bool swap_lr
Definition: TMC5130_bitfields.h:110
MSLUTSTART_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:229
SW_MODE_t::pol_stop_l
bool pol_stop_l
Definition: TMC5130_bitfields.h:108
MSLUT7_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:207
MSLUT0_t
Definition: TMC5130_bitfields.h:170
MSLUT0_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:171
ENCMODE_t::clr_enc_x
bool clr_enc_x
Definition: TMC5130_bitfields.h:158
VSTART_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:58
SW_MODE_t::en_softstop
bool en_softstop
Definition: TMC5130_bitfields.h:117
MSLUT6_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:202
ENC_CONST_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:167
ENCMODE_t::clr_once
bool clr_once
Definition: TMC5130_bitfields.h:155
RAMP_STAT_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:123
ENCMODE_t::clr_cont
bool clr_cont
Definition: TMC5130_bitfields.h:154
TMC5130_n::IOIN_t::encb_dcen_cfg4
bool encb_dcen_cfg4
Definition: TMC5130_bitfields.h:23
SW_MODE_t::sg_stop
bool sg_stop
Definition: TMC5130_bitfields.h:116
MSLUT4_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:192
MSLUTSTART_t::start_sin
uint8_t start_sin
Definition: TMC5130_bitfields.h:231
RAMP_STAT_t::position_reached
bool position_reached
Definition: TMC5130_bitfields.h:136
VMAX_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:78
D1_t
Definition: TMC5130_bitfields.h:86
ENC_CONST_t
Definition: TMC5130_bitfields.h:165
TMC5130_n::IOIN_t
Definition: TMC5130_bitfields.h:16
MSLUTSEL_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:213
A1_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:63
RAMP_STAT_t::velocity_reached
bool velocity_reached
Definition: TMC5130_bitfields.h:135
SW_MODE_t::pol_stop_r
bool pol_stop_r
Definition: TMC5130_bitfields.h:109
MSLUT4_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:191
MSLUT2_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:182
TMC5130_n::IOIN_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:19
SLAVECONF_t
Definition: TMC5130_bitfields.h:4
MSLUTSEL_t::x3
uint8_t x3
Definition: TMC5130_bitfields.h:221
ENCMODE_t::pol_n
bool pol_n
Definition: TMC5130_bitfields.h:152
VSTART_t
Definition: TMC5130_bitfields.h:56
VSTOP_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:92
MSLUTSEL_t::w3
uint8_t w3
Definition: TMC5130_bitfields.h:218
TZEROWAIT_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:97
TMC5130_n::IOIN_t::refl_step
bool refl_step
Definition: TMC5130_bitfields.h:21
RAMPMODE_t::sr
uint8_t sr
Definition: TMC5130_bitfields.h:48
VMAX_t
Definition: TMC5130_bitfields.h:76
RAMP_STAT_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:125
XACTUAL_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:53
MSLUT2_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:181
X_COMPARE_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:43
MSLUTSTART_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:227
XACTUAL_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:52
SLAVECONF_t::senddelay
uint8_t senddelay
Definition: TMC5130_bitfields.h:10
AMAX_t::sr
uint16_t sr
Definition: TMC5130_bitfields.h:73
SLAVECONF_t::slaveaddr
uint8_t slaveaddr
Definition: TMC5130_bitfields.h:9
MSLUT7_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:206
MSLUT2_t
Definition: TMC5130_bitfields.h:180
SW_MODE_t::stop_r_enable
bool stop_r_enable
Definition: TMC5130_bitfields.h:107
ENC_CONST_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:166
MSLUTSEL_t::w2
uint8_t w2
Definition: TMC5130_bitfields.h:217
TMC5130_n::IOIN_t::swcomp_in
bool swcomp_in
Definition: TMC5130_bitfields.h:28
MSLUTSEL_t
Definition: TMC5130_bitfields.h:210
TMC5130_n::IOIN_t::drv_enn_cfg6
bool drv_enn_cfg6
Definition: TMC5130_bitfields.h:25
SW_MODE_t::latch_r_inactive
bool latch_r_inactive
Definition: TMC5130_bitfields.h:114
V1_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:67
MSLUT1_t
Definition: TMC5130_bitfields.h:175
ENCMODE_t::enc_sel_decimal
bool enc_sel_decimal
Definition: TMC5130_bitfields.h:160
MSLUT6_t
Definition: TMC5130_bitfields.h:200
RAMP_STAT_t::event_stop_r
bool event_stop_r
Definition: TMC5130_bitfields.h:132
AMAX_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:72
MSLUT3_t
Definition: TMC5130_bitfields.h:185
VMAX_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:77
RAMP_STAT_t::event_stop_l
bool event_stop_l
Definition: TMC5130_bitfields.h:131
TMC5130_n::IOIN_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:17
ENCMODE_t::neg_edge
bool neg_edge
Definition: TMC5130_bitfields.h:157
MSLUTSEL_t::w0
uint8_t w0
Definition: TMC5130_bitfields.h:215
MSLUTSTART_t::start_sin90
uint8_t start_sin90
Definition: TMC5130_bitfields.h:232
X_COMPARE_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:42
MSLUTSEL_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:211
MSLUT3_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:186
OUTPUT_t
Definition: TMC5130_bitfields.h:36
MSLUT5_t
Definition: TMC5130_bitfields.h:195
MSLUT1_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:176
TMC5130_n::IOIN_t::version
uint8_t version
Definition: TMC5130_bitfields.h:30
RAMP_STAT_t::status_latch_l
bool status_latch_l
Definition: TMC5130_bitfields.h:129
SW_MODE_t::latch_l_inactive
bool latch_l_inactive
Definition: TMC5130_bitfields.h:112
RAMP_STAT_t::event_stop_sg
bool event_stop_sg
Definition: TMC5130_bitfields.h:133
MSLUT7_t
Definition: TMC5130_bitfields.h:205
RAMP_STAT_t::event_pos_reached
bool event_pos_reached
Definition: TMC5130_bitfields.h:134
ENCMODE_t::ignore_ab
bool ignore_ab
Definition: TMC5130_bitfields.h:153
A1_t::address
constexpr static uint8_t address
Definition: TMC5130_bitfields.h:62
MSLUT5_t::sr
uint32_t sr
Definition: TMC5130_bitfields.h:197
MSLUT4_t
Definition: TMC5130_bitfields.h:190
RAMP_STAT_t::second_move
bool second_move
Definition: TMC5130_bitfields.h:139
VSTOP_t
Definition: TMC5130_bitfields.h:91
RAMP_STAT_t::status_stop_l
bool status_stop_l
Definition: TMC5130_bitfields.h:127
DMAX_t
Definition: TMC5130_bitfields.h:81
ENCMODE_t
Definition: TMC5130_bitfields.h:145
RAMP_STAT_t::vzero
bool vzero
Definition: TMC5130_bitfields.h:137