Subversion Repositories HomeAutomation

Rev

Rev 552 | Rev 610 | Go to most recent revision | 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 IR_R_PORT   PORTB
  14. #define IR_R_PIN    PINB
  15. #define IR_R_DDR    DDRB
  16. #define IR_R_BIT    PB0 // Input Capture Pin
  17.  
  18. #define IR_T_PORT   PORTD
  19. #define IR_T_PIN    PIND
  20. #define IR_T_DDR    DDRD
  21. #define IR_T_BIT    PD6
  22.  
  23. #define MAX_NR_TIMES        101                                 //max ir pulses+pauses, used for dimensioning the buffer
  24.  
  25. /*-----------------------------------------------------------------------------
  26.  * Public Function Prototypes
  27.  *---------------------------------------------------------------------------*/
  28. void IrTransceiver_Init(void);
  29. void IrTransceiver_Start(void);
  30. uint8_t IrTransceiver_Poll(uint16_t **buffer, uint8_t *length);
  31. #if 0
  32. uint8_t IrTransceiver_Transmit(uint16_t **buffer, uint8_t *length);
  33. #endif
  34. uint8_t IrTransceiver_Transmit(uint8_t proto, uint32_t data, uint16_t *timeout, uint8_t *repeates);
  35. uint8_t IrTransceiver_Transmit_Poll(void);
  36. void IrReceive_Init(void);
  37. //uint8_t IrReceive_CheckIR(uint8_t *proto, uint8_t *address, uint8_t *command, uint16_t *timeout);
  38. uint8_t IrReceive_CheckIR(uint8_t *proto, uint32_t *data, uint16_t *timeout);
  39. uint8_t IrReceive_CheckIdle(void);
  40. uint16_t getRawData(uint8_t index);
  41. uint8_t getRawDataCnt(void);
  42.  
  43. /*-----------------------------------------------------------------------------
  44.  * Private Function Prototypes
  45.  *---------------------------------------------------------------------------*/
  46.  
  47.  
  48. #endif /*IRTRANSCEIVER_H_*/
  49.