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

Add methods to enable/disable the entire timer #183

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,10 @@ pub trait Capture {
/// # type Channel = Channel;
/// # type Time = KiloHertz;
/// # type Duty = u16;
/// # fn disable(&mut self, _: Channel) { unimplemented!() }
/// # fn enable(&mut self, _: Channel) { unimplemented!() }
/// # fn disable(&mut self) { unimplemented!() }
/// # fn enable(&mut self) { unimplemented!() }
/// # fn channel_disable(&mut self, _: Channel) { unimplemented!() }
/// # fn channel_enable(&mut self, _: Channel) { unimplemented!() }
/// # fn get_duty(&self, _: Channel) -> u16 { unimplemented!() }
/// # fn get_max_duty(&self) -> u16 { 0 }
/// # fn set_duty(&mut self, _: Channel, _: u16) {}
Expand All @@ -862,11 +864,17 @@ pub trait Pwm {
/// (e.g. `0.0 .. 1.0`) or an integer representation (e.g. `0 .. 65535`)
type Duty;

/// Disables a PWM timer (all channels)
fn disable(&mut self);

/// Enables a PWM timer (all channels)
fn enable(&mut self);

/// Disables a PWM `channel`
fn disable(&mut self, channel: Self::Channel);
fn channel_disable(&mut self, channel: Self::Channel);

/// Enables a PWM `channel`
fn enable(&mut self, channel: Self::Channel);
fn channel_enable(&mut self, channel: Self::Channel);

/// Returns the current PWM period
fn get_period(&self) -> Self::Time;
Expand Down