Package edu.wpi.first.hal
Class PWMJNI
java.lang.Object
edu.wpi.first.hal.JNIWrapper
edu.wpi.first.hal.DIOJNI
edu.wpi.first.hal.PWMJNI
PWM JNI Functions.
- See Also:
-
- "hal/PWM.h"
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.hal.JNIWrapper
JNIWrapper.Helper
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkPWMChannel
(int channel) Checks if a pwm channel is valid.static void
freePWMPort
(int pwmPortHandle) Frees a PWM port.static int
getPulseTimeMicroseconds
(int pwmPortHandle) Gets the current microsecond pulse time from a PWM channel.static int
initializePWMPort
(int channel) Initializes a PWM port.static void
setPulseTimeMicroseconds
(int pwmPortHandle, int microsecondPulseTime) Sets a PWM channel to the desired pulse width in microseconds.static void
setPWMOutputPeriod
(int pwmPortHandle, int period) Sets the PWM output period.static void
setPWMSimDevice
(int handle, int device) Indicates the pwm is used by a simulated device.Methods inherited from class edu.wpi.first.hal.DIOJNI
allocateDigitalPWM, checkDIOChannel, freeDigitalPWM, freeDIOPort, getDIO, getDIODirection, initializeDIOPort, isAnyPulsing, isPulsing, pulse, pulseMultiple, setDigitalPWMDutyCycle, setDigitalPWMOutputChannel, setDigitalPWMPPS, setDigitalPWMRate, setDIO, setDIODirection, setDIOSimDevice
Methods inherited from class edu.wpi.first.hal.JNIWrapper
forceLoad, suppressUnused
-
Method Details
-
initializePWMPort
Initializes a PWM port.- Parameters:
channel
- the smartio channel- Returns:
- the created pwm handle
-
checkPWMChannel
Checks if a pwm channel is valid.- Parameters:
channel
- the channel to check- Returns:
- true if the channel is valid, otherwise false
-
freePWMPort
Frees a PWM port.- Parameters:
pwmPortHandle
- the pwm handle
-
setPWMSimDevice
Indicates the pwm is used by a simulated device.- Parameters:
handle
- the pwm handledevice
- simulated device handle- See Also:
-
- "HAL_SetPWMSimDevice"
-
setPulseTimeMicroseconds
Sets a PWM channel to the desired pulse width in microseconds.- Parameters:
pwmPortHandle
- the PWM handlemicrosecondPulseTime
- the PWM value to set
-
getPulseTimeMicroseconds
Gets the current microsecond pulse time from a PWM channel.- Parameters:
pwmPortHandle
- the PWM handle- Returns:
- the current PWM microsecond pulse time
-
setPWMOutputPeriod
Sets the PWM output period.- Parameters:
pwmPortHandle
- the PWM handle.period
- 0 for 5ms, 1 or 2 for 10ms, 3 for 20ms
-