mmu.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. //mmu.h
  2. #include <inttypes.h>
  3. extern bool mmu_enabled;
  4. extern bool mmu_fil_loaded;
  5. extern uint8_t mmu_extruder;
  6. extern uint8_t tmp_extruder;
  7. extern int8_t mmu_finda;
  8. extern bool mmu_idler_sensor_detected;
  9. extern int16_t mmu_version;
  10. extern int16_t mmu_buildnr;
  11. #define MMU_FILAMENT_UNKNOWN 255
  12. #define MMU_NO_MOVE 0
  13. #define MMU_UNLOAD_MOVE 1
  14. #define MMU_LOAD_MOVE 2
  15. #define MMU_TCODE_MOVE 3
  16. #define MMU_LOAD_FEEDRATE 19.02f //mm/s
  17. #define MMU_LOAD_TIME_MS 2000 //should be fine tuned to load time for shortest allowed PTFE tubing and maximum loading speed
  18. #define MMU_CMD_NONE 0
  19. #define MMU_CMD_T0 0x10
  20. #define MMU_CMD_T1 0x11
  21. #define MMU_CMD_T2 0x12
  22. #define MMU_CMD_T3 0x13
  23. #define MMU_CMD_T4 0x14
  24. #define MMU_CMD_L0 0x20
  25. #define MMU_CMD_L1 0x21
  26. #define MMU_CMD_L2 0x22
  27. #define MMU_CMD_L3 0x23
  28. #define MMU_CMD_L4 0x24
  29. #define MMU_CMD_C0 0x30
  30. #define MMU_CMD_U0 0x40
  31. #define MMU_CMD_E0 0x50
  32. #define MMU_CMD_E1 0x51
  33. #define MMU_CMD_E2 0x52
  34. #define MMU_CMD_E3 0x53
  35. #define MMU_CMD_E4 0x54
  36. #define MMU_CMD_R0 0x60
  37. extern int mmu_puts_P(const char* str);
  38. extern int mmu_printf_P(const char* format, ...);
  39. extern int8_t mmu_rx_ok(void);
  40. extern bool check_for_idler_sensor();
  41. extern void mmu_init(void);
  42. extern void mmu_loop(void);
  43. extern void mmu_reset(void);
  44. extern int8_t mmu_set_filament_type(uint8_t extruder, uint8_t filament);
  45. extern void mmu_command(uint8_t cmd);
  46. extern bool mmu_get_response(uint8_t move = 0);
  47. extern void manage_response(bool move_axes, bool turn_off_nozzle, uint8_t move = 0);
  48. extern void mmu_load_to_nozzle();
  49. extern void mmu_M600_load_filament(bool automatic);
  50. extern void mmu_M600_wait_and_beep();
  51. extern void extr_mov(float shift, float feed_rate);
  52. extern void change_extr(int extr);
  53. extern int get_ext_nr();
  54. extern void display_loading();
  55. extern void extr_adj(int extruder);
  56. extern void extr_unload();
  57. extern void extr_adj_0();
  58. extern void extr_adj_1();
  59. extern void extr_adj_2();
  60. extern void extr_adj_3();
  61. extern void extr_adj_4();
  62. extern void mmu_load_to_nozzle_0();
  63. extern void mmu_load_to_nozzle_1();
  64. extern void mmu_load_to_nozzle_2();
  65. extern void mmu_load_to_nozzle_3();
  66. extern void mmu_load_to_nozzle_4();
  67. extern void load_all();
  68. extern void extr_change_0();
  69. extern void extr_change_1();
  70. extern void extr_change_2();
  71. extern void extr_change_3();
  72. #ifdef SNMM
  73. extern void extr_unload_all();
  74. extern void extr_unload_used();
  75. #endif //SNMM
  76. extern void extr_unload_0();
  77. extern void extr_unload_1();
  78. extern void extr_unload_2();
  79. extern void extr_unload_3();
  80. extern void extr_unload_4();
  81. extern bool mmu_check_version();
  82. extern void mmu_show_warning();
  83. extern void lcd_mmu_load_to_nozzle(uint8_t filament_nr);
  84. extern void mmu_eject_filament(uint8_t filament, bool recover);
  85. extern void mmu_eject_fil_0();
  86. extern void mmu_eject_fil_1();
  87. extern void mmu_eject_fil_2();
  88. extern void mmu_eject_fil_3();
  89. extern void mmu_eject_fil_4();
  90. extern void mmu_continue_loading();