Subversion Repositories HomeAutomation

Rev

Rev 613 | 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. #define IR_R_PORT   PORTB
  26. #define IR_R_PIN    PINB
  27. #define IR_R_DDR    DDRB
  28. #define IR_R_BIT    PB0 // Input Capture Pin
  29.  
  30. #define IR_T_PORT   PORTD
  31. #define IR_T_PIN    PIND
  32. #define IR_T_DDR    DDRD
  33. #define IR_T_BIT    PD6
  34.  
  35. #define MAX_NR_TIMES        101                                 //max ir pulses+pauses, used for dimensioning the buffer
  36.  
  37. /*-----------------------------------------------------------------------------
  38.  * Public Function Prototypes
  39.  *---------------------------------------------------------------------------*/
  40. void IrTransceiver_Init(void);
  41. void IrTransceiver_Receive_Start(uint16_t *buffer);
  42. uint8_t IrTransceiver_Receive_Poll(uint8_t *len);
  43. uint8_t IrTransceiver_Transmit(uint16_t *buffer, uint8_t length, uint8_t modfreq);
  44. uint8_t IrTransceiver_Transmit_Poll(void);
  45.  
  46.  
  47. /*-----------------------------------------------------------------------------
  48.  * Private Function Prototypes
  49.  *---------------------------------------------------------------------------*/
  50.  
  51.  
  52. #endif /*IRTRANSCEIVER_H_*/
  53.