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