Skip to content

Commit 2c4566f

Browse files
FRASTMcarlescufi
authored andcommitted
include: drivers: pwm: extend the pwm flags to be soc specific
Add 8 bits to the pwm_flags_t so that upper byte is reserved for non-standard but soc specific dts flags and keeping the low Byte for standard flags. Some of SoC like STM32 mcus can then define their own flags in their dt-bindings/pwm. Signed-off-by: Francois Ramu <[email protected]>
1 parent 313c49e commit 2c4566f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/drivers/pwm.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ extern "C" {
6464

6565
/**
6666
* @brief Provides a type to hold PWM configuration flags.
67+
*
68+
* The lower 8 bits are used for standard flags.
69+
* The upper 8 bits are reserved for SoC specific flags.
6770
*/
68-
typedef uint8_t pwm_flags_t;
71+
72+
typedef uint16_t pwm_flags_t;
6973

7074
/**
7175
* @typedef pwm_pin_set_t

include/dt-bindings/pwm/pwm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* The `PWM_POLARITY_*` flags are used with pwm_pin_set_cycles(),
1212
* pwm_pin_set_usec(), pwm_pin_set_nsec() or pwm_pin_configure_capture() to
1313
* specify the polarity of a PWM pin.
14+
* The flags are on the lower 8bits of the pwm_flags_t
1415
* @{
1516
*/
1617
/** PWM pin normal polarity (active-high pulse). */

0 commit comments

Comments
 (0)