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:
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.hal.JNIWrapper
JNIWrapper.Helper -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckPWMChannel(int channel) Checks if a pwm channel is valid.static voidfreePWMPort(int pwmPortHandle) Frees a PWM port.static intgetPulseTimeMicroseconds(int pwmPortHandle) Gets the current microsecond pulse time from a PWM channel.static intinitializePWMPort(int channel) Initializes a PWM port.static voidsetPulseTimeMicroseconds(int pwmPortHandle, int microsecondPulseTime) Sets a PWM channel to the desired pulse width in microseconds.static voidsetPWMOutputPeriod(int pwmPortHandle, int period) Sets the PWM output period.static voidsetPWMSimDevice(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, setDIOSimDeviceMethods 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:
-
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
-