WPILibC++  2020.3.2-60-g3011ebe
Solenoid Output Functions

Functions

HAL_SolenoidHandle HAL_InitializeSolenoidPort (HAL_PortHandle portHandle, int32_t *status)
 Initializes a solenoid port. More...
 
void HAL_FreeSolenoidPort (HAL_SolenoidHandle solenoidPortHandle)
 Frees a solenoid port. More...
 
HAL_Bool HAL_CheckSolenoidModule (int32_t module)
 Checks if a solenoid module is in the valid range. More...
 
HAL_Bool HAL_CheckSolenoidChannel (int32_t channel)
 Checks if a solenoid channel is in the valid range. More...
 
HAL_Bool HAL_GetSolenoid (HAL_SolenoidHandle solenoidPortHandle, int32_t *status)
 Gets the current solenoid output value. More...
 
int32_t HAL_GetAllSolenoids (int32_t module, int32_t *status)
 Gets the status of all solenoids on a specific module. More...
 
void HAL_SetSolenoid (HAL_SolenoidHandle solenoidPortHandle, HAL_Bool value, int32_t *status)
 Sets a solenoid output value. More...
 
void HAL_SetAllSolenoids (int32_t module, int32_t state, int32_t *status)
 Sets all channels on a specific module. More...
 
int32_t HAL_GetPCMSolenoidBlackList (int32_t module, int32_t *status)
 Gets the channels blacklisted from being enabled on a module. More...
 
HAL_Bool HAL_GetPCMSolenoidVoltageStickyFault (int32_t module, int32_t *status)
 Gets if a specific module has an over or under voltage sticky fault. More...
 
HAL_Bool HAL_GetPCMSolenoidVoltageFault (int32_t module, int32_t *status)
 Gets if a specific module has an over or under voltage fault. More...
 
void HAL_ClearAllPCMStickyFaults (int32_t module, int32_t *status)
 Clears all faults on a module. More...
 
void HAL_SetOneShotDuration (HAL_SolenoidHandle solenoidPortHandle, int32_t durMS, int32_t *status)
 Sets the one shot duration on a solenoid channel. More...
 
void HAL_FireOneShot (HAL_SolenoidHandle solenoidPortHandle, int32_t *status)
 Fires a single pulse on a solenoid channel. More...
 

Detailed Description

Function Documentation

◆ HAL_CheckSolenoidChannel()

HAL_Bool HAL_CheckSolenoidChannel ( int32_t  channel)

Checks if a solenoid channel is in the valid range.

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

◆ HAL_CheckSolenoidModule()

HAL_Bool HAL_CheckSolenoidModule ( int32_t  module)

Checks if a solenoid module is in the valid range.

Parameters
modulethe module number to check
Returns
true if the module number is valid, otherwise false

◆ HAL_ClearAllPCMStickyFaults()

void HAL_ClearAllPCMStickyFaults ( int32_t  module,
int32_t *  status 
)

Clears all faults on a module.

Parameters
modulethe module to clear

◆ HAL_FireOneShot()

void HAL_FireOneShot ( HAL_SolenoidHandle  solenoidPortHandle,
int32_t *  status 
)

Fires a single pulse on a solenoid channel.

The pulse is the duration set by HAL_SetOneShotDuration().

Parameters
solenoidPortHandlethe solenoid handle

◆ HAL_FreeSolenoidPort()

void HAL_FreeSolenoidPort ( HAL_SolenoidHandle  solenoidPortHandle)

Frees a solenoid port.

Parameters
solenoidPortHandlethe solenoid handle

◆ HAL_GetAllSolenoids()

int32_t HAL_GetAllSolenoids ( int32_t  module,
int32_t *  status 
)

Gets the status of all solenoids on a specific module.

Parameters
modulethe module to check
Returns
bitmask of the channels, 1 for on 0 for off

◆ HAL_GetPCMSolenoidBlackList()

int32_t HAL_GetPCMSolenoidBlackList ( int32_t  module,
int32_t *  status 
)

Gets the channels blacklisted from being enabled on a module.

Parameters
modulethe module to check @retur bitmask of the blacklisted channels, 1 for true 0 for false

◆ HAL_GetPCMSolenoidVoltageFault()

HAL_Bool HAL_GetPCMSolenoidVoltageFault ( int32_t  module,
int32_t *  status 
)

Gets if a specific module has an over or under voltage fault.

Parameters
modulethe module to check
Returns
true if faulted, otherwise false

◆ HAL_GetPCMSolenoidVoltageStickyFault()

HAL_Bool HAL_GetPCMSolenoidVoltageStickyFault ( int32_t  module,
int32_t *  status 
)

Gets if a specific module has an over or under voltage sticky fault.

Parameters
modulethe module to check
Returns
true if a stick fault is set, otherwise false

◆ HAL_GetSolenoid()

HAL_Bool HAL_GetSolenoid ( HAL_SolenoidHandle  solenoidPortHandle,
int32_t *  status 
)

Gets the current solenoid output value.

Parameters
solenoidPortHandlethe solenoid handle
Returns
true if the solenoid is on, otherwise false

◆ HAL_InitializeSolenoidPort()

HAL_SolenoidHandle HAL_InitializeSolenoidPort ( HAL_PortHandle  portHandle,
int32_t *  status 
)

Initializes a solenoid port.

Parameters
portHandlethe port handle of the module and channel to initialize
Returns
the created solenoid handle

◆ HAL_SetAllSolenoids()

void HAL_SetAllSolenoids ( int32_t  module,
int32_t  state,
int32_t *  status 
)

Sets all channels on a specific module.

Parameters
modulethe module to set the channels on
statebitmask of the channels to set, 1 for on 0 for off

◆ HAL_SetOneShotDuration()

void HAL_SetOneShotDuration ( HAL_SolenoidHandle  solenoidPortHandle,
int32_t  durMS,
int32_t *  status 
)

Sets the one shot duration on a solenoid channel.

Parameters
solenoidPortHandlethe solenoid handle
durMSthe one shot duration in ms

◆ HAL_SetSolenoid()

void HAL_SetSolenoid ( HAL_SolenoidHandle  solenoidPortHandle,
HAL_Bool  value,
int32_t *  status 
)

Sets a solenoid output value.

Parameters
solenoidPortHandlethe solenoid handle
valuetrue for on, false for off