LIRC libraries
LinuxInfraredRemoteControl
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
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 
92 
95 
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;
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;
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;
193  ir_code pre_data;
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;
203  ir_code toggle_bit_mask;
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;
238  int reps;
239  struct timeval last_send;
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;
251  struct ir_remote* next;
252 };
253 
254 #ifdef __cplusplus
255 }
256 #endif
257 
258 #endif
lirc_t min_remaining_gap
lirc_t min_total_signal_length
unsigned int freq
lirc_t max_gap_length
lirc_t max_total_signal_length
ir_code post_data
ir_code repeat_mask
struct ir_ncode * toggle_code
struct ir_code_node * next
unsigned int baud
const char * name
lirc_t * signals
struct ir_ncode * last_code
unsigned int parity
__u64 ir_code
lirc_t min_gap_length
char * name
struct timeval last_send
struct ir_code_node * current
unsigned int duty_cycle
ir_code toggle_mask
ir_code pre_data
char * dyncodes_name
lirc_t max_remaining_gap
__u32 repeat_gap
unsigned int stop_bits
unsigned int aeps
lirc_t srepeat
int release_detected
lirc_t min_remaining_gap
struct ir_code_node * transmit_state
lirc_t max_remaining_gap
ir_code code
const char * driver
struct ir_ncode * next_ncode
unsigned int min_code_repeat
struct ir_ncode dyncodes[2]
ir_code rc6_mask
ir_code toggle_bit_mask
ir_code ignore_mask
unsigned int bits_in_byte