2019-01-04 20:26:13 +00:00
|
|
|
//! @file
|
2018-08-02 16:54:00 +00:00
|
|
|
|
2019-01-22 09:56:07 +00:00
|
|
|
#ifndef MMU_H
|
|
|
|
#define MMU_H
|
|
|
|
|
2018-08-02 16:54:00 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
2018-08-07 18:37:59 +00:00
|
|
|
|
2018-08-02 16:54:00 +00:00
|
|
|
extern bool mmu_enabled;
|
2018-12-12 21:32:47 +00:00
|
|
|
extern bool mmu_fil_loaded;
|
2018-08-07 18:37:59 +00:00
|
|
|
|
|
|
|
extern uint8_t mmu_extruder;
|
|
|
|
|
2018-08-08 16:58:03 +00:00
|
|
|
extern uint8_t tmp_extruder;
|
|
|
|
|
2018-08-07 18:37:59 +00:00
|
|
|
extern int8_t mmu_finda;
|
2018-12-21 16:12:16 +00:00
|
|
|
extern bool mmu_idler_sensor_detected;
|
2018-12-21 21:33:01 +00:00
|
|
|
extern bool mmu_loading_flag;
|
2018-08-07 18:37:59 +00:00
|
|
|
|
|
|
|
extern int16_t mmu_version;
|
2018-08-09 15:43:43 +00:00
|
|
|
extern int16_t mmu_buildnr;
|
2018-08-07 18:37:59 +00:00
|
|
|
|
2018-12-21 19:56:45 +00:00
|
|
|
extern uint16_t mmu_power_failures;
|
|
|
|
|
2018-12-12 13:50:55 +00:00
|
|
|
#define MMU_FILAMENT_UNKNOWN 255
|
2018-08-07 18:37:59 +00:00
|
|
|
|
2018-12-17 20:25:07 +00:00
|
|
|
#define MMU_NO_MOVE 0
|
2018-12-12 21:32:47 +00:00
|
|
|
#define MMU_UNLOAD_MOVE 1
|
|
|
|
#define MMU_LOAD_MOVE 2
|
|
|
|
#define MMU_TCODE_MOVE 3
|
|
|
|
|
|
|
|
#define MMU_LOAD_FEEDRATE 19.02f //mm/s
|
2018-12-18 15:09:10 +00:00
|
|
|
#define MMU_LOAD_TIME_MS 2000 //should be fine tuned to load time for shortest allowed PTFE tubing and maximum loading speed
|
2018-08-07 18:37:59 +00:00
|
|
|
|
2018-08-20 18:53:53 +00:00
|
|
|
#define MMU_CMD_NONE 0
|
|
|
|
#define MMU_CMD_T0 0x10
|
|
|
|
#define MMU_CMD_T1 0x11
|
|
|
|
#define MMU_CMD_T2 0x12
|
|
|
|
#define MMU_CMD_T3 0x13
|
|
|
|
#define MMU_CMD_T4 0x14
|
2018-08-24 01:49:51 +00:00
|
|
|
#define MMU_CMD_L0 0x20
|
|
|
|
#define MMU_CMD_L1 0x21
|
|
|
|
#define MMU_CMD_L2 0x22
|
|
|
|
#define MMU_CMD_L3 0x23
|
|
|
|
#define MMU_CMD_L4 0x24
|
2018-08-24 18:30:44 +00:00
|
|
|
#define MMU_CMD_C0 0x30
|
2018-08-26 20:08:52 +00:00
|
|
|
#define MMU_CMD_U0 0x40
|
2018-08-28 21:50:31 +00:00
|
|
|
#define MMU_CMD_E0 0x50
|
|
|
|
#define MMU_CMD_E1 0x51
|
|
|
|
#define MMU_CMD_E2 0x52
|
|
|
|
#define MMU_CMD_E3 0x53
|
|
|
|
#define MMU_CMD_E4 0x54
|
|
|
|
#define MMU_CMD_R0 0x60
|
2018-12-21 19:56:45 +00:00
|
|
|
#define MMU_CMD_S3 0x73
|
2018-08-20 18:53:53 +00:00
|
|
|
|
2018-08-07 18:37:59 +00:00
|
|
|
extern int mmu_puts_P(const char* str);
|
|
|
|
|
|
|
|
extern int mmu_printf_P(const char* format, ...);
|
|
|
|
|
|
|
|
extern int8_t mmu_rx_ok(void);
|
|
|
|
|
2018-12-21 16:12:16 +00:00
|
|
|
extern bool check_for_idler_sensor();
|
2018-08-07 18:37:59 +00:00
|
|
|
|
2018-08-09 15:43:43 +00:00
|
|
|
extern void mmu_init(void);
|
2018-08-07 18:37:59 +00:00
|
|
|
|
2018-08-09 15:43:43 +00:00
|
|
|
extern void mmu_loop(void);
|
2018-08-07 18:37:59 +00:00
|
|
|
|
|
|
|
|
2018-08-09 15:43:43 +00:00
|
|
|
extern void mmu_reset(void);
|
2018-08-07 18:37:59 +00:00
|
|
|
|
2018-08-08 16:58:03 +00:00
|
|
|
extern int8_t mmu_set_filament_type(uint8_t extruder, uint8_t filament);
|
|
|
|
|
2018-08-20 18:53:53 +00:00
|
|
|
extern void mmu_command(uint8_t cmd);
|
2018-08-08 16:58:03 +00:00
|
|
|
|
2018-12-12 21:32:47 +00:00
|
|
|
extern bool mmu_get_response(uint8_t move = 0);
|
2018-08-08 16:58:03 +00:00
|
|
|
|
2019-01-15 00:29:59 +00:00
|
|
|
extern void manage_response(bool move_axes, bool turn_off_nozzle, uint8_t move = MMU_NO_MOVE);
|
2018-08-08 16:58:03 +00:00
|
|
|
|
|
|
|
extern void mmu_load_to_nozzle();
|
|
|
|
|
|
|
|
extern void mmu_M600_load_filament(bool automatic);
|
2018-08-27 14:12:10 +00:00
|
|
|
extern void mmu_M600_wait_and_beep();
|
2018-08-02 16:54:00 +00:00
|
|
|
|
|
|
|
extern void extr_mov(float shift, float feed_rate);
|
|
|
|
extern void change_extr(int extr);
|
|
|
|
extern int get_ext_nr();
|
|
|
|
extern void display_loading();
|
|
|
|
extern void extr_adj(int extruder);
|
|
|
|
extern void extr_unload();
|
|
|
|
extern void extr_adj_0();
|
|
|
|
extern void extr_adj_1();
|
|
|
|
extern void extr_adj_2();
|
|
|
|
extern void extr_adj_3();
|
|
|
|
extern void extr_adj_4();
|
2018-11-01 15:29:09 +00:00
|
|
|
extern void mmu_load_to_nozzle_0();
|
|
|
|
extern void mmu_load_to_nozzle_1();
|
|
|
|
extern void mmu_load_to_nozzle_2();
|
|
|
|
extern void mmu_load_to_nozzle_3();
|
|
|
|
extern void mmu_load_to_nozzle_4();
|
2018-08-02 16:54:00 +00:00
|
|
|
extern void load_all();
|
|
|
|
extern void extr_change_0();
|
|
|
|
extern void extr_change_1();
|
|
|
|
extern void extr_change_2();
|
|
|
|
extern void extr_change_3();
|
2018-10-31 20:48:05 +00:00
|
|
|
#ifdef SNMM
|
2018-08-02 16:54:00 +00:00
|
|
|
extern void extr_unload_all();
|
|
|
|
extern void extr_unload_used();
|
2018-10-31 20:48:05 +00:00
|
|
|
#endif //SNMM
|
2018-08-02 16:54:00 +00:00
|
|
|
extern void extr_unload_0();
|
|
|
|
extern void extr_unload_1();
|
|
|
|
extern void extr_unload_2();
|
|
|
|
extern void extr_unload_3();
|
|
|
|
extern void extr_unload_4();
|
2018-08-25 14:15:35 +00:00
|
|
|
|
|
|
|
extern bool mmu_check_version();
|
|
|
|
extern void mmu_show_warning();
|
2018-11-01 15:29:09 +00:00
|
|
|
extern void lcd_mmu_load_to_nozzle(uint8_t filament_nr);
|
2018-08-28 23:58:28 +00:00
|
|
|
extern void mmu_eject_filament(uint8_t filament, bool recover);
|
|
|
|
extern void mmu_eject_fil_0();
|
|
|
|
extern void mmu_eject_fil_1();
|
|
|
|
extern void mmu_eject_fil_2();
|
|
|
|
extern void mmu_eject_fil_3();
|
|
|
|
extern void mmu_eject_fil_4();
|
2018-12-12 13:50:55 +00:00
|
|
|
extern void mmu_continue_loading();
|
2019-01-22 09:56:07 +00:00
|
|
|
extern void mmu_filament_ramming();
|
|
|
|
extern void mmu_wait_for_heater_blocking();
|
|
|
|
extern void mmu_load_step(bool synchronize = true);
|
|
|
|
|
|
|
|
#endif //MMU_H
|