TMCStepper
SW_MODE.cpp
Go to the documentation of this file.
1
#include "
TMCStepper.h
"
2
#include "
TMC_MACROS.h
"
3
4
#define SET_REG(SETTING) SW_MODE_register.SETTING = B; write(SW_MODE_register.address, SW_MODE_register.sr)
5
#define GET_REG(SETTING) SW_MODE_t r{0}; r.sr = SW_MODE(); return r.SETTING
6
7
// SW_MODE
8
uint32_t
TMC5130Stepper::SW_MODE
() {
9
return
read
(SW_MODE_register.address);
10
}
11
void
TMC5130Stepper::SW_MODE
(uint32_t input) {
12
SW_MODE_register.sr = input;
13
write
(SW_MODE_register.address, SW_MODE_register.sr);
14
}
15
16
void
TMC5130Stepper::stop_l_enable
(
bool
B) {
SET_REG
(
stop_l_enable
); }
17
void
TMC5130Stepper::stop_r_enable
(
bool
B) {
SET_REG
(
stop_r_enable
); }
18
void
TMC5130Stepper::pol_stop_l
(
bool
B) {
SET_REG
(
pol_stop_l
); }
19
void
TMC5130Stepper::pol_stop_r
(
bool
B) {
SET_REG
(
pol_stop_r
); }
20
void
TMC5130Stepper::swap_lr
(
bool
B) {
SET_REG
(
swap_lr
); }
21
void
TMC5130Stepper::latch_l_active
(
bool
B) {
SET_REG
(
latch_l_active
); }
22
void
TMC5130Stepper::latch_l_inactive
(
bool
B) {
SET_REG
(
latch_l_inactive
);}
23
void
TMC5130Stepper::latch_r_active
(
bool
B) {
SET_REG
(
latch_r_active
); }
24
void
TMC5130Stepper::latch_r_inactive
(
bool
B) {
SET_REG
(
latch_r_inactive
);}
25
void
TMC5130Stepper::en_latch_encoder
(
bool
B) {
SET_REG
(
en_latch_encoder
);}
26
void
TMC5130Stepper::sg_stop
(
bool
B) {
SET_REG
(
sg_stop
); }
27
void
TMC5130Stepper::en_softstop
(
bool
B) {
SET_REG
(
en_softstop
); }
28
29
bool
TMC5130Stepper::stop_r_enable
() {
GET_REG
(
stop_r_enable
); }
30
bool
TMC5130Stepper::pol_stop_l
() {
GET_REG
(
pol_stop_l
); }
31
bool
TMC5130Stepper::pol_stop_r
() {
GET_REG
(
pol_stop_r
); }
32
bool
TMC5130Stepper::swap_lr
() {
GET_REG
(
swap_lr
); }
33
bool
TMC5130Stepper::latch_l_active
() {
GET_REG
(
latch_l_active
); }
34
bool
TMC5130Stepper::latch_l_inactive
() {
GET_REG
(
latch_l_inactive
);}
35
bool
TMC5130Stepper::latch_r_active
() {
GET_REG
(
latch_r_active
); }
36
bool
TMC5130Stepper::latch_r_inactive
() {
GET_REG
(
latch_r_inactive
);}
37
bool
TMC5130Stepper::en_latch_encoder
() {
GET_REG
(
en_latch_encoder
);}
38
bool
TMC5130Stepper::sg_stop
() {
GET_REG
(
sg_stop
); }
39
bool
TMC5130Stepper::en_softstop
() {
GET_REG
(
en_softstop
); }
TMC5130Stepper::en_latch_encoder
bool en_latch_encoder()
Definition:
SW_MODE.cpp:37
TMC5130Stepper::latch_r_active
bool latch_r_active()
Definition:
SW_MODE.cpp:35
TMC5130Stepper::en_softstop
bool en_softstop()
Definition:
SW_MODE.cpp:39
GET_REG
#define GET_REG(SETTING)
Definition:
SW_MODE.cpp:5
TMC5130Stepper::pol_stop_r
bool pol_stop_r()
Definition:
SW_MODE.cpp:31
TMC5130Stepper::latch_l_inactive
bool latch_l_inactive()
Definition:
SW_MODE.cpp:34
TMC5130Stepper::stop_l_enable
void stop_l_enable(bool B)
Definition:
SW_MODE.cpp:16
TMCStepper.h
TMC5130Stepper::SW_MODE
uint32_t SW_MODE()
Definition:
SW_MODE.cpp:8
TMC5130Stepper::swap_lr
bool swap_lr()
Definition:
SW_MODE.cpp:32
TMC2130Stepper::read
uint32_t read(uint8_t addressByte)
Definition:
TMC2130Stepper.cpp:65
TMC_MACROS.h
TMC5130Stepper::stop_r_enable
bool stop_r_enable()
Definition:
SW_MODE.cpp:29
TMC5130Stepper::latch_l_active
bool latch_l_active()
Definition:
SW_MODE.cpp:33
TMC5130Stepper::latch_r_inactive
bool latch_r_inactive()
Definition:
SW_MODE.cpp:36
TMC5130Stepper::sg_stop
bool sg_stop()
Definition:
SW_MODE.cpp:38
SET_REG
#define SET_REG(SETTING)
Definition:
SW_MODE.cpp:4
TMC2130Stepper::write
void write(uint8_t addressByte, uint32_t config)
Definition:
TMC2130Stepper.cpp:148
TMC5130Stepper::pol_stop_l
bool pol_stop_l()
Definition:
SW_MODE.cpp:30
src
source
SW_MODE.cpp
Generated by
1.8.17