WPILib 2012
WPILibRoboticsLibraryforFRC
Public Member Functions | Friends
AnalogTrigger Class Reference
Inheritance diagram for AnalogTrigger:
SensorBase ErrorBase

List of all members.

Public Member Functions

 AnalogTrigger (UINT8 moduleNumber, UINT32 channel)
 AnalogTrigger (UINT32 channel)
 AnalogTrigger (AnalogChannel *channel)
void SetLimitsVoltage (float lower, float upper)
void SetLimitsRaw (INT32 lower, INT32 upper)
void SetAveraged (bool useAveragedValue)
void SetFiltered (bool useFilteredValue)
UINT32 GetIndex ()
bool GetInWindow ()
bool GetTriggerState ()
AnalogTriggerOutputCreateOutput (AnalogTriggerOutput::Type type)

Friends

class AnalogTriggerOutput

Constructor & Destructor Documentation

AnalogTrigger::AnalogTrigger ( UINT8  moduleNumber,
UINT32  channel 
)

Constructor for an analog trigger given both the slot and channel.

Parameters:
moduleNumberThe analog module (1 or 2).
channelThe analog channel (1..8).
AnalogTrigger::AnalogTrigger ( UINT32  channel) [explicit]

Constructor for an analog trigger given a channel number. The default module is used in this case.

Parameters:
channelThe analog channel (1..8).
AnalogTrigger::AnalogTrigger ( AnalogChannel channel) [explicit]

Construct an analog trigger given an analog channel. This should be used in the case of sharing an analog channel between the trigger and an analog input object.


Member Function Documentation

AnalogTriggerOutput * AnalogTrigger::CreateOutput ( AnalogTriggerOutput::Type  type)

Creates an AnalogTriggerOutput object. Gets an output object that can be used for routing. Caller is responsible for deleting the AnalogTriggerOutput object.

Parameters:
typeAn enum of the type of output object to create.
Returns:
A pointer to a new AnalogTriggerOutput object.
UINT32 AnalogTrigger::GetIndex ( )

Return the index of the analog trigger. This is the FPGA index of this analog trigger instance.

Returns:
The index of the analog trigger.
bool AnalogTrigger::GetInWindow ( )

Return the InWindow output of the analog trigger. True if the analog input is between the upper and lower limits.

Returns:
The InWindow output of the analog trigger.
bool AnalogTrigger::GetTriggerState ( )

Return the TriggerState output of the analog trigger. True if above upper limit. False if below lower limit. If in Hysteresis, maintain previous state.

Returns:
The TriggerState output of the analog trigger.
void AnalogTrigger::SetAveraged ( bool  useAveragedValue)

Configure the analog trigger to use the averaged vs. raw values. If the value is true, then the averaged value is selected for the analog trigger, otherwise the immediate value is used.

void AnalogTrigger::SetFiltered ( bool  useFilteredValue)

Configure the analog trigger to use a filtered value. The analog trigger will operate with a 3 point average rejection filter. This is designed to help with 360 degree pot applications for the period where the pot crosses through zero.

void AnalogTrigger::SetLimitsRaw ( INT32  lower,
INT32  upper 
)

Set the upper and lower limits of the analog trigger. The limits are given in ADC codes. If oversampling is used, the units must be scaled appropriately.

void AnalogTrigger::SetLimitsVoltage ( float  lower,
float  upper 
)

Set the upper and lower limits of the analog trigger. The limits are given as floating point voltage values.


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