mmu2_serial.h 360 B

1234567891011121314151617181920
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stddef.h>
  4. namespace MMU2 {
  5. /// A minimal serial interface for the MMU
  6. class MMU2Serial {
  7. public:
  8. MMU2Serial() = default;
  9. void begin(uint32_t baud);
  10. void close();
  11. int read();
  12. void flush();
  13. void write(const uint8_t *buffer, size_t size);
  14. };
  15. extern MMU2Serial mmu2Serial;
  16. } // namespace MMU2