From 32ccfc50b2a6b3a92d86767d69e2fa8f80b3cdda Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Wed, 28 Feb 2024 14:44:04 -0300 Subject: [PATCH] src: lib: PWM: Add get_pwm_enable --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 80fa5519c..89cddcc87 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -350,6 +350,18 @@ fn set_pwm_enable(state: bool) { with_navigator!().set_pwm_enable(state) } +#[cpy_fn] +#[comment_c = "Get the PWM chip (PCA9685)'s OE_pin state"] +#[comment_py = "Get the PWM chip (PCA9685)'s OE_pin state.\n + Returns:\n + bool: `True` -> ON, `False` -> OFF.\n + Examples:\n + Please check :py:func:`set_pwm_channel_value`\n + >>> navigator.get_pwm_enable()"] +fn get_pwm_enable() -> bool { + with_navigator!().get_pwm_enable() +} + #[cpy_fn] #[comment_c = "LOW_LEVEL: Sets the PWM frequency of the PCA9685 chip. All channels use the same frequency."] #[comment_py = "LOW_LEVEL: Sets the PWM frequency of the PCA9685 chip. All channels use the same frequency.\n\n @@ -507,6 +519,7 @@ cpy_module!( read_accel, read_gyro, set_pwm_enable, + get_pwm_enable, set_pwm_freq_prescale, set_pwm_freq_hz, set_pwm_channel_value,