mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-20 17:53:20 +00:00
389ff92cc1
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
47 lines
900 B
C
47 lines
900 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#define SERIAL_SVC_DATA_LEN_MAX (486)
|
|
#define SERIAL_SVC_CHAR_VALUE_LEN_MAX (243)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
SerialServiceEventTypeDataReceived,
|
|
SerialServiceEventTypeDataSent,
|
|
} SerialServiceEventType;
|
|
|
|
typedef struct {
|
|
uint8_t* buffer;
|
|
uint16_t size;
|
|
} SerialServiceData;
|
|
|
|
typedef struct {
|
|
SerialServiceEventType event;
|
|
SerialServiceData data;
|
|
} SerialServiceEvent;
|
|
|
|
typedef uint16_t (*SerialServiceEventCallback)(SerialServiceEvent event, void* context);
|
|
|
|
void serial_svc_start();
|
|
|
|
void serial_svc_set_callbacks(
|
|
uint16_t buff_size,
|
|
SerialServiceEventCallback callback,
|
|
void* context);
|
|
|
|
void serial_svc_notify_buffer_is_empty();
|
|
|
|
void serial_svc_stop();
|
|
|
|
bool serial_svc_is_started();
|
|
|
|
bool serial_svc_update_tx(uint8_t* data, uint16_t data_len);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|