Line No. | Rev | Author | Line |
---|---|---|---|
1 | 6 | kaklik | /*! \file erp.h \brief Emerald Radio Protocol System. */ |
2 | //***************************************************************************** |
||
3 | // |
||
4 | // File Name : 'erp.h' |
||
5 | // Title : Emerald Radio Protocol System |
||
6 | // Author : Pascal Stang - Copyright (C) 2003 |
||
7 | // Created : 2003.09.10 |
||
8 | // Revised : 2003.09.10 |
||
9 | // Version : 0.1 |
||
10 | // Target MCU : Atmel AVR series |
||
11 | // Editor Tabs : 4 |
||
12 | // |
||
13 | // This code is distributed under the GNU Public License |
||
14 | // which can be found at http://www.gnu.org/licenses/gpl.txt |
||
15 | // |
||
16 | //***************************************************************************** |
||
17 | |||
18 | #ifndef ERP_H |
||
19 | #define ERP_H |
||
20 | |||
21 | #include "edp.h" |
||
22 | |||
23 | // defines and typedefs |
||
24 | // Packet Types (tentative) |
||
25 | #define ERP_ECHO 0x01 |
||
26 | #define ERP_ECHOREPLY 0x02 |
||
27 | #define ERP_TEST 0x03 |
||
28 | #define ERP_EDPCOMMAND 0x10 |
||
29 | #define ERP_EDPREPLY 0x11 |
||
30 | #define ERP_EDPREPLYNODEV 0x12 |
||
31 | |||
32 | #define CALLSIGN_FIELD_LEN 6 |
||
33 | |||
34 | // structures and typedefs |
||
35 | typedef struct |
||
36 | { |
||
37 | u08 CallSign[6]; |
||
38 | u08 ToAddress; |
||
39 | u08 FromAddress; |
||
40 | u08 SequenceNum; |
||
41 | u08 Type; |
||
42 | u08 Data[]; |
||
43 | } ErpPacket; |
||
44 | #define ERP_HEADER_LEN 10 |
||
45 | |||
46 | typedef struct |
||
47 | { |
||
48 | u08 EdpDestAddr; |
||
49 | EdpCommand EdpCommand; |
||
50 | } ErpEdpCommand; |
||
51 | |||
52 | typedef struct |
||
53 | { |
||
54 | u08 EdpResponse; |
||
55 | EdpReply EdpReply; |
||
56 | } ErpEdpReply; |
||
57 | |||
58 | |||
59 | // functions |
||
60 | // ERP display |
||
61 | void erpDisplayHeader(ErpPacket* erpPacket); |
||
62 | void erpDisplayPacket(ErpPacket* erpPacket, u08 pktLength); |
||
63 | void erpDisplayEdpCommand(u08 length, ErpEdpCommand* erpEdpCommand); |
||
64 | void erpDisplayEdpReply(u08 length, ErpEdpReply* erpEdpReply); |
||
65 | |||
66 | #endif |
Powered by WebSVN v2.8.3