Subversion Repositories HomeAutomation

Rev

Rev 601 | Rev 613 | 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.  
  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_Start(uint16_t *buffer);
  29. uint8_t IrTransceiver_Poll(void);
  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. //uint8_t IrTransceiver_Poll(uint16_t **buffer, uint8_t *length);
  36. #if 0
  37. uint8_t IrTransceiver_Transmit(uint16_t **buffer, uint8_t *length);
  38. #endif
  39. //uint8_t IrTransceiver_Transmit(uint8_t proto, uint32_t data, uint16_t *timeout, uint8_t *repeates);
  40. //void IrReceive_Init(void);
  41. //uint8_t IrReceive_CheckIR(uint8_t *proto, uint8_t *address, uint8_t *command, uint16_t *timeout);
  42. //uint8_t IrReceive_CheckIR(uint8_t *proto, uint32_t *data, uint16_t *timeout);
  43.  
  44. /*uint8_t IrReceive_CheckIdle(void);
  45. uint16_t getRawData(uint8_t index);
  46. uint8_t getRawDataCnt(void);
  47. */
  48. /*-----------------------------------------------------------------------------
  49.  * Private Function Prototypes
  50.  *---------------------------------------------------------------------------*/
  51.  
  52.  
  53. #endif /*IRTRANSCEIVER_H_*/
  54.