DigitalInput Class Reference

#include <DigitalInput.h>

Inheritance diagram for DigitalInput:

Inheritance graph
[legend]
Collaboration diagram for DigitalInput:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DigitalInput (unsigned channel)
 DigitalInput (unsigned slot, unsigned channel)
 ~DigitalInput (void)
unsigned GetChannel (void)
virtual unsigned GetChannelForRouting (void)
virtual unsigned GetModuleForRouting (void)
virtual bool GetAnalogTriggerForRouting (void)
virtual void RequestInterrupts (tInterruptHandler handler)
 Asynchronus handler version.
virtual void RequestInterrupts (void)
 Synchronus Wait version.


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 ( unsigned  channel  ) 

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

DigitalInput::DigitalInput ( unsigned  slot,
unsigned  channel 
)

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

DigitalInput::~DigitalInput ( void   ) 

Free resources associated with the Digital Input class.


Member Function Documentation

unsigned DigitalInput::GetChannel ( void   ) 

Returns:
The GPIO channel number that this object represents.

unsigned DigitalInput::GetChannelForRouting ( void   )  [virtual]

Returns:
The value to be written to the channel field of a routing mux.

Implements DigitalSource.

unsigned DigitalInput::GetModuleForRouting ( void   )  [virtual]

Returns:
The value to be written to the module field of a routing mux.

Implements DigitalSource.

bool DigitalInput::GetAnalogTriggerForRouting ( void   )  [virtual]

Returns:
The value to be written to the analog trigger field of a routing mux.

Implements DigitalSource.

void DigitalInput::RequestInterrupts ( tInterruptHandler  handler  )  [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.

void DigitalInput::RequestInterrupts ( void   )  [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.


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

Generated on Thu Oct 2 14:01:24 2008 for WPI Robotics Library by  doxygen 1.5.5