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