From c4d8bbd1907deef7836840dc5996cfdb1bd24eac Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Fri, 10 Mar 2023 20:59:47 +0100 Subject: [PATCH] pwm.h: add comment regarding possible channel numbers PWM drivers use channel numbers 0 and -1 to skip the channel and/or all following channels. This situation is well established in the drivers however it was not mentioned in pwm.h file. This commit adds a comment mentioning it. Signed-off-by: Michal Lenc --- include/nuttx/timers/pwm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/nuttx/timers/pwm.h b/include/nuttx/timers/pwm.h index e560117b31..e18b9600d4 100644 --- a/include/nuttx/timers/pwm.h +++ b/include/nuttx/timers/pwm.h @@ -64,6 +64,14 @@ * debug the PWM driver. */ +/* Channel Numbers **********************************************************/ + +/* PWM channels should use numbers from 1 to CONFIG_PWM_NCHANNELS. Channel + * number 0 indicates the channel not used and therefore is skipped by + * the driver (its output remains at the value defined by the peripheral), + * number -1 indicates the channel and all following channels are not used. + */ + /* IOCTL Commands ***********************************************************/ /* The PWM module uses a standard character driver framework. However, since