#ifndef IRDRIVER_H
#define IRDRIVER_H

/** Timer ticks per microsecond. */
#define  TICKS_PER_uS    5

/** DMA channel to use */
#define  IR_DMACHANNEL   1

/** Length of DMA buffer for raw timer samples */
#define  IR_DMA_LEN      512

/** Length of queue for timer samples */
#define  IR_QUEUE_LEN    4096

/**
 * The treshold value is used to cleanup the timer samples. If two
 * samples have a distance less than RC_TRESHOLD microseconds, they
 * get discarded. Note that this length must be shorter, than the
 * shortest signal length you want to measure.
 *
 * \sa timerHandler()
 */
#define  IR_TRESHOLD   10

extern int   IR_GetSamples(unsigned *dest, int maxlen);
extern int   IR_NumSamples();
extern void  IR_Init();
extern void  IR_Done();

#endif