Package edu.wpi.first.hal
Class DutyCycleJNI
java.lang.Object
edu.wpi.first.hal.JNIWrapper
edu.wpi.first.hal.DutyCycleJNI
public class DutyCycleJNI extends JNIWrapper
DutyCycle HAL JNI functions.
- See Also:
- "DutyCycle.h"
-
Nested Class Summary
-
Method Summary
Modifier and Type Method Description static void
free(int handle)
Free a DutyCycle.static int
getFPGAIndex(int handle)
Get the FPGA index for the DutyCycle.static int
getFrequency(int handle)
Get the frequency of the duty cycle signal.static int
getHighTime(int handle)
Get the raw high time of the duty cycle signal.static double
getOutput(int handle)
Get the output ratio of the duty cycle signal.static int
getOutputScaleFactor(int handle)
Get the scale factor of the output.static int
initialize(int digitalSourceHandle, int analogTriggerType)
Initialize a DutyCycle input.
-
Method Details
-
initialize
Initialize a DutyCycle input.- Parameters:
digitalSourceHandle
- the digital source to use (either a Digital Handle or a AnalogTrigger Handle)analogTriggerType
- the analog trigger type of the source if it is an analog trigger- Returns:
- the created duty cycle handle
- See Also:
- "HAL_InitializeDutyCycle"
-
free
Free a DutyCycle.- Parameters:
handle
- the duty cycle handle- See Also:
- "HAL_FreeDutyCycle"
-
getFrequency
Get the frequency of the duty cycle signal.- Parameters:
handle
- the duty cycle handle- Returns:
- frequency in Hertz
- See Also:
- "HAL_GetDutyCycleFrequency"
-
getOutput
Get the output ratio of the duty cycle signal.0 means always low, 1 means always high.
- Parameters:
handle
- the duty cycle handle- Returns:
- output ratio between 0 and 1
- See Also:
- "HAL_GetDutyCycleOutput"
-
getHighTime
Get the raw high time of the duty cycle signal.- Parameters:
handle
- the duty cycle handle- Returns:
- high time of last pulse in nanoseconds
- See Also:
- "HAL_GetDutyCycleHighTime"
-
getOutputScaleFactor
Get the scale factor of the output.An output equal to this value is always high, and then linearly scales down to 0. Divide a raw result by this in order to get the percentage between 0 and 1. Used by DMA.
- Parameters:
handle
- the duty cycle handle- Returns:
- the output scale factor
- See Also:
- "HAL_GetDutyCycleOutputScaleFactor"
-
getFPGAIndex
Get the FPGA index for the DutyCycle.- Parameters:
handle
- the duty cycle handle- Returns:
- the FPGA index
- See Also:
- "HAL_GetDutyCycleFPGAIndex"
-