Elisa3
utility.h File Reference

Utility module. More...

#include "variables.h"
#include <avr\io.h>
#include <avr\interrupt.h>
#include <avr\sleep.h>
#include <avr\eeprom.h>
#include "ports_io.h"
#include "adc.h"
#include "motors.h"
#include "leds.h"
#include "spi.h"
#include "mirf.h"
#include "usart.h"
#include "sensors.h"
#include "ir_remote_control.h"
#include "eepromIO.h"

Go to the source code of this file.

Functions

unsigned char getSelector ()
 Return the current selector postion.
void initPeripherals ()
 Initialize all the port pins and peripherals calling their "init" functions.
void sleep (unsigned char seconds)
 Let the roboot go in extended standby mode.
unsigned long int getTime100MicroSec ()
 A global variable "clockTick" is incremented at each adc interrupt; this variable is used as base time (104 us resolution). This function is useful for instance to create non-blocking delays, calling the function at start of delay and then re-calling it to check when the desired delay is passed.
void readBatteryLevel ()
 Simply set the flag that indicates when the battery has to be read.
void resetOdometry ()

Detailed Description

Utility module.

Author:
Stefano Morgani <stefano@gctronic.com>
Version:
1.0
Date:
01.02.12

The module contains various functions that aren't related to any other module, they are instead of general use.


Function Documentation

unsigned char getSelector ( )

Return the current selector postion.

Returns:
byte representing the selector postion (0..15).
unsigned long int getTime100MicroSec ( )

A global variable "clockTick" is incremented at each adc interrupt; this variable is used as base time (104 us resolution). This function is useful for instance to create non-blocking delays, calling the function at start of delay and then re-calling it to check when the desired delay is passed.

Returns:
the current clock ticks since the start
void initPeripherals ( )

Initialize all the port pins and peripherals calling their "init" functions.

Returns:
none
void readBatteryLevel ( )

Simply set the flag that indicates when the battery has to be read.

Returns:
none
void resetOdometry ( )
void sleep ( unsigned char  seconds)

Let the roboot go in extended standby mode.

Parameters:
secondsnumber of seconds to stay in sleep
Returns:
none
 All Files Functions Variables Defines