Commit Graph

1452 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
5d5cd23715
Update to embedded-io 0.5 (#1752) 2023-08-07 13:43:09 +02:00
Grant Miller
d49f40dd5c embassy-stm32: Misc clippy fixes 2023-08-06 15:00:39 -05:00
xoviat
ae608cf2fa stm32: fix rtc and examples 2023-08-06 12:06:29 -05:00
xoviat
28618d12a1 stm32/rtc: restructure 2023-08-06 11:58:28 -05:00
xoviat
66c1712118 stm32/rtc: enable in rcc mod 2023-08-06 11:11:53 -05:00
Josh Junon
7b3d7a3826 stm32: add note about Output/OutputOpenDrain drop behavior 2023-08-06 05:58:38 +02:00
xoviat
e80db42061 stm32/dma: minor cleanup, optmization 2023-08-04 17:15:56 -05:00
xoviat
7e269f6f17 stm32/dma: consolidate ringbuf 2023-08-03 21:12:34 -05:00
Dario Nieuwenhuis
0d8a9b1e7a
Merge pull request #1729 from mattico/i2c-async-timeout
stm32: add async timeout functions to I2c and TimeoutI2c
2023-08-01 08:20:48 +00:00
Bartek
5fcebd28f4 Fix unlocking the backup domain when enabling LSE
Set PWREN bit to enable the power interface clock before enabling access to the backup domain.
2023-08-01 13:46:34 +09:30
xoviat
a1fce1b554
Merge pull request #1714 from xoviat/dma
stm32/dma: add writable ringbuf
2023-07-31 22:57:30 +00:00
xoviat
bbc8424a5b stm32/dma: remove trace 2023-07-31 17:55:25 -05:00
Matt Ickstadt
036bc669cd stm32: only enable async TimeoutI2c on V2 I2C peripheral 2023-07-31 14:17:50 -05:00
Matt Ickstadt
26cc0e634d stm32: add async timeout functions to I2c and TimeoutI2c 2023-07-31 13:47:03 -05:00
Matt Ickstadt
1b0f4ee653 stm32: add outlives bounds to TimeoutI2c impl blocks
This should make usage and error messages more clear.
2023-07-31 13:35:06 -05:00
xoviat
4a9df60a7b
Merge pull request #1727 from embassy-rs/hrtim-v2
stm32: add hrtim v2
2023-07-31 17:04:51 +00:00
Dario Nieuwenhuis
5c2ba3b212 stm32: add hrtim v2 2023-07-31 15:42:03 +02:00
Dario Nieuwenhuis
6caf627262
Merge pull request #1704 from rubdos/ieee802154-fixes
Expose IEEE802.15.4 address in Driver
2023-07-31 12:30:33 +00:00
Ruben De Smet
4afdce4ec5
Introduce driver::HardwareAddress without smoltcp dependency 2023-07-31 14:21:26 +02:00
Dario Nieuwenhuis
036e00113e stm32/flash: avoid pointless "if flag is set, set it". 2023-07-31 12:48:52 +02:00
Dario Nieuwenhuis
958cace36d
Merge pull request #1724 from bguruprasath5/stm32g0-flash-support
Added STM32G0 Flash Support
2023-07-31 10:35:28 +00:00
dev-guruprasath
42b21fd7ae added flash support 2023-07-31 13:56:16 +05:30
chemicstry
ad85beb677 stm32/can: Add more derives for CAN Envelope 2023-07-31 10:32:17 +03:00
chemicstry
780569c08a Merge remote-tracking branch 'origin/main' into bxcan_timestamp 2023-07-31 10:29:20 +03:00
xoviat
ffa0c08140 stm32/dma: fix condition check 2023-07-30 20:22:14 -05:00
xoviat
c38c85ef1f stm32/dma: add traces 2023-07-30 19:39:17 -05:00
Dario Nieuwenhuis
6c6bd11c1a
Merge pull request #1606 from JcBernack/rng-update
STM32: RNG update
2023-07-30 23:44:11 +00:00
Dario Nieuwenhuis
4999b045df stm32/rng: use bind_interrupts!. 2023-07-31 01:41:12 +02:00
Dario Nieuwenhuis
105aa8f452
Merge pull request #1718 from copterust/stm32-spi-set-freq-in-config
Move frequency to SPI config
2023-07-30 22:05:22 +00:00
Dario Nieuwenhuis
3aef5999d5
Merge pull request #1716 from xoviat/rcc-p
stm32/rcc: extract and combine ahb/apb prescalers
2023-07-30 20:43:54 +00:00
Scott Mabin
e8d3e86591 stm32f2: Avoid resetting rtc backup domain
Also ensure the pwr is enabled before trying to initialize. For the F2
series this is in a seperate clock control register.
2023-07-30 21:22:48 +01:00
Jan Christoph Bernack
d6c5c1772c improve RNG polling 2023-07-30 22:19:34 +02:00
Jan Christoph Bernack
b65406791a add RNG conditioning 2023-07-30 22:16:42 +02:00
xoviat
538cf2bc24 stm32/dma: fix condition check 2023-07-30 14:02:41 -05:00
bofh
1d815f4ba0 Fix typo 2023-07-30 18:20:36 +02:00
bofh
aef93246b4 Fix Spi::new_internal call in i2s 2023-07-30 18:11:39 +02:00
bofh
6b1d802caa Move frequency to SPI config 2023-07-30 18:01:34 +02:00
xoviat
6f30e92c7a stm32/dma: don't write to full ringbuf 2023-07-30 10:57:17 -05:00
xoviat
a8a491212b stm32/rcc: cleanup merge 2023-07-30 10:18:54 -05:00
xoviat
2f18770e27 stm32/rcc: extract and combine ahb/apb prescalers 2023-07-30 09:52:30 -05:00
xoviat
087e649bc2 stm32/dma: fix typos 2023-07-30 09:28:02 -05:00
xoviat
fd9b6487e1 stm32/dma: impl. wringbuf for bdma 2023-07-30 09:25:58 -05:00
xoviat
603c4cb4fa stm32/dma: complete initial ringbuf impl. 2023-07-30 09:18:33 -05:00
Dario Nieuwenhuis
8bed573b88
Merge pull request #1713 from MabezDev/stm32f2-pll-overflow
stm32f2 PLL overflow with crystal
2023-07-30 12:16:52 +00:00
xoviat
8064f4bfe0 stm32/dma: add draft writable dma buf 2023-07-29 20:10:29 -05:00
xoviat
6256a6c57c fix comments 2023-07-29 19:27:16 -05:00
xoviat
bae31ebce7 stm32/dma: rename ringbuf 2023-07-29 19:25:18 -05:00
Scott Mabin
e0ce7fcde7 stm32f2 pll overflow with crystal
With a large enough HSE input frequency, the vco clock calculation will
overflow a u32. Therefore, in this specific case we have to use the
inner value and cast to u64 to ensure the mul isn't clipped before
applying the divider.
2023-07-30 01:00:53 +01:00
xoviat
a9f6e30bcd rustfmt 2023-07-29 12:03:01 -05:00
xoviat
0d7b005252 stm32/pwm: add output type control 2023-07-29 12:01:32 -05:00
Dario Nieuwenhuis
fcbfd224a7
Merge pull request #1706 from mattico/timeouti2c-lifetime
TimeoutI2c: allow ref to live shorter than peripheral
2023-07-28 23:08:06 +00:00
xoviat
5bb5654d84 stm32/hrtim: pub instance 2023-07-28 17:39:01 -05:00
xoviat
a8d3bcbb75 stm32/hrtim: shorten names 2023-07-28 17:37:14 -05:00
xoviat
ec787d3518 stm32/hrtim: cleanup merge issues 2023-07-28 17:27:15 -05:00
xoviat
c7c701b3e3 Merge branch 'main' of https://github.com/embassy-rs/embassy into hrtim 2023-07-28 17:18:22 -05:00
xoviat
e495d606ec stm32/hrtim: extract traits 2023-07-28 17:16:46 -05:00
xoviat
28136579e9 stm32/hrtim: extract into mod 2023-07-28 17:07:08 -05:00
Matt Ickstadt
5a8704b4d8 TimeoutI2c: allow ref to live shorter than peripheral 2023-07-28 11:16:43 -05:00
JuliDi
6dd2fc5941
add document-features 2023-07-28 16:59:13 +02:00
Dario Nieuwenhuis
3690af9bea
stm32/timer: merge pwm module into timer. (#1703)
The traits there are applicable to timer use cases other than PWM.
It doesn't make sense to keep them separated.
2023-07-28 15:29:27 +02:00
Dario Nieuwenhuis
8d8c642845
Merge pull request #1701 from chemicstry/bxcan_methods2
stm32/can: implement more convenience methods
2023-07-28 11:44:30 +00:00
Dario Nieuwenhuis
036e6ae30c
Rename embassy-hal-common to embassy-hal-internal, document it's for internal use only. (#1700) 2023-07-28 13:23:22 +02:00
chemicstry
38b5d1ee2b stm32/can: implement more convenience methods 2023-07-28 14:22:24 +03:00
Dario Nieuwenhuis
2e4f89068a
Merge pull request #1686 from xoviat/usart
stm32/usart: fix error msg for lptim
2023-07-28 10:42:32 +00:00
xoviat
44c8db2911
Merge pull request #1681 from alexferro/feature/stm32-dma-read-exact
Add a STM32/DMARingBuffer::read_exact helper
2023-07-28 01:16:48 +00:00
chemicstry
62ab0bf2e7 stm32/can: implement proper RX timestamps 2023-07-25 12:12:45 +03:00
xoviat
77e34c5e8a
Merge pull request #1684 from xoviat/wpan
stm32/rcc: move rcc logic from ipcc
2023-07-25 01:22:07 +00:00
xoviat
270d1d59a0 stm32/rcc: use wpan default only for wpan 2023-07-24 18:25:15 -05:00
xoviat
3c41784de8 stm32/usart: fix error msg for lptim 2023-07-24 18:08:23 -05:00
xoviat
1425dda0a7 stm32/rcc: fix minor issues 2023-07-24 17:19:45 -05:00
Dario Nieuwenhuis
9f898c460f
Merge pull request #1685 from chemicstry/bxcan_async_enable
stm32/can: bxcan async enable
2023-07-24 15:24:18 +00:00
chemicstry
2a0fe73045 stm32/can: bxcan async enable 2023-07-24 17:53:23 +03:00
xoviat
bd60f003e0 stm32/rcc: move rcc logic from ipcc 2023-07-23 17:01:34 -05:00
Alex Ferro
4883fdd154 Add a STM32/DMARingBuffer::read_exact helper
This provides a helper function with an async implementation, that
will only return (or error) when it was able to read that many bytes,
sleeping until ready.

Additionally, corrected the documentation for Ringbuffer functions to use
"elements" instead of "bytes" as the types were already generic over the
word/element size.
2023-07-22 17:17:01 -06:00
xoviat
d42dff45de Merge branch 'main' of https://github.com/embassy-rs/embassy into hrtim 2023-07-22 14:49:31 -05:00
JuliDi
8e230bf6ec
add missing TransferOptions fields for DMA 2023-07-22 21:36:03 +02:00
JuliDi
a56b3e9a44
update feature gates for v3 2023-07-22 19:47:36 +02:00
JuliDi
0378366e29
Merge remote-tracking branch 'xoviat/update-metapac' into fix-dac-example 2023-07-22 19:26:20 +02:00
JuliDi
80ce6d1fb7
update DAC triggers to incorporate v3 2023-07-22 19:25:02 +02:00
xoviat
ba8e5d8589 rustfmt 2023-07-22 12:10:50 -05:00
xoviat
192cdc2f85 stm32: suppress adc f3 2023-07-22 12:07:02 -05:00
xoviat
64f8a779ca stm32: add dac fix 2023-07-22 11:54:54 -05:00
xoviat
5693ed1178 stm32: add minimal fdcan impl 2023-07-22 11:50:30 -05:00
Adam Greig
e5b4641f9e
stm32/dac: set pin mode to analog (ref #334) 2023-07-22 13:19:26 +01:00
Alessandro Pezzato
36ff688fab stm32/uart: optimize swap_rx_tx 2023-07-19 10:50:40 +02:00
Alessandro Pezzato
3df2c71e6c stm32/uart: add swap_rx_tx 2023-07-19 10:26:47 +02:00
Dario Nieuwenhuis
10f5966787 Convert files to LF endings. 2023-07-18 14:24:58 +02:00
xoviat
55ac480cb0 stm32/eth: fix cfg(not(time)) 2023-07-17 16:24:09 -05:00
xoviat
17d5e1c470 stm32/eth: add set_poll_interval 2023-07-15 12:02:08 -05:00
xoviat
975a780efe stm32/eth: impl. poll interval 2023-07-15 09:57:09 -05:00
xoviat
c3774607a5 stm32/eth: convert static metho 2023-07-15 09:37:25 -05:00
xoviat
48b37aa2bf stm32/eth: refactor genericsmi 2023-07-15 09:32:36 -05:00
Phil Markgraf
3bae533066
Enable RTC on STM32WL chips (#1645)
* Add clippy allow to not report if same then branch

* Support enabling RTC clock on STM32WL

* Add clippy allow to not report if same then branch

* Support enabling RTC clock on STM32WL

* Add rtc example for stm32wl

* Address code review feedback
2023-07-15 13:40:23 +02:00
Dario Nieuwenhuis
dff9bd9711 Remove trivial to remove uses of atomic-polyfill. 2023-07-12 18:30:43 +02:00
shakencodes
29f3d5b68d Ensure I2C master_stop() called after error 2023-07-10 16:40:33 -07:00
David Purser
69b4e898b3
Correctly calculate target VCO frequency from multipliers 2023-07-07 20:52:44 -05:00
Dario Nieuwenhuis
f8d608093f stm32/otg: implement EndpointError::Disabled for reads.
It was implemented only for writes.
2023-07-07 03:55:57 +02:00
Dario Nieuwenhuis
ffeb40ff43 stm32/otg: change some info logs to trace. 2023-07-06 13:49:19 +02:00
xoviat
864202a23a
Merge pull request #1578 from schphil/can-split
stm32 can split method
2023-07-05 23:27:53 +00:00
Mathias
1255d8a8ce Merge branch 'main' of https://github.com/embassy-rs/embassy into embassy-stm32/rcc-rtc-l4 2023-07-05 12:36:42 +02:00
Dario Nieuwenhuis
eb57bb298f
Merge pull request #1617 from xoviat/const-rcc
stm32/rcc: allow const-propagation
2023-07-04 22:31:55 +00:00
xoviat
953c745ed8 stm32/rcc: allow const-propagation 2023-07-04 16:29:46 -05:00
Dario Nieuwenhuis
9c4df46c46 rustfmt. 2023-07-04 21:34:55 +02:00
Dario Nieuwenhuis
a101d9078d update embedded-hal crates. 2023-07-04 19:59:36 +02:00
William Yager
0c4180cdd0 fmt 2023-07-03 19:39:58 -04:00
William Yager
d9824dfd64 Add bank 1 16 bit 2023-07-03 19:39:51 -04:00
Philipp Scheff
a96f30edf4 allow deed code can rx & clippy 2023-07-03 23:48:07 +02:00
Philipp Scheff
af15b49bfe fmt 2023-07-03 22:57:33 +02:00
Mathias
60b2f075dc Merge branch 'main' of https://github.com/embassy-rs/embassy into embassy-stm32/rcc-rtc-l4 2023-07-03 19:33:26 +02:00
xoviat
0c49e6747c wip 2023-07-02 22:00:50 -05:00
Dario Nieuwenhuis
c9b9be5b81 hal-common: require DerefMut for peripherals, not just Deref.
Otherwise you can create multiple drivers on the same singleton like this:

```rust
let mut input = Input::new(&pin, Pull::None);
let mut output = Output::new(&pin, Level::Low, Speed::Low);
input.is_high();
output.set_high();
input.is_high();
output.set_high();
```

Thanks @pennae for reporting.
2023-07-02 22:16:01 +02:00
xoviat
2e6b813225 hrtim: add guardrails on bridge sec. duty 2023-07-02 09:17:12 -05:00
xoviat
aceba1c03f hrtim: fix example and auto adjust psc. 2023-07-01 21:47:44 -05:00
xoviat
8141d53d94 Merge branch 'main' of https://github.com/embassy-rs/embassy into hrtim 2023-07-01 17:32:25 -05:00
xoviat
21a8653195 hrtim: minor cleanup 2023-07-01 17:32:16 -05:00
Mathias
d372df7ddb L4: Switch to MSI to prevent problems with PLL configuration, and enable power to AHB bus clock to allow RTC to run 2023-07-01 12:16:23 +02:00
xoviat
6e13f5b387 rustfmt 2023-06-30 18:33:22 -05:00
xoviat
c07854fed8 stm32/hrtim: minor fixes 2023-06-30 18:22:02 -05:00
xoviat
8c4997c5fc stm32/hrtim: impl. bridge, dead-time part. res. 2023-06-30 18:22:01 -05:00
xoviat
3252eaa060 stm32/hrtim: add example impl. 2023-06-30 18:21:59 -05:00
xoviat
348019e37f stm32/hrtim: impl channel alloc type system 2023-06-30 18:21:58 -05:00
xoviat
b9eb3dfad7 stm32/hrtim: add api concept 2023-06-30 18:21:57 -05:00
xoviat
71513ccb39 stm32/hrtim: impl. draft frequency computation 2023-06-30 18:21:57 -05:00
xoviat
cdb3fb059f stm32/hrtim: first draft 2023-06-30 18:21:42 -05:00
Dario Nieuwenhuis
6eb46c419c
Merge pull request #1565 from JuliDi/main
Implement DMA for DAC on STM32
2023-06-29 08:54:28 +00:00
Julian
96f1525ffe
Revert changes to dma.rs 2023-06-29 09:20:25 +02:00
Dario Nieuwenhuis
e892014b65 Update stm32-metapac, includes chiptool changes to use real Rust enums now. 2023-06-29 02:01:33 +02:00
Kevin Lannen
5666c56903 STM32G4: Add CRS support to RCC
Create working CRS USB Example
2023-06-28 16:53:16 -06:00
JuliDi
daedfbbd87
add dma is_running change doc 2023-06-28 15:39:36 +02:00
JuliDi
91c31d5e43
Update DAC examples, add DAC + DMA example 2023-06-28 11:58:25 +02:00
Dario Nieuwenhuis
ed493be869 stm32: update metapac, includes fix for OTG with 9 endpoints (H7) 2023-06-27 23:58:32 +02:00
JuliDi
9c81d63155
fix warnings 2023-06-27 22:33:17 +02:00
JuliDi
60c54107ce
fix sdmmc bdma transferconfig fields 2023-06-27 21:58:56 +02:00
JuliDi
56dd22f0ac
feature-gate set_channel_mode, undo dma.rs changes 2023-06-27 21:23:47 +02:00
JuliDi
afec1b439b
feature-gate dma write, make trigger not return a result 2023-06-27 18:17:51 +02:00
Dario Nieuwenhuis
219ef5b37a stm32/otg: add VBUS detection.
Fixes #1442.
2023-06-27 12:52:37 +02:00
Dario Nieuwenhuis
5e6e18b310 stm32/usb: add TODO: implement VBUS detection. 2023-06-27 04:29:01 +02:00
Dario Nieuwenhuis
80407aa930 stm32/otg: set tx fifo num in IN endpoints on configure. 2023-06-27 02:12:33 +02:00
Dario Nieuwenhuis
a575e40a35 stm32/otg: clear NAK bit on endpoint enable. 2023-06-27 02:12:06 +02:00
Dario Nieuwenhuis
28fb492c40 stm32/otg: flush fifos on reconfigure and on ep disable. 2023-06-27 00:42:24 +02:00
JuliDi
e7bc84dda8
fix issues when DAC2 present, add additional options to DMA (NOT YET WORKING with STM32H7A3ZI) 2023-06-26 09:42:25 +02:00
JuliDi
8cafaa1f3c
add docs, cleanup 2023-06-25 11:54:25 +02:00
JuliDi
df944edeef
fix minor issues with splitting channels etc 2023-06-25 10:53:35 +02:00
JuliDi
388d3e273d
first attempt at fixing the 2nd channel problem 2023-06-24 13:10:59 +02:00
JuliDi
915f79c974
allow independent use of ch1 and ch2 on dac 2023-06-23 12:14:40 +02:00
JuliDi
ea04a0277b
change dma complete transfer IR default to true 2023-06-23 12:14:26 +02:00
schphil
71afa40a69
Merge branch 'embassy-rs:main' into can-split 2023-06-23 10:19:30 +02:00
Philipp Scheff
89fbb02979 add as_mut 2023-06-22 17:49:33 +02:00
Philipp Scheff
5ecf9ec7bc split can 2023-06-22 17:17:51 +02:00
JuliDi
78736328a0
update docs and update to new dma interface 2023-06-22 10:44:08 +02:00