mmu.h 3.2 KB

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