WPILibC++  2019.2.1-1-g453a904
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Relay Output Functions

Functions

HAL_RelayHandle HAL_InitializeRelayPort (HAL_PortHandle portHandle, HAL_Bool fwd, 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_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
void HAL_FreeRelayPort ( HAL_RelayHandle  relayPortHandle)

Frees a relay port.

Parameters
relayPortHandlethe relay handle
HAL_Bool HAL_GetRelay ( HAL_RelayHandle  relayPortHandle,
int32_t *  status 
)

Gets the current state of the relay channel.

Parameters
relayPortHandlethe relay handle
Returns
true for on, false for off
HAL_RelayHandle HAL_InitializeRelayPort ( HAL_PortHandle  portHandle,
HAL_Bool  fwd,
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
portHandlethe port handle to initialize
fwdtrue for the forward port, false for the reverse port
Returns
the created relay handle
void HAL_SetRelay ( HAL_RelayHandle  relayPortHandle,
HAL_Bool  on,
int32_t *  status 
)

Sets the state of a relay output.

Parameters
relayPortHandlethe relay handle
ontrue for on, false for off