board.h 732 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 disable_interrupts();
  10. static void enable_interrupts();
  11. static void enable_timer();
  12. static void disable_timer();
  13. static rl::TimePoint get_now();
  14. static void toggle_led();
  15. static void enable_uart(UARTRxCallback rx, UARTTxCallback tx);
  16. static void send_uart(char);
  17. static void enable_usart();
  18. static void send_usart(const char *, size_t);
  19. static void send_usart(const char *);
  20. static void sleep(const rl::TimePoint &until);
  21. static void delay();
  22. };