#include <oir.h>
Inheritance diagram for oIR:

Public Member Functions | |
| oIR (IOLINE channel, IR_TYPE type) | |
| void | callibrate (short c) |
| short | value (void) |
| int | value (void) const |
| Digital value on channel. | |
| void | operate (bool b) |
| True starts A2D; otherwise 0 on channel. | |
Static Public Member Functions | |
| int | TCR1 (void) |
| void | TMCR (int iarb) |
| bool | HSQR (int chan, int val) |
| Configures the host sequence register. | |
| bool | HSRR (int chan, int val) |
| Configures the host sequence request register. | |
| bool | CPR (int chan, int val) |
| Configures the channel priority register (Ref. TPU Channel Utilization). | |
| bool | CIER (int chan, int cie) |
| Configures the channel interrupt enable register. | |
| int | CISR (int chan) |
| Returns the channel interrupt status register. | |
| void | CISR_clear (int chan) |
| Clears the channel interrupt status register for the channel. | |
| bool | TICR (int cirl, int cibv) |
| Configures the TPU interrupt configuration register. | |
| int | tpu_vector (IOLINE channel) |
| Given a channel, returns the vector number to use for an interrupt. | |
#include <hardware/oir.h> int main() { oIR ir(0,GP12D2); // channel 0 of A2D port. ir.callibrate(0); // appearing too close while (ir.value() < 40) { // .. do something useful } }
|
||||||||||||
|
Constructor specifying channel on A2D PORT. Callibrate factor needed for each sensor. |
|
|
Note: A larger callibration number will decrease distance returned. The default is:
|
|
||||||||||||
|
Configures the channel interrupt enable register.
|
|
||||||||||||
|
Configures the channel priority register (Ref. TPU Channel Utilization).
|
|
||||||||||||
|
Configures the host sequence register.
|
|
||||||||||||
|
Configures the host sequence request register.
|
|
|
misnomer--should be TCR1 divisor--return number of clocks (PSCK,TCR1P modifications) Globally available object. Can be used in combination with TPU_REGISTER definition to say TPU_REGISTER->CFSR.BITS... |
|
|
was tpu_init Configures the channel function select register |
|
|
Distance from object in millimeterss. Set status of component |
1.3