main.c File Reference

#include "t89c51cc02.h"
#include "datatypes.h"
#include "adc.h"
#include "can.h"
#include "timer.h"
#include "sharp.h"
#include "fingersensors.h"
#include "photosensor.h"
#include "bumper.h"
#include "command.h"
#include "eeprom.h"

Go to the source code of this file.

Defines

#define DEBUG   1
#define LENGTH_SENSORBUFFER   128
#define SAMPLEPOINTS   18
#define BUFFER_LENGTH   6 * SAMPLEPOINTS
#define SERIALNUMBER   0x01

Functions

void main ()

Variables

const char version [] = "Sensor Control 07092007 #1"
WORD xdata sensorbuffer [BUFFER_LENGTH]
 circular buffer for sensor readings


Detailed Description

Definition in file main.c.


Define Documentation

#define BUFFER_LENGTH   6 * SAMPLEPOINTS
 

size of sensor backbuffer in WORDS

Definition at line 34 of file main.c.

Referenced by main().

#define DEBUG   1
 

Debug flag - enables additional debug output via CAN

Definition at line 24 of file main.c.

#define LENGTH_SENSORBUFFER   128
 

Maximum size of the external data memory in 16Bit Words

Definition at line 27 of file main.c.

#define SAMPLEPOINTS   18
 

combined number of samples taken per measurement point

Definition at line 31 of file main.c.

Referenced by main().

#define SERIALNUMBER   0x01
 

main serial number of the firmware

Definition at line 37 of file main.c.

Referenced by main().


Function Documentation

void main  ) 
 

Initializes all sensor subsystems and implements the main sensor reading cycle.

Definition at line 53 of file main.c.

References ADC_init(), BUFFER_LENGTH, Bumper_init(), Bumper_read(), BUMPERSENSORS_NR, can_data, CAN_enablechannel, CAN_init(), CAN_SendMsg(), CAN_setchannel, CH_DISABLE, CH_TxENA, CheckMonitor(), Command_ReadDefaultConfiguration(), Command_ReportDue(), Command_TimecheckEnable, fingersensors, Fingersensors_init(), FINGERSENSORS_NR, Fingersensors_read(), measurement_task, Photosensor_init(), Photosensor_PowerOff, Photosensor_read(), read_eeprom_config, readenable, reporting, SAMPLEPOINTS, sensorbuffer, SERIALNUMBER, Sharp_init(), Sharp_PowerOff, Sharp_PowerOn, Sharp_read(), and Timer_init().


Variable Documentation

WORD xdata sensorbuffer[BUFFER_LENGTH]
 

circular buffer for sensor readings

We store all sequential sensor readings into this buffer.
The buffer resides in XRAM space of the T89C51CC02 ("Externer Datenspeicher")

Definition at line 48 of file main.c.

Referenced by main().

const char version[] = "Sensor Control 07092007 #1"
 

the version number encodes the current date in DDMMYYYY form and a revision number

Definition at line 40 of file main.c.


Generated on Wed Oct 24 12:57:24 2007 for SensorControl by  doxygen 1.4.6