mmu2_error_converter.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stddef.h>
  4. namespace MMU2 {
  5. /// Translates MMU2::ErrorCode into an index of Prusa-Error-Codes
  6. /// Basically this is the way to obtain an index into all other functions in this API
  7. uint8_t PrusaErrorCodeIndex(uint16_t ec);
  8. /// @returns pointer to a PROGMEM string representing the Title of the Prusa-Error-Codes error
  9. /// @param i index of the error - obtained by calling ErrorCodeIndex
  10. const char * const PrusaErrorTitle(uint8_t i);
  11. /// @returns pointer to a PROGMEM string representing the multi-page Description of the Prusa-Error-Codes error
  12. /// @param i index of the error - obtained by calling ErrorCodeIndex
  13. const char * const PrusaErrorDesc(uint8_t i);
  14. /// @returns the actual numerical value of the Prusa-Error-Codes error
  15. /// @param i index of the error - obtained by calling ErrorCodeIndex
  16. uint16_t PrusaErrorCode(uint8_t i);
  17. /// @returns Btns pair of buttons for a particular Prusa-Error-Codes error
  18. /// @param i index of the error - obtained by calling ErrorCodeIndex
  19. uint8_t PrusaErrorButtons(uint8_t i);
  20. /// @returns pointer to a PROGMEM string representing the Title of a button
  21. /// @param i index of the error - obtained by calling PrusaErrorButtons + extracting low or high nibble from the Btns pair
  22. const char * const PrusaErrorButtonTitle(uint8_t bi);
  23. /// @returns pointer to a PROGMEM string representing the "More" button
  24. const char * const PrusaErrorButtonMore();
  25. } // namespace MMU2