70#ifndef __AVR_ATmega32U4__
78typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
80#define NEC_HDR_MARK 9000
81#define NEC_HDR_SPACE 4500
82#define NEC_BIT_MARK 560
83#define NEC_ONE_SPACE 1600
84#define NEC_ZERO_SPACE 560
85#define NEC_RPT_SPACE 2250
86#define NEC_RPT_PERIOD 110000
121#define TOPBIT 0x80000000
125#define SYSCLOCK F_CPU
127#define SYSCLOCK 16000000
132#define GAP_TICKS (_GAP/USECPERTICK)
135#define TIMER_DISABLE_INTR (TIMSK2 = 0)
136#define TIMER_ENABLE_PWM (TCCR2A |= _BV(COM2B1))
137#define TIMER_DISABLE_PWM (TCCR2A &= ~(_BV(COM2B1)))
138#define TIMER_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))
139#define TIMER_DISABLE_INTR (TIMSK2 = 0)
140#define TIMER_INTR_NAME TIMER2_COMPA_vect
141#define TIMER_CONFIG_KHZ(val) ({ \
142 const uint8_t pwmval = F_CPU / 2000 / (val); \
143 TCCR2A = _BV(WGM20); \
144 TCCR2B = _BV(WGM22) | _BV(CS20); \
146 OCR2B = pwmval / 3; \
149#define TIMER_COUNT_TOP (SYSCLOCK * USECPERTICK / 1000000)
150#if (TIMER_COUNT_TOP < 256)
151#define TIMER_CONFIG_NORMAL() ({ \
152 TCCR2A = _BV(WGM21); \
153 TCCR2B = _BV(CS20); \
154 OCR2A = TIMER_COUNT_TOP; \
158#define TIMER_CONFIG_NORMAL() ({ \
159 TCCR2A = _BV(WGM21); \
160 TCCR2B = _BV(CS21); \
161 OCR2A = TIMER_COUNT_TOP / 8; \
169 volatile uint8_t rcvstate;
170 volatile uint32_t lastTime;
172 volatile uint8_t rawbuf[RAWBUF];
173 volatile uint8_t rawlen;
278 volatile uint8_t *rawbuf;
381 void sendRaw(
unsigned int buf[],
int len, uint8_t hz);
463 ErrorStatus decodeNEC();
Configuration file of library.
Header for MePort.cpp module.
Driver for Me IR module.
Definition MeIR.h:184
void sendRaw(unsigned int buf[], int len, uint8_t hz)
void enableIROut(uint8_t khz)
boolean keyPressed(unsigned char r)
void sendNEC(unsigned long data, int nbits)
void sendString(String s)