TMCStepper
TMC2208_bitfields.h
Go to the documentation of this file.
1 #pragma once
2 #pragma pack(push, 1)
3 
4 namespace TMC2208_n {
5  struct GCONF_t {
6  constexpr static uint8_t address = 0x00;
7  union {
8  uint16_t sr : 10;
9  struct {
10  bool i_scale_analog : 1,
13  shaft : 1,
19  test_mode : 1;
20  };
21  };
22  };
23 }
24 
25 namespace TMC2208_n {
26  struct IOIN_t {
27  constexpr static uint8_t address = 0x06;
28  union {
29  uint32_t sr;
30  struct {
31  bool enn : 1,
32  : 1,
33  ms1 : 1,
34  ms2 : 1,
35  diag : 1,
36  : 1,
37  pdn_uart : 1,
38  step : 1,
39  sel_a : 1,
40  dir : 1;
41  uint16_t : 14;
42  uint8_t version : 8;
43  };
44  };
45  };
46 }
47 
48 namespace TMC2224_n {
49  struct IOIN_t {
50  constexpr static uint8_t address = 0x06;
51  union {
52  uint32_t sr;
53  struct {
54  bool : 1,
55  pdn_uart : 1,
56  spread : 1,
57  dir : 1,
58  enn : 1,
59  step : 1,
60  ms1 : 1,
61  ms2 : 1,
62  sel_a : 1;
63  uint16_t : 15;
64  uint8_t version : 8;
65  };
66  };
67  };
68 }
69 
71  constexpr static uint8_t address = 0x07;
72  union {
73  uint16_t sr;
74  struct {
75  uint8_t fclktrim : 5,
76  : 3,
77  ottrim : 2;
78  };
79  };
80 };
81 
82 namespace TMC2208_n {
83  struct VACTUAL_t {
84  constexpr static uint8_t address = 0x22;
85  uint32_t sr;
86  };
87 }
88 
89 struct MSCURACT_t {
90  constexpr static uint8_t address = 0x6B;
91  union {
92  uint32_t sr : 25;
93  struct {
94  int16_t cur_a : 9,
95  : 7,
96  cur_b : 9;
97  };
98  };
99 };
100 
101 namespace TMC2208_n {
102  struct CHOPCONF_t {
103  constexpr static uint8_t address = 0x6C;
104  union {
105  uint32_t sr;
106  struct {
107  uint8_t toff : 4,
108  hstrt : 3,
109  hend : 4,
110  : 4,
111  tbl : 2;
112  bool vsense : 1;
113  uint8_t : 6,
114  mres : 4;
115  bool intpol : 1,
116  dedge : 1,
117  diss2g : 1,
118  diss2vs : 1;
119  };
120  };
121  };
122 
123  struct PWMCONF_t {
124  constexpr static uint8_t address = 0x70;
125  union {
126  uint32_t sr;
127  struct {
128  uint8_t pwm_ofs : 8,
129  pwm_grad : 8,
130  pwm_freq : 2;
131  bool pwm_autoscale : 1,
133  uint8_t freewheel : 2,
134  : 2,
135  pwm_reg : 4,
136  pwm_lim : 4;
137  };
138  };
139  };
140 
141  struct DRV_STATUS_t {
142  constexpr static uint8_t address = 0x6F;
143  union {
144  uint32_t sr;
145  struct {
146  bool otpw : 1,
147  ot : 1,
148  s2ga : 1,
149  s2gb : 1,
150  s2vsa : 1,
151  s2vsb : 1,
152  ola : 1,
153  olb : 1,
154  t120 : 1,
155  t143 : 1,
156  t150 : 1,
157  t157 : 1;
158  uint8_t : 4,
160  : 3,
161  : 6;
162  bool stealth : 1,
163  stst : 1;
164  };
165  };
166  };
167 
168  struct PWM_SCALE_t {
169  constexpr static uint8_t address = 0x71;
170  union {
171  uint32_t sr;
172  struct {
173  uint8_t pwm_scale_sum : 8,
174  : 8;
175  int16_t pwm_scale_auto : 9;
176  };
177  };
178  };
179 }
180 
181 #pragma pack(pop)
TMC2208_n::GCONF_t::index_step
bool index_step
Definition: TMC2208_bitfields.h:15
TMC2208_n::PWMCONF_t::pwm_grad
uint8_t pwm_grad
Definition: TMC2208_bitfields.h:129
TMC2224_n::IOIN_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:52
TMC2208_n::DRV_STATUS_t::stealth
uint8_t bool stealth
Definition: TMC2208_bitfields.h:160
TMC2208_n::PWMCONF_t::pwm_reg
uint8_t pwm_reg
Definition: TMC2208_bitfields.h:134
TMC2208_n::PWM_SCALE_t
Definition: TMC2208_bitfields.h:168
TMC2224_n::IOIN_t::version
uint8_t version
Definition: TMC2208_bitfields.h:64
TMC2208_n::GCONF_t::multistep_filt
bool multistep_filt
Definition: TMC2208_bitfields.h:18
TMC2208_n::DRV_STATUS_t::s2vsa
bool s2vsa
Definition: TMC2208_bitfields.h:150
MSCURACT_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:90
MSCURACT_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:92
TMC2224_n::IOIN_t::pdn_uart
bool pdn_uart
Definition: TMC2208_bitfields.h:55
TMC2208_n::IOIN_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:29
TMC2208_n::DRV_STATUS_t::otpw
bool otpw
Definition: TMC2208_bitfields.h:146
TMC2208_n::DRV_STATUS_t
Definition: TMC2208_bitfields.h:141
TMC2208_n::PWMCONF_t::pwm_freq
uint8_t pwm_freq
Definition: TMC2208_bitfields.h:130
TMC2208_n::PWM_SCALE_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:169
TMC2208_n::PWMCONF_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:126
MSCURACT_t
Definition: TMC2208_bitfields.h:89
TMC2224_n::IOIN_t::spread
bool spread
Definition: TMC2208_bitfields.h:56
FACTORY_CONF_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:71
TMC2208_n::DRV_STATUS_t::t157
bool t157
Definition: TMC2208_bitfields.h:157
TMC2208_n::PWMCONF_t::pwm_autograd
bool pwm_autograd
Definition: TMC2208_bitfields.h:132
TMC2224_n::IOIN_t::sel_a
bool sel_a
Definition: TMC2208_bitfields.h:62
TMC2208_n::DRV_STATUS_t::s2gb
bool s2gb
Definition: TMC2208_bitfields.h:149
TMC2208_n::PWMCONF_t::pwm_lim
uint8_t pwm_lim
Definition: TMC2208_bitfields.h:136
TMC2208_n::CHOPCONF_t::diss2g
bool diss2g
Definition: TMC2208_bitfields.h:117
FACTORY_CONF_t::sr
uint16_t sr
Definition: TMC2208_bitfields.h:73
TMC2208_n::CHOPCONF_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:105
TMC2208_n::VACTUAL_t
Definition: TMC2208_bitfields.h:83
TMC2208_n::VACTUAL_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:84
TMC2208_n::IOIN_t
Definition: TMC2208_bitfields.h:26
TMC2208_n::CHOPCONF_t::toff
uint8_t toff
Definition: TMC2208_bitfields.h:107
FACTORY_CONF_t::fclktrim
uint8_t fclktrim
Definition: TMC2208_bitfields.h:75
TMC2208_n::PWMCONF_t::freewheel
uint8_t freewheel
Definition: TMC2208_bitfields.h:133
TMC2208_n::CHOPCONF_t
Definition: TMC2208_bitfields.h:102
TMC2208_n::DRV_STATUS_t::t143
bool t143
Definition: TMC2208_bitfields.h:155
TMC2208_n::DRV_STATUS_t::ola
bool ola
Definition: TMC2208_bitfields.h:152
TMC2208_n::PWM_SCALE_t::pwm_scale_auto
uint8_t int16_t pwm_scale_auto
Definition: TMC2208_bitfields.h:174
TMC2208_n::GCONF_t::pdn_disable
bool pdn_disable
Definition: TMC2208_bitfields.h:16
TMC2208_n::IOIN_t::version
uint8_t version
Definition: TMC2208_bitfields.h:42
TMC2208_n::IOIN_t::sel_a
bool sel_a
Definition: TMC2208_bitfields.h:39
TMC2208_n::IOIN_t::pdn_uart
bool pdn_uart
Definition: TMC2208_bitfields.h:36
TMC2224_n::IOIN_t::ms1
bool ms1
Definition: TMC2208_bitfields.h:60
TMC2208_n::CHOPCONF_t::mres
uint8_t mres
Definition: TMC2208_bitfields.h:114
TMC2224_n::IOIN_t::ms2
bool ms2
Definition: TMC2208_bitfields.h:61
TMC2208_n::PWM_SCALE_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:171
TMC2208_n::IOIN_t::step
bool step
Definition: TMC2208_bitfields.h:38
TMC2208_n::GCONF_t::test_mode
bool test_mode
Definition: TMC2208_bitfields.h:19
TMC2208_n::DRV_STATUS_t::s2ga
bool s2ga
Definition: TMC2208_bitfields.h:148
TMC2208_n::GCONF_t::shaft
bool shaft
Definition: TMC2208_bitfields.h:13
TMC2224_n::IOIN_t
Definition: TMC2208_bitfields.h:49
TMC2208_n::CHOPCONF_t::hend
uint8_t hend
Definition: TMC2208_bitfields.h:109
TMC2208_n::GCONF_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:6
TMC2208_n::IOIN_t::diag
bool diag
Definition: TMC2208_bitfields.h:35
TMC2208_n::CHOPCONF_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:103
TMC2208_n::PWMCONF_t
Definition: TMC2208_bitfields.h:123
TMC2208_n::DRV_STATUS_t::cs_actual
uint8_t cs_actual
Definition: TMC2208_bitfields.h:159
TMC2208_n::CHOPCONF_t::hstrt
uint8_t hstrt
Definition: TMC2208_bitfields.h:108
TMC2208_n::GCONF_t
Definition: TMC2208_bitfields.h:5
TMC2208_n::IOIN_t::dir
bool dir
Definition: TMC2208_bitfields.h:40
TMC2208_n::CHOPCONF_t::vsense
bool vsense
Definition: TMC2208_bitfields.h:112
TMC2224_n::IOIN_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:50
TMC2224_n
Definition: TMC2208_bitfields.h:48
TMC2208_n::IOIN_t::enn
bool enn
Definition: TMC2208_bitfields.h:31
TMC2208_n::CHOPCONF_t::intpol
bool intpol
Definition: TMC2208_bitfields.h:115
TMC2208_n::CHOPCONF_t::diss2vs
bool diss2vs
Definition: TMC2208_bitfields.h:118
FACTORY_CONF_t
Definition: TMC2208_bitfields.h:70
TMC2208_n::PWMCONF_t::pwm_ofs
uint8_t pwm_ofs
Definition: TMC2208_bitfields.h:128
TMC2208_n::DRV_STATUS_t::t150
bool t150
Definition: TMC2208_bitfields.h:156
TMC2208_n
Definition: TMC2208_bitfields.h:4
TMC2208_n::GCONF_t::sr
uint16_t sr
Definition: TMC2208_bitfields.h:8
TMC2208_n::GCONF_t::internal_rsense
bool internal_rsense
Definition: TMC2208_bitfields.h:11
TMC2208_n::DRV_STATUS_t::s2vsb
bool s2vsb
Definition: TMC2208_bitfields.h:151
TMC2208_n::IOIN_t::ms2
bool ms2
Definition: TMC2208_bitfields.h:34
MSCURACT_t::cur_b
int16_t cur_b
Definition: TMC2208_bitfields.h:95
TMC2224_n::IOIN_t::enn
bool enn
Definition: TMC2208_bitfields.h:58
TMC2208_n::GCONF_t::mstep_reg_select
bool mstep_reg_select
Definition: TMC2208_bitfields.h:17
TMC2208_n::IOIN_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:27
TMC2208_n::CHOPCONF_t::dedge
bool dedge
Definition: TMC2208_bitfields.h:116
TMC2208_n::DRV_STATUS_t::stst
uint8_t bool stst
Definition: TMC2208_bitfields.h:163
TMC2208_n::VACTUAL_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:85
TMC2224_n::IOIN_t::dir
bool dir
Definition: TMC2208_bitfields.h:57
TMC2208_n::IOIN_t::ms1
bool ms1
Definition: TMC2208_bitfields.h:32
TMC2208_n::CHOPCONF_t::tbl
uint8_t tbl
Definition: TMC2208_bitfields.h:110
TMC2208_n::DRV_STATUS_t::sr
uint32_t sr
Definition: TMC2208_bitfields.h:144
TMC2208_n::PWMCONF_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:124
FACTORY_CONF_t::ottrim
uint8_t ottrim
Definition: TMC2208_bitfields.h:76
TMC2208_n::GCONF_t::index_otpw
bool index_otpw
Definition: TMC2208_bitfields.h:14
MSCURACT_t::cur_a
int16_t cur_a
Definition: TMC2208_bitfields.h:94
TMC2208_n::GCONF_t::i_scale_analog
bool i_scale_analog
Definition: TMC2208_bitfields.h:10
TMC2208_n::GCONF_t::en_spreadcycle
bool en_spreadcycle
Definition: TMC2208_bitfields.h:12
TMC2208_n::DRV_STATUS_t::address
constexpr static uint8_t address
Definition: TMC2208_bitfields.h:142
TMC2224_n::IOIN_t::step
bool step
Definition: TMC2208_bitfields.h:59
TMC2208_n::PWM_SCALE_t::pwm_scale_sum
uint8_t pwm_scale_sum
Definition: TMC2208_bitfields.h:173
TMC2208_n::DRV_STATUS_t::t120
bool t120
Definition: TMC2208_bitfields.h:154
TMC2208_n::DRV_STATUS_t::olb
bool olb
Definition: TMC2208_bitfields.h:153
TMC2208_n::PWMCONF_t::pwm_autoscale
bool pwm_autoscale
Definition: TMC2208_bitfields.h:131
TMC2208_n::DRV_STATUS_t::ot
bool ot
Definition: TMC2208_bitfields.h:147