Subversion Repositories HomeAutomation

Rev

Rev 613 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. #ifndef IRTRANSCEIVER_H_
  2. #define IRTRANSCEIVER_H_
  3.  
  4. /*-----------------------------------------------------------------------------
  5.  * Includes
  6.  *---------------------------------------------------------------------------*/
  7. #include <stdio.h>
  8.  
  9. /*-----------------------------------------------------------------------------
  10.  * Defines
  11.  *---------------------------------------------------------------------------*/
  12. #define IR_R_PORT   PORTB
  13. #define IR_R_PIN    PINB
  14. #define IR_R_DDR    DDRB
  15. #define IR_R_BIT    PB0 // Input Capture Pin
  16.  
  17. #define IR_T_PORT   PORTD
  18. #define IR_T_PIN    PIND
  19. #define IR_T_DDR    DDRD
  20. #define IR_T_BIT    PD6
  21.  
  22. #define MAX_NR_TIMES        101                                 //max ir pulses+pauses, used for dimensioning the buffer
  23.  
  24. /*-----------------------------------------------------------------------------
  25.  * Public Function Prototypes
  26.  *---------------------------------------------------------------------------*/
  27. void IrTransceiver_Init(void);
  28. void IrTransceiver_Receive_Start(uint16_t *buffer);
  29. uint8_t IrTransceiver_Receive_Poll(uint8_t *len);
  30. uint8_t IrTransceiver_Transmit(uint16_t *buffer, uint8_t length, uint8_t modfreq);
  31. uint8_t IrTransceiver_Transmit_Poll(void);
  32.  
  33.  
  34. /*-----------------------------------------------------------------------------
  35.  * Private Function Prototypes
  36.  *---------------------------------------------------------------------------*/
  37.  
  38.  
  39. #endif /*IRTRANSCEIVER_H_*/
  40.