aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-09-29 23:23:45 +0000
committerGitHub <[email protected]>2025-09-29 23:23:45 +0000
commitc3a093a505bf6e7a1a679113b9bec68059909e36 (patch)
treef163017441a5652191eaaa5e646a54e5feca22ed /tests
parent2d1e9f91906fd183157182048f2632570a542790 (diff)
parent2cd2894d33e69c8481c360026015397f0742876a (diff)
Merge pull request #4722 from tonarino/qei-config
Allow configuring the pull up/down resistors and Qei mode for the Qei peripheral
Diffstat (limited to 'tests')
-rw-r--r--tests/stm32/src/bin/afio.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/stm32/src/bin/afio.rs b/tests/stm32/src/bin/afio.rs
index cc44dc59c..81d50874b 100644
--- a/tests/stm32/src/bin/afio.rs
+++ b/tests/stm32/src/bin/afio.rs
@@ -12,8 +12,9 @@ use embassy_stm32::time::khz;
12use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; 12use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin};
13use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; 13use embassy_stm32::timer::input_capture::{CapturePin, InputCapture};
14use embassy_stm32::timer::pwm_input::PwmInput; 14use embassy_stm32::timer::pwm_input::PwmInput;
15use embassy_stm32::timer::qei::{Qei, QeiPin}; 15use embassy_stm32::timer::qei::Qei;
16use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; 16use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm};
17use embassy_stm32::timer::{Ch1, Ch2};
17use embassy_stm32::usart::{Uart, UartRx, UartTx}; 18use embassy_stm32::usart::{Uart, UartRx, UartTx};
18use embassy_stm32::{bind_interrupts, Peripherals}; 19use embassy_stm32::{bind_interrupts, Peripherals};
19 20
@@ -258,10 +259,11 @@ async fn main(_spawner: Spawner) {
258 { 259 {
259 // partial remap 260 // partial remap
260 reset_afio_registers(); 261 reset_afio_registers();
261 Qei::new::<AfioRemap<1>>( 262 Qei::new::<Ch1, Ch2, AfioRemap<1>>(
262 p.TIM1.reborrow(), 263 p.TIM1.reborrow(),
263 QeiPin::new(p.PA8.reborrow()), 264 p.PA8.reborrow(),
264 QeiPin::new(p.PA9.reborrow()), 265 p.PA9.reborrow(),
266 Default::default(),
265 ); 267 );
266 defmt::assert_eq!(AFIO.mapr().read().tim1_remap(), 1); 268 defmt::assert_eq!(AFIO.mapr().read().tim1_remap(), 1);
267 } 269 }