Tiny protocol
0.9.0
Tiny communication protocol for microcontrollers
|
Classes | |
struct | STinyHdData_ |
struct | STinyHdInit_ |
class | Tiny::ProtoHd |
Typedefs | |
typedef struct STinyHdData_ | STinyHdData |
typedef struct STinyHdInit_ | STinyHdInit |
Functions | |
int | tiny_hd_init (STinyHdData *handle, STinyHdInit *init) |
Initialized communication for Tiny Half Duplex protocol. More... | |
void | tiny_hd_close (STinyHdData *handle) |
stops Tiny Half Duplex state machine More... | |
int | tiny_hd_run (STinyHdData *handle) |
runs receive functions of Tiny Half Duplex protocol. More... | |
int | tiny_hd_run_tx (STinyHdData *handle) |
int | tiny_send_wait_ack (STinyHdData *handle, void *buf, uint16_t len) |
Sends userdata and waits for acknowledgement from remote side. More... | |
typedef struct STinyHdData_ STinyHdData |
This structure contains service data, required for half-duplex functioning.
typedef struct STinyHdInit_ STinyHdInit |
This structure is used for initialization of Tiny Half Duplex protocol.
void tiny_hd_close | ( | STinyHdData * | handle | ) |
stops Tiny Half Duplex state machine
stops Tiny Half Duplex state machine.
handle | - pointer to STinyHdData |
int tiny_hd_init | ( | STinyHdData * | handle, |
STinyHdInit * | init | ||
) |
Initialized communication for Tiny Half Duplex protocol.
The function initializes internal structures for Tiny Half Duplex state machine.
handle | - pointer to Tiny Half Duplex data |
init | - pointer to STinyHdInit data. |
int tiny_hd_run | ( | STinyHdData * | handle | ) |
runs receive functions of Tiny Half Duplex protocol.
Runs receive functions of Tiny Half Duplex protocol. This function must be called all the time in the loop if send operation is not performed. For atmega controllers this means to call tiny_hd_run() in loop() routine. If user packet is received during execution of the function, it wil call on_frame_cb_t callback to process received packet.
handle | - pointer to STinyHdData |
int tiny_hd_run_tx | ( | STinyHdData * | handle | ) |
Use this function for multithread mode, when you need to run tx in separate thread.
handle | - pointer to STinyHdData |
int tiny_send_wait_ack | ( | STinyHdData * | handle, |
void * | buf, | ||
uint16_t | len | ||
) |
Sends userdata and waits for acknowledgement from remote side.
Sends userdata and waits for acknowledgement from remote side.
handle | - pointer to STinyHdData |
buf | - data to send |
len | - length of data to send |