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
Adding a formal get function would complement the existing set function
Obviously one could just write:
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