-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.c
94 lines (83 loc) · 2.03 KB
/
template.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* \file template.c
* \brief Poppy module application side template.
* \author Nicolas Rabault
* \version 0.1
* \date 22 Avril 2015
*
* Please feel free to copy this template and use it at base for your new Poppy
* module application.
*/
/**
* This is the minimal include you will need to use poppy_com in a module
* application
*/
#include "poppy-com/poppyNetwork.h"
/**
* \enum msg_dir_t
* \brief Module specific register enumerator.
*
* This structure is used to list all the specific module register.
* The first register should be equal to PROTOCOL_REGISTER_NB, because is the
* first free register.
* The last register should be MODULE_REGISTER_NB, for the user space register
* enumerator...
*/
typedef enum {
/*
* Add all you register id here like :
* FIRST_MODULE_REGISTER = PROTOCOL_REGISTER_NB,
* SECOND_MODULE_REGISTER,
* THIRD_MODULE_REGISTER,
* ...
*/
MODULE_REGISTER_NB
}module_register_t;
/**
* \fn void rx_cb(msg_dir_t dir, msg_t *msg)
* \brief Callback function for Slave mode messages reception.
*
* \param dir Message direction. (That will be remove!)
* \param msg Received message.
*/
void rx_cb(msg_dir_t dir, msg_t *msg) {
/*
* Add your RX code here.
*/
}
/**
* \fn void rxgc_cb(msg_dir_t dir, msg_t *msg)
* \brief Callback function for Slave mode messages reception with general call.
*
* \param dir Message direction. (That will be remove!)
* \param msg Received message.
*/
void rxgc_cb(msg_dir_t dir, msg_t *msg) {
/*
* Add your RX general call code here.
*/
}
/**
* \fn void tx_cb(msg_t *msg)
* \brief Callback function for Slave mode messages transmission.
*
* \param msg Transmitted message. You have to put something in this msg_t.
*/
void tx_cb(msg_t *msg) {
/*
* Add your TX code here.
*/
}
/**
* \fn int main(void)
* \brief Your main module application process.
*
* \return integer
*/
int main(void) {
poppyNetwork_init(tx_cb, rx_cb, rxgc_cb);
/*
* Add your main code here.
*/
return 0;
}