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

Allow PullUp and PullDown inputs for timer pwm_input and qei #357

Merged
merged 1 commit into from
Aug 17, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added DMA receive support for `SPI`
- Added `release` functions to SPI DMA
- Add GPIOF/GPIOG support for high/xl density lines
- Allow using `Input<PullUp>` and `Input<PullDown>` for timers' pwm and qei inputs.

### Fixed
- Fix > 2 byte i2c reads
Expand Down
8 changes: 4 additions & 4 deletions src/pwm_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::pac::TIM4;
use crate::pac::{TIM2, TIM3};

use crate::afio::MAPR;
use crate::gpio::{self, Floating, Input};
use crate::gpio::{self, Input};
use crate::rcc::{Clocks, GetBusFreq, RccBus};
use crate::time::Hertz;
use crate::timer::Timer;
Expand All @@ -21,11 +21,11 @@ pub trait Pins<REMAP> {}

use crate::timer::sealed::{Ch1, Ch2, Remap};

impl<TIM, REMAP, P1, P2> Pins<REMAP> for (P1, P2)
impl<TIM, REMAP, P1, P2, MODE1, MODE2> Pins<REMAP> for (P1, P2)
where
REMAP: Remap<Periph = TIM>,
P1: Ch1<REMAP> + gpio::PinExt<Mode = Input<Floating>>,
P2: Ch2<REMAP> + gpio::PinExt<Mode = Input<Floating>>,
P1: Ch1<REMAP> + gpio::PinExt<Mode = Input<MODE1>>,
P2: Ch2<REMAP> + gpio::PinExt<Mode = Input<MODE2>>,
{
}

Expand Down