remote.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (c) 2001 Ross Crawford
8  *
9  * The contents of this file are subject to the Mozilla Public License
10  * Version 1.0 (the "License"); you may not use this file except in
11  * compliance with the License. You may obtain a copy of the License at
12  * http://www.mozilla.org/MPL/
13  *
14  * Software distributed under the License is distributed on an "AS IS"
15  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
16  * License for the specific language governing rights and limitations
17  * under the License.
18  *
19  */
20 
21 #ifndef _REMOTE_H
22 #define _REMOTE_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <config.h>
29 
30 #ifdef CONF_LR_HANDLER
31 
32 
34 #define LR_TIMEOUT 100
35 
37 #define LRKEY_M1 0x1
38 #define LRKEY_M2 0x2
40 #define LRKEY_M3 0x4
42 #define LRKEY_A1 0x8
44 #define LRKEY_B1 0x10
46 #define LRKEY_C1 0x20
48 #define LRKEY_A2 0x40
50 #define LRKEY_B2 0x80
52 #define LRKEY_C2 0x100
54 #define LRKEY_P1 0x200
56 #define LRKEY_P2 0x400
58 #define LRKEY_P3 0x800
60 #define LRKEY_P4 0x1000
62 #define LRKEY_P5 0x2000
64 #define LRKEY_STOP 0x4000
66 #define LRKEY_BEEP 0x8000
68 
70 enum _evt {
73 } EventType;
74 
76 
80 typedef int (*lr_handler_t) (unsigned int, unsigned int);
81 
84 
86 void lr_startup(void);
88 void lr_init(void);
90 void lr_shutdown(void);
91 
93 
97 extern inline void lr_set_handler(lr_handler_t handler) {
98  lr_handler = handler;
99 }
100 
102 #define LR_DUMMY_HANDLER ((lr_handler_t)0)
103 
104 #endif // CONF_TM
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif
_evt
enumerate our event types
Definition: remote.h:70
int(* lr_handler_t)(unsigned int, unsigned int)
the remote key handler type
Definition: remote.h:80
a key on the remote was released
Definition: remote.h:72
void lr_set_handler(lr_handler_t handler)
set a new handler for LEGO IR Remote messages
Definition: remote.h:97
kernel configuration file
a key on the remote was pressed
Definition: remote.h:71
void lr_init(void)
initialize the LEGO IR Remote subsystem
void lr_shutdown(void)
stop the LEGO IR Remote subsystem
lr_handler_t lr_handler
remote handler
void lr_startup(void)
start the LEGO IR Remote subsystem
enum _evt EventType
the LEGO IR Remote event types

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.8.11