diff --git a/include/nuttx/timers/pwm.h b/include/nuttx/timers/pwm.h index f6fbdce7173..3e7a7c9812c 100644 --- a/include/nuttx/timers/pwm.h +++ b/include/nuttx/timers/pwm.h @@ -118,13 +118,26 @@ /* These are helper definitions for setting PWM channel output polarity to * logical low or high level. The pulsed output should start with this - * logical value and should return to it when the output is disabled. + * logical value. + * The output polarity of the PWM's disabled channel does not depend on this + * value, refer to DCPOL instead. */ #define PWM_CPOL_NDEF 0 /* Not defined, default value by arch driver should be used */ #define PWM_CPOL_LOW 1 /* Logical zero */ #define PWM_CPOL_HIGH 2 /* Logical one */ +/* PWM disabled channel polarity ********************************************/ + +/* The output of the PWM disabled channel may depend on the platform + * dependant peripheral. These helper definitions can be used for setting + * the disabled channel's output state. + */ + +#define PWM_DCPOL_NDEF 0 /* Not defined, the default output state is arch dependant */ +#define PWM_DCPOL_LOW 1 /* Logical zero */ +#define PWM_DCPOL_HIGH 2 /* Logical one */ + /**************************************************************************** * Public Types ****************************************************************************/ @@ -146,6 +159,7 @@ struct pwm_chan_s ub16_t dead_time_b; #endif uint8_t cpol; + uint8_t dcpol; int8_t channel; }; #endif @@ -174,6 +188,7 @@ struct pwm_info_s * generate an indefinite number of pulses */ # endif uint8_t cpol; /* Channel polarity */ + uint8_t dcpol; /* Disabled channel polarity */ #endif /* CONFIG_PWM_MULTICHAN */ FAR void *arg; /* User provided argument to be used in the