Subversion Repositories HomeAutomation

Rev

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