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
25extern "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
39#define LRKEY_M2 0x2
41#define LRKEY_M3 0x4
43#define LRKEY_A1 0x8
45#define LRKEY_B1 0x10
47#define LRKEY_C1 0x20
49#define LRKEY_A2 0x40
51#define LRKEY_B2 0x80
53#define LRKEY_C2 0x100
55#define LRKEY_P1 0x200
57#define LRKEY_P2 0x400
59#define LRKEY_P3 0x800
61#define LRKEY_P4 0x1000
63#define LRKEY_P5 0x2000
65#define LRKEY_STOP 0x4000
67#define LRKEY_BEEP 0x8000
68
74
76
80typedef int (*lr_handler_t) (unsigned int, unsigned int);
81
84
86void lr_startup(void);
88void lr_init(void);
90void lr_shutdown(void);
91
93
97extern 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
int(* lr_handler_t)(unsigned int, unsigned int)
the remote key handler type
Definition remote.h:80
void lr_startup(void)
start the LEGO IR Remote subsystem
lr_handler_t lr_handler
remote handler
enum _evt EventType
the LEGO IR Remote event types
void lr_set_handler(lr_handler_t handler)
set a new handler for LEGO IR Remote messages
Definition remote.h:97
_evt
enumerate our event types
Definition remote.h:70
@ LREVT_KEYON
a key on the remote was pressed
Definition remote.h:71
@ LREVT_KEYOFF
a key on the remote was released
Definition remote.h:72
void lr_init(void)
initialize the LEGO IR Remote subsystem
void lr_shutdown(void)
stop the LEGO IR Remote subsystem

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

Generated for brickOS C by doxygen 1.9.8