Skip to content

pwm_set_mask_enabled missing complementary pwm_get_mask_enabled #3045

Description

@sprickett

Adding a formal get function would complement the existing set function

uint32_t slice_mask = pwm_hw->en;  // Where is pwm_get_mask_enabled() when you want it?
slice_mask |= 1u << pwm_gpio_to_slice_num(RED_PIN);
slice_mask |= 1u << pwm_gpio_to_slice_num(GREEN_PIN);
slice_mask |= 1u << pwm_gpio_to_slice_num(BLUE_PIN);
pwm_set_mask_enabled(slice_mask);

Obviously one could just write:

pwm_hw->en |= slice_mask;

But formal get and set functions are perhaps nicer.

I notice that get functions are few and far between so there might be a reason why this is not here already

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions