Now you can download a copy of these docs so you can use them offline! Download now

DigitalInput Class Reference

#include <DigitalInput.h>

Inheritance diagram for DigitalInput:
Collaboration diagram for DigitalInput:

List of all members.

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)

Detailed Description

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.

Definition at line 21 of file DigitalInput.h.


Constructor & Destructor Documentation

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.

Parameters:
channel The digital channel (1..14).

Definition at line 47 of file DigitalInput.cpp.

DigitalInput::DigitalInput ( UINT8  moduleNumber,
UINT32  channel 
)

Create an instance of a Digital Input class. Creates a digital input given an channel and module.

Parameters:
moduleNumber The digital module (1 or 2).
channel The digital channel (1..14).

Definition at line 59 of file DigitalInput.cpp.

DigitalInput::~DigitalInput (  )  [virtual]

Free resources associated with the Digital Input class.

Definition at line 67 of file DigitalInput.cpp.


Member Function Documentation

bool DigitalInput::GetAnalogTriggerForRouting (  )  [virtual]
Returns:
The value to be written to the analog trigger field of a routing mux.

Implements DigitalSource.

Definition at line 117 of file DigitalInput.cpp.

UINT32 DigitalInput::GetChannel (  ) 
Returns:
The GPIO channel number that this object represents.

Definition at line 92 of file DigitalInput.cpp.

UINT32 DigitalInput::GetChannelForRouting (  )  [virtual]
Returns:
The value to be written to the channel field of a routing mux.

Implements DigitalSource.

Definition at line 100 of file DigitalInput.cpp.

UINT32 DigitalInput::GetModuleForRouting (  )  [virtual]
Returns:
The value to be written to the module field of a routing mux.

Implements DigitalSource.

Definition at line 108 of file DigitalInput.cpp.

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.

Definition at line 161 of file DigitalInput.cpp.

void DigitalInput::RequestInterrupts ( tInterruptHandler  handler,
void *  param = NULL 
) [virtual]

Asynchronus handler version.

Request interrupts asynchronously on this digital input.

Parameters:
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.

Definition at line 130 of file DigitalInput.cpp.


The documentation for this class was generated from the following files:

Generated on Thu Jan 12 2012 22:35:30 for WPILibC++ by doxygen 1.7.1