2021-09-10 12:19:02 +10:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2021-11-21 17:47:54 +03:00
|
|
|
#define SERIAL_SVC_DATA_LEN_MAX (248)
|
2021-10-12 21:48:34 +10:00
|
|
|
|
2021-09-10 12:19:02 +10:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-11-08 22:41:40 +03:00
|
|
|
typedef uint16_t(*SerialSvcDataReceivedCallback)(uint8_t* buff, uint16_t size, void* context);
|
2021-10-12 19:41:42 +03:00
|
|
|
typedef void(*SerialSvcDataSentCallback)(void* context);
|
|
|
|
|
2021-09-13 14:25:37 +03:00
|
|
|
void serial_svc_start();
|
2021-09-10 12:19:02 +10:00
|
|
|
|
2021-11-08 22:41:40 +03:00
|
|
|
void serial_svc_set_callbacks(uint16_t buff_size, SerialSvcDataReceivedCallback on_received_cb, SerialSvcDataSentCallback on_sent_cb, void* context);
|
|
|
|
|
|
|
|
void serial_svc_notify_buffer_is_empty();
|
2021-10-12 21:48:34 +10:00
|
|
|
|
2021-09-13 14:25:37 +03:00
|
|
|
void serial_svc_stop();
|
2021-09-10 12:19:02 +10:00
|
|
|
|
2021-10-12 19:41:42 +03:00
|
|
|
bool serial_svc_update_tx(uint8_t* data, uint8_t data_len);
|
2021-09-10 12:19:02 +10:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|