source: libvcomm/proto.h @ 2fba30a

Revision 2fba30a, 3.9 KB checked in by Tarmo Kople <tarmo@…>, 5 years ago (diff)

+ added Vblast_irframe action

Vblast_irframe(hid_device vhandle, uint8_t freq, uint8_t duty)
Blasts previously captured or set IRframe

  • Property mode set to 100755
Line 
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//! Blast IRframe info (freq , duty cycle)
76#define REQ_BLAST_IRFRAME       31
77
78// Response type ID's (100-255)
79//! <ID, LEN_LSB, LEN_MSB, LENxBYTE ...>
80#define RESP_IRFRAME            100
81//! <ID, LEN_LSB, LEN_MSB, IRCODE(8bytes)>
82#define RESP_IRCODE             101
83//! <ID, NUM_LSB, NUM_MSB, IRCODE(8bytes), IRCODE(8bytes)>
84#define RESP_EVENT                      102
85//! <ID, LEN_LSB, LEN_MSB, LENxBYTE>
86#define RESP_EVENTMAP           103
87//! <ID, LEN_LSB, LEN_MSB, LEN, ...>
88#define RESP_FW_VERSION 104
89//! <ID, LEN_LSB, LEN_MSB, CONFIG (struct_config)>
90#define RESP_CONFIG             105
91//! <ID, LEN_LSB, LEN_MSB, HWID (struct hwid)>
92#define RESP_ID                 106
93//! <ID, LEN_LSB, LEN_MSB, STAT (struct stat_t)>
94#define RESP_STAT               108
95//! <ID, BTN state>
96#define RESP_BTN                109
97//! <ID, LEN_LSB, LEN_MSB, 0x00>
98#define RESP_OK                 0
99//! <ID, LEN_LSB, LEN_MSB ERRCODE>
100#define RESP_ERR                        255
101
102//Err codes for R_ERR
103//! Unknown request
104#define ERR_UNKNOWN_REQ 1
105//! Unknown event num (out of EventMap bounds)
106#define ERR_UNKNOWN_EVENT_NUM   2
107//! Write eventmap from RAM -> flash failed.
108#define ERR_FLASH_WRITE_FAILED  3
109//! No such event in EventMap
110#define ERR_IRCODE_NOT_FOUND    4
111//! EventMap full
112#define ERR_EVENTMAP_FULL               5
113//! No support for this protocol (Blaster)
114#define ERR_PROTOCOL_NOT_SUPPORTED      6
115//! Argument error
116#define ERR_INVALID_ARGUMENT    7
117
118// IRcode protocol numbers
119//! NEC & NEC like protocols
120#define PROTO_NEC       1
121//! Philips RC5 protocol
122#define PROTO_RC5       2
123//! Philips RC6 protocol
124#define PROTO_RC6       3
125//! Sony SIRC protocol
126#define PROTO_SIRC      4
127//! Samsung ptotocol
128#define PROTO_SAMSUNG   5
129//! X-Sat protocol
130#define PROTO_XSAT  6
131//! Amino S1 protocol
132#define PROTO_AMINO_S1  7
133//! Amino S2 protocol
134#define PROTO_AMINO_S2  8
135//! Microsoft MCE protocole
136#define PROTO_RC6_MCE   9
137//! Keyboard protocol
138#define PROTO_KEYBOARD  0xFE
139//! Media Key protocol
140#define PROTO_CONSUMER  0xFD
141//! Power event protocol (sleep, ...)
142#define PROTO_POWER             0xFC
143//! Mouse event protocol
144#define PROTO_MOUSE             0xFB
145#endif /* PROTO_H_ */
Note: See TracBrowser for help on using the repository browser.