io_source.cpp File Reference
#include <stdint.h>
#include "io.hpp"
#include "bio.h"
#include "adc0.h"
Include dependency graph for io_source.cpp:

Macros

#define MAX_FALLING_EDGES_PER_IR_FRAME   32
 
#define led_set(num, realbit)
 

Macro Definition Documentation

#define led_set (   num,
  realbit 
)
Value:
if (mLedValue & (1 << num)) \
LPC_GPIO1->FIOCLR = (1 << realbit); \
LPC_GPIO1->FIOSET = (1 << realbit)
#define LPC_GPIO1
Definition: LPC17xx.h:1006
#define MAX_FALLING_EDGES_PER_IR_FRAME   32

The design of the IR Sensor is as follows: Timer1 captures falling edges of CAP1.0 and timestamps are saved when this happens. Every time capture happens, a 20ms match interrupt is setup/reset. When no more signals arrive, the 20ms match interrupt will decode the timestamps and convert timestamps into binary signal.

Note that this doesn't decode into real data sent through the IR, but nevertheless, the decoded signal will be unique per button pressed on an IR remote.