Now you can download a copy of these docs so you can use them offline! Download now
AnalogTrigger Class Reference
Inheritance diagram for AnalogTrigger:
Collaboration diagram for AnalogTrigger:

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
 

Detailed Description

Definition at line 16 of file AnalogTrigger.h.

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).

Definition at line 60 of file AnalogTrigger.cpp.

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).

Definition at line 49 of file AnalogTrigger.cpp.

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.

Definition at line 70 of file AnalogTrigger.cpp.

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.

Definition at line 195 of file AnalogTrigger.cpp.

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.

Definition at line 152 of file AnalogTrigger.cpp.

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.

Definition at line 163 of file AnalogTrigger.cpp.

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.

Definition at line 179 of file AnalogTrigger.cpp.

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.

Definition at line 122 of file AnalogTrigger.cpp.

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.

Definition at line 137 of file AnalogTrigger.cpp.

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.

Definition at line 86 of file AnalogTrigger.cpp.

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.

Definition at line 103 of file AnalogTrigger.cpp.


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

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6