uart.h 600 B

123456789101112131415161718192021
  1. #pragma once
  2. #include "shark_libs.h"
  3. #include "byte_queue.h"
  4. #define CH_START 0xF5
  5. #define CH_END 0xF6
  6. #define CH_ESC 0xF7
  7. #define CH_ESC_START 0x05
  8. #define CH_ESC_END 0x06
  9. #define CH_ESC_ESC 0x07
  10. #define SHARK_UART_TX_MEM_SIZE 512
  11. #define SHARK_UART_RX_MEM_SIZE 512
  12. void shark_uart_init(void);
  13. void shark_uart_tx_start(void);
  14. void shark_uart_tx_continue(const void *buff, u16 length);
  15. void shark_uart_tx_end(void);
  16. bool shark_uart_tx_frame(u32 efid, const void *data);
  17. bool shark_uart_tx_command(u8 command, const void *args, u16 length);