aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/stepcompress.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-06-06 16:49:44 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-06-20 09:26:10 -0400
commit9a2eb4beddf1f6e551f4e85836cf1e0bd056ea03 (patch)
treef6b92ab81fee8a6083ba5ece9280843befdd2ef9 /klippy/chelper/stepcompress.h
parent8a830ff0cee1ae96044cee4258842a14b2781a94 (diff)
downloadkutter-9a2eb4beddf1f6e551f4e85836cf1e0bd056ea03.tar.gz
kutter-9a2eb4beddf1f6e551f4e85836cf1e0bd056ea03.tar.xz
kutter-9a2eb4beddf1f6e551f4e85836cf1e0bd056ea03.zip
chelper: Move cartesian and delta kinematics code to their own C files
Move the cartesian and delta specific code to new files kin_cartesian.c and kin_delta.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/stepcompress.h')
-rw-r--r--klippy/chelper/stepcompress.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/klippy/chelper/stepcompress.h b/klippy/chelper/stepcompress.h
new file mode 100644
index 00000000..2a2fe725
--- /dev/null
+++ b/klippy/chelper/stepcompress.h
@@ -0,0 +1,40 @@
+#ifndef STEPCOMPRESS_H
+#define STEPCOMPRESS_H
+
+#include <stdint.h> // uint32_t
+
+#define ERROR_RET -989898989
+
+struct stepcompress *stepcompress_alloc(
+ uint32_t max_error, uint32_t queue_step_msgid
+ , uint32_t set_next_step_dir_msgid, uint32_t invert_sdir, uint32_t oid);
+void stepcompress_free(struct stepcompress *sc);
+int set_next_step_dir(struct stepcompress *sc, int sdir);
+int stepcompress_reset(struct stepcompress *sc, uint64_t last_step_clock);
+int stepcompress_set_homing(struct stepcompress *sc, uint64_t homing_clock);
+int stepcompress_queue_msg(struct stepcompress *sc, uint32_t *data, int len);
+double stepcompress_get_mcu_freq(struct stepcompress *sc);
+uint32_t stepcompress_get_oid(struct stepcompress *sc);
+
+struct queue_append {
+ struct stepcompress *sc;
+ uint32_t *qnext, *qend, last_step_clock_32;
+ double clock_offset;
+};
+struct queue_append queue_append_start(
+ struct stepcompress *sc, double print_time, double adjust);
+void queue_append_finish(struct queue_append qa);
+int queue_append(struct queue_append *qa, double step_clock);
+
+struct serialqueue;
+struct steppersync *steppersync_alloc(
+ struct serialqueue *sq, struct stepcompress **sc_list, int sc_num
+ , int move_num);
+void steppersync_free(struct steppersync *ss);
+void steppersync_set_time(struct steppersync *ss, double time_offset
+ , double mcu_freq);
+int steppersync_flush(struct steppersync *ss, uint64_t move_clock);
+
+double safe_sqrt(double v);
+
+#endif // stepcompress.h