Subversion Repositories HomeAutomation

Rev

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

  1. /**
  2.  * @defgroup infrared IR Driver Library
  3.  * @code #include <drivers/ir/transceiver/transceiver.h> @endcode
  4.  *
  5.  * @brief  
  6.  *
  7.  *
  8.  * @author  Andreas Fritiofson, Anders Runeson
  9.  * @date    2007
  10.  */
  11.  
  12. /**@{*/
  13.  
  14. #ifndef IRTRANSCEIVER_H_
  15. #define IRTRANSCEIVER_H_
  16.  
  17. /*-----------------------------------------------------------------------------
  18.  * Includes
  19.  *---------------------------------------------------------------------------*/
  20. #include <stdio.h>
  21.  
  22. /*-----------------------------------------------------------------------------
  23.  * Defines
  24.  *---------------------------------------------------------------------------*/
  25.  
  26. //#define MAX_NR_TIMES      101                                 //max ir pulses+pauses, used for dimensioning the buffer
  27. #define MAX_NR_TIMES        81
  28.  
  29. #define TRUE 1
  30. #define FALSE 0
  31.  
  32. #ifndef IR_RX_ACTIVE_LOW
  33. #define IR_RX_ACTIVE_LOW    1
  34. #endif
  35.  
  36. #ifndef IR_TX_ACTIVE_LOW
  37. #define IR_TX_ACTIVE_LOW    0
  38. #endif
  39.  
  40. #ifndef IR_TX_ENABLE
  41. #define IR_TX_ENABLE    0
  42. #endif
  43.  
  44. #ifndef IR_RX_ENABLE
  45. #define IR_RX_ENABLE    0
  46. #endif
  47.  
  48. #ifndef IR_SUPPORTED_NUM_CHANNELS
  49. #define IR_SUPPORTED_NUM_CHANNELS 3
  50. #endif
  51.  
  52.  
  53. /*-----------------------------------------------------------------------------
  54.  * Public Function Prototypes
  55.  *---------------------------------------------------------------------------*/
  56. void IrTransceiver_Transmit(uint8_t channel, uint16_t *buffer, uint8_t length);
  57.  
  58. void IrTransceiver_Init(void);
  59. uint8_t IrTransceiver_GetStoreEnableRx(uint8_t channel);
  60. void IrTransceiver_DisableRx(uint8_t channel);
  61. void IrTransceiver_EnableRx(uint8_t channel);
  62. void IrTransceiver_ResetRx(uint8_t channel);
  63.  
  64. //void IrTransceiver_Init_RX_Channel(uint8_t channel, uint16_t *buffer, irCallback_t callback, uint8_t pcint_id, volatile uint8_t* port, volatile uint8_t* pin, volatile uint8_t* ddr,uint8_t nr, uint8_t pcint);
  65.  
  66. /**
  67.  * @brief Type of the callback function pointer
  68.  * parameters: channel, buffer, length
  69.  */
  70. typedef void (*irRxCallback_t)(uint8_t, uint16_t*, uint8_t);
  71. typedef void (*irTxCallback_t)(uint8_t);
  72.  
  73.  
  74. /*-----------------------------------------------------------------------------
  75.  * Private Function Prototypes
  76.  *---------------------------------------------------------------------------*/
  77.  
  78. void IrTransceiver_Store(uint8_t channel);
  79.  
  80. #endif /*IRTRANSCEIVER_H_*/
  81.