27 #ifndef _TINY_HALF_DUPLEX_H_ 28 #define _TINY_HALF_DUPLEX_H_ 35 #include "proto/hdlc/tiny_hdlc.h" 49 #ifndef DOXYGEN_SHOULD_SKIP_THIS 190 static inline STinyData * hd_to_tiny(
STinyHdData * handle)
192 return &handle->handle;
hdlc_crc_t
Definition: tiny_hdlc.h:54
int tiny_hd_init(STinyHdData *handle, STinyHdInit *init)
Initialized communication for Tiny Half Duplex protocol.
Definition: tiny_hd.c:182
on_frame_cb_t on_sent_cb
Callback to get notification of sent frames.
Definition: tiny_hd.h:60
int tiny_hd_run_tx(STinyHdData *handle)
Definition: tiny_hd.c:238
read_block_cb_t read_func
callback function to read bytes from the physical channel
Definition: tiny_hd.h:84
uint16_t timeout
timeout. Can be set to 0 during initialization. In this case timeout will be set to default ...
Definition: tiny_hd.h:100
on_frame_cb_t on_sent_cb
Callback to get notification of sent frames.
Definition: tiny_hd.h:90
void tiny_hd_close(STinyHdData *handle)
stops Tiny Half Duplex state machine
Definition: tiny_hd.c:215
on_frame_cb_t on_frame_cb
Callback to process received frames.
Definition: tiny_hd.h:58
struct STinyHdData_ STinyHdData
read_block_cb_t read_func
callback function to read bytes from the physical channel
Definition: tiny_hd.h:56
int tiny_send_wait_ack(STinyHdData *handle, void *buf, uint16_t len)
Sends userdata and waits for acknowledgement from remote side.
Definition: tiny_hd.c:81
int(* read_block_cb_t)(void *pdata, void *buffer, int size)
Definition: tiny_types.h:141
void(* on_frame_cb_t)(void *handle, uint16_t uid, uint8_t *pdata, int size)
Definition: tiny_types.h:154
on_frame_cb_t on_frame_cb
callback function to process incoming frames
Definition: tiny_hd.h:88
write_block_cb_t write_func
callback function to write bytes to the physical channel
Definition: tiny_hd.h:82
hdlc_crc_t crc_type
Definition: tiny_hd.h:108
uint16_t inbuf_size
maximum input buffer size
Definition: tiny_hd.h:98
void * inbuf
Definition: tiny_hd.h:96
uint8_t multithread_mode
multithread mode. At present should be 0
Definition: tiny_hd.h:102
Definition: tiny_hdlc.h:68
uint16_t timeout
Timeout for operations with acknowledge.
Definition: tiny_hd.h:62
int(* write_block_cb_t)(void *pdata, const void *buffer, int size)
Definition: tiny_types.h:130
int tiny_hd_run(STinyHdData *handle)
runs receive functions of Tiny Half Duplex protocol.
Definition: tiny_hd.c:231
uint16_t uid
field used to store temporary uid
Definition: tiny_hd.h:64
void * user_data
user specific data
Definition: tiny_hd.h:72
struct STinyHdInit_ STinyHdInit
write_block_cb_t write_func
callback function to write bytes to the physical channel
Definition: tiny_hd.h:54
bool multithread_mode
Multithread mode. Should be zero.
Definition: tiny_hd.h:70
void * pdata
user data for block read/write functions
Definition: tiny_hd.h:86