WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
Public Member Functions | Friends | List of all members
AnalogTrigger Class Reference
Inheritance diagram for AnalogTrigger:
SensorBase ErrorBase

Public Member Functions

 AnalogTrigger (uint8_t moduleNumber, uint32_t channel)
 
 AnalogTrigger (uint32_t channel)
 
 AnalogTrigger (AnalogChannel *channel)
 
void SetLimitsVoltage (float lower, float upper)
 
void SetLimitsRaw (int32_t lower, int32_t upper)
 
void SetAveraged (bool useAveragedValue)
 
void SetFiltered (bool useFilteredValue)
 
uint32_t GetIndex ()
 
bool GetInWindow ()
 
bool GetTriggerState ()
 
AnalogTriggerOutputCreateOutput (AnalogTriggerOutput::Type type)
 
- Public Member Functions inherited from SensorBase
 SensorBase ()
 
virtual ~SensorBase ()
 
- Public Member Functions inherited from ErrorBase
virtual ErrorGetError ()
 Retrieve the current error. Get the current error information associated with this sensor.
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (ErrorBase *rhs) const
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 

Friends

class AnalogTriggerOutput
 

Additional Inherited Members

- Static Public Member Functions inherited from SensorBase
static void DeleteSingletons ()
 
static uint32_t GetDefaultAnalogModule ()
 
static uint32_t GetDefaultDigitalModule ()
 
static uint32_t GetDefaultSolenoidModule ()
 
static bool CheckAnalogModule (uint8_t moduleNumber)
 
static bool CheckDigitalModule (uint8_t moduleNumber)
 
static bool CheckPWMModule (uint8_t moduleNumber)
 
static bool CheckRelayModule (uint8_t moduleNumber)
 
static bool CheckSolenoidModule (uint8_t moduleNumber)
 
static bool CheckDigitalChannel (uint32_t channel)
 
static bool CheckRelayChannel (uint32_t channel)
 
static bool CheckPWMChannel (uint32_t channel)
 
static bool CheckAnalogChannel (uint32_t channel)
 
static bool CheckSolenoidChannel (uint32_t channel)
 
- Static Public Member Functions inherited from ErrorBase
static void SetGlobalError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber)
 
static void SetGlobalWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber)
 
static ErrorGetGlobalError ()
 
- Static Public Attributes inherited from SensorBase
static const uint32_t kSystemClockTicksPerMicrosecond = 40
 
static const uint32_t kDigitalChannels = 14
 
static const uint32_t kAnalogChannels = 8
 
static const uint32_t kAnalogModules = 2
 
static const uint32_t kDigitalModules = 2
 
static const uint32_t kSolenoidChannels = 8
 
static const uint32_t kSolenoidModules = 2
 
static const uint32_t kPwmChannels = 10
 
static const uint32_t kRelayChannels = 8
 
static const uint32_t kChassisSlots = 8
 
- Protected Member Functions inherited from SensorBase
void AddToSingletonList ()
 
- Protected Member Functions inherited from ErrorBase
 ErrorBase ()
 Initialize the instance status to 0 for now.
 
- Protected Attributes inherited from ErrorBase
Error m_error
 
- Static Protected Attributes inherited from ErrorBase
static SEM_ID _globalErrorMutex = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
 
static Error _globalError
 

Constructor & Destructor Documentation

AnalogTrigger::AnalogTrigger ( uint8_t  moduleNumber,
uint32_t  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_t  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_t 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_t  lower,
int32_t  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: