Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

include/remote.h File Reference

Interface: LEGO Infrared Remote Control. More...

#include <config.h>

Include dependency graph for remote.h:

Include dependency graph

Go to the source code of this file.

Defines

#define LR_TIMEOUT   100
 timeout value in mSec

#define LRKEY_M1   0x1
 The message #1 key.

#define LRKEY_M2   0x2
 The message #2 key.

#define LRKEY_M3   0x4
 The message #3 key.

#define LRKEY_A1   0x8
 Motor-A forward (up).

#define LRKEY_B1   0x10
 Motor-B forward (up).

#define LRKEY_C1   0x20
 Motor-C forward (up).

#define LRKEY_A2   0x40
 Motor-A reverse (down).

#define LRKEY_B2   0x80
 Motor-B reverse (down).

#define LRKEY_C2   0x100
 Motor-C reverse (down).

#define LRKEY_P1   0x200
 Run Program 1.

#define LRKEY_P2   0x400
 Run Program 2.

#define LRKEY_P3   0x800
 Run Program 3.

#define LRKEY_P4   0x1000
 Run Program 4.

#define LRKEY_P5   0x2000
 Run Program 5.

#define LRKEY_STOP   0x4000
 Stop key.

#define LRKEY_BEEP   0x8000
 Beep Key.

#define LR_DUMMY_HANDLER   ((lr_handler_t)0)
 dummy remote event handler


Typedefs

typedef int(* lr_handler_t )(unsigned int, unsigned int)
 the remote key handler type


Enumerations

enum  _evt { LREVT_KEYON = 1, LREVT_KEYOFF = 2 }
 enumerate our event types More...


Functions

void lr_startup (void)
 start the LEGO IR Remote subsystem

void lr_init (void)
 initialize the LEGO IR Remote subsystem

void lr_shutdown (void)
 stop the LEGO IR Remote subsystem

void lr_set_handler (lr_handler_t handler)
 set a new handler for LEGO IR Remote messages


Variables

enum _evt EventType
 the LEGO IR Remote event types

lr_handler_t lr_handler
 remote handler


Detailed Description

Interface: LEGO Infrared Remote Control.

Author:
Ross Crawford <rcrawford@csi.com>

Definition in file remote.h.


Define Documentation

#define LR_DUMMY_HANDLER   ((lr_handler_t)0)
 

dummy remote event handler

Definition at line 102 of file remote.h.

#define LR_TIMEOUT   100
 

timeout value in mSec

Definition at line 34 of file remote.h.

#define LRKEY_A1   0x8
 

Motor-A forward (up).

Definition at line 43 of file remote.h.

#define LRKEY_A2   0x40
 

Motor-A reverse (down).

Definition at line 49 of file remote.h.

#define LRKEY_B1   0x10
 

Motor-B forward (up).

Definition at line 45 of file remote.h.

#define LRKEY_B2   0x80
 

Motor-B reverse (down).

Definition at line 51 of file remote.h.

#define LRKEY_BEEP   0x8000
 

Beep Key.

Definition at line 67 of file remote.h.

#define LRKEY_C1   0x20
 

Motor-C forward (up).

Definition at line 47 of file remote.h.

#define LRKEY_C2   0x100
 

Motor-C reverse (down).

Definition at line 53 of file remote.h.

#define LRKEY_M1   0x1
 

The message #1 key.

Definition at line 37 of file remote.h.

#define LRKEY_M2   0x2
 

The message #2 key.

Definition at line 39 of file remote.h.

#define LRKEY_M3   0x4
 

The message #3 key.

Definition at line 41 of file remote.h.

#define LRKEY_P1   0x200
 

Run Program 1.

Definition at line 55 of file remote.h.

#define LRKEY_P2   0x400
 

Run Program 2.

Definition at line 57 of file remote.h.

#define LRKEY_P3   0x800
 

Run Program 3.

Definition at line 59 of file remote.h.

#define LRKEY_P4   0x1000
 

Run Program 4.

Definition at line 61 of file remote.h.

#define LRKEY_P5   0x2000
 

Run Program 5.

Definition at line 63 of file remote.h.

#define LRKEY_STOP   0x4000
 

Stop key.

Definition at line 65 of file remote.h.


Typedef Documentation

typedef int(* lr_handler_t)(unsigned int, unsigned int)
 

the remote key handler type

Parameters:
event_type was key pressed or released?
key the key, on the remote, that was pressed/released
Returns:
0 if not processed, otherwise non-zero.

Definition at line 80 of file remote.h.

Referenced by lr_set_handler().


Enumeration Type Documentation

enum _evt
 

enumerate our event types

Enumeration values:
LREVT_KEYON  a key on the remote was pressed
LREVT_KEYOFF  a key on the remote was released

Definition at line 70 of file remote.h.


Function Documentation

void lr_init void   ) 
 

initialize the LEGO IR Remote subsystem

void lr_set_handler lr_handler_t  handler  )  [inline]
 

set a new handler for LEGO IR Remote messages

Parameters:
handler pointer to a function which is to be the processing function for received messages
Returns:
Nothing

Definition at line 97 of file remote.h.

References lr_handler, and lr_handler_t.

void lr_shutdown void   ) 
 

stop the LEGO IR Remote subsystem

void lr_startup void   ) 
 

start the LEGO IR Remote subsystem


Variable Documentation

enum _evt EventType
 

the LEGO IR Remote event types

lr_handler_t lr_handler
 

remote handler

Definition at line 83 of file remote.h.

Referenced by lr_set_handler().


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

Generated on Mon Feb 16 21:01:55 2004 for brickOS C by doxygen 1.3.5