TMCStepper
COOLCONF.cpp
Go to the documentation of this file.
1
#include "
TMCStepper.h
"
2
#include "
TMC_MACROS.h
"
3
4
#define SET_REG(SETTING) COOLCONF_register.SETTING = B; write(COOLCONF_register.address, COOLCONF_register.sr);
5
#define GET_REG(SETTING) return COOLCONF_register.SETTING;
6
7
// COOLCONF
8
uint32_t
TMC2130Stepper::COOLCONF
() {
return
COOLCONF_register.sr; }
9
void
TMC2130Stepper::COOLCONF
(uint32_t input) {
10
COOLCONF_register.sr = input;
11
write
(COOLCONF_register.address, COOLCONF_register.sr);
12
}
13
14
void
TMC2130Stepper::semin
( uint8_t B ) {
SET_REG
(
semin
); }
15
void
TMC2130Stepper::seup
( uint8_t B ) {
SET_REG
(
seup
); }
16
void
TMC2130Stepper::semax
( uint8_t B ) {
SET_REG
(
semax
); }
17
void
TMC2130Stepper::sedn
( uint8_t B ) {
SET_REG
(
sedn
); }
18
void
TMC2130Stepper::seimin
(
bool
B ) {
SET_REG
(
seimin
); }
19
void
TMC2130Stepper::sgt
( int8_t B ) {
SET_REG
(
sgt
); }
20
void
TMC2130Stepper::sfilt
(
bool
B ) {
SET_REG
(
sfilt
); }
21
22
uint8_t
TMC2130Stepper::semin
() {
GET_REG
(
semin
); }
23
uint8_t
TMC2130Stepper::seup
() {
GET_REG
(
seup
); }
24
uint8_t
TMC2130Stepper::semax
() {
GET_REG
(
semax
); }
25
uint8_t
TMC2130Stepper::sedn
() {
GET_REG
(
sedn
); }
26
bool
TMC2130Stepper::seimin
(){
GET_REG
(
seimin
); }
27
bool
TMC2130Stepper::sfilt
() {
GET_REG
(
sfilt
); }
28
29
int8_t
TMC2130Stepper::sgt
() {
30
// Two's complement in a 7bit value
31
int8_t val = (COOLCONF_register.sgt & 0x40) << 1;
// Isolate sign bit
32
val |= COOLCONF_register.sgt & 0x7F;
33
return
val;
34
}
35
36
uint16_t
TMC2209Stepper::COOLCONF
() {
return
COOLCONF_register
.
sr
; }
37
void
TMC2209Stepper::COOLCONF
(uint16_t input) {
38
COOLCONF_register
.
sr
= input;
39
write
(
COOLCONF_register
.
address
,
COOLCONF_register
.
sr
);
40
}
41
42
void
TMC2209Stepper::semin
( uint8_t B ) {
SET_REG
(
semin
); }
43
void
TMC2209Stepper::seup
( uint8_t B ) {
SET_REG
(
seup
); }
44
void
TMC2209Stepper::semax
( uint8_t B ) {
SET_REG
(
semax
); }
45
void
TMC2209Stepper::sedn
( uint8_t B ) {
SET_REG
(
sedn
); }
46
void
TMC2209Stepper::seimin
(
bool
B ) {
SET_REG
(
seimin
); }
47
48
uint8_t
TMC2209Stepper::semin
() {
GET_REG
(
semin
); }
49
uint8_t
TMC2209Stepper::seup
() {
GET_REG
(
seup
); }
50
uint8_t
TMC2209Stepper::semax
() {
GET_REG
(
semax
); }
51
uint8_t
TMC2209Stepper::sedn
() {
GET_REG
(
sedn
); }
52
bool
TMC2209Stepper::seimin
(){
GET_REG
(
seimin
); }
SET_REG
#define SET_REG(SETTING)
Definition:
COOLCONF.cpp:4
TMC2209Stepper::sedn
uint8_t sedn()
Definition:
COOLCONF.cpp:51
TMC2209Stepper::seimin
bool seimin()
Definition:
COOLCONF.cpp:52
TMC2209Stepper::COOLCONF_register
TMC2209_n::COOLCONF_t COOLCONF_register
Definition:
TMCStepper.h:1062
TMC2209Stepper::seup
uint8_t seup()
Definition:
COOLCONF.cpp:49
TMC2130Stepper::seup
uint8_t seup()
Definition:
COOLCONF.cpp:23
TMC2130Stepper::COOLCONF
uint32_t COOLCONF()
Definition:
COOLCONF.cpp:8
TMCStepper.h
TMC2130Stepper::sfilt
bool sfilt()
Definition:
COOLCONF.cpp:27
TMC_MACROS.h
TMC2130Stepper::semax
uint8_t semax()
Definition:
COOLCONF.cpp:24
GET_REG
#define GET_REG(SETTING)
Definition:
COOLCONF.cpp:5
TMC2130Stepper::semin
uint8_t semin()
Definition:
COOLCONF.cpp:22
TMC2209_n::COOLCONF_t::sr
uint16_t sr
Definition:
TMC2209_bitfields.h:39
TMC2130Stepper::sedn
uint8_t sedn()
Definition:
COOLCONF.cpp:25
TMC2208Stepper::write
void write(uint8_t, uint32_t)
Definition:
TMC2208Stepper.cpp:118
TMC2130Stepper::seimin
bool seimin()
Definition:
COOLCONF.cpp:26
TMC2130Stepper::sgt
int8_t sgt()
Definition:
COOLCONF.cpp:29
TMC2209Stepper::semax
uint8_t semax()
Definition:
COOLCONF.cpp:50
TMC2209_n::COOLCONF_t::address
constexpr static uint8_t address
Definition:
TMC2209_bitfields.h:37
TMC2130Stepper::write
void write(uint8_t addressByte, uint32_t config)
Definition:
TMC2130Stepper.cpp:148
TMC2209Stepper::COOLCONF
uint16_t COOLCONF()
Definition:
COOLCONF.cpp:36
TMC2209Stepper::semin
uint8_t semin()
Definition:
COOLCONF.cpp:48
src
source
COOLCONF.cpp
Generated by
1.8.17