WPILibC++ 2023.4.3-108-ge5452e3
HandlesInternal.h File Reference
#include <stdint.h>
#include <wpi/Synchronization.h>
#include "hal/Types.h"

Go to the source code of this file.

Classes

class  hal::HandleBase
 Base for all HAL Handles. More...
 

Namespaces

namespace  hal
 WPILib Hardware Abstraction Layer (HAL) namespace.
 

Enumerations

enum class  hal::HAL_HandleEnum {
  hal::Undefined = 0 , hal::DIO = wpi::kHandleTypeHALBase , hal::Port = 2 , hal::Notifier = 3 ,
  hal::Interrupt = 4 , hal::AnalogOutput = 5 , hal::AnalogInput = 6 , hal::AnalogTrigger = 7 ,
  hal::Relay = 8 , hal::PWM = 9 , hal::DigitalPWM = 10 , hal::Counter = 11 ,
  hal::FPGAEncoder = 12 , hal::Encoder = 13 , hal::Compressor = 14 , hal::Solenoid = 15 ,
  hal::AnalogGyro = 16 , hal::Vendor = 17 , hal::SimulationJni = 18 , hal::CAN = 19 ,
  hal::SerialPort = 20 , hal::DutyCycle = 21 , hal::DMA = 22 , hal::AddressableLED = 23 ,
  hal::CTREPCM = 24 , hal::CTREPDP = 25 , hal::REVPDH = 26 , hal::REVPH = 27
}
 Enum of HAL handle types. More...
 

Functions

static int16_t hal::getHandleIndex (HAL_Handle handle)
 Get the handle index from a handle. More...
 
static HAL_HandleEnum hal::getHandleType (HAL_Handle handle)
 Get the handle type from a handle. More...
 
static bool hal::isHandleType (HAL_Handle handle, HAL_HandleEnum handleType)
 Get if the handle is a specific type. More...
 
static bool hal::isHandleCorrectVersion (HAL_Handle handle, int16_t version)
 Get if the version of the handle is correct. More...
 
int16_t hal::getHandleTypedIndex (HAL_Handle handle, HAL_HandleEnum enumType, int16_t version)
 Get if the handle is a correct type and version. More...
 
int16_t hal::getPortHandleChannel (HAL_PortHandle handle)
 Gets the port channel of a port handle. More...
 
int16_t hal::getPortHandleModule (HAL_PortHandle handle)
 Gets the port module of a port handle. More...
 
int16_t hal::getPortHandleSPIEnable (HAL_PortHandle handle)
 Gets the SPI channel of a port handle. More...
 
HAL_PortHandle hal::createPortHandle (uint8_t channel, uint8_t module)
 Create a port handle. More...
 
HAL_PortHandle hal::createPortHandleForSPI (uint8_t channel)
 Create a port handle for SPI. More...
 
HAL_Handle hal::createHandle (int16_t index, HAL_HandleEnum handleType, int16_t version)
 Create a handle for a specific index, type and version. More...
 

Variables

constexpr int16_t hal::InvalidHandleIndex = -1