WPILibC++ 2027.0.0-alpha-2
Loading...
Searching...
No Matches
DutyCycle Functions

Functions

HAL_DutyCycleHandle HAL_InitializeDutyCycle (int32_t channel, const char *allocationLocation, int32_t *status)
 Initialize a DutyCycle input.
 
void HAL_FreeDutyCycle (HAL_DutyCycleHandle dutyCycleHandle)
 Free a DutyCycle.
 
void HAL_SetDutyCycleSimDevice (HAL_DutyCycleHandle handle, HAL_SimDeviceHandle device)
 Indicates the duty cycle is used by a simulated device.
 
double HAL_GetDutyCycleFrequency (HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
 Get the frequency of the duty cycle signal.
 
double HAL_GetDutyCycleOutput (HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
 Get the output ratio of the duty cycle signal.
 
int32_t HAL_GetDutyCycleHighTime (HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
 Get the raw high time of the duty cycle signal.
 

Detailed Description

Function Documentation

◆ HAL_FreeDutyCycle()

void HAL_FreeDutyCycle ( HAL_DutyCycleHandle dutyCycleHandle)

Free a DutyCycle.

Parameters
dutyCycleHandlethe duty cycle handle

◆ HAL_GetDutyCycleFrequency()

double HAL_GetDutyCycleFrequency ( HAL_DutyCycleHandle dutyCycleHandle,
int32_t * status )

Get the frequency of the duty cycle signal.

Parameters
[in]dutyCycleHandlethe duty cycle handle
[out]statusError status variable. 0 on success.
Returns
frequency in Hertz

◆ HAL_GetDutyCycleHighTime()

int32_t HAL_GetDutyCycleHighTime ( HAL_DutyCycleHandle dutyCycleHandle,
int32_t * status )

Get the raw high time of the duty cycle signal.

Parameters
[in]dutyCycleHandlethe duty cycle handle
[out]statusError status variable. 0 on success.
Returns
high time of last pulse in nanoseconds

◆ HAL_GetDutyCycleOutput()

double HAL_GetDutyCycleOutput ( HAL_DutyCycleHandle dutyCycleHandle,
int32_t * status )

Get the output ratio of the duty cycle signal.

0 means always low, 1 means always high.

Parameters
[in]dutyCycleHandlethe duty cycle handle
[out]statusError status variable. 0 on success.
Returns
output ratio between 0 and 1

◆ HAL_InitializeDutyCycle()

HAL_DutyCycleHandle HAL_InitializeDutyCycle ( int32_t channel,
const char * allocationLocation,
int32_t * status )

Initialize a DutyCycle input.

Parameters
[in]channelthe smartio channel
[in]allocationLocationthe location where the allocation is occurring (can be null)
[out]statusError status variable. 0 on success.
Returns
the created duty cycle handle

◆ HAL_SetDutyCycleSimDevice()

void HAL_SetDutyCycleSimDevice ( HAL_DutyCycleHandle handle,
HAL_SimDeviceHandle device )

Indicates the duty cycle is used by a simulated device.

Parameters
handlethe duty cycle handle
devicesimulated device handle