eZio Pan
5dc3738bc2
add missing interrupt for timer
2024-04-05 00:51:20 +02:00
eZio Pan
78b9cb98d4
"separate CC interrupt" is for AdvCh4 only
2024-04-05 00:51:20 +02:00
eZio Pan
348a46b110
move enable_outputs
to private trait ...
...
... to avoid API leaking.
2024-04-05 00:51:20 +02:00
Dario Nieuwenhuis
2bca875b5f
stm32: use private_bounds for sealed traits.
2024-03-23 01:38:51 +01:00
Dario Nieuwenhuis
389cbc0a77
stm32/timer: simplify traits, convert from trait methods to struct.
2024-03-23 01:37:28 +01:00
René van Dorst
fb9d42684b
stm32: Fix psc compile error with current stm32-data
...
Commit cc525f1b25
has changed the definition of the `psc` register.
Update timer/mod.rs to reflect the stm32-data change.
2024-03-20 19:59:17 +01:00
Dario Nieuwenhuis
eca9aac194
Fix warnings in recent nightly.
2024-03-20 16:39:09 +01:00
Ralf
b7bb4b23f8
STM32 SimplePwm: Fix regression and re-enable output pin
...
PR #2499 implemented timer hierarchy, but removed enable_outputs()
from trait CaptureCompare16bitInstance and from SimplePwm.
This functions is required for advanced timers to set bit BDTR.MOE
and to enable the output signal.
2024-03-08 11:18:45 +01:00
eZio Pan
47c579eba2
update metapac
2024-02-29 00:11:40 +08:00
Torin Cooper-Bennun
5c45723777
stm32: timers: use TIMx_CC interrupt source for advanced timers
...
fixes (hopefully) time driver when using TIM1/8/20
2024-02-26 10:03:51 +00:00
Dario Nieuwenhuis
e8474426d8
hal-internal: remove impl DerefMut for PeripheralRef.
...
if you have `PeripheralRef<'a, AnyPIn>` for pin A, and `AnyPin` (owned) for pin B, you can `mem::swap` them.
so, getting access forever to pin A, just by "sacrificing" pin B
this defeats the point of PeripheralRef, which is if you got a `PeripheralRef<'a, T>` then you're only allowed to use the peripheral for `'a`.
Also some drivers rely on the fact only one instance of a singleton exists for soundness, so this is a soundness fix for those.
2024-02-20 01:02:15 +01:00
eZio Pan
b4399a1bf5
timer-doc-fix
2024-02-10 16:22:36 +08:00
eZio Pan
8fd803a5fe
use cfg_if to reduce macro condition
2024-02-10 00:00:43 +01:00
eZio Pan
0f94006be3
doc fix
2024-02-10 00:00:43 +01:00
eZio Pan
6c690ab259
restore original public API of timer, but keep new PAC
2024-02-10 00:00:43 +01:00
eZio Pan
b3cdf3a040
bug fix
2024-02-10 00:00:43 +01:00
eZio Pan
319f10da5d
stm32-timer: filter out c0, f1 and f37x
2024-02-10 00:00:43 +01:00
eZio Pan
5b646bc3bd
stm32-timer: L0 is special
2024-02-10 00:00:43 +01:00
eZio Pan
d538829f2f
add methods with macro
2024-02-10 00:00:43 +01:00
eZio Pan
dc4898ca89
update timer mod after stm32-metapac timer_v2
2024-02-09 23:58:13 +01:00
Dario Nieuwenhuis
7e02389995
Merge pull request #2410 from eZioPan/waveform-on-CHx
...
impl waveform with TIM OC Channel DMA
2024-02-01 01:02:01 +00:00
Ralf
db776c9623
stm32/simple_pwm: add set_output_compare_mode
2024-01-10 18:48:26 +01:00
eZio Pan
b16cc04036
bug fix
2024-01-08 19:18:24 +08:00
eZio Pan
890a1269d0
refactor with clippy
2024-01-06 22:48:21 +08:00
eZio Pan
424ddaf3d9
impl waveform with TIM Channel
2024-01-06 22:22:38 +08:00
Dario Nieuwenhuis
638aa313d4
stm32/pwm: simplify impl blocks.
2024-01-02 17:28:23 +01:00
Dario Nieuwenhuis
cad4efe57f
stm32/timer: add missing supertrait bounds.
2024-01-02 17:28:08 +01:00
eZio Pan
c276da5fcb
ask a DMA Channel only when use .gen_waveform()
2024-01-02 14:01:09 +08:00
eZio Pan
873ee06151
some trivial fix
...
use less #[cfg] macro; reuse same variable
2023-12-30 12:01:08 +08:00
eZio Pan
24f569821c
record&restore TIM OC to it's earlier state
2023-12-29 23:22:10 +08:00
eZio Pan
8c2a6df03b
implement PWM waveform generating with DMA
2023-12-28 20:09:12 +08:00
Dario Nieuwenhuis
189b15c426
stm32/timer: docs.
2023-12-19 17:35:38 +01:00
Dario Nieuwenhuis
124478c5e9
stm32: more docs.
2023-12-18 19:11:23 +01:00
eZio Pan
879c0ad989
after stm32-metapac update, TIM CR1 ARPE enum to bool
2023-12-14 21:33:35 +08:00
Grant Miller
8c0e2748db
stm32/timer: Fix frequency off-by-one
2023-12-01 22:09:15 -06:00
Dion Dokter
5b3f75dc72
Merge branch 'master' into center-align
2023-10-20 14:17:55 +02:00
Dion Dokter
6f2995cd4c
Invert assert
2023-10-20 10:41:39 +02:00
Ralf
9a7fda87b0
STM32: timer enable_output does not take bool, but just enables the output
2023-10-13 18:52:10 +02:00
Ralf
adc810d24b
STM32: Fix regression in advanced timer to enable output of PWM signal by partly reverting commit 74eb519
2023-10-13 17:38:40 +02:00
pbert
ecdd7c0e2f
enable clock first
2023-10-12 11:04:44 +02:00
pbert
f65a96c541
STM32: combine RccPeripherals reset() and enable() to reset_and_enable()
2023-10-12 11:04:19 +02:00
randi
710874021a
Implemented Pwm trait for complementary pwm from embedded_hal
2023-10-07 12:22:31 +13:00
randi
b217d147de
Implemented Pwm trait from embedded_hal
2023-10-07 11:57:19 +13:00
Dion Dokter
a9dc887060
Added clarifying comment
2023-10-02 21:41:30 +02:00
Dion Dokter
137e47f98d
Do affect the frequency
2023-10-02 21:14:44 +02:00
Dion Dokter
561126b0d6
stm32: Add the ability to center-align timers
2023-10-01 23:09:01 +02:00
xoviat
4999de6f82
rustfmt
2023-09-30 12:53:17 -05:00
Daniel Berlin
9b8bdad403
Fix clippy error exposed by moving out of macros
2023-09-30 13:07:11 -04:00
Daniel Berlin
3c3fb0a529
Remove unused imports
2023-09-30 12:20:31 -04:00
Daniel Berlin
dc4c27aead
Move one more method out of macros
2023-09-30 12:16:47 -04:00