e_remote_control.c File Reference

Manage the IR receiver module (timer2). More...

#include "e_remote_control.h"
#include "../e_epuck_ports.h"
#include "e_agenda.h"
#include "e_led.h"

Functions

void e_init_remote_control (void)
 Initialise the IR receiver ports.
void __attribute__ ((__interrupt__, auto_psv))
void e_read_remote_control (void)
 Read the signal and stock the information.
unsigned char e_get_check (void)
 Read the check bit.
unsigned char e_get_address (void)
 Read the adress of the commande.
unsigned char e_get_data (void)
 Read the data of the command.

Variables

static unsigned char address_temp = 0
static unsigned char data_temp = 0
static unsigned char check_temp = 0
static unsigned char address = 0
static unsigned char data = 0
static unsigned char check = 2


Detailed Description

Manage the IR receiver module (timer2).

This module manage the IR receiver with the agenda solution (timer2).

Alittle exemple to manage the IR remote (the body LED change his state when you press a button of the IR controller).

 #include <p30f6014A.h>
 #include <motor_led/e_epuck_ports.h>
 #include <motor_led/e_init_port.h>
 #include <motor_led/advance_one_timer/e_remote_control.h>
 #include <motor_led/advance_one_timer/e_agenda.h>
 
 int main(void)
 {
        int ir_check;
        int previous_check = 0;
        e_init_port();
        e_init_remote_control();
        e_start_agendas_processing();
        while(1)
        {
                ir_check = e_get_check();
                if(ir_check != previous_check)
                        BODY_LED = BODY_LED^1;
                previous_check = ir_check;
        }
 }
See also:
e_agenda.h
Author:
Code: Francesco Mondada, Lucas Meier
Doc: Jonathan Besuchet

Function Documentation

void __attribute__ ( (__interrupt__, auto_psv)   ) 

unsigned char e_get_address ( void   ) 

Read the adress of the commande.

Returns:
adress adress part of the signal

unsigned char e_get_check ( void   ) 

Read the check bit.

Returns:
check check bit of the signal

unsigned char e_get_data ( void   ) 

Read the data of the command.

Returns:
data data part of the signal

void e_init_remote_control ( void   ) 

Initialise the IR receiver ports.

void e_read_remote_control ( void   ) 

Read the signal and stock the information.


Variable Documentation

unsigned char address = 0 [static]

unsigned char address_temp = 0 [static]

unsigned char check = 2 [static]

unsigned char check_temp = 0 [static]

unsigned char data = 0 [static]

unsigned char data_temp = 0 [static]


Generated on Fri Feb 29 14:26:54 2008 for e-puck by  doxygen 1.5.4