Subversion Repositories HomeAutomation

Rev

Rev 521 | Blame | Last modification | View Log | SVN | RSS feed

  1. #ifndef IRCOMMON_H_
  2. #define IRCOMMON_H_
  3.  
  4. /*-----------------------------------------------------------------------------
  5.  * Includes
  6.  *---------------------------------------------------------------------------*/
  7. #include <stdio.h>
  8.  
  9. /*-----------------------------------------------------------------------------
  10.  * Defines
  11.  *---------------------------------------------------------------------------*/
  12. #define IR_OK               1
  13. #define IR_FAILED           -1  //?
  14. #define IR_NO_PROTOCOL      2
  15. #define IR_TIME_OVFL        3
  16. #define IR_NO_DATA          4
  17. #define IR_NOT_CORRECT_DATA 5
  18.  
  19. #define CYCLES_PER_US       (F_CPU/1000000)
  20.  
  21. #define IR_PROTO_RC5        0
  22. #define IR_RC5_ST_BIT       864*CYCLES_PER_US       //us
  23. #define IR_RC5_BIT          864*2*CYCLES_PER_US
  24. #define IR_RC5_REPETITION   105                     //ms    (time between pulsetrains)
  25. #define IR_RC5_F_MOD        36                      //kHz   (modulation frequency)
  26.  
  27. #define IR_PROTO_RC6        1
  28. #define IR_RC6_ST_BIT       1*CYCLES_PER_US         //us
  29. #define IR_RC6_REPETITION   1                       //ms    (time between pulsetrains)
  30. #define IR_RC6_F_MOD        36                      //kHz   (modulation frequency)
  31.  
  32. #define IR_PROTO_RCMM       2                               //Wont work together with SHARP
  33. #define IR_RCMM_ST_BIT      256*CYCLES_PER_US       //us
  34. #define IR_RCMM_REPETITION 158                      //ms    (time between pulsetrains)
  35. #define IR_RCMM_F_MOD       36                      //kHz   (modulation frequency)
  36.  
  37. #define IR_PROTO_SIRC       3
  38. #define IR_SIRC_ST_BIT      2400*CYCLES_PER_US      //us
  39. #define IR_SIRC_REPETITION  40                      //ms    (time between pulsetrains)
  40. #define IR_SIRC_F_MOD       40                      //kHz   (modulation frequency)
  41. #define IR_SIRC_ZERO_LOW    450*CYCLES_PER_US       //us
  42. #define IR_SIRC_ZERO_HIGH   750*CYCLES_PER_US       //us
  43. #define IR_SIRC_ONE_LOW     1050*CYCLES_PER_US      //us
  44. #define IR_SIRC_ONE_HIGH    1350*CYCLES_PER_US      //us
  45.  
  46. #define IR_PROTO_SHARP      4                               //Wont work together with RCMM
  47. #define IR_SHARP_ST_BIT     275*CYCLES_PER_US       //us
  48. #define IR_SHARP_REPETITION 55                      //ms    (time between pulsetrains)
  49. #define IR_SHARP_F_MOD      38                      //kHz   (modulation frequency)
  50.  
  51.  
  52.  
  53. #endif /*IRCOMMON_H_*/
  54.