serial_service.h 555 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #define SERIAL_SVC_DATA_LEN_MAX (245)
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef void(*SerialSvcDataReceivedCallback)(uint8_t* buff, uint16_t size, void* context);
  9. typedef void(*SerialSvcDataSentCallback)(void* context);
  10. void serial_svc_start();
  11. void serial_svc_set_callbacks(SerialSvcDataReceivedCallback on_received_cb, SerialSvcDataSentCallback on_sent_cb, void* context);
  12. void serial_svc_stop();
  13. bool serial_svc_update_tx(uint8_t* data, uint8_t data_len);
  14. #ifdef __cplusplus
  15. }
  16. #endif