Skip to content

Commit

Permalink
src: lib: PWM: Add get_pwm_enable
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulTrombin authored and patrickelectric committed Mar 4, 2024
1 parent 74cdbd6 commit 15cd1c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lib.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 15cd1c8

Please sign in to comment.