poppy_com  0.1
Poppy2.0 communication library
 All Classes Files Functions Variables Enumerations Enumerator Pages
context.h
1 #ifndef CONTEXT_H_
2 #define CONTEXT_H_
3 
4 #include "poppy-com/inc/config.h"
6 
7 #define TRUE 1
8 #define FALSE 0
9 
10 typedef void (*DATA_CB) (msg_dir_t dir, volatile unsigned char *data);
11 
12 typedef struct {
13  unsigned char rx_error : 1;
14  unsigned char master_write : 1;
15  unsigned char master_read : 1;
16  unsigned char unexpected_state : 1;
17  unsigned char warning : 1;
18 } status_t;
19 
20 /*
21  * All applicativ side message should have a structure like :
22  * ADDR - REGISTER - SIZE - DATA[512] - CHECKSUM
23  */
24 typedef enum {
25  GET_ID,
26  WRITE_ID,
27  GET_MODULE_TYPE,
28  GET_STATUS,
29  GET_FIRM_REVISION,
30  GET_COM_REVISION,
31  PROTOCOL_REGISTER_NB
32 }register_t;
33 
34 typedef struct {
35  // Callback pointers
36  DATA_CB data_cb;
37  TX_CB tx_cb;
38  RX_CB rx_cb;
39  RX_CB rxgc_cb;
41  // Module infomations
42  unsigned char id;
43  unsigned char type;
45  // Variables
48  }context_t;
49 
50 context_t ctx;
51 
52 #endif /* CONTEXT_H_ */
RX_CB rxgc_cb
Definition: context.h:39
unsigned char id
Definition: context.h:42
msg_t msg
Definition: context.h:47
RX_CB rx_cb
Definition: context.h:38
unsigned char type
Definition: context.h:43
Message structure.
Definition: poppyNetwork.h:38
TX_CB tx_cb
Definition: context.h:37
status_t status
Definition: context.h:46
DATA_CB data_cb
Definition: context.h:36
Poppy communication main include file.
msg_dir_t
Message direction enum.
Definition: poppyNetwork.h:22