aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/timer/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-stm32/src/timer/mod.rs')
-rw-r--r--embassy-stm32/src/timer/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs
index c8f580101..8530c5229 100644
--- a/embassy-stm32/src/timer/mod.rs
+++ b/embassy-stm32/src/timer/mod.rs
@@ -379,7 +379,7 @@ pub(crate) mod sealed {
379 379
380 let regs = Self::regs_gp32(); 380 let regs = Self::regs_gp32();
381 regs.psc().write(|r| r.set_psc(psc)); 381 regs.psc().write(|r| r.set_psc(psc));
382 regs.arr().write(|r| r.set_arr(arr)); 382 regs.arr().write_value(arr);
383 383
384 regs.cr1().modify(|r| r.set_urs(vals::Urs::COUNTERONLY)); 384 regs.cr1().modify(|r| r.set_urs(vals::Urs::COUNTERONLY));
385 regs.egr().write(|r| r.set_ug(true)); 385 regs.egr().write(|r| r.set_ug(true));
@@ -391,7 +391,7 @@ pub(crate) mod sealed {
391 let timer_f = Self::frequency(); 391 let timer_f = Self::frequency();
392 392
393 let regs = Self::regs_gp32(); 393 let regs = Self::regs_gp32();
394 let arr = regs.arr().read().arr(); 394 let arr = regs.arr().read();
395 let psc = regs.psc().read().psc(); 395 let psc = regs.psc().read().psc();
396 396
397 timer_f / arr / (psc + 1) 397 timer_f / arr / (psc + 1)
@@ -399,22 +399,22 @@ pub(crate) mod sealed {
399 399
400 /// Set comapre value for a channel. 400 /// Set comapre value for a channel.
401 fn set_compare_value(&self, channel: Channel, value: u32) { 401 fn set_compare_value(&self, channel: Channel, value: u32) {
402 Self::regs_gp32().ccr(channel.index()).modify(|w| w.set_ccr(value)); 402 Self::regs_gp32().ccr(channel.index()).write_value(value);
403 } 403 }
404 404
405 /// Get capture value for a channel. 405 /// Get capture value for a channel.
406 fn get_capture_value(&self, channel: Channel) -> u32 { 406 fn get_capture_value(&self, channel: Channel) -> u32 {
407 Self::regs_gp32().ccr(channel.index()).read().ccr() 407 Self::regs_gp32().ccr(channel.index()).read()
408 } 408 }
409 409
410 /// Get max compare value. This depends on the timer frequency and the clock frequency from RCC. 410 /// Get max compare value. This depends on the timer frequency and the clock frequency from RCC.
411 fn get_max_compare_value(&self) -> u32 { 411 fn get_max_compare_value(&self) -> u32 {
412 Self::regs_gp32().arr().read().arr() 412 Self::regs_gp32().arr().read()
413 } 413 }
414 414
415 /// Get compare value for a channel. 415 /// Get compare value for a channel.
416 fn get_compare_value(&self, channel: Channel) -> u32 { 416 fn get_compare_value(&self, channel: Channel) -> u32 {
417 Self::regs_gp32().ccr(channel.index()).read().ccr() 417 Self::regs_gp32().ccr(channel.index()).read()
418 } 418 }
419 } 419 }
420 420