WPILib 2012
WPILibRoboticsLibraryforFRC
|
#include <DigitalInput.h>
Public Member Functions | |
DigitalInput (UINT32 channel) | |
DigitalInput (UINT8 moduleNumber, UINT32 channel) | |
virtual | ~DigitalInput () |
UINT32 | Get () |
UINT32 | GetChannel () |
virtual UINT32 | GetChannelForRouting () |
virtual UINT32 | GetModuleForRouting () |
virtual bool | GetAnalogTriggerForRouting () |
virtual void | RequestInterrupts (tInterruptHandler handler, void *param=NULL) |
Asynchronus handler version. | |
virtual void | RequestInterrupts () |
Synchronus Wait version. | |
void | SetUpSourceEdge (bool risingEdge, bool fallingEdge) |
Class to read a digital input. This class will read digital inputs and return the current value on the channel. Other devices such as encoders, gear tooth sensors, etc. that are implemented elsewhere will automatically allocate digital inputs and outputs as required. This class is only for devices like switches etc. that aren't implemented anywhere else.
DigitalInput::DigitalInput | ( | UINT32 | channel | ) | [explicit] |
Create an instance of a Digital Input class. Creates a digital input given a channel and uses the default module.
channel | The digital channel (1..14). |
DigitalInput::DigitalInput | ( | UINT8 | moduleNumber, |
UINT32 | channel | ||
) |
Create an instance of a Digital Input class. Creates a digital input given an channel and module.
moduleNumber | The digital module (1 or 2). |
channel | The digital channel (1..14). |
DigitalInput::~DigitalInput | ( | ) | [virtual] |
Free resources associated with the Digital Input class.
bool DigitalInput::GetAnalogTriggerForRouting | ( | ) | [virtual] |
Implements DigitalSource.
UINT32 DigitalInput::GetChannel | ( | ) |
UINT32 DigitalInput::GetChannelForRouting | ( | ) | [virtual] |
Implements DigitalSource.
UINT32 DigitalInput::GetModuleForRouting | ( | ) | [virtual] |
Implements DigitalSource.
void DigitalInput::RequestInterrupts | ( | ) | [virtual] |
Synchronus Wait version.
Request interrupts synchronously on this digital input. Request interrupts in synchronus mode where the user program will have to explicitly wait for the interrupt to occur. The default is interrupt on rising edges only.
Implements DigitalSource.
void DigitalInput::RequestInterrupts | ( | tInterruptHandler | handler, |
void * | param = NULL |
||
) | [virtual] |
Asynchronus handler version.
Request interrupts asynchronously on this digital input.
handler | The address of the interrupt handler function of type tInterruptHandler that will be called whenever there is an interrupt on the digitial input port. Request interrupts in synchronus mode where the user program interrupt handler will be called when an interrupt occurs. The default is interrupt on rising edges only. |
Implements DigitalSource.