From 7cf0886e6f9636f740d1c9dc3b19a423f00b0d13 Mon Sep 17 00:00:00 2001 From: Shaun Prickett Date: Mon, 29 Jun 2026 22:50:35 +0100 Subject: [PATCH 1/2] Implement pwm_get_mask_enabled --- src/rp2_common/hardware_pwm/include/hardware/pwm.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/rp2_common/hardware_pwm/include/hardware/pwm.h b/src/rp2_common/hardware_pwm/include/hardware/pwm.h index 4e111ec89..5149e814c 100644 --- a/src/rp2_common/hardware_pwm/include/hardware/pwm.h +++ b/src/rp2_common/hardware_pwm/include/hardware/pwm.h @@ -557,12 +557,21 @@ static inline void pwm_set_enabled(uint slice_num, bool enabled) { /** \brief Enable/Disable multiple PWM slices simultaneously * \ingroup hardware_pwm * - * \param mask Bitmap of PWMs to enable/disable. Bits 0 to 7 enable slices 0-7 respectively + * \param mask Bitmask of PWMs to enable/disable. Bits 0 to 7 enable slices 0-7 respectively */ static inline void pwm_set_mask_enabled(uint32_t mask) { pwm_hw->en = mask; } +/** \brief Get PWM slice enabled status + * \ingroup hardware_pwm + * + * \param Bitmask of all PWM slices currently enabled + */ +static inline uint32_t pwm_get_mask_enabled(void) { + return pwm_hw->en; +} + /** * \def PWM_DEFAULT_IRQ_NUM() * \ingroup hardware_pwm From 215c3a24d7cf93cf8cddb52cf72ad23cc9e55342 Mon Sep 17 00:00:00 2001 From: Shaun Prickett Date: Wed, 1 Jul 2026 20:43:38 +0100 Subject: [PATCH 2/2] Fix bad doc --- src/rp2_common/hardware_pwm/include/hardware/pwm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rp2_common/hardware_pwm/include/hardware/pwm.h b/src/rp2_common/hardware_pwm/include/hardware/pwm.h index 5149e814c..42eed1f52 100644 --- a/src/rp2_common/hardware_pwm/include/hardware/pwm.h +++ b/src/rp2_common/hardware_pwm/include/hardware/pwm.h @@ -566,7 +566,7 @@ static inline void pwm_set_mask_enabled(uint32_t mask) { /** \brief Get PWM slice enabled status * \ingroup hardware_pwm * - * \param Bitmask of all PWM slices currently enabled + * \return Bitmask of all PWM slices currently enabled */ static inline uint32_t pwm_get_mask_enabled(void) { return pwm_hw->en;