UARTDriver.cpp 908 B

1234567891011121314151617181920212223242526272829
  1. #include "UARTDriver.h"
  2. Empty::UARTDriver::UARTDriver() {}
  3. void Empty::UARTDriver::begin(uint32_t b) {}
  4. void Empty::UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS) {}
  5. void Empty::UARTDriver::end() {}
  6. void Empty::UARTDriver::flush() {}
  7. bool Empty::UARTDriver::is_initialized() { return false; }
  8. void Empty::UARTDriver::set_blocking_writes(bool blocking) {}
  9. bool Empty::UARTDriver::tx_pending() { return false; }
  10. /* Empty implementations of Stream virtual methods */
  11. uint32_t Empty::UARTDriver::available() { return 0; }
  12. uint32_t Empty::UARTDriver::txspace() { return 1; }
  13. int16_t Empty::UARTDriver::read() { return -1; }
  14. /* Empty implementations of Print virtual methods */
  15. size_t Empty::UARTDriver::write(uint8_t c) { return 0; }
  16. size_t Empty::UARTDriver::write(const uint8_t *buffer, size_t size)
  17. {
  18. size_t n = 0;
  19. while (size--) {
  20. n += write(*buffer++);
  21. }
  22. return n;
  23. }