Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: TMCStepper mRotaryEncoder-os
Diff: source/IHOLD_IRUN.cpp
- Revision:
- 0:3f4cfbeda9d3
diff -r 000000000000 -r 3f4cfbeda9d3 source/IHOLD_IRUN.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source/IHOLD_IRUN.cpp Thu Feb 04 19:46:56 2021 +0000
@@ -0,0 +1,20 @@
+#include "TMCStepper.h"
+#include "TMC_MACROS.h"
+
+#define SET_REG(SETTING) IHOLD_IRUN_register.SETTING = B; write(IHOLD_IRUN_register.address, IHOLD_IRUN_register.sr);
+#define GET_REG(SETTING) return IHOLD_IRUN_register.SETTING;
+
+// IHOLD_IRUN
+uint32_t TMCStepper::IHOLD_IRUN() { return IHOLD_IRUN_register.sr; }
+void TMCStepper::IHOLD_IRUN(uint32_t input) {
+ IHOLD_IRUN_register.sr = input;
+ write(IHOLD_IRUN_register.address, IHOLD_IRUN_register.sr);
+}
+
+void TMCStepper::ihold(uint8_t B) { SET_REG(ihold); }
+void TMCStepper::irun(uint8_t B) { SET_REG(irun); }
+void TMCStepper::iholddelay(uint8_t B) { SET_REG(iholddelay); }
+
+uint8_t TMCStepper::ihold() { GET_REG(ihold); }
+uint8_t TMCStepper::irun() { GET_REG(irun); }
+uint8_t TMCStepper::iholddelay() { GET_REG(iholddelay); }
\ No newline at end of file