22 lines
650 B
C
22 lines
650 B
C
#ifndef hdlc_h
|
|
#define hdlc_h
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef void (*sendchar_type)(uint8_t data);
|
|
typedef void (*frame_handler_type)(const uint8_t *frame_buffer,
|
|
uint16_t frame_length);
|
|
|
|
#define MINIHDLC_MAX_FRAME_LENGTH 64
|
|
|
|
void hdlc_init(sendchar_type sendchar_function,
|
|
frame_handler_type frame_hander_function);
|
|
void hdlc_char_receiver(uint8_t data);
|
|
void hdlc_send_frame(const uint8_t *frame_buffer, uint8_t frame_length);
|
|
|
|
void hdlc_send_frame_to_buffer(const uint8_t *frame_buffer, uint8_t frame_length);
|
|
uint8_t *hdlc_get_buffer();
|
|
uint32_t hdlc_get_buffer_size();
|
|
|
|
#endif |