This is an automated email from the ASF dual-hosted git repository. Donny9 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 392fe2ab4b13ba58bde934206a5c1868d4c81181 Author: yangsong8 <[email protected]> AuthorDate: Fri Nov 13 21:03:20 2026 +0800 Documentation: describe the optional PWM ioctl commands. Document PWMIOC_SETOUTPUTIDLE, PWMIOC_GETOUTPUTSTATE, PWMIOC_ENABLENOTIFY, PWMIOC_DISABLENOTIFY, PWMIOC_GETPOWERSTATE and PWMIOC_SETPOWERSTATE. Assisted-by: Kiro:claude-opus-5-5 Signed-off-by: yangsong8 <[email protected]> --- Documentation/os/drivers/character/timers/pwm.rst | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Documentation/os/drivers/character/timers/pwm.rst b/Documentation/os/drivers/character/timers/pwm.rst index 59169ba92e4..cbce4028569 100644 --- a/Documentation/os/drivers/character/timers/pwm.rst +++ b/Documentation/os/drivers/character/timers/pwm.rst @@ -182,6 +182,41 @@ performed. This may not be supported by all drivers. +The following commands call optional lower half methods. They return +``-ENOSYS`` if the lower half does not provide the method. + +.. c:macro:: PWMIOC_SETOUTPUTIDLE + +Force the output of a channel to its idle state (see ``dcpol``) at once. +The argument is the channel number. + +.. c:macro:: PWMIOC_GETOUTPUTSTATE + +Read the output level of a channel. The argument is a pointer to +``struct pwm_output_state_s``: the caller sets ``channel`` and the driver +fills ``state`` (``true`` for high). + +.. c:macro:: PWMIOC_ENABLENOTIFY + +Enable the edge notification of a channel. The argument is a pointer to +``struct pwm_notify_s`` with the channel and the edge (``PWM_EDGE_RISING``, +``PWM_EDGE_FALLING`` or ``PWM_EDGE_BOTH``). + +.. c:macro:: PWMIOC_DISABLENOTIFY + +Disable the edge notification of a channel. The argument is the channel +number. + +.. c:macro:: PWMIOC_GETPOWERSTATE + +Read the power state of the device. The argument is a pointer to +``uint8_t``. ``PWM_FULL_POWER`` is the full power state; other values are +driver specific. + +.. c:macro:: PWMIOC_SETPOWERSTATE + +Change the power state of the device. The argument is the new state. + Application Example ~~~~~~~~~~~~~~~~~~~
