mmu.h 3.0 KB

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