Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Header: #include <applibs/pwm.h>
Sets the state of a PWM channel for a PWM controller.
int PWM_Apply(int pwmFd, PWM_ChannelId pwmChannel, const PwmState *newState);
Parameters
pwmFdThe file descriptor for the PWM controller. PWM_Open retrieves the file descriptor.pwmChannelThe zero-based index that identifies the PWM channel to update. The maximum value permitted depends on the platform.newStateA pointer to a PwmState struct that contains the new settings to apply. The pointer must remain valid for the duration of the call.
Errors
Returns -1 if an error is encountered and sets errno to the error value.
EBADF: the file descriptor is invalid.
ENODEV: the
pwmChannelparameter is invalid. Verify whether the channel is valid for the hardware platform.EINVAL: the
newStateparameter passed is invalid. Verify that thenewStateparameter isn't NULL, and contains valid settings.
Return value
Returns 0 for success, or -1 for failure, in which case errno is set to the error value.
Application manifest requirements
To access a PWM controller, your application must identify it in the Pwm field of the application manifest.