Skip to content

Commit 3bf9c6c

Browse files
committed
rm generics in PwmInput, Qei
1 parent 3dd5610 commit 3bf9c6c

File tree

7 files changed

+258
-326
lines changed

7 files changed

+258
-326
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Breaking changes
1111

12-
- Relax pin type generics for `Serial`, `I2c`, `Spi`, `Can`. [#462]
12+
- Relax pin type generics for `Serial`, `I2c`, `Spi`, `Can`, `Qei`, `PwmInput`. [#462] [#516]
1313
~~Use enums of pin tuples and `Enum::from<(tuple)>` for pin remap before passing to peripheral.~~
1414
Use pin enums and `impl RInto<(enum), R>` for peripheral constructors.
1515
Add `RInto` trait and `Rmp` peripheral wrapper, add `remap` for peripherals. [#514]
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1818
- Take `&Clocks` instead of `Clocks` [#498]
1919
- Temporary replace `stm32f1` with `stm32f1-staging` [#503]
2020
- `Spi` now takes `Option<PIN>` for `SCK`, `MISO`, `MOSI` [#514]
21+
- move `Qei` mod inside `pwm_input` mod [#516]
2122

2223
### Changed
2324

@@ -66,6 +67,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6667
[#510]: https://github.com/stm32-rs/stm32f1xx-hal/pull/510
6768
[#511]: https://github.com/stm32-rs/stm32f1xx-hal/pull/511
6869
[#514]: https://github.com/stm32-rs/stm32f1xx-hal/pull/514
70+
[#516]: https://github.com/stm32-rs/stm32f1xx-hal/pull/516
6971

7072
## [v0.10.0] - 2022-12-12
7173

examples/pwm_input.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
use panic_halt as _;
88

99
use cortex_m_rt::entry;
10-
use stm32f1xx_hal::{
11-
pac,
12-
prelude::*,
13-
timer::{pwm_input::*, Timer},
14-
};
10+
use stm32f1xx_hal::{pac, prelude::*, timer::pwm_input::*};
1511

1612
#[entry]
1713
fn main() -> ! {
@@ -31,11 +27,11 @@ fn main() -> ! {
3127
let (_pa15, _pb3, pb4) = afio.mapr.disable_jtag(gpioa.pa15, gpiob.pb3, gpiob.pb4);
3228
let pb5 = gpiob.pb5;
3329

34-
let pwm_input = Timer::new(p.TIM3, &clocks).pwm_input(
30+
let pwm_input = p.TIM3.remap(&mut afio.mapr).pwm_input(
3531
(pb4, pb5),
36-
&mut afio.mapr,
3732
&mut dbg,
3833
Configuration::Frequency(10.kHz()),
34+
&clocks,
3935
);
4036

4137
loop {

examples/qei.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ use panic_semihosting as _;
99
use cortex_m_semihosting::hprintln;
1010

1111
use cortex_m_rt::entry;
12-
use stm32f1xx_hal::{pac, prelude::*, qei::QeiOptions, timer::Timer};
12+
use stm32f1xx_hal::{
13+
pac,
14+
prelude::*,
15+
timer::{pwm_input::QeiOptions, Timer},
16+
};
1317

1418
#[entry]
1519
fn main() -> ! {
@@ -21,8 +25,6 @@ fn main() -> ! {
2125

2226
let clocks = rcc.cfgr.freeze(&mut flash.acr);
2327

24-
let mut afio = dp.AFIO.constrain();
25-
2628
// let gpioa = dp.GPIOA.split();
2729
let gpiob = dp.GPIOB.split();
2830

@@ -38,7 +40,7 @@ fn main() -> ! {
3840
let c1 = gpiob.pb6;
3941
let c2 = gpiob.pb7;
4042

41-
let qei = Timer::new(dp.TIM4, &clocks).qei((c1, c2), &mut afio.mapr, QeiOptions::default());
43+
let qei = Timer::new(dp.TIM4, &clocks).qei((c1, c2), QeiOptions::default());
4244
let mut delay = cp.SYST.delay(&clocks);
4345

4446
loop {

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ pub mod flash;
142142
pub mod gpio;
143143
pub mod i2c;
144144
pub mod prelude;
145-
pub mod qei;
146145
pub mod rcc;
147146
pub mod rtc;
148147
pub mod serial;

src/prelude.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ pub use crate::rcc::RccExt as _stm32_hal_rcc_RccExt;
2020
pub use crate::serial::SerialExt as _;
2121
pub use crate::spi::SpiExt as _;
2222
pub use crate::time::U32Ext as _stm32_hal_time_U32Ext;
23+
pub use crate::timer::pwm_input::PwmInputExt as _;
24+
pub use crate::timer::pwm_input::QeiExt as _;
2325
#[cfg(feature = "rtic")]
2426
pub use crate::timer::MonoTimerExt as _stm32f4xx_hal_timer_MonoTimerExt;
2527
pub use crate::timer::PwmExt as _stm32f4xx_hal_timer_PwmExt;

src/qei.rs

Lines changed: 0 additions & 201 deletions
This file was deleted.

0 commit comments

Comments
 (0)