LIRC libraries LinuxInfraredRemoteControl

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

- File List
- Globals

ir_remote_types.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** ir_remote_types.h *******************************************************
3 ****************************************************************************
4 *
5 * ir_remote_types.h - describes and decodes the signals from IR remotes
6 *
7 * Copyright (C) 1996,97 Ralph Metzler <rjkm@thp.uni-koeln.de>
8 * Copyright (C) 1998 Christoph Bartelmus <lirc@bartelmus.de>
9 *
10 */
11
19 #ifndef IR_REMOTE_TYPES_H
20 #define IR_REMOTE_TYPES_H
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #if defined(__linux__)
27 #include <sys/types.h>
28 #else
29 #include <stdint.h>
30 typedef int8_t __s8;
31 typedef uint8_t __u8;
32 typedef int16_t __s16;
33 typedef uint16_t __u16;
34 typedef int32_t __s32;
35 typedef uint32_t __u32;
36 typedef int64_t __s64;
37 typedef uint64_t __u64;
38 #endif
39
40 #include <sys/time.h>
41 #include <unistd.h>
42 #include <string.h>
43 #include <math.h>
44 #include <stdlib.h>
45 #if defined(__linux__)
46 #include <linux/types.h>
47 #endif
48
49 #include "include/media/lirc.h"
50
55 typedef __u64 ir_code;
56
61 struct ir_code_node {
62 ir_code code;
63 struct ir_code_node* next;
64 };
65
72 struct ir_ncode {
74 char* name;
75
77 ir_code code;
78
80 int length;
81
83 lirc_t* signals;
84
87 struct ir_code_node* next;
88
91 struct ir_code_node* current;
92
94 struct ir_code_node* transmit_state;
95
97 struct ir_ncode* next_ncode;
98 };
99
100 /*
101 * struct ir_remote
102 * defines the encoding of a remote control
103 */
104
105 /* definitions for flags */
106
107 #define IR_PROTOCOL_MASK 0x07ff
108
109 /* protocols: must not be combined */
110 /* Don't forget to take a look at config_file.h when adding new flags */
111
112 #define RAW_CODES 0x0001
113 #define RC5 0x0002
114 #define SHIFT_ENC RC5
115 /* Hm, RC6 protocols seem to have changed the biphase semantics so
116 * that lircd will calculate the bit-wise complement of the codes. But
117 * this is only a guess as I did not have a datasheet... */
118
119 #define RC6 0x0004
120 #define RCMM 0x0008
121 #define SPACE_ENC 0x0010
122 #define SPACE_FIRST 0x0020
123 #define GOLDSTAR 0x0040
124 #define GRUNDIG 0x0080
125 #define BO 0x0100
126 #define SERIAL 0x0200
127 #define XMP 0x0400
129 /* additinal flags: can be orred together with protocol flag */
130 #define REVERSE 0x0800
131 #define NO_HEAD_REP 0x1000
132 #define NO_FOOT_REP 0x2000
133 #define CONST_LENGTH 0x4000
134 #define REPEAT_HEADER 0x8000
136 #define COMPAT_REVERSE 0x00010000
141 #define REPEAT_MAX_DEFAULT 600
142
143 #define DEFAULT_FREQ 38000
144
145 #define IR_PARITY_NONE 0
146 #define IR_PARITY_EVEN 1
147 #define IR_PARITY_ODD 2
148
150 struct decode_ctx_t {
151 ir_code code;
152 ir_code pre;
153 ir_code post;
154 int repeat_flag;
155 lirc_t max_remaining_gap;
156 lirc_t min_remaining_gap;
157 };
158
159
163 struct ir_remote {
164 const char* name;
165 const char* driver;
166 struct ir_ncode* codes;
167 int bits;
168 int flags;
169 int eps;
170 unsigned int aeps;
176 char* dyncodes_name;
177 int dyncode;
178 struct ir_ncode dyncodes[2];
180 /* pulse and space lengths of: */
181
182 lirc_t phead, shead;
183 lirc_t pthree, sthree;
184 lirc_t ptwo, stwo;
185 lirc_t pone, sone;
186 lirc_t pzero, szero;
187 lirc_t plead;
188 lirc_t ptrail;
189 lirc_t pfoot, sfoot;
190 lirc_t prepeat, srepeat;
192 int pre_data_bits;
193 ir_code pre_data;
194 int post_data_bits;
195 ir_code post_data;
196 lirc_t pre_p, pre_s;
197 lirc_t post_p, post_s;
199 __u32 gap;
200 __u32 gap2;
201 __u32 repeat_gap;
202 int toggle_bit;
203 ir_code toggle_bit_mask;
204 int suppress_repeat;
207 int min_repeat;
215 unsigned int min_code_repeat;
216 unsigned int freq;
217 unsigned int duty_cycle;
218 ir_code toggle_mask;
219 ir_code rc6_mask;
221 /* serial protocols */
222 unsigned int baud;
223 unsigned int bits_in_byte;
224 unsigned int parity;
225 unsigned int stop_bits;
229 ir_code ignore_mask;
230 ir_code repeat_mask;
231 /* end of user editable values */
232
233 ir_code toggle_bit_mask_state;
234 int toggle_mask_state;
235 int repeat_countdown;
236 struct ir_ncode* last_code;
237 struct ir_ncode* toggle_code;
238 int reps;
239 struct timeval last_send;
240 lirc_t min_remaining_gap;
241 lirc_t max_remaining_gap;
243 lirc_t min_total_signal_length;
244 lirc_t max_total_signal_length;
245 lirc_t min_gap_length;
246 lirc_t max_gap_length;
247 lirc_t min_pulse_length, max_pulse_length;
248 lirc_t min_space_length, max_space_length;
249 int release_detected;
250 int manual_sort;
251 struct ir_remote* next;
252 };
253
254 #ifdef __cplusplus
255 }
256 #endif
257
258 #endif
ir_remote::min_remaining_gap
lirc_t min_remaining_gap
Definition: ir_remote_types.h:240
ir_remote
Definition: ir_remote_types.h:163
ir_remote::bits
int bits
Definition: ir_remote_types.h:167
ir_remote::min_total_signal_length
lirc_t min_total_signal_length
Definition: ir_remote_types.h:243
ir_code_node
Definition: ir_remote_types.h:61
ir_remote::freq
unsigned int freq
Definition: ir_remote_types.h:216
ir_remote::max_gap_length
lirc_t max_gap_length
Definition: ir_remote_types.h:246
ir_remote::max_total_signal_length
lirc_t max_total_signal_length
Definition: ir_remote_types.h:244
ir_remote::post_data
ir_code post_data
Definition: ir_remote_types.h:195
ir_remote::post_s
lirc_t post_s
Definition: ir_remote_types.h:197
ir_remote::plead
lirc_t plead
Definition: ir_remote_types.h:187
ir_remote::repeat_mask
ir_code repeat_mask
Definition: ir_remote_types.h:230
ir_remote::toggle_code
struct ir_ncode * toggle_code
Definition: ir_remote_types.h:237
ir_ncode::next
struct ir_code_node * next
Definition: ir_remote_types.h:87
ir_remote::baud
unsigned int baud
Definition: ir_remote_types.h:222
ir_remote::name
const char * name
Definition: ir_remote_types.h:164
ir_ncode::signals
lirc_t * signals
Definition: ir_remote_types.h:83
ir_remote::eps
int eps
Definition: ir_remote_types.h:169
ir_remote::last_code
struct ir_ncode * last_code
Definition: ir_remote_types.h:236
ir_remote::parity
unsigned int parity
Definition: ir_remote_types.h:224
decode_ctx_t::pre
ir_code pre
Definition: ir_remote_types.h:152
ir_code
__u64 ir_code
Definition: ir_remote_types.h:55
ir_remote::sfoot
lirc_t sfoot
Definition: ir_remote_types.h:189
ir_remote::ptrail
lirc_t ptrail
Definition: ir_remote_types.h:188
ir_remote::pre_data_bits
int pre_data_bits
Definition: ir_remote_types.h:192
ir_remote::min_gap_length
lirc_t min_gap_length
Definition: ir_remote_types.h:245
ir_remote::manual_sort
int manual_sort
Definition: ir_remote_types.h:250
ir_ncode::name
char * name
Definition: ir_remote_types.h:74
ir_remote::last_send
struct timeval last_send
Definition: ir_remote_types.h:239
ir_ncode::current
struct ir_code_node * current
Definition: ir_remote_types.h:91
ir_remote::duty_cycle
unsigned int duty_cycle
Definition: ir_remote_types.h:217
ir_remote::post_data_bits
int post_data_bits
Definition: ir_remote_types.h:194
ir_remote::sthree
lirc_t sthree
Definition: ir_remote_types.h:183
ir_remote::toggle_mask
ir_code toggle_mask
Definition: ir_remote_types.h:218
ir_remote::pre_data
ir_code pre_data
Definition: ir_remote_types.h:193
decode_ctx_t::post
ir_code post
Definition: ir_remote_types.h:153
ir_remote::sone
lirc_t sone
Definition: ir_remote_types.h:185
ir_remote::dyncodes_name
char * dyncodes_name
Definition: ir_remote_types.h:176
ir_remote::shead
lirc_t shead
Definition: ir_remote_types.h:182
decode_ctx_t::max_remaining_gap
lirc_t max_remaining_gap
Definition: ir_remote_types.h:155
decode_ctx_t::code
ir_code code
Definition: ir_remote_types.h:151
ir_remote::repeat_gap
__u32 repeat_gap
Definition: ir_remote_types.h:201
ir_remote::gap
__u32 gap
Definition: ir_remote_types.h:199
ir_remote::stop_bits
unsigned int stop_bits
Definition: ir_remote_types.h:225
ir_remote::pre_s
lirc_t pre_s
Definition: ir_remote_types.h:196
ir_remote::szero
lirc_t szero
Definition: ir_remote_types.h:186
ir_remote::dyncode
int dyncode
Definition: ir_remote_types.h:177
ir_ncode
Definition: ir_remote_types.h:72
ir_remote::stwo
lirc_t stwo
Definition: ir_remote_types.h:184
ir_remote::flags
int flags
Definition: ir_remote_types.h:168
ir_remote::aeps
unsigned int aeps
Definition: ir_remote_types.h:170
ir_remote::srepeat
lirc_t srepeat
Definition: ir_remote_types.h:190
decode_ctx_t
Definition: ir_remote_types.h:150
ir_remote::release_detected
int release_detected
Definition: ir_remote_types.h:249
decode_ctx_t::min_remaining_gap
lirc_t min_remaining_gap
Definition: ir_remote_types.h:156
ir_ncode::transmit_state
struct ir_code_node * transmit_state
Definition: ir_remote_types.h:94
ir_remote::max_remaining_gap
lirc_t max_remaining_gap
Definition: ir_remote_types.h:241
ir_remote::suppress_repeat
int suppress_repeat
Definition: ir_remote_types.h:204
ir_ncode::code
ir_code code
Definition: ir_remote_types.h:77
ir_remote::toggle_bit
int toggle_bit
Definition: ir_remote_types.h:202
ir_remote::driver
const char * driver
Definition: ir_remote_types.h:165
ir_ncode::next_ncode
struct ir_ncode * next_ncode
Definition: ir_remote_types.h:97
ir_remote::min_code_repeat
unsigned int min_code_repeat
Definition: ir_remote_types.h:215
ir_remote::dyncodes
struct ir_ncode dyncodes[2]
Definition: ir_remote_types.h:178
ir_remote::rc6_mask
ir_code rc6_mask
Definition: ir_remote_types.h:219
decode_ctx_t::repeat_flag
int repeat_flag
Definition: ir_remote_types.h:154
ir_remote::toggle_bit_mask
ir_code toggle_bit_mask
Definition: ir_remote_types.h:203
ir_remote::gap2
__u32 gap2
Definition: ir_remote_types.h:200
ir_remote::min_repeat
int min_repeat
Definition: ir_remote_types.h:207
ir_remote::ignore_mask
ir_code ignore_mask
Definition: ir_remote_types.h:229
ir_remote::bits_in_byte
unsigned int bits_in_byte
Definition: ir_remote_types.h:223
ir_ncode::length
int length
Definition: ir_remote_types.h:80