mmu2_reporting.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /// @file mmu2_reporting.h
  2. #pragma once
  3. #include <stdint.h>
  4. namespace MMU2 {
  5. enum CommandInProgress : uint8_t {
  6. NoCommand = 0,
  7. CutFilament = 'C',
  8. EjectFilament = 'E',
  9. Homing = 'H',
  10. LoadFilament = 'L',
  11. Reset = 'X',
  12. ToolChange = 'T',
  13. UnloadFilament = 'U',
  14. };
  15. /// Called at the begin of every MMU operation
  16. void BeginReport(CommandInProgress cip, uint16_t ec);
  17. /// Called at the end of every MMU operation
  18. void EndReport(CommandInProgress cip, uint16_t ec);
  19. /// Called when the MMU sends operation error (even repeatedly)
  20. void ReportErrorHook(CommandInProgress cip, uint16_t ec);
  21. /// Called when the MMU sends operation progress update
  22. void ReportProgressHook(CommandInProgress cip, uint16_t ec);
  23. /// Button codes + extended actions performed on the printer's side
  24. enum Buttons : uint8_t {
  25. Left = 0,
  26. Middle,
  27. Right,
  28. // performed on the printer's side
  29. RestartMMU,
  30. StopPrint,
  31. NoButton = 0xff // shall be kept last
  32. };
  33. Buttons ButtonPressed(uint16_t ec);
  34. /// @returns true if the MMU is communicating and available
  35. /// can change at runtime
  36. bool MMUAvailable();
  37. /// Global Enable/Disable use MMU (to be stored in EEPROM)
  38. bool UseMMU();
  39. } // namespace