C Hardware Description Table
int driver_version:
The maximum driver version for which this entry is compatible.
Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.
int tpu_channel:
The tpu channel the bumper is attached to. Valid values are 0..15 Each bumper needs a tpu channel to signal a 'bump'-occurrence.
int tpu_timer:
The tpu timer that has to be used. Valid values are TIMER1, TIMER2
If a 'bump' is detected the corresponding timer-value is stored for later calculations.
TIMER1 runs at a speed of 4MHz-8MHz (depending on CPUclock) TIMER2 runs at a speed of 512kHz-1MHz (depending on CPUclock)
short transition:
React on a certain transition. Valid values are RISING, FALLING, EITHER
To alter the behaviour of the bumper, the type of transition the TPU reacts on can be choosen.
C.4 Compass Entry
typedef struct
{
short version; short channel; void* pc_port; short pc_pin; void* cal_port; short cal_pin; void* sdo_port; short sdo_pin;
}compass_type;
e.g.
compass_type compass = {0,13,(void*)IOBase, 2,(void*)IOBase, 4, (BYTE*)IOBase, 0};
short version:
The maximum driver version for which this entry is compatible.
Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.
short channel:
TPU channel that is connected to the compass for clocking the data transfer. Valid values are 0..15
void* pc_port:
Pointer to an 8Bit register/latch (out). PC is the start signal for the compass
short pc_pin:
This is the bit number in the register/latch addressed by pc_port. Valid values are 0..7
void* cal_port:
Pointer to an 8Bit register/latch (out). CAL is the calibration start signal for the compass.
It can be set to NULL if no calibration is needed (In this case never call the calibration function).
short cal_pin: