Subversion Repositories HomeAutomation

Rev

Details | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
121 johboh 1
/*********************************************************************
2
 *
3
 *                  IR Reciver header file
4
 *
5
 *********************************************************************
6
 * FileName:        $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canIR/Include/IRec.h $
7
 * Last changed:    $LastChangedDate: 2006-11-18 22:14:33 +0100 (Sat, 18 Nov 2006) $
8
 * By:              $LastChangedBy: johboh $
9
 * Revision:        $Revision: 124 $
10
 ********************************************************************/
11
 
12
#ifndef IREC_H
13
#define IREC_H
14
 
15
#include <p18cxxx.h>
122 johboh 16
#include <stackTasks.h>
17
#include <compiler.h>
18
#include <typedefs.h>
121 johboh 19
 
122 johboh 20
typedef enum {IR_NONE=0,IR_RC5=1,IR_RC5X=2,IR_RC6=3} IR_TYPE;
121 johboh 21
 
124 johboh 22
#define t1  534 //   444uS at prescale 1:8 at 10MHz
23
#define t2 1069 //   889uS at prescale 1:8 at 10MHz
24
#define t3 1638 //  1333uS at prescale 1:8 at 10MHz
25
#define t4 2185 //  1778uS at prescale 1:8 at 10MHz
26
#define t6 3204 //  2664uS at prescale 1:8 at 10MHz
121 johboh 27
 
122 johboh 28
// T3 overflow = 65536 * 1/10Mhz*8 = 0,0524288 = 52ms
29
 
30
void irecInit(void);
31
void irecISR(void);
32
void irecParse(IR_TYPE type, BYTE toggle, BYTE addr, BYTE data);
33
 
34
 
35
 
121 johboh 36
#endif //IREC_H
122 johboh 37