poppy_com  0.1
Poppy2.0 communication library
 All Classes Files Functions Variables Enumerations Enumerator Pages
poppyNetwork.h
Go to the documentation of this file.
1 
12 #ifndef poppy_com_H_
13 #define poppy_com_H_
14 
22 typedef enum {
23  TX,
24  RX,
25  RXGC,
26  END
27 }msg_dir_t;
28 
29 
38 typedef struct {
39  unsigned char reg;
40  unsigned char size;
41  unsigned char data[512];
42 }msg_t;
43 
44 typedef void (*RX_CB) (msg_dir_t dir, msg_t *msg);
45 typedef void (*TX_CB) (msg_t *msg);
46 
56 void poppyNetwork_init(TX_CB tx_cb,
57  RX_CB rx_cb,
58  RX_CB rxgc_cb);
59 
68 unsigned char poppyNetwork_read(unsigned char addr, msg_t *msg,
69  unsigned char reply_size);
70 
78 unsigned char poppyNetwork_write(unsigned char addr, msg_t *msg);
79 
88 #endif /* poppy_com_H_ */
unsigned char size
Definition: poppyNetwork.h:40
unsigned char poppyNetwork_write(unsigned char addr, msg_t *msg)
Master mode write function.
Definition: poppyNetwork.c:85
void tx_cb(msg_t *msg)
Callback function for Slave mode messages transmission.
Definition: template.c:73
void poppyNetwork_init(TX_CB tx_cb, RX_CB rx_cb, RX_CB rxgc_cb)
Initialisation of the Poppy communication lib.
Definition: poppyNetwork.c:17
Message structure.
Definition: poppyNetwork.h:38
void rxgc_cb(msg_dir_t dir, msg_t *msg)
Callback function for Slave mode messages reception with general call.
Definition: template.c:61
unsigned char reg
Definition: poppyNetwork.h:39
void rx_cb(msg_dir_t dir, msg_t *msg)
Callback function for Slave mode messages reception.
Definition: template.c:48
msg_dir_t
Message direction enum.
Definition: poppyNetwork.h:22