libvcomm  1.0
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
proto.h
Go to the documentation of this file.
1 /** \file
2  * This file contains IRvoodoo communication protocol definitions
3 
4  * @author Tarmo Kople <tarmo@flycom.ee>
5  */
6 
7 
8 
9 #ifndef PROTO_H_
10 #define PROTO_H_
11 
12 // Report ID's
13 // Request type ID's (0-99)
14 
15 //! Get last IRFrame <ID, 0x00>
16 #define REQ_GET_IR_FRAME 1
17 //! Get last IRCode <ID, 0x00>
18 #define REQ_GET_IRCODE 2
19 //! Get single event[n] <ID, NUM_LSB, NUM_MSB>
20 #define REQ_GET_EVENT 3
21 //! Get whole event map <ID, 0x00>
22 #define REQ_GET_EVENTMAP 4
23 //! Send IRFrame (blast raw IRFrame)
24 #define REQ_SET_IR_FRAME 5
25 //! Send IRCode (blast IRcode)
26 #define REQ_SET_IRCODE 6
27 //! Insert new event or update existing <ID, IRCODE, IRCODE>
28 #define REQ_SET_EVENT 7
29 //! Set whole event map
30 #define REQ_SET_EVENTMAP 8
31 //! Clear whole eventmap <ID, 0x00>
32 #define REQ_CLEAR_EVENTMAP 9
33 //! Clear event by num <ID, NUM_LSB, NUM_MSB>
34 #define REQ_CLEAR_EVENT_NUM 10
35 //! Clear event by IRCODE <ID, IRCODE>
36 #define REQ_CLEAR_EVENT_IRCODE 11
37 //! Read EventMap from flash -> to ram <ID, 0x00>
38 #define REQ_WRITE_EVENTMAP 12
39 //! Write EventMap from RAM -> to flash <ID, 0x00>
40 #define REQ_READ_EVENTMAP 13
41 //! send ok
42 #define REQ_PING 14
43 //! Get firmware version
44 #define REQ_GET_FW_VERSION 15
45 //! Clears last IRCode & IRFrame
46 #define REQ_CLEAR_LAST 16
47 //! Enter configuration mode <ID, 0x00>
48 #define REQ_SET_MODE_CFG 17
49 //! Enter normal mode <ID, 0x00>
50 #define REQ_SET_MODE_NORMAL 18
51 //! Enter capture mode
52 #define REQ_SET_MODE_CAPT 19
53 //! Get firmware (backup to pc)
54 #define REQ_GET_FW 20
55 //! Enter ISP programming mode
56 #define REQ_ENTER_ISP 21
57 //! get configuration (send to pc)
58 #define REQ_GET_CONFIG 22
59 //! set configuration (receive and save config)
60 #define REQ_SET_CONFIG 23
61 //! Get Part ID & Serial
62 #define REQ_GET_ID 24
63 //! Restore default configuration
64 #define REQ_RESET_CONFIG 25
65 //! Runtime statistics
66 #define REQ_GET_STAT 26
67 //! Set LED ON or OFF
68 #define REQ_SET_LED 27
69 //! Get button state
70 #define REQ_GET_BTN 28
71 //! Set IRframe data(page)
72 #define REQ_SET_IRFRAME_PAGE 29
73 //! Set IRframe info (num of pulses in IRframe)
74 #define REQ_SET_IRFRAME_INFO 30
75 
76 // Response type ID's (100-255)
77 //! <ID, LEN_LSB, LEN_MSB, LENxBYTE ...>
78 #define RESP_IRFRAME 100
79 //! <ID, LEN_LSB, LEN_MSB, IRCODE(8bytes)>
80 #define RESP_IRCODE 101
81 //! <ID, NUM_LSB, NUM_MSB, IRCODE(8bytes), IRCODE(8bytes)>
82 #define RESP_EVENT 102
83 //! <ID, LEN_LSB, LEN_MSB, LENxBYTE>
84 #define RESP_EVENTMAP 103
85 //! <ID, LEN_LSB, LEN_MSB, LEN, ...>
86 #define RESP_FW_VERSION 104
87 //! <ID, LEN_LSB, LEN_MSB, CONFIG (struct_config)>
88 #define RESP_CONFIG 105
89 //! <ID, LEN_LSB, LEN_MSB, HWID (struct hwid)>
90 #define RESP_ID 106
91 //! <ID, LEN_LSB, LEN_MSB, STAT (struct stat_t)>
92 #define RESP_STAT 108
93 //! <ID, BTN state>
94 #define RESP_BTN 109
95 //! <ID, LEN_LSB, LEN_MSB, 0x00>
96 #define RESP_OK 0
97 //! <ID, LEN_LSB, LEN_MSB ERRCODE>
98 #define RESP_ERR 255
99 
100 //Err codes for R_ERR
101 //! Unknown request
102 #define ERR_UNKNOWN_REQ 1
103 //! Unknown event num (out of EventMap bounds)
104 #define ERR_UNKNOWN_EVENT_NUM 2
105 //! Write eventmap from RAM -> flash failed.
106 #define ERR_FLASH_WRITE_FAILED 3
107 //! No such event in EventMap
108 #define ERR_IRCODE_NOT_FOUND 4
109 //! EventMap full
110 #define ERR_EVENTMAP_FULL 5
111 //! No support for this protocol (Blaster)
112 #define ERR_PROTOCOL_NOT_SUPPORTED 6
113 //! Argument error
114 #define ERR_INVALID_ARGUMENT 7
115 
116 // IRcode protocol numbers
117 //! NEC & NEC like protocols
118 #define PROTO_NEC 1
119 //! Philips RC5 protocol
120 #define PROTO_RC5 2
121 //! Philips RC6 protocol
122 #define PROTO_RC6 3
123 //! Sony SIRC protocol
124 #define PROTO_SIRC 4
125 //! Samsung ptotocol
126 #define PROTO_SAMSUNG 5
127 //! X-Sat protocol
128 #define PROTO_XSAT 6
129 //! Amino S1 protocol
130 #define PROTO_AMINO_S1 7
131 //! Amino S2 protocol
132 #define PROTO_AMINO_S2 8
133 //! Microsoft MCE protocole
134 #define PROTO_RC6_MCE 9
135 //! Keyboard protocol
136 #define PROTO_KEYBOARD 0xFE
137 //! Media Key protocol
138 #define PROTO_CONSUMER 0xFD
139 //! Power event protocol (sleep, ...)
140 #define PROTO_POWER 0xFC
141 //! Mouse event protocol
142 #define PROTO_MOUSE 0xFB
143 #endif /* PROTO_H_ */