#include <avr/io.h>
#include "basic.h"
Go to the source code of this file.
Defines | |
#define | IRMLENGTH 20 /*!< maximum pulse length in bytes */ |
#define | IRMSLENGTH 30 /*!< maximum string length in bytes */ |
#define | IRDATABITTIME 12 /*!< bit time in 36kHz cycles for data transmiting */ |
#define | IRDATABYTETIME 128 /*!< time to wait while a byte is transmitted */ |
#define | IRKEYS 4 /*!< number of recognized keys <=5 */ |
#define | ISIRON ((PIND & _BV(PD4))==0) /*!< 1: ir-on, 0: ir-off */ |
#define | WAITIR {sei(); while (sendready == 0) _NOP; cli(); } while (0) |
Typedefs | |
typedef u08 | irdatatype [IRMLENGTH] |
type to store the information from IR | |
Functions | |
void | ir_send (u08 *irbuf_) |
sends one pulse of ir ("<length>blablabla") | |
void | ir_string_send (u08 *se) |
sends a string of ir-datas ( "blablabla\0") | |
u08 | ir_comp (irdatatype cmp_target, irdatatype read_ir) |
Compares two IR pulses. | |
u08 | ir_to_val (irdatatype data) |
Converts and returns an ir-impuls as value. | |
u08 * | val_to_ir (u08 dat) |
Converts a byte-value to an ir-impuls stored in irdata. | |
void | do_ir () |
handles the lowlevel tranmission and receiving | |
void | start_ir_r () |
starts the receiving of a pulse | |
void | do_ir_string () |
handles string sending | |
Variables | |
u08 | irerror |
error code of last ir pulse conversation | |
u08 | irbittime |
length of one bit in 36kHz cycles | |
irdatatype | cmp_target [IRKEYS] |
datas read from eeprom for ircont (ir_load()) | |
volatile irdatatype | irrbuf |
received single ir-pulse ("<length>blablabla") | |
volatile u08 | irrstring [IRMSLENGTH] |
received string. ("<length>blablabla") | |
volatile u08 | pulsevalid |
pointer to the data to send | |
volatile u08 | stringvalid |
Is set 1 if a valid string is received. Set it to 0 if computated. But also reset irrstring[0]! | |
volatile u08 | sendready |
This variable is used to wait for the IR-String send routines. It's used in WAITIR. | |
volatile u08 * | senddata |
pointer to the data to send just for the INT-function |
Definition in file ir.h.
|
bit time in 36kHz cycles for data transmiting |
|
time to wait while a byte is transmitted Definition at line 21 of file ir.h. Referenced by do_ir_string(). |
|
number of recognized keys <=5 |
|
maximum pulse length in bytes Definition at line 15 of file ir.h. Referenced by do_ir(), and start_ir_r(). |
|
maximum string length in bytes Definition at line 17 of file ir.h. Referenced by do_ir(). |
|
1: ir-on, 0: ir-off |
|
type to store the information from IR The bits are written/read from left to right. A '0' means signal 'off' a '1' means 'on'. The timing is determined by irbittime and the 36kHz clock from modulation. The first byte is the length of the string (including it self). So the string "04 aa 00 aa ff" wouldn't send the last FF! Definition at line 35 of file ir.h. Referenced by ir_comp(), ir_to_val(), and val_to_ir(). |
|
handles the lowlevel tranmission and receiving The results of receiving are stored in irbuf and irstring. The values pulsevalid and stringvalid return if any data was received. Definition at line 75 of file ir.c. Referenced by SIGNAL(). |
|
Compares two IR pulses. This is used for ircont. The bigger the result the narrower the pulses.
|
|
sends one pulse of ir ("<length>blablabla") This will last (irbuf_[0] * irbittime /36000) while nothing else will be computated. The data is given in irbuf_ < send an ir pulse Definition at line 119 of file ir.c. Referenced by do_ir_string(). |
|
starts the receiving of a pulse This will last maximum (irlength * irbittime / 36000) while nothing else will be computated. The result will be writte to irbuf Definition at line 130 of file ir.c. Referenced by SIGNAL(). |