48 DIO = wpi::kHandleTypeHALBase,
85 return static_cast<int16_t>(handle & 0xffff);
120 return (((handle & 0xFF0000) >> 16) & version) == version;
139#if !defined(__FRC_ROBORIO__)
167 return static_cast<uint8_t>(handle & 0xff);
181 return static_cast<uint8_t>((handle >> 8) & 0xff);
195 return static_cast<uint8_t>((handle >> 16) & 0xff);
Base for all HAL Handles.
Definition: HandlesInternal.h:28
HandleBase & operator=(const HandleBase &)=delete
virtual void ResetHandles()
static void ResetGlobalHandles()
HandleBase(const HandleBase &)=delete
int16_t m_version
Definition: HandlesInternal.h:38
int32_t HAL_Handle
Definition: Types.h:17
HAL_Handle HAL_PortHandle
Definition: Types.h:19
::int16_t int16_t
Definition: Meta.h:55
::uint8_t uint8_t
Definition: Meta.h:52
WPILib Hardware Abstraction Layer (HAL) namespace.
Definition: ChipObject.h:40
static bool isHandleCorrectVersion(HAL_Handle handle, int16_t version)
Get if the version of the handle is correct.
Definition: HandlesInternal.h:119
HAL_HandleEnum
Enum of HAL handle types.
Definition: HandlesInternal.h:46
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.h:41
int16_t getPortHandleModule(HAL_PortHandle handle)
Gets the port module of a port handle.
Definition: HandlesInternal.h:177
static bool isHandleType(HAL_Handle handle, HAL_HandleEnum handleType)
Get if the handle is a specific type.
Definition: HandlesInternal.h:106
HAL_PortHandle createPortHandle(uint8_t channel, uint8_t module)
Create a port handle.
static HAL_HandleEnum getHandleType(HAL_Handle handle)
Get the handle type from a handle.
Definition: HandlesInternal.h:94
static int16_t getHandleIndex(HAL_Handle handle)
Get the handle index from a handle.
Definition: HandlesInternal.h:83
HAL_PortHandle createPortHandleForSPI(uint8_t channel)
Create a port handle for SPI.
int16_t getPortHandleChannel(HAL_PortHandle handle)
Gets the port channel of a port handle.
Definition: HandlesInternal.h:163
int16_t getPortHandleSPIEnable(HAL_PortHandle handle)
Gets the SPI channel of a port handle.
Definition: HandlesInternal.h:191
int16_t getHandleTypedIndex(HAL_Handle handle, HAL_HandleEnum enumType, int16_t version)
Get if the handle is a correct type and version.
Definition: HandlesInternal.h:134