TMCStepper
TMC2660_bitfields.h
Go to the documentation of this file.
1 #pragma once
2 #pragma pack(push, 1)
3 
4 struct DRVCTRL_1_t {
5  constexpr static uint8_t address = 0b00;
6  union {
7  uint32_t sr;
8  struct {
9  uint8_t cb : 8;
10  bool phb : 1;
11  uint8_t ca : 8;
12  bool pha : 1;
13  };
14  };
15 };
16 
17 struct DRVCTRL_0_t {
18  constexpr static uint8_t address = 0b00;
19  union {
20  uint32_t sr;
21  struct {
22  uint8_t mres : 4;
23  uint8_t : 4;
24  bool dedge : 1;
25  bool intpol : 1;
26  };
27  };
28 };
29 
30 namespace TMC2660_n {
31  struct CHOPCONF_t {
32  constexpr static uint8_t address = 0b100;
33  union {
34  uint32_t sr;
35  struct {
36  uint8_t toff : 4;
37  uint8_t hstrt : 3;
38  uint8_t hend : 4;
39  uint8_t hdec : 2;
40  bool rndtf : 1;
41  bool chm : 1;
42  uint8_t tbl : 2;
43  };
44  };
45  };
46 }
47 
48 struct SMARTEN_t {
49  constexpr static uint8_t address = 0b101;
50  union {
51  uint32_t sr;
52  struct {
53  uint8_t semin : 4,
54  : 1,
55  seup : 2,
56  : 1,
57  semax : 4,
58  : 1,
59  sedn : 2;
60  bool seimin : 1;
61  };
62  };
63 };
64 
65 struct SGCSCONF_t {
66  constexpr static uint8_t address = 0b110;
67  union {
68  uint32_t sr;
69  struct {
70  uint8_t cs : 5;
71  uint8_t : 3;
72  uint8_t sgt : 7;
73  uint8_t : 1;
74  bool sfilt : 1;
75  };
76  };
77 };
78 
79 struct DRVCONF_t {
80  constexpr static uint8_t address = 0b111;
81  union {
82  uint32_t sr;
83  struct {
84  uint8_t : 4;
85  uint8_t rdsel : 2;
86  bool vsense : 1;
87  bool sdoff : 1;
88  uint8_t ts2g : 2;
89  bool diss2g : 1;
90  uint8_t : 1;
91  uint8_t slpl : 2;
92  uint8_t slph : 2;
93  bool tst : 1;
94  };
95  };
96 };
97 
99  union {
100  uint32_t sr;
101  struct {
102  bool sg_value : 1,
103  ot : 1,
104  otpw : 1,
105  s2ga : 1,
106  s2gb : 1,
107  ola : 1,
108  olb : 1,
109  stst : 1;
110  uint8_t : 2;
111  uint16_t mstep : 10;
112  };
113  };
114 };
115 
117  union {
118  uint32_t sr;
119  struct {
120  bool sg_value : 1,
121  ot : 1,
122  otpw : 1,
123  s2ga : 1,
124  s2gb : 1,
125  ola : 1,
126  olb : 1,
127  stst : 1;
128  uint8_t : 2;
129  uint16_t sg_result : 10;
130  };
131  };
132 };
133 
135  union {
136  uint32_t sr;
137  struct {
138  bool sg_value : 1,
139  ot : 1,
140  otpw : 1,
141  s2ga : 1,
142  s2gb : 1,
143  ola : 1,
144  olb : 1,
145  stst : 1;
146  uint8_t : 2;
147  uint8_t se : 5;
148  uint8_t sg_result : 5;
149  };
150  };
151 };
152 
153 #pragma pack(pop)
READ_RDSEL00_t::ola
bool ola
Definition: TMC2660_bitfields.h:107
TMC2660_n::CHOPCONF_t::address
constexpr static uint8_t address
Definition: TMC2660_bitfields.h:32
READ_RDSEL00_t::otpw
bool otpw
Definition: TMC2660_bitfields.h:104
TMC2660_n::CHOPCONF_t::hstrt
uint8_t hstrt
Definition: TMC2660_bitfields.h:37
READ_RDSEL10_t::sg_value
bool sg_value
Definition: TMC2660_bitfields.h:138
TMC2660_n::CHOPCONF_t
Definition: TMC2660_bitfields.h:31
SGCSCONF_t::address
constexpr static uint8_t address
Definition: TMC2660_bitfields.h:66
READ_RDSEL01_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:118
DRVCONF_t::address
constexpr static uint8_t address
Definition: TMC2660_bitfields.h:80
DRVCONF_t::vsense
bool vsense
Definition: TMC2660_bitfields.h:86
TMC2660_n::CHOPCONF_t::tbl
uint8_t tbl
Definition: TMC2660_bitfields.h:42
READ_RDSEL10_t::ola
bool ola
Definition: TMC2660_bitfields.h:143
TMC2660_n::CHOPCONF_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:34
READ_RDSEL01_t::s2ga
bool s2ga
Definition: TMC2660_bitfields.h:123
TMC2660_n::CHOPCONF_t::hend
uint8_t hend
Definition: TMC2660_bitfields.h:38
DRVCTRL_0_t::intpol
bool intpol
Definition: TMC2660_bitfields.h:25
DRVCONF_t::rdsel
uint8_t rdsel
Definition: TMC2660_bitfields.h:85
READ_RDSEL10_t::otpw
bool otpw
Definition: TMC2660_bitfields.h:140
SMARTEN_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:51
DRVCTRL_0_t::address
constexpr static uint8_t address
Definition: TMC2660_bitfields.h:18
DRVCTRL_0_t::dedge
bool dedge
Definition: TMC2660_bitfields.h:24
READ_RDSEL10_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:136
TMC2660_n::CHOPCONF_t::hdec
uint8_t hdec
Definition: TMC2660_bitfields.h:39
DRVCONF_t
Definition: TMC2660_bitfields.h:79
READ_RDSEL01_t::sg_value
bool sg_value
Definition: TMC2660_bitfields.h:120
TMC2660_n
Definition: TMC2660_bitfields.h:30
DRVCONF_t::diss2g
bool diss2g
Definition: TMC2660_bitfields.h:89
READ_RDSEL00_t::s2gb
bool s2gb
Definition: TMC2660_bitfields.h:106
DRVCTRL_1_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:7
SMARTEN_t::address
constexpr static uint8_t address
Definition: TMC2660_bitfields.h:49
READ_RDSEL10_t
Definition: TMC2660_bitfields.h:134
READ_RDSEL00_t::sg_value
bool sg_value
Definition: TMC2660_bitfields.h:102
TMC2660_n::CHOPCONF_t::chm
bool chm
Definition: TMC2660_bitfields.h:41
DRVCTRL_0_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:20
READ_RDSEL00_t::mstep
uint16_t mstep
Definition: TMC2660_bitfields.h:111
TMC2660_n::CHOPCONF_t::rndtf
bool rndtf
Definition: TMC2660_bitfields.h:40
DRVCTRL_1_t::pha
bool pha
Definition: TMC2660_bitfields.h:12
SMARTEN_t
Definition: TMC2660_bitfields.h:48
SGCSCONF_t
Definition: TMC2660_bitfields.h:65
READ_RDSEL10_t::se
uint8_t se
Definition: TMC2660_bitfields.h:147
READ_RDSEL01_t::olb
bool olb
Definition: TMC2660_bitfields.h:126
SMARTEN_t::seup
uint8_t seup
Definition: TMC2660_bitfields.h:54
DRVCONF_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:82
SGCSCONF_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:68
SGCSCONF_t::sfilt
bool sfilt
Definition: TMC2660_bitfields.h:74
READ_RDSEL10_t::sg_result
uint8_t sg_result
Definition: TMC2660_bitfields.h:148
DRVCONF_t::ts2g
uint8_t ts2g
Definition: TMC2660_bitfields.h:88
READ_RDSEL00_t::olb
bool olb
Definition: TMC2660_bitfields.h:108
DRVCTRL_1_t::cb
uint8_t cb
Definition: TMC2660_bitfields.h:9
READ_RDSEL00_t::ot
bool ot
Definition: TMC2660_bitfields.h:103
READ_RDSEL00_t::stst
bool stst
Definition: TMC2660_bitfields.h:109
READ_RDSEL01_t::stst
bool stst
Definition: TMC2660_bitfields.h:127
READ_RDSEL10_t::ot
bool ot
Definition: TMC2660_bitfields.h:139
READ_RDSEL01_t::otpw
bool otpw
Definition: TMC2660_bitfields.h:122
READ_RDSEL00_t::sr
uint32_t sr
Definition: TMC2660_bitfields.h:100
SMARTEN_t::semin
uint8_t semin
Definition: TMC2660_bitfields.h:53
READ_RDSEL10_t::olb
bool olb
Definition: TMC2660_bitfields.h:144
READ_RDSEL01_t::sg_result
uint16_t sg_result
Definition: TMC2660_bitfields.h:129
READ_RDSEL01_t::ot
bool ot
Definition: TMC2660_bitfields.h:121
DRVCONF_t::slpl
uint8_t slpl
Definition: TMC2660_bitfields.h:91
DRVCTRL_0_t::mres
uint8_t mres
Definition: TMC2660_bitfields.h:22
READ_RDSEL10_t::stst
bool stst
Definition: TMC2660_bitfields.h:145
SMARTEN_t::seimin
bool seimin
Definition: TMC2660_bitfields.h:60
DRVCONF_t::tst
bool tst
Definition: TMC2660_bitfields.h:93
TMC2660_n::CHOPCONF_t::toff
uint8_t toff
Definition: TMC2660_bitfields.h:36
SGCSCONF_t::cs
uint8_t cs
Definition: TMC2660_bitfields.h:70
DRVCONF_t::sdoff
bool sdoff
Definition: TMC2660_bitfields.h:87
READ_RDSEL00_t
Definition: TMC2660_bitfields.h:98
SMARTEN_t::semax
uint8_t semax
Definition: TMC2660_bitfields.h:56
READ_RDSEL10_t::s2ga
bool s2ga
Definition: TMC2660_bitfields.h:141
READ_RDSEL01_t
Definition: TMC2660_bitfields.h:116
READ_RDSEL01_t::ola
bool ola
Definition: TMC2660_bitfields.h:125
READ_RDSEL10_t::s2gb
bool s2gb
Definition: TMC2660_bitfields.h:142
READ_RDSEL01_t::s2gb
bool s2gb
Definition: TMC2660_bitfields.h:124
READ_RDSEL00_t::s2ga
bool s2ga
Definition: TMC2660_bitfields.h:105
SMARTEN_t::sedn
uint8_t sedn
Definition: TMC2660_bitfields.h:58
DRVCTRL_0_t
Definition: TMC2660_bitfields.h:17
DRVCTRL_1_t::phb
bool phb
Definition: TMC2660_bitfields.h:10
DRVCTRL_1_t
Definition: TMC2660_bitfields.h:4
DRVCTRL_1_t::address
constexpr static uint8_t address
Definition: TMC2660_bitfields.h:5
DRVCTRL_1_t::ca
uint8_t ca
Definition: TMC2660_bitfields.h:11
DRVCONF_t::slph
uint8_t slph
Definition: TMC2660_bitfields.h:92
SGCSCONF_t::sgt
uint8_t sgt
Definition: TMC2660_bitfields.h:72