Subversion Repositories HomeAutomation

Rev

Rev 2254 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /**
  2.  * @defgroup infrared IR Protocols Driver Library
  3.  * @code #include <drivers/ir/protocols.h> @endcode
  4.  *
  5.  * @brief  
  6.  *
  7.  *
  8.  * @author  Andreas Fritiofson, Anders Runeson
  9.  * @date    2007
  10.  */
  11.  
  12. /**@{*/
  13.  
  14.  
  15. #ifndef IR_PROTOCOLS_H_
  16. #define IR_PROTOCOLS_H_
  17. #include <stdio.h>
  18. #include <config.h>
  19.  
  20. /* Protocol data structure */
  21. typedef struct {
  22.     uint8_t protocol;
  23.     uint64_t data;
  24.     uint16_t timeout;       //Set to 0 to indicate burst protocol (only one pulse train is sent)
  25.     uint8_t repeats;
  26.     uint16_t modfreq;
  27.     uint8_t framecnt;
  28. } Ir_Protocol_Data_t;
  29.  
  30. /* Which protocols to use. These should perhaps be configuration options
  31.  * (config.inc). Only applies to receiver right now */
  32. #ifndef IR_PROTOCOLS_USE_SIRC
  33. # define IR_PROTOCOLS_USE_SIRC      1
  34. #endif
  35. #ifndef IR_PROTOCOLS_USE_RC5
  36. # define IR_PROTOCOLS_USE_RC5       1
  37. #endif
  38. #ifndef IR_PROTOCOLS_USE_SHARP
  39. # define IR_PROTOCOLS_USE_SHARP     1
  40. #endif
  41. #ifndef IR_PROTOCOLS_USE_NEC
  42. # define IR_PROTOCOLS_USE_NEC       1
  43. #endif
  44. #ifndef IR_PROTOCOLS_USE_SAMSUNG
  45. # define IR_PROTOCOLS_USE_SAMSUNG   1
  46. #endif
  47. #ifndef IR_PROTOCOLS_USE_MARANTZ
  48. # define IR_PROTOCOLS_USE_MARANTZ   1
  49. #endif
  50. #ifndef IR_PROTOCOLS_USE_PANASONIC
  51. # define IR_PROTOCOLS_USE_PANASONIC 1
  52. #endif
  53. #ifndef IR_PROTOCOLS_USE_SKY
  54. # define IR_PROTOCOLS_USE_SKY       1
  55. #endif
  56. #ifndef IR_PROTOCOLS_USE_IROBOT
  57. # define IR_PROTOCOLS_USE_IROBOT        1
  58. #endif
  59. #ifndef IR_PROTOCOLS_USE_NEXA2
  60. # define IR_PROTOCOLS_USE_NEXA2 1
  61. #endif
  62. #ifndef IR_PROTOCOLS_USE_NEXA1
  63. # define IR_PROTOCOLS_USE_NEXA1 1
  64. #endif
  65. #ifndef IR_PROTOCOLS_USE_VIKING
  66. # define IR_PROTOCOLS_USE_VIKING    1
  67. #endif
  68. #ifndef IR_PROTOCOLS_USE_VIKING_STEAK
  69. # define IR_PROTOCOLS_USE_VIKING_STEAK  1
  70. #endif
  71. #ifndef IR_PROTOCOLS_USE_RUBICSON
  72. # define IR_PROTOCOLS_USE_RUBICSON  1
  73. #endif
  74. #ifndef IR_PROTOCOLS_USE_OREGON
  75. # define IR_PROTOCOLS_USE_OREGON    1
  76. #endif
  77.  
  78.  
  79. /* All these functions take a buffer with pulse times and tries to parse it
  80.  * to a Ir_Protocol_Data_t structure. They return IR_OK on success
  81.  * and IR_NOT_CORRECT_DATA if there was no match. */
  82. #if (IR_PROTOCOLS_USE_SIRC)
  83. int8_t parseSIRC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  84. #endif
  85. #if (IR_PROTOCOLS_USE_RC5)
  86. int8_t parseRC5(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  87. #endif
  88. #if (IR_PROTOCOLS_USE_SHARP)
  89. int8_t parseSharp(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  90. #endif
  91. #if (IR_PROTOCOLS_USE_NEC)
  92. int8_t parseNEC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  93. #endif
  94. #if (IR_PROTOCOLS_USE_SAMSUNG)
  95. int8_t parseSamsung(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  96. #endif
  97. #if (IR_PROTOCOLS_USE_MARANTZ)
  98. int8_t parseMarantz(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  99. #endif
  100. #if (IR_PROTOCOLS_USE_PANASONIC)
  101. int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  102. #endif
  103. #if (IR_PROTOCOLS_USE_SKY)
  104. int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  105. #endif
  106. #if (IR_PROTOCOLS_USE_IROBOT)
  107. int8_t parseiRobot(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  108. #endif
  109.  
  110.  
  111. /* RF protocols needs index parameter */
  112. #if (IR_PROTOCOLS_USE_NEXA2)
  113. int8_t parseNexa2(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto);
  114. #endif
  115. #if (IR_PROTOCOLS_USE_NEXA1)
  116. int8_t parseNexa1(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto);
  117. #endif
  118. #if (IR_PROTOCOLS_USE_VIKING)
  119. int8_t parseViking(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto);
  120. #endif
  121. #if (IR_PROTOCOLS_USE_VIKING_STEAK)
  122. int8_t parseVikingSteak(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto);
  123. #endif
  124. #if (IR_PROTOCOLS_USE_RUBICSON)
  125. int8_t parseRubicson(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto);
  126. #endif
  127. #if (IR_PROTOCOLS_USE_OREGON)
  128. int8_t parseOregon(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto);
  129. #endif
  130.  
  131. /* Try to parse all above protocols until a match is found. */
  132. int8_t parseProtocol(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto);
  133. /* The Hash protocol always succeeds and creates a one-way signature of the
  134.  * pulse times buffer that is supposed to be unique and constant for a specific
  135.  * IR event. It may be used to send a valid event even if the protocol hasn't
  136.  * been implemented or decoded yet. */
  137. int8_t parseHash(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
  138.  
  139. /* These functions expand a Ir_Protocol_Data_t structure into a raw buffer with
  140.  * pulse lengths. They return IR_OK on success and IR_NOT_CORRECT_DATA if the
  141.  * Ir_Protocol_Data_t structure is for another protocol or contains invalid
  142.  * data. */
  143. int8_t expandSIRC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  144. int8_t expandRC5(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  145. int8_t expandSharp(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  146. int8_t expandNEC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  147. int8_t expandSamsung(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  148. int8_t expandMarantz(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  149. int8_t expandPanasonic(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  150. int8_t expandSky(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  151. int8_t expandiRobot(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  152. int8_t expandNexa2(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  153. int8_t expandNexa1(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  154. /* Pass the Ir_Protocol_Data_t automatically to the correct function. */
  155. int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
  156.  
  157.  
  158. #define IR_OK           1
  159. #define IR_NO_PROTOCOL      2
  160. #define IR_TIME_OVFL        3
  161. #define IR_NO_DATA      4
  162. #define IR_NOT_CORRECT_DATA     5
  163. #define IR_TO_MUCH_DATA     6
  164. #define IR_NOT_FINISHED     7
  165. #define IR_SEND_DEBUG       8
  166. #define IR_BUTTON_DOWN      0x0
  167. #define IR_BUTTON_UP        0xf
  168.  
  169. // defined for the module, uses same definitions for pressed and released as other buttons
  170. #define IR_BUTTON_RELEASED  0x0
  171. #define IR_BUTTON_PRESSED   0x1
  172.  
  173.  
  174. #define CYCLES_PER_US       (F_CPU/1000000UL)
  175. #define TIMER_PRESC         (8)
  176.  
  177. #ifndef IR_MIN_PULSE_WIDTH
  178. #define IR_MIN_PULSE_WIDTH  (0)                                 //us, used in continuous mode
  179. #endif
  180. #ifndef IR_MIN_STARTPULSE_WIDTH
  181. #define IR_MIN_STARTPULSE_WIDTH (0UL)                           //us, not used when set to 0
  182. #endif
  183. #ifndef IR_MAX_PULSE_WIDTH
  184. #define IR_MAX_PULSE_WIDTH  (12000UL)                           //us
  185. #endif
  186.  
  187. /* RC5 Implementation
  188.  * Receiver: DONE
  189.  * Transmitter: DONE
  190.  */
  191. #define IR_RC5_HALF_BIT     (889*CYCLES_PER_US/TIMER_PRESC)     //us
  192. #define IR_RC5_BIT          (889*2*CYCLES_PER_US/TIMER_PRESC)   //us
  193. #define IR_RC5_TIMEOUT      (117-IR_MAX_PULSE_WIDTH/1000)       //ms    (time between ir frames)
  194. #define IR_RC5_REPS         (1)                                 //      (minimum number of times to repeat code)
  195. #define IR_RC5_F_MOD        (36)                                //kHz   (modulation frequency)
  196. #define IR_RC5_TOL_DIV      (4)
  197.  
  198. /* RC6 Implementation
  199.  * Receiver:
  200.  * Transmitter:
  201.  */
  202. #define IR_RC6_ST_BIT       (1*CYCLES_PER_US/TIMER_PRESC)       //us
  203. #define IR_RC6_TIMEOUT      (50-IR_MAX_PULSE_WIDTH/1000)        //ms    (time between ir frames)
  204. #define IR_RC6_REPS         (1)                                 //      (minimum number of times to repeat code)
  205. #define IR_RC6_F_MOD        (36)                                //kHz   (modulation frequency)
  206. #define IR_RC6_TOL_DIV      (4)
  207.  
  208. /* RCMM Implementation
  209.  * Receiver:
  210.  * Transmitter:
  211.  */
  212. #define IR_RCMM_ST_BIT      (256*CYCLES_PER_US/TIMER_PRESC)     //us
  213. #define IR_RCMM_TIMEOUT     (170-IR_MAX_PULSE_WIDTH/1000)       //ms    (time between ir frames)
  214. #define IR_RCMM_REPS        (1)                                 //      (minimum number of times to repeat code)
  215. #define IR_RCMM_F_MOD       (36)                                //kHz   (modulation frequency)
  216. #define IR_RCMM_TOL_DIV     (4)
  217.  
  218. /* SIRC Implementation
  219.  * Receiver: DONE
  220.  * Transmitter: DONE
  221.  */
  222. #define IR_SIRC_ST_BIT      (2400*CYCLES_PER_US/TIMER_PRESC)    //us
  223. #define IR_SIRC_LOW         (600*CYCLES_PER_US/TIMER_PRESC)     //us
  224. #define IR_SIRC_HIGH_ONE    (1200*CYCLES_PER_US/TIMER_PRESC)    //us
  225. #define IR_SIRC_HIGH_ZERO   (600*CYCLES_PER_US/TIMER_PRESC)     //us
  226. #define IR_SIRC_TIMEOUT     (52-IR_MAX_PULSE_WIDTH/1000)                                    //ms    (time between ir frames)
  227. #define IR_SIRC_REPS        (3)                                 //      (minimum number of times to repeat code)
  228. #define IR_SIRC_F_MOD       (40)                                //kHz   (modulation frequency)
  229. #define IR_SIRC_TOL_DIV     (4)
  230.  
  231. /* Sharp Implementation
  232.  * Receiver: DONE
  233.  * Transmitter:
  234.  */
  235. #define IR_SHARP_HIGH       (280*CYCLES_PER_US/TIMER_PRESC)     //us
  236. #define IR_SHARP_LOW_ONE    (1850*CYCLES_PER_US/TIMER_PRESC)    //us
  237. #define IR_SHARP_LOW_ZERO   (780*CYCLES_PER_US/TIMER_PRESC)     //us
  238. #define IR_SHARP_TIMEOUT    (67-IR_MAX_PULSE_WIDTH/1000)        //ms    (time between ir frames)
  239. #define IR_SHARP_REPS       (2)                                 //      (minimum number of times to repeat code)
  240. #define IR_SHARP_F_MOD      (38)                                //kHz   (modulation frequency)
  241. #define IR_SHARP_TOL_DIV    (4)
  242.  
  243. /* NEC Implementation
  244.  * Receiver: DONE
  245.  * Transmitter: DONE
  246.  */
  247. #define IR_NEC_ST_BIT       (9000*CYCLES_PER_US/TIMER_PRESC)    //us
  248. #define IR_NEC_ST_PAUSE     (4500*CYCLES_PER_US/TIMER_PRESC)    //us
  249. #define IR_NEC_LOW_ONE      (1690*CYCLES_PER_US/TIMER_PRESC)    //us
  250. #define IR_NEC_LOW_ZERO     (560*CYCLES_PER_US/TIMER_PRESC)     //us
  251. #define IR_NEC_HIGH         (560*CYCLES_PER_US/TIMER_PRESC)     //us
  252. #define IR_NEC_TIMEOUT      (122-IR_MAX_PULSE_WIDTH/1000)       //ms    (time between ir frames)
  253. #define IR_NEC_ST_TIMEOUT   (65)                                //ms    (time between first ir frames and second)
  254. #define IR_NEC_REPS         (1)                                 //      (minimum number of times to repeat code)
  255. #define IR_NEC_F_MOD        (38)                                //kHz   (modulation frequency)
  256. #define IR_NEC_TOL_DIV      (4)
  257.  
  258. /* Samsung Implementation
  259.  * Receiver: DONE
  260.  * Transmitter: DONE
  261.  */
  262. #define IR_SAMS_ST_BIT      (4500*CYCLES_PER_US/TIMER_PRESC)    //us
  263. #define IR_SAMS_ST_PAUSE    (4500*CYCLES_PER_US/TIMER_PRESC)    //us
  264. #define IR_SAMS_LOW_ONE     (1720*CYCLES_PER_US/TIMER_PRESC)    //us
  265. #define IR_SAMS_LOW_ZERO    (650*CYCLES_PER_US/TIMER_PRESC)     //us
  266. #define IR_SAMS_HIGH        (500*CYCLES_PER_US/TIMER_PRESC)     //us
  267. #define IR_SAMS_TIMEOUT     (62-IR_MAX_PULSE_WIDTH/1000)        //ms    (time between ir frames)
  268. #define IR_SAMS_REPS        (1)                                 //      (minimum number of times to repeat code)
  269. #define IR_SAMS_F_MOD       (38)                                //kHz   (modulation frequency)
  270. #define IR_SAMS_TOL_DIV     (4)
  271.  
  272. /* Marantz Implementation
  273.  * Receiver: DONE (has not been tested with odd adressbits)
  274.  * Transmitter: DONE
  275.  */
  276. #define IR_MARANTZ_HALF_BIT     (889*CYCLES_PER_US/TIMER_PRESC)     //us
  277. #define IR_MARANTZ_BIT          (889*2*CYCLES_PER_US/TIMER_PRESC)   //us
  278. #define IR_MARANTZ_TIMEOUT      (117-IR_MAX_PULSE_WIDTH/1000)       //ms    (time between ir frames)
  279. #define IR_MARANTZ_REPS         (1)                                 //      (minimum number of times to repeat code)
  280. #define IR_MARANTZ_F_MOD        (36)                                //kHz   (modulation frequency)
  281. #define IR_MARANTZ_TOL_DIV      (4)
  282.  
  283. /* Panasonic Implementation
  284.  * Receiver: DONE
  285.  * Transmitter: DONE
  286.  */
  287. #define IR_PANA_ST_BIT      (3570*CYCLES_PER_US/TIMER_PRESC)    //us
  288. #define IR_PANA_ST_PAUSE    (1630*CYCLES_PER_US/TIMER_PRESC)    //us
  289. #define IR_PANA_LOW_ONE     (1240*CYCLES_PER_US/TIMER_PRESC)    //us
  290. #define IR_PANA_LOW_ZERO    (400*CYCLES_PER_US/TIMER_PRESC)     //us
  291. #define IR_PANA_HIGH        (495*CYCLES_PER_US/TIMER_PRESC)     //us
  292. #define IR_PANA_TIMEOUT     (92-IR_MAX_PULSE_WIDTH/1000)        //ms    (time between ir frames)
  293. #define IR_PANA_REPS        (1)                                 //      (minimum number of times to repeat code)
  294. #define IR_PANA_F_MOD       (38)                                //kHz   (modulation frequency)
  295. #define IR_PANA_TOL_DIV     (4)
  296.  
  297. /* Sky Implementation
  298.  * Receiver: DONE
  299.  * Transmitter:
  300.  */
  301. #define IR_SKY_ST_BIT       (2800*CYCLES_PER_US/TIMER_PRESC)    //us
  302. #define IR_SKY_SHORT        (460*CYCLES_PER_US/TIMER_PRESC)     //us
  303. #define IR_SKY_LONG         (920*CYCLES_PER_US/TIMER_PRESC)     //us
  304. #define IR_SKY_TIMEOUT      (162-IR_MAX_PULSE_WIDTH/1000)       //ms    (time between ir frames)
  305. #define IR_SKY_REPS         (1)                                 //      (minimum number of times to repeat code)
  306. #define IR_SKY_F_MOD        (38)                                //kHz   (modulation frequency)
  307. #define IR_SKY_TOL_DIV      (4)
  308.  
  309. /* iRobot Implementation
  310.  * Receiver: -
  311.  * Transmitter: DONE
  312.  */
  313. #define IR_IROBOT_ST_BIT        (2800*CYCLES_PER_US/TIMER_PRESC)        //us
  314. #define IR_IROBOT_SHORT     (1000*CYCLES_PER_US/TIMER_PRESC)        //us
  315. #define IR_IROBOT_LONG      (3000*CYCLES_PER_US/TIMER_PRESC)        //us
  316. #define IR_IROBOT_TIMEOUT       30      //ms    (time between ir frames)
  317. #define IR_IROBOT_REPS      (6)                                 //      (minimum number of times to repeat code)
  318. #define IR_IROBOT_F_MOD     (40)                                //kHz   (modulation frequency)
  319. #define IR_IROBOT_TOL_DIV       (4)
  320.  
  321.  
  322. /* Nexa2 Implementation
  323.  * Receiver: DONE
  324.  * Transmitter: DONE
  325.  */
  326. #define IR_NEXA2_START1     (10000*CYCLES_PER_US/TIMER_PRESC)   //us
  327. #define IR_NEXA2_START2     (2500*CYCLES_PER_US/TIMER_PRESC)    //us
  328. #define IR_NEXA2_HIGH       (320*CYCLES_PER_US/TIMER_PRESC)     //us
  329. #define IR_NEXA2_LOW_ONE    (210*CYCLES_PER_US/TIMER_PRESC)     //us
  330. #define IR_NEXA2_LOW_ZERO   (1200*CYCLES_PER_US/TIMER_PRESC)    //us
  331. #define IR_NEXA2_TIMEOUT    (200)                               //ms    (time between ir frames)
  332. #define IR_NEXA2_REPS       (5)                                 //      (minimum number of times to repeat code)
  333. #define IR_NEXA2_F_MOD      (38)                                //kHz   (modulation frequency)
  334. #define IR_NEXA2_TOL_DIV    (2)
  335.  
  336.  
  337. /* Nexa1 Implementation
  338.  * Receiver: DONE
  339.  * Transmitter:
  340.  */
  341. #define IR_NEXA1_START      (10000*CYCLES_PER_US/TIMER_PRESC)   //us
  342. #define IR_NEXA1_SHORT      (370*CYCLES_PER_US/TIMER_PRESC)     //us
  343. #define IR_NEXA1_LONG       (1050*CYCLES_PER_US/TIMER_PRESC)    //us
  344. #define IR_NEXA1_TIMEOUT    (200)                               //ms    (time between ir frames)
  345. #define IR_NEXA1_REPS       (4)                                 //      (minimum number of times to repeat code)
  346. #define IR_NEXA1_F_MOD      (38)                                //kHz   (modulation frequency)
  347. #define IR_NEXA1_TOL_DIV    (2)
  348.  
  349.  
  350. /* Viking Temperature sensor Implementation
  351.  * Receiver:
  352.  */
  353. #define IR_VIKING_LOW       (940*CYCLES_PER_US/TIMER_PRESC)     //us
  354. #define IR_VIKING_HIGH_ONE  (1483*CYCLES_PER_US/TIMER_PRESC)        //us
  355. #define IR_VIKING_HIGH_ZERO (550*CYCLES_PER_US/TIMER_PRESC) //us
  356. #define IR_VIKING_TIMEOUT   (0)                                 //ms BURST! (time between ir frames)
  357. #define IR_VIKING_REPS      (1)                                 //      (minimum number of times to repeat code)
  358. #define IR_VIKING_F_MOD     (38)                                //kHz   (modulation frequency)
  359. #define IR_VIKING_TOL_DIV   (3)
  360.  
  361. /* Viking Steak temperature sensor Implementation
  362.  * Receiver:
  363.  */
  364. #define IR_VIKING_STEAK_HIGH        (700*CYCLES_PER_US/TIMER_PRESC)     //us
  365. #define IR_VIKING_STEAK_LOW_ONE (4000*CYCLES_PER_US/TIMER_PRESC)        //us
  366. #define IR_VIKING_STEAK_LOW_ZERO    (1700*CYCLES_PER_US/TIMER_PRESC)    //us
  367. #define IR_VIKING_STEAK_LOW_START   (7800*CYCLES_PER_US/TIMER_PRESC)        //us
  368. #define IR_VIKING_STEAK_TIMEOUT (200)                                   //ms BURST! (time between ir frames)
  369. #define IR_VIKING_STEAK_REPS        (1)                                 //      (minimum number of times to repeat code)
  370. #define IR_VIKING_STEAK_F_MOD       (38)                                //kHz   (modulation frequency)
  371. #define IR_VIKING_STEAK_TOL_DIV (4)
  372.  
  373. /* Rubicson temperature sensor Implementation
  374.  * Receiver:
  375.  */
  376. #define IR_RUBICSON_HIGH        (550*CYCLES_PER_US/TIMER_PRESC)     //us
  377. #define IR_RUBICSON_LOW_ONE     (1880*CYCLES_PER_US/TIMER_PRESC)        //us
  378. #define IR_RUBICSON_LOW_ZERO        (900*CYCLES_PER_US/TIMER_PRESC) //us
  379. #define IR_RUBICSON_LOW_START       (3850*CYCLES_PER_US/TIMER_PRESC)        //us
  380. #define IR_RUBICSON_TIMEOUT     (200)                                   //ms BURST! (time between ir frames)
  381. #define IR_RUBICSON_REPS        (1)                                 //      (minimum number of times to repeat code)
  382. #define IR_RUBICSON_F_MOD       (38)                                //kHz   (modulation frequency)
  383. #define IR_RUBICSON_TOL_DIV     (4)
  384.  
  385. /* Oregon weather sensor Implementation
  386.  * Receiver:
  387.  */
  388. #define IR_OREGON_SHORT_S       (250*CYCLES_PER_US/TIMER_PRESC)     //us
  389. #define IR_OREGON_SHORT_L       (700*CYCLES_PER_US/TIMER_PRESC)     //us
  390. #define IR_OREGON_LONG_S        (750*CYCLES_PER_US/TIMER_PRESC)     //us
  391. #define IR_OREGON_LONG_L        (1250*CYCLES_PER_US/TIMER_PRESC)    //us
  392. #define IR_OREGON_END           (2000*CYCLES_PER_US/TIMER_PRESC)    //us
  393. #define IR_OREGON_DATASIZE      25
  394. #define IR_OREGON_TIMEOUT       (200)                               //ms BURST! (time between ir frames)
  395. #define IR_OREGON_REPS          (1)                                 //      (minimum number of times to repeat code)
  396. #define IR_OREGON_F_MOD         (38)                                //kHz   (modulation frequency)
  397.  
  398.  
  399. #define IR_PROTO_HASH       0xfe
  400. #define IR_PROTO_UNKNOWN    0xff                                //
  401.  
  402.  
  403.  
  404. /**@}*/
  405. #endif /*IR_PROTOCOLS_H_*/
  406.