Subversion Repositories HomeAutomation

Rev

Rev 547 | 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. #include <drivers/ir/ircommon.h>
  9.  
  10. /*-----------------------------------------------------------------------------
  11.  * Defines
  12.  *---------------------------------------------------------------------------*/
  13. #define IRPORT  PORTB
  14. #define IRPIN   PINB
  15. #define IRDDR   DDRB
  16. #define IRBIT   PB0 // Input Capture Pin
  17.  
  18. #define MAX_NR_TIMES        101                                 //max ir pulses+pauses, used for dimensioning the buffer
  19.  
  20. /*-----------------------------------------------------------------------------
  21.  * Public Function Prototypes
  22.  *---------------------------------------------------------------------------*/
  23. void IrTransceiver_Init(void);
  24. void IrTransceiver_Start(void);
  25. uint8_t IrTransceiver_Poll(uint16_t **buffer, uint8_t *length);
  26. void IrReceive_Init(void);
  27. uint8_t IrReceive_CheckIR(uint8_t *proto, uint8_t *address, uint8_t *command, uint16_t *timeout);
  28. uint8_t IrReceive_CheckIdle(void);
  29. uint16_t getRawData(uint8_t index);
  30. uint8_t getRawDataCnt(void);
  31.  
  32. /*-----------------------------------------------------------------------------
  33.  * Private Function Prototypes
  34.  *---------------------------------------------------------------------------*/
  35. uint8_t receiveRC5(uint8_t *address, uint8_t *command);
  36. uint8_t receiveSIRC(uint8_t *address, uint8_t *command);
  37.  
  38.  
  39. #endif /*IRTRANSCEIVER_H_*/
  40.