McMajan Library Pack  v 2.00
Improve your Arduino !
Ss_McIRDA_Int.h File Reference
#include "Ss_McIRDA.h"
#include "Ss_McMajan_Config.h"
+ Include dependency graph for Ss_McIRDA_Int.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  irparams_t
 

Macros

#define IR_USE_TIMER2
 
#define SYSCLOCK   16000000
 
#define ERR   0
 
#define DECODED   1
 
#define cbi(sfr, bit)   (_SFR_BYTE(sfr) &= ~_BV(bit))
 
#define sbi(sfr, bit)   (_SFR_BYTE(sfr) |= _BV(bit))
 
#define NEC_HDR_MARK   9000
 
#define NEC_HDR_SPACE   4500
 
#define NEC_BIT_MARK   560
 
#define NEC_ONE_SPACE   1600
 
#define NEC_ZERO_SPACE   560
 
#define NEC_RPT_SPACE   2250
 
#define SONY_HDR_MARK   2400
 
#define SONY_HDR_SPACE   600
 
#define SONY_ONE_MARK   1200
 
#define SONY_ZERO_MARK   600
 
#define SONY_RPT_LENGTH   45000
 
#define SONY_DOUBLE_SPACE_USECS   500
 
#define SANYO_HDR_MARK   3500
 
#define SANYO_HDR_SPACE   950
 
#define SANYO_ONE_MARK   2400
 
#define SANYO_ZERO_MARK   700
 
#define SANYO_DOUBLE_SPACE_USECS   800
 
#define SANYO_RPT_LENGTH   45000
 
#define MITSUBISHI_HDR_SPACE   350
 
#define MITSUBISHI_ONE_MARK   1950
 
#define MITSUBISHI_ZERO_MARK   750
 
#define RC5_T1   889
 
#define RC5_RPT_LENGTH   46000
 
#define RC6_HDR_MARK   2666
 
#define RC6_HDR_SPACE   889
 
#define RC6_T1   444
 
#define RC6_RPT_LENGTH   46000
 
#define SHARP_BIT_MARK   245
 
#define SHARP_ONE_SPACE   1805
 
#define SHARP_ZERO_SPACE   795
 
#define SHARP_GAP   600000
 
#define SHARP_TOGGLE_MASK   0x3FF
 
#define SHARP_RPT_SPACE   3000
 
#define DISH_HDR_MARK   400
 
#define DISH_HDR_SPACE   6100
 
#define DISH_BIT_MARK   400
 
#define DISH_ONE_SPACE   1700
 
#define DISH_ZERO_SPACE   2800
 
#define DISH_RPT_SPACE   6200
 
#define DISH_TOP_BIT   0x8000
 
#define PANASONIC_HDR_MARK   3502
 
#define PANASONIC_HDR_SPACE   1750
 
#define PANASONIC_BIT_MARK   502
 
#define PANASONIC_ONE_SPACE   1244
 
#define PANASONIC_ZERO_SPACE   400
 
#define JVC_HDR_MARK   8000
 
#define JVC_HDR_SPACE   4000
 
#define JVC_BIT_MARK   600
 
#define JVC_ONE_SPACE   1600
 
#define JVC_ZERO_SPACE   550
 
#define JVC_RPT_LENGTH   60000
 
#define SAMSUNG_HDR_MARK   4500
 
#define SAMSUNG_BITS   32
 
#define SAMSUNG_HDR_SPACE   4500
 
#define SAMSUNG_BIT_MARK   560
 
#define SAMSUNG_ONE_SPACE   1600
 
#define SAMSUNG_ZERO_SPACE   600
 
#define DAIKIN_MARK   450
 
#define DAIKIN_ONE_SPACE   1270
 
#define DAIKIN_ZERO_SPACE   425
 
#define DAIKIN_POST_SPACE   1670
 
#define DAIKIN_LONG_MARK   3490
 
#define DAIKIN_LONG_SPACE   24870
 
#define DAIKIN_VERY_LONG_SPACE   35150
 
#define SHARP_BITS   15
 
#define DISH_BITS   16
 
#define TOLERANCE   25
 
#define LTOL   (1.0 - TOLERANCE/100.)
 
#define UTOL   (1.0 + TOLERANCE/100.)
 
#define _GAP   5000
 
#define GAP_TICKS   ((unsigned int)_GAP/(unsigned int)USECPERTICK)
 
#define TICKS_LOW(us)   (int) (((us)*LTOL/USECPERTICK))
 
#define TICKS_HIGH(us)   (int) (((us)*UTOL/USECPERTICK + 1))
 
#define STATE_IDLE   2
 
#define STATE_MARK   3
 
#define STATE_SPACE   4
 
#define STATE_STOP   5
 
#define MARK   0
 
#define SPACE   1
 
#define TOPBIT   0x80000000
 
#define NEC_BITS   32
 
#define SONY_BITS   12
 
#define SANYO_BITS   12
 
#define MITSUBISHI_BITS   16
 
#define MIN_RC5_SAMPLES   11
 
#define MIN_RC6_SAMPLES   1
 
#define PANASONIC_BITS   48
 
#define JVC_BITS   16
 
#define DAIKIN_BITS   290
 
#define TIMER_RESET
 
#define TIMER_ENABLE_PWM   (TCCR2A |= _BV(COM2B1))
 
#define TIMER_DISABLE_PWM   (TCCR2A &= ~(_BV(COM2B1)))
 
#define TIMER_ENABLE_INTR   (TIMSK2 = _BV(OCIE2A))
 
#define TIMER_DISABLE_INTR   (TIMSK2 = 0)
 
#define TIMER_INTR_NAME   TIMER2_COMPA_vect
 
#define TIMER_CONFIG_KHZ(val)
 
#define TIMER_COUNT_TOP   (SYSCLOCK * USECPERTICK / 1000000)
 
#define TIMER_CONFIG_NORMAL()
 
#define TIMER_PWM_PIN   3 /* Arduino Duemilanove, Diecimila, LilyPad, etc */
 
#define BLINKLED   13
 
#define BLINKLED_ON()   (PORTB |= B00100000)
 
#define BLINKLED_OFF()   (PORTB &= B11011111)
 

Variables

volatile irparams_t irparams
 

Macro Definition Documentation

§ _GAP

#define _GAP   5000

Definition at line 253 of file Ss_McIRDA_Int.h.

§ BLINKLED

#define BLINKLED   13

Definition at line 541 of file Ss_McIRDA_Int.h.

§ BLINKLED_OFF

#define BLINKLED_OFF ( )    (PORTB &= B11011111)

Definition at line 543 of file Ss_McIRDA_Int.h.

§ BLINKLED_ON

#define BLINKLED_ON ( )    (PORTB |= B00100000)

Definition at line 542 of file Ss_McIRDA_Int.h.

§ cbi

#define cbi (   sfr,
  bit 
)    (_SFR_BYTE(sfr) &= ~_BV(bit))

Definition at line 116 of file Ss_McIRDA_Int.h.

§ DAIKIN_BITS

#define DAIKIN_BITS   290

Definition at line 301 of file Ss_McIRDA_Int.h.

§ DAIKIN_LONG_MARK

#define DAIKIN_LONG_MARK   3490

Definition at line 212 of file Ss_McIRDA_Int.h.

§ DAIKIN_LONG_SPACE

#define DAIKIN_LONG_SPACE   24870

Definition at line 213 of file Ss_McIRDA_Int.h.

§ DAIKIN_MARK

#define DAIKIN_MARK   450

Definition at line 204 of file Ss_McIRDA_Int.h.

§ DAIKIN_ONE_SPACE

#define DAIKIN_ONE_SPACE   1270

Definition at line 205 of file Ss_McIRDA_Int.h.

§ DAIKIN_POST_SPACE

#define DAIKIN_POST_SPACE   1670

Definition at line 210 of file Ss_McIRDA_Int.h.

§ DAIKIN_VERY_LONG_SPACE

#define DAIKIN_VERY_LONG_SPACE   35150

Definition at line 214 of file Ss_McIRDA_Int.h.

§ DAIKIN_ZERO_SPACE

#define DAIKIN_ZERO_SPACE   425

Definition at line 208 of file Ss_McIRDA_Int.h.

§ DECODED

#define DECODED   1

Definition at line 111 of file Ss_McIRDA_Int.h.

§ DISH_BIT_MARK

#define DISH_BIT_MARK   400

Definition at line 175 of file Ss_McIRDA_Int.h.

§ DISH_BITS

#define DISH_BITS   16

Definition at line 245 of file Ss_McIRDA_Int.h.

§ DISH_HDR_MARK

#define DISH_HDR_MARK   400

Definition at line 173 of file Ss_McIRDA_Int.h.

§ DISH_HDR_SPACE

#define DISH_HDR_SPACE   6100

Definition at line 174 of file Ss_McIRDA_Int.h.

§ DISH_ONE_SPACE

#define DISH_ONE_SPACE   1700

Definition at line 176 of file Ss_McIRDA_Int.h.

§ DISH_RPT_SPACE

#define DISH_RPT_SPACE   6200

Definition at line 178 of file Ss_McIRDA_Int.h.

§ DISH_TOP_BIT

#define DISH_TOP_BIT   0x8000

Definition at line 179 of file Ss_McIRDA_Int.h.

§ DISH_ZERO_SPACE

#define DISH_ZERO_SPACE   2800

Definition at line 177 of file Ss_McIRDA_Int.h.

§ ERR

#define ERR   0

Definition at line 110 of file Ss_McIRDA_Int.h.

§ GAP_TICKS

#define GAP_TICKS   ((unsigned int)_GAP/(unsigned int)USECPERTICK)

Definition at line 258 of file Ss_McIRDA_Int.h.

§ IR_USE_TIMER2

#define IR_USE_TIMER2

Definition at line 100 of file Ss_McIRDA_Int.h.

§ JVC_BIT_MARK

#define JVC_BIT_MARK   600

Definition at line 190 of file Ss_McIRDA_Int.h.

§ JVC_BITS

#define JVC_BITS   16

Definition at line 300 of file Ss_McIRDA_Int.h.

§ JVC_HDR_MARK

#define JVC_HDR_MARK   8000

Definition at line 188 of file Ss_McIRDA_Int.h.

§ JVC_HDR_SPACE

#define JVC_HDR_SPACE   4000

Definition at line 189 of file Ss_McIRDA_Int.h.

§ JVC_ONE_SPACE

#define JVC_ONE_SPACE   1600

Definition at line 191 of file Ss_McIRDA_Int.h.

§ JVC_RPT_LENGTH

#define JVC_RPT_LENGTH   60000

Definition at line 193 of file Ss_McIRDA_Int.h.

§ JVC_ZERO_SPACE

#define JVC_ZERO_SPACE   550

Definition at line 192 of file Ss_McIRDA_Int.h.

§ LTOL

#define LTOL   (1.0 - TOLERANCE/100.)

Definition at line 248 of file Ss_McIRDA_Int.h.

§ MARK

#define MARK   0

Definition at line 288 of file Ss_McIRDA_Int.h.

§ MIN_RC5_SAMPLES

#define MIN_RC5_SAMPLES   11

Definition at line 297 of file Ss_McIRDA_Int.h.

§ MIN_RC6_SAMPLES

#define MIN_RC6_SAMPLES   1

Definition at line 298 of file Ss_McIRDA_Int.h.

§ MITSUBISHI_BITS

#define MITSUBISHI_BITS   16

Definition at line 296 of file Ss_McIRDA_Int.h.

§ MITSUBISHI_HDR_SPACE

#define MITSUBISHI_HDR_SPACE   350

Definition at line 151 of file Ss_McIRDA_Int.h.

§ MITSUBISHI_ONE_MARK

#define MITSUBISHI_ONE_MARK   1950

Definition at line 152 of file Ss_McIRDA_Int.h.

§ MITSUBISHI_ZERO_MARK

#define MITSUBISHI_ZERO_MARK   750

Definition at line 153 of file Ss_McIRDA_Int.h.

§ NEC_BIT_MARK

#define NEC_BIT_MARK   560

Definition at line 127 of file Ss_McIRDA_Int.h.

§ NEC_BITS

#define NEC_BITS   32

Definition at line 293 of file Ss_McIRDA_Int.h.

§ NEC_HDR_MARK

#define NEC_HDR_MARK   9000

Definition at line 125 of file Ss_McIRDA_Int.h.

§ NEC_HDR_SPACE

#define NEC_HDR_SPACE   4500

Definition at line 126 of file Ss_McIRDA_Int.h.

§ NEC_ONE_SPACE

#define NEC_ONE_SPACE   1600

Definition at line 128 of file Ss_McIRDA_Int.h.

§ NEC_RPT_SPACE

#define NEC_RPT_SPACE   2250

Definition at line 130 of file Ss_McIRDA_Int.h.

§ NEC_ZERO_SPACE

#define NEC_ZERO_SPACE   560

Definition at line 129 of file Ss_McIRDA_Int.h.

§ PANASONIC_BIT_MARK

#define PANASONIC_BIT_MARK   502

Definition at line 184 of file Ss_McIRDA_Int.h.

§ PANASONIC_BITS

#define PANASONIC_BITS   48

Definition at line 299 of file Ss_McIRDA_Int.h.

§ PANASONIC_HDR_MARK

#define PANASONIC_HDR_MARK   3502

Definition at line 182 of file Ss_McIRDA_Int.h.

§ PANASONIC_HDR_SPACE

#define PANASONIC_HDR_SPACE   1750

Definition at line 183 of file Ss_McIRDA_Int.h.

§ PANASONIC_ONE_SPACE

#define PANASONIC_ONE_SPACE   1244

Definition at line 185 of file Ss_McIRDA_Int.h.

§ PANASONIC_ZERO_SPACE

#define PANASONIC_ZERO_SPACE   400

Definition at line 186 of file Ss_McIRDA_Int.h.

§ RC5_RPT_LENGTH

#define RC5_RPT_LENGTH   46000

Definition at line 159 of file Ss_McIRDA_Int.h.

§ RC5_T1

#define RC5_T1   889

Definition at line 158 of file Ss_McIRDA_Int.h.

§ RC6_HDR_MARK

#define RC6_HDR_MARK   2666

Definition at line 161 of file Ss_McIRDA_Int.h.

§ RC6_HDR_SPACE

#define RC6_HDR_SPACE   889

Definition at line 162 of file Ss_McIRDA_Int.h.

§ RC6_RPT_LENGTH

#define RC6_RPT_LENGTH   46000

Definition at line 164 of file Ss_McIRDA_Int.h.

§ RC6_T1

#define RC6_T1   444

Definition at line 163 of file Ss_McIRDA_Int.h.

§ SAMSUNG_BIT_MARK

#define SAMSUNG_BIT_MARK   560

Definition at line 199 of file Ss_McIRDA_Int.h.

§ SAMSUNG_BITS

#define SAMSUNG_BITS   32

Definition at line 197 of file Ss_McIRDA_Int.h.

§ SAMSUNG_HDR_MARK

#define SAMSUNG_HDR_MARK   4500

Definition at line 196 of file Ss_McIRDA_Int.h.

§ SAMSUNG_HDR_SPACE

#define SAMSUNG_HDR_SPACE   4500

Definition at line 198 of file Ss_McIRDA_Int.h.

§ SAMSUNG_ONE_SPACE

#define SAMSUNG_ONE_SPACE   1600

Definition at line 200 of file Ss_McIRDA_Int.h.

§ SAMSUNG_ZERO_SPACE

#define SAMSUNG_ZERO_SPACE   600

Definition at line 201 of file Ss_McIRDA_Int.h.

§ SANYO_BITS

#define SANYO_BITS   12

Definition at line 295 of file Ss_McIRDA_Int.h.

§ SANYO_DOUBLE_SPACE_USECS

#define SANYO_DOUBLE_SPACE_USECS   800

Definition at line 144 of file Ss_McIRDA_Int.h.

§ SANYO_HDR_MARK

#define SANYO_HDR_MARK   3500

Definition at line 140 of file Ss_McIRDA_Int.h.

§ SANYO_HDR_SPACE

#define SANYO_HDR_SPACE   950

Definition at line 141 of file Ss_McIRDA_Int.h.

§ SANYO_ONE_MARK

#define SANYO_ONE_MARK   2400

Definition at line 142 of file Ss_McIRDA_Int.h.

§ SANYO_RPT_LENGTH

#define SANYO_RPT_LENGTH   45000

Definition at line 145 of file Ss_McIRDA_Int.h.

§ SANYO_ZERO_MARK

#define SANYO_ZERO_MARK   700

Definition at line 143 of file Ss_McIRDA_Int.h.

§ sbi

#define sbi (   sfr,
  bit 
)    (_SFR_BYTE(sfr) |= _BV(bit))

Definition at line 119 of file Ss_McIRDA_Int.h.

§ SHARP_BIT_MARK

#define SHARP_BIT_MARK   245

Definition at line 166 of file Ss_McIRDA_Int.h.

§ SHARP_BITS

#define SHARP_BITS   15

Definition at line 244 of file Ss_McIRDA_Int.h.

§ SHARP_GAP

#define SHARP_GAP   600000

Definition at line 169 of file Ss_McIRDA_Int.h.

§ SHARP_ONE_SPACE

#define SHARP_ONE_SPACE   1805

Definition at line 167 of file Ss_McIRDA_Int.h.

§ SHARP_RPT_SPACE

#define SHARP_RPT_SPACE   3000

Definition at line 171 of file Ss_McIRDA_Int.h.

§ SHARP_TOGGLE_MASK

#define SHARP_TOGGLE_MASK   0x3FF

Definition at line 170 of file Ss_McIRDA_Int.h.

§ SHARP_ZERO_SPACE

#define SHARP_ZERO_SPACE   795

Definition at line 168 of file Ss_McIRDA_Int.h.

§ SONY_BITS

#define SONY_BITS   12

Definition at line 294 of file Ss_McIRDA_Int.h.

§ SONY_DOUBLE_SPACE_USECS

#define SONY_DOUBLE_SPACE_USECS   500

Definition at line 137 of file Ss_McIRDA_Int.h.

§ SONY_HDR_MARK

#define SONY_HDR_MARK   2400

Definition at line 132 of file Ss_McIRDA_Int.h.

§ SONY_HDR_SPACE

#define SONY_HDR_SPACE   600

Definition at line 133 of file Ss_McIRDA_Int.h.

§ SONY_ONE_MARK

#define SONY_ONE_MARK   1200

Definition at line 134 of file Ss_McIRDA_Int.h.

§ SONY_RPT_LENGTH

#define SONY_RPT_LENGTH   45000

Definition at line 136 of file Ss_McIRDA_Int.h.

§ SONY_ZERO_MARK

#define SONY_ZERO_MARK   600

Definition at line 135 of file Ss_McIRDA_Int.h.

§ SPACE

#define SPACE   1

Definition at line 289 of file Ss_McIRDA_Int.h.

§ STATE_IDLE

#define STATE_IDLE   2

Definition at line 268 of file Ss_McIRDA_Int.h.

§ STATE_MARK

#define STATE_MARK   3

Definition at line 269 of file Ss_McIRDA_Int.h.

§ STATE_SPACE

#define STATE_SPACE   4

Definition at line 270 of file Ss_McIRDA_Int.h.

§ STATE_STOP

#define STATE_STOP   5

Definition at line 271 of file Ss_McIRDA_Int.h.

§ SYSCLOCK

#define SYSCLOCK   16000000

Definition at line 107 of file Ss_McIRDA_Int.h.

§ TICKS_HIGH

#define TICKS_HIGH (   us)    (int) (((us)*UTOL/USECPERTICK + 1))

Definition at line 263 of file Ss_McIRDA_Int.h.

§ TICKS_LOW

#define TICKS_LOW (   us)    (int) (((us)*LTOL/USECPERTICK))

Definition at line 262 of file Ss_McIRDA_Int.h.

§ TIMER_CONFIG_KHZ

#define TIMER_CONFIG_KHZ (   val)
Value:
({ \
const uint8_t pwmval = SYSCLOCK / 2000 / (val); \
TCCR2A = _BV(WGM20); \
TCCR2B = _BV(WGM22) | _BV(CS20); \
OCR2A = pwmval; \
OCR2B = pwmval / 3; \
})
#define SYSCLOCK

Definition at line 313 of file Ss_McIRDA_Int.h.

§ TIMER_CONFIG_NORMAL

#define TIMER_CONFIG_NORMAL ( )
Value:
({ \
TCCR2A = _BV(WGM21); \
TCCR2B = _BV(CS21); \
OCR2A = TIMER_COUNT_TOP / 8; \
TCNT2 = 0; \
})
#define TIMER_COUNT_TOP

Definition at line 329 of file Ss_McIRDA_Int.h.

§ TIMER_COUNT_TOP

#define TIMER_COUNT_TOP   (SYSCLOCK * USECPERTICK / 1000000)

Definition at line 320 of file Ss_McIRDA_Int.h.

§ TIMER_DISABLE_INTR

#define TIMER_DISABLE_INTR   (TIMSK2 = 0)

Definition at line 311 of file Ss_McIRDA_Int.h.

§ TIMER_DISABLE_PWM

#define TIMER_DISABLE_PWM   (TCCR2A &= ~(_BV(COM2B1)))

Definition at line 309 of file Ss_McIRDA_Int.h.

§ TIMER_ENABLE_INTR

#define TIMER_ENABLE_INTR   (TIMSK2 = _BV(OCIE2A))

Definition at line 310 of file Ss_McIRDA_Int.h.

§ TIMER_ENABLE_PWM

#define TIMER_ENABLE_PWM   (TCCR2A |= _BV(COM2B1))

Definition at line 308 of file Ss_McIRDA_Int.h.

§ TIMER_INTR_NAME

#define TIMER_INTR_NAME   TIMER2_COMPA_vect

Definition at line 312 of file Ss_McIRDA_Int.h.

§ TIMER_PWM_PIN

#define TIMER_PWM_PIN   3 /* Arduino Duemilanove, Diecimila, LilyPad, etc */

Definition at line 343 of file Ss_McIRDA_Int.h.

§ TIMER_RESET

#define TIMER_RESET

Definition at line 307 of file Ss_McIRDA_Int.h.

§ TOLERANCE

#define TOLERANCE   25

Definition at line 247 of file Ss_McIRDA_Int.h.

§ TOPBIT

#define TOPBIT   0x80000000

Definition at line 291 of file Ss_McIRDA_Int.h.

§ UTOL

#define UTOL   (1.0 + TOLERANCE/100.)

Definition at line 249 of file Ss_McIRDA_Int.h.

Variable Documentation

§ irparams

volatile irparams_t irparams

Definition at line 14 of file Ss_McIRDA.cpp.