Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updade: Integrations navigator 0.3.1 - lib: PWM: Change pwm_enable to set_pwm_enable #59

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ crate-type = ["cdylib"]
cpy-binder = "1.0"
libc = "0.2"
pyo3 = { version = "0.18", features = ["extension-module", "abi3-py39"], optional = true }
navigator-rs = { version = "=0.3.0" }
navigator-rs = { version = "0.3.1" }
rand = "0.8"
lazy_static = "1.4.0"

Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ fn read_gyro() -> AxisData {
state (bool): The desired PWM chip state. `True` -> ON, `False` -> OFF.\n
Examples:\n
Please check :py:func:`set_pwm_channel_value`\n
>>> navigator.pwm_enable(True)"]
fn pwm_enable(state: bool) {
with_navigator!().pwm_enable(state)
>>> navigator.set_pwm_enable(True)"]
fn set_pwm_enable(state: bool) {
with_navigator!().set_pwm_enable(state)
}

#[cpy_fn]
Expand All @@ -373,7 +373,7 @@ fn pwm_enable(state: bool) {
>>> import bluerobotics_navigator as navigator\n
>>> navigator.set_pwm_freq_prescale(119)\n
>>> navigator.set_pwm_channel_value(PwmChannel.Ch1, 2000)\n
>>> navigator.pwm_enable(True)"]
>>> navigator.set_pwm_enable(True)"]
fn set_pwm_freq_prescale(value: u8) {
with_navigator!().set_pwm_freq_prescale(value)
}
Expand All @@ -393,7 +393,7 @@ fn set_pwm_freq_prescale(value: u8) {
>>> import bluerobotics_navigator as navigator\n
>>> navigator.set_pwm_freq_hz(60)\n
>>> navigator.set_pwm_channel_value(PwmChannel.Ch1, 2000)\n
>>> navigator.pwm_enable(True)"]
>>> navigator.set_pwm_enable(True)"]
fn set_pwm_freq_hz(freq: f32) {
with_navigator!().set_pwm_freq_hz(freq)
}
Expand All @@ -402,7 +402,7 @@ fn set_pwm_freq_hz(freq: f32) {
#[comment_c = "Sets the duty cycle (the proportion of ON time) for the selected PWM channel."]
#[comment_py = "Sets the duty cycle (the proportion of ON time) for the selected PWM channel.\n
This sets the PWM channel's OFF counter, with the ON counter hard-coded to 0.\n
The output turns ON at the start of each cycle, then turns OFF after the specified count
The output turns ON at the start of each cycle, then turns OFF after the specified count
(value), where each full cycle (defined by :py:func:`set_pwm_freq_hz`) is split into 4096
segments.\n
Notes:\n
Expand All @@ -421,7 +421,7 @@ fn set_pwm_freq_hz(freq: f32) {
>>> navigator.init()\n
>>> navigator.set_pwm_freq_hz(1000)\n
>>> navigator.set_pwm_channel_value(PwmChannel.Ch1, 2000)\n
>>> navigator.pwm_enable(True)"]
>>> navigator.set_pwm_enable(True)"]
fn set_pwm_channel_value(channel: PwmChannel, value: u16) {
with_navigator!().set_pwm_channel_value(channel.into(), value)
}
Expand Down Expand Up @@ -506,7 +506,7 @@ cpy_module!(
read_mag,
read_accel,
read_gyro,
pwm_enable,
set_pwm_enable,
set_pwm_freq_prescale,
set_pwm_freq_hz,
set_pwm_channel_value,
Expand Down
Loading