TMCStepper
ENCMODE.cpp
Go to the documentation of this file.
1
#include "
TMCStepper.h
"
2
#include "
TMC_MACROS.h
"
3
4
#define SET_REG(SETTING) ENCMODE_register.SETTING = B; write(ENCMODE_register.address, ENCMODE_register.sr);
5
#define GET_REG(SETTING) ENCMODE_t r{0}; r.sr = ENCMODE(); return r.SETTING;
6
7
// ENCMODE
8
uint32_t
TMC5130Stepper::ENCMODE
() {
9
return
read
(ENCMODE_register.address);
10
}
11
void
TMC5130Stepper::ENCMODE
(uint32_t input) {
12
ENCMODE_register.sr = input;
13
write
(ENCMODE_register.address, ENCMODE_register.sr);
14
}
15
16
void
TMC5130Stepper::pol_a
(
bool
B) {
SET_REG
(
pol_a
); }
17
void
TMC5130Stepper::pol_b
(
bool
B) {
SET_REG
(
pol_b
); }
18
void
TMC5130Stepper::pol_n
(
bool
B) {
SET_REG
(
pol_n
); }
19
void
TMC5130Stepper::ignore_ab
(
bool
B) {
SET_REG
(
ignore_ab
); }
20
void
TMC5130Stepper::clr_cont
(
bool
B) {
SET_REG
(
clr_cont
); }
21
void
TMC5130Stepper::clr_once
(
bool
B) {
SET_REG
(
clr_once
); }
22
void
TMC5130Stepper::pos_edge
(
bool
B) {
SET_REG
(
pos_edge
); }
23
void
TMC5130Stepper::neg_edge
(
bool
B) {
SET_REG
(
neg_edge
); }
24
void
TMC5130Stepper::clr_enc_x
(
bool
B) {
SET_REG
(
clr_enc_x
); }
25
void
TMC5130Stepper::latch_x_act
(
bool
B) {
SET_REG
(
latch_x_act
); }
26
void
TMC5130Stepper::enc_sel_decimal
(
bool
B){
SET_REG
(
enc_sel_decimal
); }
27
28
bool
TMC5130Stepper::pol_a
() {
GET_REG
(
pol_a
); }
29
bool
TMC5130Stepper::pol_b
() {
GET_REG
(
pol_b
); }
30
bool
TMC5130Stepper::pol_n
() {
GET_REG
(
pol_n
); }
31
bool
TMC5130Stepper::ignore_ab
() {
GET_REG
(
ignore_ab
); }
32
bool
TMC5130Stepper::clr_cont
() {
GET_REG
(
clr_cont
); }
33
bool
TMC5130Stepper::clr_once
() {
GET_REG
(
clr_once
); }
34
bool
TMC5130Stepper::pos_edge
() {
GET_REG
(
pos_edge
); }
35
bool
TMC5130Stepper::neg_edge
() {
GET_REG
(
neg_edge
); }
36
bool
TMC5130Stepper::clr_enc_x
() {
GET_REG
(
clr_enc_x
); }
37
bool
TMC5130Stepper::latch_x_act
() {
GET_REG
(
latch_x_act
); }
38
bool
TMC5130Stepper::enc_sel_decimal
() {
GET_REG
(
enc_sel_decimal
); }
TMC5130Stepper::pol_n
bool pol_n()
Definition:
ENCMODE.cpp:30
TMC5130Stepper::neg_edge
bool neg_edge()
Definition:
ENCMODE.cpp:35
TMC5130Stepper::latch_x_act
bool latch_x_act()
Definition:
ENCMODE.cpp:37
TMC5130Stepper::enc_sel_decimal
bool enc_sel_decimal()
Definition:
ENCMODE.cpp:38
TMC5130Stepper::ignore_ab
bool ignore_ab()
Definition:
ENCMODE.cpp:31
TMCStepper.h
TMC5130Stepper::pos_edge
bool pos_edge()
Definition:
ENCMODE.cpp:34
TMC2130Stepper::read
uint32_t read(uint8_t addressByte)
Definition:
TMC2130Stepper.cpp:65
TMC5130Stepper::pol_b
bool pol_b()
Definition:
ENCMODE.cpp:29
GET_REG
#define GET_REG(SETTING)
Definition:
ENCMODE.cpp:5
TMC_MACROS.h
TMC5130Stepper::clr_enc_x
bool clr_enc_x()
Definition:
ENCMODE.cpp:36
TMC5130Stepper::pol_a
bool pol_a()
Definition:
ENCMODE.cpp:28
TMC5130Stepper::clr_cont
bool clr_cont()
Definition:
ENCMODE.cpp:32
TMC2130Stepper::write
void write(uint8_t addressByte, uint32_t config)
Definition:
TMC2130Stepper.cpp:148
SET_REG
#define SET_REG(SETTING)
Definition:
ENCMODE.cpp:4
TMC5130Stepper::ENCMODE
uint32_t ENCMODE()
Definition:
ENCMODE.cpp:8
TMC5130Stepper::clr_once
bool clr_once()
Definition:
ENCMODE.cpp:33
src
source
ENCMODE.cpp
Generated by
1.8.17