#include "asuro.h"
Go to the source code of this file.
private variables to the ISR | |
| char | AS_ir_lastsample = 0 |
| last read sample | |
| unsigned char | AS_ir_bittimer = 0 |
| call counter for AS_isr_irrc5() | |
| unsigned short | AS_ir_data_tmp = 0 |
| RC5 bit stream. | |
| char | AS_ir_bitcount = 0 |
| number of read bits | |
Defines | |
| #define | AS_IR_SAMPLES_PER_BIT 8 |
| 8 samples per bit | |
| #define | AS_IR_SAMPLES_PER_BIT_EARLY 6 |
| edge not before the 6th sample | |
| #define | AS_IR_SAMPLES_PER_BIT_LATE 10 |
| edge after 10 samples at the latest | |
| #define | AS_IR_PAUSE_SAMPLES 200 |
| The start bit is only valid after 200 samples with unchanged edge. | |
| #define | AS_IR_PORT PORTD |
| port D | |
| #define | AS_IR_DDR DDRD |
| IO direction port D. | |
| #define | AS_IR_PINR PIND |
| input port D | |
| #define | AS_IR_PIN PD0 |
| IO pin on port D. | |
Functions | |
| void | AS_isr_irrc5 (void) |
| Read the last IR-RC5 code received. | |
| unsigned short | AS_Irrc5Read (void) |
| Read the last RC5 code that was successfully received. | |
Variables | |
| volatile unsigned short | AS_ir_data = 0 |
| last completely read RC5 packet | |
Based on the c't-Bot version created by Benjamin Benz (bbe@heise.de).
Definition in file asuro_avr_irrc5.c.
|
|
The start bit is only valid after 200 samples with unchanged edge. According to Benz, this should be 50x1.778ms, but since we have an 8-bit counter for the samples, we are satisfied with about the half of it. Definition at line 31 of file asuro_avr_irrc5.c. Referenced by AS_isr_irrc5(). |
|
|
Read the last RC5 code that was successfully received. This will flush the input, thus subsequent calls will return 0 or a new value.
Definition at line 121 of file asuro_avr_irrc5.c. References AS_ir_data. |
|
|
Read the last IR-RC5 code received. called about every 222.2us Definition at line 53 of file asuro_avr_irrc5.c. References AS_ir_bitcount, AS_ir_bittimer, AS_ir_data, AS_ir_data_tmp, AS_ir_lastsample, AS_IR_PAUSE_SAMPLES, AS_IR_SAMPLES_PER_BIT_EARLY, AS_IR_SAMPLES_PER_BIT_LATE, and AS_IRRX_SAMPLE. Referenced by SIGNAL(). |
1.4.6