board.h 659 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "rotor-light.hpp"
  3. namespace rl = rotor_light;
  4. using UARTRxCallback = void (*)(char);
  5. using UARTTxCallback = void (*)();
  6. struct Board {
  7. static constexpr uint32_t samples = 100000;
  8. static void init_start();
  9. static void enable_timer();
  10. static void disable_timer();
  11. static rl::TimePoint get_now();
  12. static void toggle_led();
  13. static void enable_uart(UARTRxCallback rx, UARTTxCallback tx);
  14. static void send_uart(char);
  15. static void enable_usart();
  16. static void send_usart(const char *, size_t);
  17. static void send_usart(const char *);
  18. static void sleep(const rl::TimePoint &until);
  19. static void delay();
  20. };