WPILibC++ 2024.3.2
Relay Output Functions

Functions

HAL_RelayHandle HAL_InitializeRelayPort (HAL_PortHandle portHandle, HAL_Bool fwd, const char *allocationLocation, int32_t *status)
 Initializes a relay. More...
 
void HAL_FreeRelayPort (HAL_RelayHandle relayPortHandle)
 Frees a relay port. More...
 
HAL_Bool HAL_CheckRelayChannel (int32_t channel)
 Checks if a relay channel is valid. More...
 
void HAL_SetRelay (HAL_RelayHandle relayPortHandle, HAL_Bool on, int32_t *status)
 Sets the state of a relay output. More...
 
HAL_Bool HAL_GetRelay (HAL_RelayHandle relayPortHandle, int32_t *status)
 Gets the current state of the relay channel. More...
 

Detailed Description

Function Documentation

◆ HAL_CheckRelayChannel()

HAL_Bool HAL_CheckRelayChannel ( int32_t  channel)

Checks if a relay channel is valid.

Parameters
channelthe channel to check
Returns
true if the channel is valid, otherwise false

◆ HAL_FreeRelayPort()

void HAL_FreeRelayPort ( HAL_RelayHandle  relayPortHandle)

Frees a relay port.

Parameters
relayPortHandlethe relay handle

◆ HAL_GetRelay()

HAL_Bool HAL_GetRelay ( HAL_RelayHandle  relayPortHandle,
int32_t *  status 
)

Gets the current state of the relay channel.

Parameters
[in]relayPortHandlethe relay handle
[out]statusError status variable. 0 on success.
Returns
true for on, false for off

◆ HAL_InitializeRelayPort()

HAL_RelayHandle HAL_InitializeRelayPort ( HAL_PortHandle  portHandle,
HAL_Bool  fwd,
const char *  allocationLocation,
int32_t *  status 
)

Initializes a relay.

Note this call will only initialize either the forward or reverse port of the relay. If you need both, you will need to initialize 2 relays.

Parameters
[in]portHandlethe port handle to initialize
[in]fwdtrue for the forward port, false for the reverse port
[in]allocationLocationthe location where the allocation is occurring (can be null)
[out]statusError status variable. 0 on success.
Returns
the created relay handle

◆ HAL_SetRelay()

void HAL_SetRelay ( HAL_RelayHandle  relayPortHandle,
HAL_Bool  on,
int32_t *  status 
)

Sets the state of a relay output.

Parameters
[in]relayPortHandlethe relay handle
[in]ontrue for on, false for off
[out]statusError status variable. 0 on success.