|
47 | 47 | the channels have pins connected they can be enabled.
|
48 | 48 |
|
49 | 49 | ```
|
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(); |
52 | 52 |
|
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(); |
56 | 56 |
|
57 | 57 | let mut ch1 = ch1_no_pins
|
58 | 58 | .output_to_pa6(pa6)
|
|
121 | 121 | // 50Hz.
|
122 | 122 | let mut (ch1_no_pins, _, _, _) = tim1(device.TIM3, 9000, 50.Hz(), clocks);
|
123 | 123 |
|
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(); |
126 | 126 |
|
127 | 127 | let mut ch1 = ch1_no_pins.output_to(pa7);
|
128 | 128 | ch1.enable();
|
|
136 | 136 | ```
|
137 | 137 | ...
|
138 | 138 |
|
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(); |
142 | 142 |
|
143 | 143 | let mut ch1 = ch1_no_pins
|
144 | 144 | .output_to(pa7)
|
|
0 commit comments