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/TMC2160_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 | namespace TMC2160_n { |
| charly | 0:3f4cfbeda9d3 | 5 | struct IOIN_t { |
| charly | 0:3f4cfbeda9d3 | 6 | constexpr static uint8_t address = 0x04; |
| charly | 0:3f4cfbeda9d3 | 7 | union { |
| charly | 0:3f4cfbeda9d3 | 8 | uint32_t sr; |
| charly | 0:3f4cfbeda9d3 | 9 | struct { |
| charly | 0:3f4cfbeda9d3 | 10 | bool refl_step : 1, |
| charly | 0:3f4cfbeda9d3 | 11 | refr_dir : 1, |
| charly | 0:3f4cfbeda9d3 | 12 | encb_dcen_cfg4 : 1, |
| charly | 0:3f4cfbeda9d3 | 13 | enca_dcin_cfg5 : 1, |
| charly | 0:3f4cfbeda9d3 | 14 | drv_enn : 1, |
| charly | 0:3f4cfbeda9d3 | 15 | dco_cfg6 : 1, |
| charly | 0:3f4cfbeda9d3 | 16 | : 2; |
| charly | 0:3f4cfbeda9d3 | 17 | uint16_t : 16; |
| charly | 0:3f4cfbeda9d3 | 18 | uint8_t version : 8; |
| charly | 0:3f4cfbeda9d3 | 19 | }; |
| charly | 0:3f4cfbeda9d3 | 20 | }; |
| charly | 0:3f4cfbeda9d3 | 21 | }; |
| charly | 0:3f4cfbeda9d3 | 22 | |
| charly | 0:3f4cfbeda9d3 | 23 | struct PWMCONF_t { |
| charly | 0:3f4cfbeda9d3 | 24 | constexpr static uint8_t address = 0x70; |
| charly | 0:3f4cfbeda9d3 | 25 | union { |
| charly | 0:3f4cfbeda9d3 | 26 | uint32_t sr; |
| charly | 0:3f4cfbeda9d3 | 27 | struct { |
| charly | 0:3f4cfbeda9d3 | 28 | uint8_t pwm_ofs : 8, |
| charly | 0:3f4cfbeda9d3 | 29 | pwm_grad : 8, |
| charly | 0:3f4cfbeda9d3 | 30 | pwm_freq : 2; |
| charly | 0:3f4cfbeda9d3 | 31 | bool pwm_autoscale : 1, |
| charly | 0:3f4cfbeda9d3 | 32 | pwm_autograd : 1; |
| charly | 0:3f4cfbeda9d3 | 33 | uint8_t freewheel : 2, |
| charly | 0:3f4cfbeda9d3 | 34 | : 2, |
| charly | 0:3f4cfbeda9d3 | 35 | pwm_reg : 4, |
| charly | 0:3f4cfbeda9d3 | 36 | pwm_lim : 4; |
| charly | 0:3f4cfbeda9d3 | 37 | }; |
| charly | 0:3f4cfbeda9d3 | 38 | }; |
| charly | 0:3f4cfbeda9d3 | 39 | }; |
| charly | 0:3f4cfbeda9d3 | 40 | |
| charly | 0:3f4cfbeda9d3 | 41 | struct PWM_SCALE_t { |
| charly | 0:3f4cfbeda9d3 | 42 | constexpr static uint8_t address = 0x71; |
| charly | 0:3f4cfbeda9d3 | 43 | union { |
| charly | 0:3f4cfbeda9d3 | 44 | uint32_t sr : 25; |
| charly | 0:3f4cfbeda9d3 | 45 | struct { |
| charly | 0:3f4cfbeda9d3 | 46 | uint8_t pwm_scale_sum : 8, |
| charly | 0:3f4cfbeda9d3 | 47 | : 8; |
| charly | 0:3f4cfbeda9d3 | 48 | uint16_t pwm_scale_auto : 9; |
| charly | 0:3f4cfbeda9d3 | 49 | }; |
| charly | 0:3f4cfbeda9d3 | 50 | }; |
| charly | 0:3f4cfbeda9d3 | 51 | }; |
| charly | 0:3f4cfbeda9d3 | 52 | } |
| charly | 0:3f4cfbeda9d3 | 53 | |
| charly | 0:3f4cfbeda9d3 | 54 | #pragma pack(pop) |