86 return static_cast<int16_t
>(handle & 0xffff);
121 return (((handle & 0xFF0000) >> 16) & version) == version;
140#if !defined(__FRC_SYSTEMCORE__)
@ index
Definition base.h:690
A class for driving addressable LEDs, such as WS2812B, WS2815, and NeoPixels.
Definition AddressableLED.hpp:31
Persistent alert to be sent to the driver station.
Definition Alert.hpp:36
High level class for interfacing with CAN devices conforming to the standard CAN spec.
Definition CAN.hpp:24
Class for operating a compressor connected to a pneumatics module.
Definition Compressor.hpp:34
Class to read a duty cycle PWM input.
Definition DutyCycle.hpp:23
Class to read quad encoders.
Definition Encoder.hpp:31
Notifiers run a user-provided callback function on a separate thread.
Definition Notifier.hpp:30
Class implements the PWM generation in the FPGA.
Definition PWM.hpp:26
Driver for the RS-232 serial port on the roboRIO.
Definition SerialPort.hpp:27
Solenoid class for running high voltage Digital Output on a pneumatics module.
Definition Solenoid.hpp:26
static void ResetGlobalHandles()
HandleBase & operator=(const HandleBase &)=delete
HandleBase(const HandleBase &)=delete
virtual void ResetHandles()
int16_t m_version
Definition HandlesInternal.hpp:37
int32_t HAL_Handle
Definition Types.h:17
WPILib Hardware Abstraction Layer (HAL) namespace.
Definition Types.hpp:9
HAL_HandleEnum
Enum of HAL handle types.
Definition HandlesInternal.hpp:45
@ REVPDH
Definition HandlesInternal.hpp:72
@ Interrupt
Definition HandlesInternal.hpp:50
@ CTREPCM
Definition HandlesInternal.hpp:70
@ CANStream
Definition HandlesInternal.hpp:74
@ DMA
Definition HandlesInternal.hpp:68
@ Relay
Definition HandlesInternal.hpp:54
@ AnalogGyro
Definition HandlesInternal.hpp:62
@ SimulationJni
Definition HandlesInternal.hpp:64
@ CTREPDP
Definition HandlesInternal.hpp:71
@ Port
Definition HandlesInternal.hpp:48
@ Counter
Definition HandlesInternal.hpp:57
@ DIO
Definition HandlesInternal.hpp:47
@ DigitalPWM
Definition HandlesInternal.hpp:56
@ REVPH
Definition HandlesInternal.hpp:73
@ AnalogOutput
Definition HandlesInternal.hpp:51
@ FPGAEncoder
Definition HandlesInternal.hpp:58
@ AnalogTrigger
Definition HandlesInternal.hpp:53
@ Undefined
Definition HandlesInternal.hpp:46
@ Vendor
Definition HandlesInternal.hpp:63
int16_t getHandleTypedIndex(HAL_Handle handle, HAL_HandleEnum enumType, int16_t version)
Get if the handle is a correct type and version.
Definition HandlesInternal.hpp:135
HAL_Handle createHandle(int16_t index, HAL_HandleEnum handleType, int16_t version)
Create a handle for a specific index, type and version.
constexpr int16_t InvalidHandleIndex
Definition HandlesInternal.hpp:40
static bool isHandleCorrectVersion(HAL_Handle handle, int16_t version)
Get if the version of the handle is correct.
Definition HandlesInternal.hpp:120
static int16_t getHandleIndex(HAL_Handle handle)
Get the handle index from a handle.
Definition HandlesInternal.hpp:84
static HAL_HandleEnum getHandleType(HAL_Handle handle)
Get the handle type from a handle.
Definition HandlesInternal.hpp:95
static bool isHandleType(HAL_Handle handle, HAL_HandleEnum handleType)
Get if the handle is a specific type.
Definition HandlesInternal.hpp:107
constexpr int kHandleTypeHALBase
Definition Synchronization.hpp:26