Main Page | File List | Globals

ir.h

Go to the documentation of this file.
00001 //
00002 // C Interface: stationir
00003 //
00004 // Description:
00005 //
00006 //
00007 // Author: Leonhard Klein <leoklein@gmx.net>, (C) 2004
00008 #ifndef __STATIONIR_H__
00009 #define __STATIONIR_H__
00010 
00011 #include <avr/io.h>
00012 #include "basic.h"
00013 
00014 
00015 #define IRMLENGTH 20                     
00016 #define IRMSLENGTH 30                    
00017 #define IRDATABITTIME 12                 
00018 #define IRDATABYTETIME 128               
00019 #define IRKEYS 4                         
00021 #ifdef TEST
00022   #define ISIRON (1)
00023   #define WAITIR
00024 #else
00025   #define ISIRON ((PIND & _BV(PD4))==0)    
00026   #define WAITIR {sei(); while (sendready == 0) _NOP; cli(); } while (0)
00027 #endif
00028 
00029 typedef u08 irdatatype[IRMLENGTH];
00030 
00031 u08 irerror;                             
00032 u08 irbittime;                           
00033 
00034 irdatatype cmp_target[IRKEYS];           
00035 
00036 extern volatile irdatatype irrbuf;       
00037 extern volatile u08 irrstring[IRMSLENGTH];
00038 extern volatile u08 pulsevalid;
00039 extern volatile u08 stringvalid;
00040 extern volatile u08 sendready;
00041 extern void ir_send(u08 *irbuf_);        
00042 extern void ir_string_send(u08 *se);     
00043 
00044 extern u08 ir_comp(irdatatype cmp_target, irdatatype read_ir);
00045 #ifdef STATION
00046 extern void ir_and(irdatatype res, irdatatype and2);
00047 #endif
00048 
00049 /* don't use in do_*' s */
00050 extern volatile u08 *senddata;           
00051 extern u08 ir_to_val(irdatatype data);
00052 extern u08 *val_to_ir(u08 dat);
00053 extern void do_ir();                     
00054 extern void start_ir_r();                
00055 extern void do_ir_string();              
00056 
00057 #endif

Generated on Wed Feb 2 20:03:50 2005 for Robot by doxygen 1.3.6