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