#include "t89c51cc02.h"
#include "datatypes.h"
Go to the source code of this file.
Defines | |
#define | PHOTOSENSOR_OFF 0x03 |
#define | Photosensor_PowerOff() P3=(P3 & PHOTOSENSOR_OFF) |
#define | Photosensor_select(s) psensor=s; P3=((P3 & PHOTOSENSOR_OFF)|psensor_select[psensor & 0x07]) |
#define | PHOTOSENSORS_NR 5 |
Functions | |
void | Photosensor_init (void) |
initialize photosensor subsystem | |
void | Photosensor_toggle (void) |
toggles LED of selected photosensor | |
WORD | Photosensor_read (BYTE) |
read the value of a single photosensor |
Definition in file photosensor.h.
|
bit mask used to turn off all photosensors Definition at line 7 of file photosensor.h. |
|
macro to turn off all photosensors Definition at line 9 of file photosensor.h. Referenced by main(), Photosensor_init(), Photosensor_read(), and Photosensor_toggle(). |
|
macro to activate a given photosensor Definition at line 11 of file photosensor.h. Referenced by Photosensor_read(), and Photosensor_toggle(). |
|
number of active photosensors Definition at line 13 of file photosensor.h. |
|
initialize photosensor subsystem The photosensors are turned off by default. Definition at line 31 of file photosensor.c. References Photosensor_PowerOff, and psensor. Referenced by main(). |
|
read the value of a single photosensor The given sensor is activated first and than sampled with a simple differential scheme.
Definition at line 79 of file photosensor.c. References ADC(), Photosensor_PowerOff, Photosensor_select, and SHARP_PWRCTL. Referenced by main(). |
|
toggles LED of selected photosensor
The photosensor is selected with the Photosensor_select function. Definition at line 44 of file photosensor.c. References Photosensor_PowerOff, Photosensor_select, and psensor. |