31 #include "proto/crc/tiny_crc.h" 41 #define TINY_HDLC_FILL_BYTE 0xFF 60 HDLC_LL_RESET_BOTH = 0x00,
61 HDLC_LL_RESET_TX_ONLY = 0x01,
62 HDLC_LL_RESET_RX_ONLY = 0x02,
182 int hdlc_ll_run_rx(hdlc_ll_handle_t handle,
const void *data,
int len,
int *error);
221 int hdlc_ll_put(hdlc_ll_handle_t handle,
const void *data,
int len) __attribute__((deprecated));
void(* on_frame_cb_t)(void *udata, uint8_t *pdata, int size)
on_frame_cb_t is a callback function, which is called every time new frame is received.
Definition: tiny_types.h:194
int hdlc_ll_put_frame(hdlc_ll_handle_t handle, const void *data, int len)
Puts next frame for sending.
Definition: hdlc.c:357
on_tx_frame_cb_t on_frame_send
User-defined callback, which is called when the packet is sent to TX channel.
Definition: hdlc.h:96
int hdlc_ll_run_tx(hdlc_ll_handle_t handle, void *data, int len)
If hdlc protocol has some data to send it will full data with This function returns either if no more...
Definition: hdlc.c:309
int hdlc_ll_close(hdlc_ll_handle_t handle)
Shutdowns all hdlc activity.
Definition: hdlc.c:106
int hdlc_ll_get_buf_size_ex(int mtu, hdlc_crc_t crc_type, int rx_window)
Returns minimum buffer size, required to hold hdlc low level data for desired payload size...
Definition: hdlc.c:567
hdlc_crc_t crc_type
crc field type to use on hdlc level.
Definition: hdlc.h:114
void * user_data
User data, which will be passed to user-defined callback as first argument.
Definition: hdlc.h:117
Structure describes configuration of lowest HDLC level Initialize this structure by 0 before passing ...
Definition: hdlc.h:75
Structure describes configuration of lowest HDLC level Initialize this structure by 0 before passing ...
Definition: hdlc_int.h:65
int hdlc_ll_init(hdlc_ll_handle_t *handle, hdlc_ll_init_t *init)
Initializes hdlc level and returns hdlc handle or NULL in case of error.
Definition: hdlc.c:71
void * buf
Buffer to be used by hdlc level to receive data to.
Definition: hdlc.h:102
This is Tiny HAL implementation for microcontrollers.
int mtu
mtu size, can be 0
Definition: hdlc.h:120
int hdlc_ll_run_rx(hdlc_ll_handle_t handle, const void *data, int len, int *error)
Processes incoming data.
Definition: hdlc.c:532
int hdlc_ll_get_buf_size(int mtu)
Returns minimum buffer size, required to hold hdlc low level data for desired payload size...
Definition: hdlc.c:559
struct hdlc_ll_data_t * hdlc_ll_handle_t
Handle for HDLC low level protocol.
Definition: hdlc.h:68
hdlc_crc_t crc_type
crc field type to use on hdlc level.
Definition: hdlc_int.h:102
void hdlc_ll_reset(hdlc_ll_handle_t handle, uint8_t flags)
Resets hdlc state.
Definition: hdlc.c:121
on_frame_cb_t on_frame_read
User-defined callback, which is called when new packet arrives from hw channel.
Definition: hdlc.h:86
int buf_size
size of hdlc buffer
Definition: hdlc.h:107
void(* on_tx_frame_cb_t)(void *udata, const uint8_t *pdata, int size)
on_frame_send_cb_t is a callback function, which is called every time new frame is sent...
Definition: tiny_types.h:203
hdlc_ll_reset_flags_t
Flags for hdlc_ll_reset function.
Definition: hdlc.h:58
int hdlc_ll_put(hdlc_ll_handle_t handle, const void *data, int len) __attribute__((deprecated))
Puts next frame for sending.
Definition: hdlc.c:352