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 committed Mar 1, 2024
1 parent 0ee1f76 commit 3db2ed6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib.rs
Expand Up @@ -349,6 +349,17 @@ fn read_gyro() -> AxisData {
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]
Expand Down Expand Up @@ -508,6 +519,7 @@ cpy_module!(
read_accel,
read_gyro,
pwm_enable,
get_pwm_enable,
set_pwm_freq_prescale,
set_pwm_freq_hz,
set_pwm_channel_value,
Expand Down

0 comments on commit 3db2ed6

Please sign in to comment.