drivers: pwm: clarify behavior

As written the specification when both period and pulse are zero is
inconsistent: allowed behavior would be to drive the pin at constant
active or constant inactive, depending on which condition was checked
first.

Clarify that driving constant active level requres a non-zero pulse
equal to period.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-05-25 08:39:59 -05:00 committed by Carles Cufí
commit a4337bde28

View file

@ -60,10 +60,10 @@ __subsystem struct pwm_driver_api {
/**
* @brief Set the period and pulse width for a single PWM output.
*
* Passing 0 to the @p pulse will cause the pin to be driven to a constant
* Passing 0 as @p pulse will cause the pin to be driven to a constant
* inactive level.
* Passing a @p pulse equal @p period will cause the pin to be driven
* to a constant active level.
* Passing a non-zero @p pulse equal to @p period will cause the pin
* to be driven to a constant active level.
*
* @param dev Pointer to the device structure for the driver instance.
* @param pwm PWM pin.