WPILib 2012
WPILibRoboticsLibraryforFRC
|
#include <SensorBase.h>
Public Member Functions | |
SensorBase () | |
virtual | ~SensorBase () |
Static Public Member Functions | |
static void | DeleteSingletons () |
static UINT32 | GetDefaultAnalogModule () |
static UINT32 | GetDefaultDigitalModule () |
static UINT32 | GetDefaultSolenoidModule () |
static bool | CheckAnalogModule (UINT8 moduleNumber) |
static bool | CheckDigitalModule (UINT8 moduleNumber) |
static bool | CheckPWMModule (UINT8 moduleNumber) |
static bool | CheckRelayModule (UINT8 moduleNumber) |
static bool | CheckSolenoidModule (UINT8 moduleNumber) |
static bool | CheckDigitalChannel (UINT32 channel) |
static bool | CheckRelayChannel (UINT32 channel) |
static bool | CheckPWMChannel (UINT32 channel) |
static bool | CheckAnalogChannel (UINT32 channel) |
static bool | CheckSolenoidChannel (UINT32 channel) |
Static Public Attributes | |
static const UINT32 | kSystemClockTicksPerMicrosecond = 40 |
static const UINT32 | kDigitalChannels = 14 |
static const UINT32 | kAnalogChannels = 8 |
static const UINT32 | kAnalogModules = 2 |
static const UINT32 | kDigitalModules = 2 |
static const UINT32 | kSolenoidChannels = 8 |
static const UINT32 | kSolenoidModules = 2 |
static const UINT32 | kPwmChannels = 10 |
static const UINT32 | kRelayChannels = 8 |
static const UINT32 | kChassisSlots = 8 |
Protected Member Functions | |
void | AddToSingletonList () |
Base class for all sensors. Stores most recent status information as well as containing utility functions for checking channels and error processing.
SensorBase::SensorBase | ( | ) |
Creates an instance of the sensor base and gets an FPGA handle
SensorBase::~SensorBase | ( | ) | [virtual] |
Frees the resources for a SensorBase.
void SensorBase::AddToSingletonList | ( | ) | [protected] |
Add sensor to the singleton list. Add this sensor to the list of singletons that need to be deleted when the robot program exits. Each of the sensors on this list are singletons, that is they aren't allocated directly with new, but instead are allocated by the static GetInstance method. As a result, they are never deleted when the program exits. Consequently these sensors may still be holding onto resources and need to have their destructors called at the end of the program.
bool SensorBase::CheckAnalogChannel | ( | UINT32 | channel | ) | [static] |
Check that the analog channel number is value. Verify that the analog channel number is one of the legal channel numbers. Channel numbers are 1-based.
bool SensorBase::CheckAnalogModule | ( | UINT8 | moduleNumber | ) | [static] |
Check that the analog module number is valid.
bool SensorBase::CheckDigitalChannel | ( | UINT32 | channel | ) | [static] |
Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 1-based.
bool SensorBase::CheckDigitalModule | ( | UINT8 | moduleNumber | ) | [static] |
Check that the digital module number is valid.
bool SensorBase::CheckPWMChannel | ( | UINT32 | channel | ) | [static] |
Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 1-based.
bool SensorBase::CheckPWMModule | ( | UINT8 | moduleNumber | ) | [static] |
Check that the digital module number is valid.
bool SensorBase::CheckRelayChannel | ( | UINT32 | channel | ) | [static] |
Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 1-based.
bool SensorBase::CheckRelayModule | ( | UINT8 | moduleNumber | ) | [static] |
Check that the digital module number is valid.
bool SensorBase::CheckSolenoidChannel | ( | UINT32 | channel | ) | [static] |
Verify that the solenoid channel number is within limits.
bool SensorBase::CheckSolenoidModule | ( | UINT8 | moduleNumber | ) | [static] |
Check that the solenoid module number is valid.
void SensorBase::DeleteSingletons | ( | ) | [static] |
Delete all the singleton classes on the list. All the classes that were allocated as singletons need to be deleted so their resources can be freed.