TMCStepper
TMC2209Stepper.cpp
Go to the documentation of this file.
1 #include "TMCStepper.h"
2 
3 uint32_t TMC2209Stepper::IOIN() {
5 }
6 bool TMC2209Stepper::enn() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.enn; }
7 bool TMC2209Stepper::ms1() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.ms1; }
8 bool TMC2209Stepper::ms2() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.ms2; }
9 bool TMC2209Stepper::diag() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.diag; }
10 bool TMC2209Stepper::pdn_uart() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.pdn_uart; }
11 bool TMC2209Stepper::step() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.step; }
12 bool TMC2209Stepper::spread_en() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.spread_en;}
13 bool TMC2209Stepper::dir() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.dir; }
14 uint8_t TMC2209Stepper::version() { TMC2209_n::IOIN_t r{0}; r.sr = IOIN(); return r.version; }
15 
17  IHOLD_IRUN(IHOLD_IRUN_register.sr);
18  TPOWERDOWN(TPOWERDOWN_register.sr);
19  TPWMTHRS(TPWMTHRS_register.sr);
20  GCONF(GCONF_register.sr);
21  SLAVECONF(SLAVECONF_register.sr);
22  VACTUAL(VACTUAL_register.sr);
23  CHOPCONF(CHOPCONF_register.sr);
24  PWMCONF(PWMCONF_register.sr);
25  TCOOLTHRS(TCOOLTHRS_register.sr);
26 }
27 
28 void TMC2209Stepper::SGTHRS(uint8_t input) {
29  SGTHRS_register.sr = input;
31 }
33  return SGTHRS_register.sr;
34 }
35 
36 // W: TCOOLTHRS
37 uint32_t TMC2209Stepper::TCOOLTHRS() { return TCOOLTHRS_register.sr; }
38 void TMC2209Stepper::TCOOLTHRS(uint32_t input) {
39  TCOOLTHRS_register.sr = input;
40  write(TCOOLTHRS_register.address, TCOOLTHRS_register.sr);
41 }
42 
45 }
TMC2209_n::IOIN_t::address
constexpr static uint8_t address
Definition: TMC2209_bitfields.h:6
TMC2208Stepper::PWMCONF
uint32_t PWMCONF()
Definition: PWMCONF.cpp:54
TMC2209Stepper::SG_RESULT
uint16_t SG_RESULT()
Definition: TMC2209Stepper.cpp:43
TMC2209Stepper::spread_en
bool spread_en()
Definition: TMC2209Stepper.cpp:12
TMC2209Stepper::diag
bool diag()
Definition: TMC2209Stepper.cpp:9
TMC2208Stepper::read
uint32_t read(uint8_t)
Definition: TMC2208Stepper.cpp:221
TMC2209_n::IOIN_t
Definition: TMC2209_bitfields.h:5
TMC2209_n::IOIN_t::sr
uint32_t sr
Definition: TMC2209_bitfields.h:8
TMC2209Stepper::dir
bool dir()
Definition: TMC2209Stepper.cpp:13
TMC2209Stepper::step
bool step()
Definition: TMC2209Stepper.cpp:11
TMCStepper.h
TMC2209Stepper::enn
bool enn()
Definition: TMC2209Stepper.cpp:6
TMC2208Stepper::SLAVECONF
uint16_t SLAVECONF()
Definition: TMC2208Stepper.cpp:276
TMC2209_n::SGTHRS_t::address
constexpr static uint8_t address
Definition: TMC2209_bitfields.h:27
TMC2209Stepper::IOIN
uint32_t IOIN()
Definition: TMC2209Stepper.cpp:3
TMC2208Stepper::GCONF
uint32_t GCONF()
Definition: GCONF.cpp:67
TMC2208Stepper::CHOPCONF
uint32_t CHOPCONF()
Definition: CHOPCONF.cpp:58
TMC2209Stepper::SGTHRS
uint8_t SGTHRS()
Definition: TMC2209Stepper.cpp:32
TMC2208Stepper::write
void write(uint8_t, uint32_t)
Definition: TMC2208Stepper.cpp:118
TMCStepper::TPOWERDOWN
uint8_t TPOWERDOWN()
Definition: TMCStepper.cpp:123
TMC2209Stepper::push
void push()
Definition: TMC2209Stepper.cpp:16
TMC2209Stepper::TCOOLTHRS
uint32_t TCOOLTHRS()
Definition: TMC2209Stepper.cpp:37
TMC2209_n::SG_RESULT_t::address
constexpr static uint8_t address
Definition: TMC2209_bitfields.h:32
TMC2209_n::SGTHRS_t::sr
uint8_t sr
Definition: TMC2209_bitfields.h:28
TMC2209Stepper::ms1
bool ms1()
Definition: TMC2209Stepper.cpp:7
TMC2208Stepper::VACTUAL
uint32_t VACTUAL()
Definition: TMC2208Stepper.cpp:332
TMC2209Stepper::ms2
bool ms2()
Definition: TMC2209Stepper.cpp:8
TMC2209Stepper::pdn_uart
bool pdn_uart()
Definition: TMC2209Stepper.cpp:10
TMCStepper::IHOLD_IRUN
uint32_t IHOLD_IRUN()
Definition: IHOLD_IRUN.cpp:8
TMC2209Stepper::SGTHRS_register
TMC2209_n::SGTHRS_t SGTHRS_register
Definition: TMCStepper.h:1061
TMC2209Stepper::version
uint8_t version()
Definition: TMC2209Stepper.cpp:14
TMCStepper::TPWMTHRS
uint32_t TPWMTHRS()
Definition: TMCStepper.cpp:133