Elisa3
e_remote_control.h File Reference

Manage the LEDs with blinking possibility (timer2). More...

#include <avr\io.h>
#include <avr\interrupt.h>
#include "variables.h"

Go to the source code of this file.

Defines

#define REMOTE   (PINJ & _BV(PJ6))>>6
#define BOTTOMR   10
#define BOTTOMl   11
#define STANDBY   12
#define MUTE   13
#define VOL_UP   16
#define VOL_DOWN   17
#define CHAN_UP   32
#define CHAN_DOWN   33
#define I_II   35
#define OUT_AUX_1   56

Functions

void e_init_remote_control (void)
 Initialise the IR receiver ports.
void e_read_remote_control (void)
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.

Detailed Description

Manage the LEDs with blinking possibility (timer2).

Manage the IR receiver module (timer2)

Here we use the agenda solution to make the LED blinking.

A little exemple for LEDs blinking with agenda (all LEDs blink with 100ms delay)

 #include <p30f6014A.h>
 #include <motor_led/e_epuck_ports.h>
 #include <motor_led/e_init_port.h>
 #include <motor_led/advance_one_timer/e_led.h>
 #include <motor_led/advance_one_timer/e_agenda.h>
 
 int main(void)
 {
        e_init_port();
        e_activate_agenda(e_blink_led, 1000); //blink with 100ms
        e_start_agendas_processing();
        while(1) {}
 }
See also:
e_agenda.h
Author:
Code: Valentin Longchamp
Doc: Jonathan Besuchet

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

A little 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:
Jonathan Besuchet

Define Documentation

#define BOTTOMl   11
#define BOTTOMR   10
#define CHAN_DOWN   33
#define CHAN_UP   32
#define I_II   35
#define MUTE   13
#define OUT_AUX_1   56
#define REMOTE   (PINJ & _BV(PJ6))>>6
#define STANDBY   12
#define VOL_DOWN   17
#define VOL_UP   16

Function Documentation

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  )
 All Data Structures Files Functions Variables Typedefs Defines