serial_service.h 622 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #define SERIAL_SVC_DATA_LEN_MAX (248)
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef uint16_t(*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(uint16_t buff_size, SerialSvcDataReceivedCallback on_received_cb, SerialSvcDataSentCallback on_sent_cb, void* context);
  12. void serial_svc_notify_buffer_is_empty();
  13. void serial_svc_stop();
  14. bool serial_svc_update_tx(uint8_t* data, uint8_t data_len);
  15. #ifdef __cplusplus
  16. }
  17. #endif