Main Page Data Structures File List Data Fields Globals Related Pages

# remote.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | RC_DMACHANNEL 1
| DMA channel to use.
#define | TICKS_PER_uS 5
| Timer ticks per microsecond.
#define | RC_QUEUE_SIZE 16
| Queue length for received keycodes.
#define | RC_TRESHOLD 10
| The treshold value is used to cleanup the timer samples.
#define | RCKEY_REPEAT 0x80000000
#define | RCKEY_PROTO 0x78000000
#define | RCKEY_CODE 0x07FFFFFF
#define | RCKEY_NONE 0x00000000
#define | RCKEY_RC5 0x08000000
#define | RCKEY_NEC 0x10000000
#define | RCKEY_SONY 0x18000000
#define | RCKEY_RECS80 0x20000000
#define | RCKEY_DENON 0x28000000
#define | RCKEY_MOTOROLA 0x30000000
#define | RCKEY_JAPAN 0x38000000
#define | RCKEY_SAMSUNG 0x40000000
#define | RCKEY_DAEWOO 0x48000000
#define | RC5_SHORT 889
#define | RC5_LONG (RC5_SHORT * 2)
#define | RC5_MARGIN (RC5_SHORT / 2)
#define | NEC_PULSE 560
#define | NEC_START1 (NEC_PULSE * 16)
#define | NEC_START2 (NEC_PULSE * 8)
#define | NEC_REPEAT (NEC_PULSE * 4)
#define | NEC_PAUSE0 (NEC_PULSE * 1)
#define | NEC_PAUSE1 (NEC_PULSE * 3)
#define | NEC_MARGIN (NEC_PULSE / 2)
#define | SAM_PULSE 560
#define | SAM_START1 (SAM_PULSE * 8)
#define | SAM_START2 (SAM_PULSE * 8)
#define | SAM_PAUSE0 (SAM_PULSE * 1)
#define | SAM_PAUSE1 (SAM_PULSE * 3)
#define | SAM_MARGIN (SAM_PULSE / 2)
#define | SAM_REPEATMS 120
## Functions
int | RC_KeyAvail ()
| Check for currently available keycodes.
unsigned long | RC_GetKey ()
| Get a keycode from the queue.
void | RC_Init ()
| This function must be called to initialize the remote control subsystem.
void | RC_Done ()
| Shutdown the remote control subsystem, and free all used resources.

## Define Documentation

#define NEC_MARGIN (NEC_PULSE / 2)

| Definition at line 69 of file remote.h. Referenced by DecodeNEC().

#define NEC_PAUSE0 (NEC_PULSE * 1)

| Definition at line 67 of file remote.h. Referenced by DecodeNEC().

#define NEC_PAUSE1 (NEC_PULSE * 3)

| Definition at line 68 of file remote.h. Referenced by DecodeNEC().

#define NEC_PULSE 560

| Definition at line 63 of file remote.h. Referenced by DecodeNEC().

#define NEC_REPEAT (NEC_PULSE * 4)

| Definition at line 66 of file remote.h. Referenced by DecodeNEC().

#define NEC_START1 (NEC_PULSE * 16)

| Definition at line 64 of file remote.h. Referenced by DecodeNEC().

#define NEC_START2 (NEC_PULSE * 8)

| Definition at line 65 of file remote.h. Referenced by DecodeNEC().

#define RC5_LONG (RC5_SHORT * 2)

| Definition at line 58 of file remote.h. Referenced by DecodeRC5().

#define RC5_MARGIN (RC5_SHORT / 2)

| Definition at line 59 of file remote.h. Referenced by DecodeRC5().

#define RC5_SHORT 889

| Definition at line 57 of file remote.h. Referenced by DecodeRC5().

#define RC_DMACHANNEL 1

| DMA channel to use. Definition at line 6 of file remote.h. Referenced by RC_Done(), RC_Init(), and timerHandler().

#define RC_QUEUE_SIZE 16

| Queue length for received keycodes. Definition at line 14 of file remote.h. Referenced by DecodeSamples(), and RC_GetKey().

#define RC_TRESHOLD 10

| The treshold value is used to cleanup the timer samples. If two samples have a distance less than RC_TRESHOLD microseconds, they get discarded. Note that this length must be shorter, than the shortest signal length you want to measure. See also: TimerHandler() Definition at line 25 of file remote.h. Referenced by DecodeSamples().

#define RCKEY_CODE 0x07FFFFFF

| Definition at line 41 of file remote.h. Referenced by DecodeNEC().

#define RCKEY_DAEWOO 0x48000000

| Definition at line 52 of file remote.h.

#define RCKEY_DENON 0x28000000

| Definition at line 48 of file remote.h.

#define RCKEY_JAPAN 0x38000000

| Definition at line 50 of file remote.h.

#define RCKEY_MOTOROLA 0x30000000

| Definition at line 49 of file remote.h.

#define RCKEY_NEC 0x10000000

| Definition at line 45 of file remote.h. Referenced by DecodeNEC().

#define RCKEY_NONE 0x00000000

| Definition at line 43 of file remote.h.

#define RCKEY_PROTO 0x78000000

| Definition at line 40 of file remote.h.

#define RCKEY_RC5 0x08000000

| Definition at line 44 of file remote.h. Referenced by DecodeRC5().

#define RCKEY_RECS80 0x20000000

| Definition at line 47 of file remote.h.

#define RCKEY_REPEAT 0x80000000

| Definition at line 39 of file remote.h. Referenced by DecodeNEC(), DecodeRC5(), DecodeSAMSUNG(), and gfxTest().

#define RCKEY_SAMSUNG 0x40000000

| Definition at line 51 of file remote.h. Referenced by DecodeSAMSUNG().

#define RCKEY_SONY 0x18000000

| Definition at line 46 of file remote.h.

#define SAM_MARGIN (SAM_PULSE / 2)

| Definition at line 78 of file remote.h. Referenced by DecodeSAMSUNG().

#define SAM_PAUSE0 (SAM_PULSE * 1)

| Definition at line 76 of file remote.h. Referenced by DecodeSAMSUNG().

#define SAM_PAUSE1 (SAM_PULSE * 3)

| Definition at line 77 of file remote.h. Referenced by DecodeSAMSUNG().

#define SAM_PULSE 560

| Definition at line 73 of file remote.h. Referenced by DecodeSAMSUNG().

#define SAM_REPEATMS 120

| Definition at line 79 of file remote.h. Referenced by DecodeSAMSUNG().

#define SAM_START1 (SAM_PULSE * 8)

| Definition at line 74 of file remote.h. Referenced by DecodeSAMSUNG().

#define SAM_START2 (SAM_PULSE * 8)

| Definition at line 75 of file remote.h. Referenced by DecodeSAMSUNG().

#define TICKS_PER_uS 5

| Timer ticks per microsecond. Definition at line 10 of file remote.h. Referenced by DecodeSamples().

## Function Documentation

void RC_Done | ( |  | ) |

| Shutdown the remote control subsystem, and free all used resources. Definition at line 416 of file remote.cpp. References AMD_StopDma(), oldTimerHandler, PCB_T1CON, RC_DMACHANNEL, and TCON_STOP. Referenced by main().

unsigned long RC_GetKey | ( |  | ) |

| Get a keycode from the queue. This function will block until a keycode is received. Use the RC_KeyAvail() function to check if there are codes in the queue. See also: RC_KeyAvail() Returns: valid keycode != 0 Definition at line 361 of file remote.cpp. References qCount, qHead, queue, RC_KeyAvail(), RC_QUEUE_SIZE, and RTX_Sleep_Time(). Referenced by gfxTest().

void RC_Init | ( |  | ) |

| This function must be called to initialize the remote control subsystem. Definition at line 380 of file remote.cpp. References AMD_EnableDrq(), AMD_StartDma(), DmaInfo::control, DCON_BW, DCON_DINC, DCON_DMIO, DCON_P, DCON_SSYNC, DCON_TC, dmabuf, DmaInfo::dstMem, DmaInfo::length, oldTimerHandler, PCB_T1CMPA, PCB_T1CNT, PCB_T1CON, pfe_enable_bus(), pfe_enable_pcs(), RC_DMA_LEN, RC_DMACHANNEL, DmaInfo::srcPort, TCON_CONT, TCON_INT, TCON_START, TCON_STOP, and timerHandler(). Referenced by main().

int RC_KeyAvail | ( |  | ) |

| Check for currently available keycodes. Any available keycodes can be retrieved with RC_GetKey() See also: RC_GetKey() Returns: number of available keycodes. Definition at line 344 of file remote.cpp. References qCount. Referenced by RC_GetKey().