Skip to content

Commit 6aba91b

Browse files
committed
Update docs
1 parent b30fe24 commit 6aba91b

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

CHANGELOG.md

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

1212
- Make `Clocks` `ppre1()` and `ppre2()` methods public, to get the current
1313
Prescaler value. ([#210])
14-
- Implement `into_xxx` methods for partially erased pins ([#189])
1514
- Enable better GPIO internal resistor configuration ([#189])
1615
- Support for GPIO output slew rate configuration ([#189])
1716
- Support for GPIO interrupts ([#189])
17+
- Implement `into_xxx` methods for erased pins ([#213])
1818

1919
### Changed
2020

@@ -59,6 +59,7 @@ let clocks = rcc
5959
in alternate function mode ([#189])
6060
- GPIO internal resistor configuration is no longer encoded into pin typestate
6161
in input mode ([#189])
62+
- GPIO configuration functions no longer require registers as arguments ([#213])
6263

6364
## [v0.6.1] - 2020-12-10
6465

@@ -313,6 +314,7 @@ let clocks = rcc
313314
[defmt]: https://github.com/knurling-rs/defmt
314315
[filter]: https://defmt.ferrous-systems.com/filtering.html
315316

317+
[#213]: https://github.com/stm32-rs/stm32f3xx-hal/pull/213
316318
[#211]: https://github.com/stm32-rs/stm32f3xx-hal/pull/211
317319
[#210]: https://github.com/stm32-rs/stm32f3xx-hal/pull/210
318320
[#208]: https://github.com/stm32-rs/stm32f3xx-hal/pull/208

src/gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! let dp = pac::Peripherals::take().unwrap();
88
//! let rcc = dp.RCC.constrain();
99
//!
10-
//! let mut gpioa = dp.GPIOA.split(&mut rcc.ahb);
10+
//! let gpioa = dp.GPIOA.split(&mut rcc.ahb);
1111
//! ```
1212
//!
1313
//! The resulting [Parts](gpioa::Parts) struct contains one field for each pin. Every pin type is a

src/pwm.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
the channels have pins connected they can be enabled.
4848
4949
```
50-
let mut gpioa = dp.GPIOB.split(&mut rcc.ahb);
51-
let pa6 = gpioa.pa6.into_af2(&mut gpioa.moder, &mut gpioa.afrl);
50+
let gpioa = dp.GPIOB.split(&mut rcc.ahb);
51+
let pa6 = gpioa.pa6.into_af2_push_pull();
5252
53-
let mut gpiob = dp.GPIOB.split(&mut rcc.ahb);
54-
let pb1 = gpiob.pb1.into_af2(&mut gpiob.moder, &mut gpiob.afrl);
55-
let pb4 = gpiob.pb4.into_af2(&mut gpiob.moder, &mut gpiob.afrl);
53+
let gpiob = dp.GPIOB.split(&mut rcc.ahb);
54+
let pb1 = gpiob.pb1.into_af2_push_pull();
55+
let pb4 = gpiob.pb4.into_af2_open_drain();
5656
5757
let mut ch1 = ch1_no_pins
5858
.output_to_pa6(pa6)
@@ -121,8 +121,8 @@
121121
// 50Hz.
122122
let mut (ch1_no_pins, _, _, _) = tim1(device.TIM3, 9000, 50.Hz(), clocks);
123123
124-
let mut gpioa = dp.GPIOB.split(&mut rcc.ahb);
125-
let pa7 = gpioa.pa7.into_af6(&mut gpioa.moder, &mut gpioa.afrl);
124+
let gpioa = dp.GPIOB.split(&mut rcc.ahb);
125+
let pa7 = gpioa.pa7.into_af6_push_pull();
126126
127127
let mut ch1 = ch1_no_pins.output_to(pa7);
128128
ch1.enable();
@@ -136,9 +136,9 @@
136136
```
137137
...
138138
139-
let mut gpioa = dp.GPIOB.split(&mut rcc.ahb);
140-
let pa7 = gpioa.pa7.into_af6(&mut gpioa.moder, &mut gpioa.afrl);
141-
let pa8 = gpioa.pa8.into_af6(&mut gpioa.moder, &mut gpioa.afrl);
139+
let gpioa = dp.GPIOB.split(&mut rcc.ahb);
140+
let pa7 = gpioa.pa7.into_af6_push_pull();
141+
let pa8 = gpioa.pa8.into_af6_push_pull();
142142
143143
let mut ch1 = ch1_no_pins
144144
.output_to(pa7)

0 commit comments

Comments
 (0)