WPILib 2012
WPILibRoboticsLibraryforFRC
Public Member Functions
DigitalInput Class Reference

#include <DigitalInput.h>

Inheritance diagram for DigitalInput:
DigitalSource InterruptableSensorBase SensorBase ErrorBase

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.


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

Parameters:
moduleNumberThe digital module (1 or 2).
channelThe digital channel (1..14).
DigitalInput::~DigitalInput ( ) [virtual]

Free resources associated with the Digital Input class.


Member Function Documentation

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

Implements DigitalSource.

UINT32 DigitalInput::GetChannel ( )
Returns:
The GPIO channel number that this object represents.
UINT32 DigitalInput::GetChannelForRouting ( ) [virtual]
Returns:
The value to be written to the channel field of a routing mux.

Implements DigitalSource.

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

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.

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


The documentation for this class was generated from the following files:
 All Classes Functions Variables