Elisa3
irCommunication.c File Reference
#include "irCommunication.h"

Functions

void irCommInitTransmitter ()
 Initialize the IR communication state machine in transmission mode (used internally).
void irCommInitReceiver ()
 Initialize the IR communication state machine in reception mode (used internally).
void irCommInitVars ()
void irCommInit ()
 Initialize the IR communication; need to be called only once.
void irCommDeinit ()
 Stop the IR communication, only sensors sampling for obstacle and cliff avoidance is enabled.
void resetDebugVariables ()
void irCommTasks ()
 Handle the internal state machine of the IR communication. Need to be called repeatedly from the main loop.
void irCommSendData (unsigned char value)
 Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.
unsigned char irCommDataSent ()
 Tell whether the last transmission is terminated or not.
unsigned char irCommDataAvailable ()
 Tell whether incoming data are received or not.
unsigned char irCommReadData ()
 Get the last byte received through IR.
signed char irCommReceivingSensor ()
 Get the last sensor id that receives the message.
signed int getBearing (unsigned char sensor)
 Get the direction of the sensor that receives the last message.

Function Documentation

signed int getBearing ( unsigned char  sensor)

Get the direction of the sensor that receives the last message.

Returns:
the angle of the sensor (-180..180)
unsigned char irCommDataAvailable ( )

Tell whether incoming data are received or not.

Returns:
1 if one byte is received, 0 otherwise
unsigned char irCommDataSent ( )

Tell whether the last transmission is terminated or not.

Returns:
1 if the last byte is sent, 0 otherwise
void irCommDeinit ( )

Stop the IR communication, only sensors sampling for obstacle and cliff avoidance is enabled.

Returns:
none
void irCommInit ( )

Initialize the IR communication; need to be called only once.

Returns:
none

Initialize the IR communication state machine in reception mode (used internally).

Returns:
none

Initialize the IR communication state machine in transmission mode (used internally).

Returns:
none
void irCommInitVars ( )
unsigned char irCommReadData ( )

Get the last byte received through IR.

Returns:
the value of the byte received
signed char irCommReceivingSensor ( )

Get the last sensor id that receives the message.

Returns:
the sensor id (0..7); 0 is the front sensor, sensors id increases clockwise
void irCommSendData ( unsigned char  value)

Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.

Parameters:
value,:byte to be sent; sensor: sensor id mask (bit 0 corresponds to sensor 0 in front of robot, id increases clockwise).
Returns:
none Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.
Parameters:
value,:byte to be sent; sensor.
Returns:
none
void irCommTasks ( )

Handle the internal state machine of the IR communication. Need to be called repeatedly from the main loop.

Returns:
none
 All Files Functions Variables Defines