TMC7300
Loading...
Searching...
No Matches
TMC7300_Register.h
Go to the documentation of this file.
1// modified from https://github.com/trinamic/TMC-API/blob/868611b6fe73155c4cbc3313ce1040d171f39fd3/tmc/ic/TMC7300/TMC7300_Register.h
2
3#ifndef TMC7300_REGISTER_H
4#define TMC7300_REGISTER_H
5
6// clang-format off
7
8// ===== TMC7300 register set =====
9
10#define _TMC7300_GCONF 0x00
11#define _TMC7300_GSTAT 0x01
12#define _TMC7300_IFCNT 0x02
13#define _TMC7300_SLAVECONF 0x03
14#define _TMC7300_IOIN 0x06
15#define _TMC7300_CURRENT_LIMIT 0x10
16#define _TMC7300_PWM_AB 0x22
17#define _TMC7300_CHOPCONF 0x6C
18#define _TMC7300_DRVSTATUS 0x6F
19#define _TMC7300_PWMCONF 0x70
20
21#define _TMC7300_GCONF_VALUE_ADDR 0
22#define _TMC7300_GSTAT_VALUE_ADDR 1
23#define _TMC7300_IFCNT_VALUE_ADDR 2
24#define _TMC7300_SLAVECONF_VALUE_ADDR 3
25#define _TMC7300_IOIN_VALUE_ADDR 4
26#define _TMC7300_CURRENT_LIMIT_VALUE_ADDR 5
27#define _TMC7300_PWM_AB_VALUE_ADDR 6
28#define _TMC7300_CHOPCONF_VALUE_ADDR 7
29#define _TMC7300_DRVSTATUS_VALUE_ADDR 8
30#define _TMC7300_PWMCONF_VALUE_ADDR 9
31
32
33// modified from https://github.com/trinamic/TMC-API/blob/868611b6fe73155c4cbc3313ce1040d171f39fd3/tmc/ic/TMC7300/TMC7300_Fields.h
34
35#define _TMC7300_PWM_DIRECT_MASK 0x00000001
36#define _TMC7300_PWM_DIRECT_SHIFT 0
37#define _TMC7300_EXTCAP_MASK 0x00000002
38#define _TMC7300_EXTCAP_SHIFT 1
39#define _TMC7300_PAR_MODE_MASK 0x00000004
40#define _TMC7300_PAR_MODE_SHIFT 2
41#define _TMC7300_TEST_MODE_MASK 0x00000080
42#define _TMC7300_TEST_MODE_SHIFT 7
43#define _TMC7300_RESET_MASK 0x00000001
44#define _TMC7300_RESET_SHIFT 0
45#define _TMC7300_DRV_ERR_MASK 0x00000002
46#define _TMC7300_DRV_ERR_SHIFT 1
47#define _TMC7300_U3V5_MASK 0x00000004
48#define _TMC7300_U3V5_SHIFT 2
49#define _TMC7300_IFCNT_MASK 0x000000FF
50#define _TMC7300_IFCNT_SHIFT 0
51#define _TMC7300_SLAVECONF_MASK 0x00000F00
52#define _TMC7300_SLAVECONF_SHIFT 8
53#define _TMC7300_EN_MASK 0x00000001
54#define _TMC7300_EN_SHIFT 0
55#define _TMC7300_NSTDBY_MASK 0x00000002
56#define _TMC7300_NSTDBY_SHIFT 1
57#define _TMC7300_AD0_MASK 0x00000004
58#define _TMC7300_AD0_SHIFT 2
59#define _TMC7300_AD1_MASK 0x00000008
60#define _TMC7300_AD1_SHIFT 3
61#define _TMC7300_DIAG_MASK 0x00000010
62#define _TMC7300_DIAG_SHIFT 4
63#define _TMC7300_UART_ENABLED_MASK 0x00000020
64#define _TMC7300_UART_ENABLED_SHIFT 5
65#define _TMC7300_UART_INPUT_MASK 0x00000040
66#define _TMC7300_UART_INPUT_SHIFT 6
67#define _TMC7300_MODE_INPUT_MASK 0x00000080
68#define _TMC7300_MODE_INPUT_SHIFT 7
69#define _TMC7300_A2_MASK 0x00000100
70#define _TMC7300_A2_SHIFT 8
71#define _TMC7300_A1_MASK 0x00000200
72#define _TMC7300_A1_SHIFT 9
73#define _TMC7300_COMP_A1A2_MASK 0x00000400
74#define _TMC7300_COMP_A1A2_SHIFT 10
75#define _TMC7300_COMP_B1B2_MASK 0x00000800
76#define _TMC7300_COMP_B1B2_SHIFT 11
77#define _TMC7300_VERSION_MASK 0xFF000000
78#define _TMC7300_VERSION_SHIFT 24
79#define _TMC7300_MOTORRUN_MASK 0x00000001
80#define _TMC7300_MOTORRUN_SHIFT 0
81#define _TMC7300_IRUN_MASK 0x00001F00
82#define _TMC7300_IRUN_SHIFT 8
83#define _TMC7300_PWM_A_MASK 0x000001FF
84#define _TMC7300_PWM_A_SHIFT 0
85#define _TMC7300_PWM_B_MASK 0x01FF0000
86#define _TMC7300_PWM_B_SHIFT 16
87#define _TMC7300_ENABLEDRV_MASK 0x00000001
88#define _TMC7300_ENABLEDRV_SHIFT 0
89#define _TMC7300_TBL_MASK 0x00018000
90#define _TMC7300_TBL_SHIFT 15
91#define _TMC7300_DISS2G_MASK 0x40000000
92#define _TMC7300_DISS2G_SHIFT 30
93#define _TMC7300_DISS2VS_MASK 0x80000000
94#define _TMC7300_DISS2VS_SHIFT 31
95#define _TMC7300_OTPW_MASK 0x00000001
96#define _TMC7300_OTPW_SHIFT 0
97#define _TMC7300_OT_MASK 0x00000002
98#define _TMC7300_OT_SHIFT 1
99#define _TMC7300_S2GA_MASK 0x00000004
100#define _TMC7300_S2GA_SHIFT 2
101#define _TMC7300_S2GB_MASK 0x00000008
102#define _TMC7300_S2GB_SHIFT 3
103#define _TMC7300_S2VSA_MASK 0x00000010
104#define _TMC7300_S2VSA_SHIFT 4
105#define _TMC7300_S2VSB_MASK 0x00000020
106#define _TMC7300_S2VSB_SHIFT 5
107#define _TMC7300_OLA_MASK 0x00000040
108#define _TMC7300_OLA_SHIFT 6
109#define _TMC7300_OLB_MASK 0x00000080
110#define _TMC7300_OLB_SHIFT 7
111#define _TMC7300_T120_MASK 0x00000100
112#define _TMC7300_T120_SHIFT 8
113#define _TMC7300_T150_MASK 0x00000200
114#define _TMC7300_T150_SHIFT 9
115#define _TMC7300_PWM_FREQ_MASK 0x00030000
116#define _TMC7300_PWM_FREQ_SHIFT 16
117#define _TMC7300_FREEWHEEL_MASK 0x00300000
118#define _TMC7300_FREEWHEEL_SHIFT 20
119
120// clang-format on
121
122#endif // TMC7300_REGISTER_H