PWM_Open Function

Header: #include <applibs/pwm.h>

Opens a PWM controller, and returns a file descriptor to use for subsequent calls.

int PWM_Open(PWM_ControllerId pwm);

Parameters

  • pwm The zero-based index of the PWM controller to access. The maximum value permitted depends on the platform.

Errors

Returns -1 if an error is encountered and sets errno to the error value.

  • EACCES: access to the PWM interface is not permitted because the pwm parameter is not listed in the Pwm field of the application manifest.

Return value

Returns the file descriptor for the PWM controller if it was opened successfully, 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.