#include "main.h"
#include "stm32f4xx_hal_tim.h"


/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __RC5_IR_EMUL_RECEIVER_H
#define __RC5_IR_EMUL_RECEIVER_H

typedef enum { NO = 0, YES = !NO} StatusYesOrNo;

/* RC5 frame structure*/
typedef struct
{
  __IO uint8_t ToggleBit;  /* Toggle bit field */
  __IO uint8_t Address;    /* Address field */ 
  __IO uint8_t Command;    /* Command field */ 
} RC5Frame_TypeDef;

extern StatusYesOrNo RC5_FrameReceived;
extern RC5Frame_TypeDef RC5_Frame;


/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void RC5_Receiver_Init(void);
void RC5_Sample_Data(void);
void RC5_MeasureFirstLowDuration(void);
void RC5_CGI(char *Command);
	
RC5Frame_TypeDef RC5_Decode(void);

#endif /* __RC5_IR_EMUL_RECEIVER_H */

