/*
 * irdecode.h
 *
 *  Created on: 2014-5-2
 *      Author: twd2
 */



#ifndef IRDECODE_H_
#define IRDECODE_H_

#include <msp430.h>
#include "utils.h"

#define IR_PORT_DIR P1DIR
#define IR_BIT BIT5
#define IR_IN (IR_PORT_DIR &= ~IR_BIT)
#define IR_DATA ((P1IN & IR_BIT)==IR_BIT)

void irdecode_init();
unsigned char irdecode_readhead();
int irdecode_read(unsigned char *, unsigned int);
short irdecode_readbyte();

#endif /* IRDECODE_H_ */
