xoviat
316be179af
stm32: move to bind_interrupts
...
disable lora functionality for now
2023-05-24 17:29:56 -05:00
Timo Kröger
977a7906e4
stm32 uart: Fix error flag handling for blocking operations
...
Clear and report the error flags one by one and pop the data byte only
after all error flags were handled.
For v1/v2 we emulate the v3/v4 behaviour by buffering the status
register because a read to the data register clears all flags at once
which means we might loose all but the first error.
2023-05-14 21:10:37 +02:00
Dirk Stolle
0584312ef0
Fix some typos
2023-05-08 23:25:01 +02:00
Dario Nieuwenhuis
a61701b756
stm32/usart: add OVER8 and PRESC support, update PAC
2023-05-02 19:36:00 +02:00
Dario Nieuwenhuis
96e8a7ddb9
stm32/uart: feature-gate ringbuffer out when using gpdma, not supported yet.
2023-05-01 22:43:23 +02:00
Rasmus Melchior Jacobsen
45843034ec
Actually clear idle flag
2023-05-01 22:42:36 +02:00
Rasmus Melchior Jacobsen
7757405908
Remove unused import
2023-05-01 22:42:36 +02:00
Rasmus Melchior Jacobsen
fc268df6f5
Support overflow detection for more than one ring-period
2023-05-01 22:42:36 +02:00
Rasmus Melchior Jacobsen
4ea6662e55
Do not disable dma request when idle line is detected
2023-05-01 22:42:36 +02:00
Rasmus Melchior Jacobsen
49455792cb
Ring-buffered uart rx with one-period overrun detection
2023-05-01 22:42:36 +02:00
xoviat
b77794c9a7
stm32/uart: abort on error
2023-04-28 21:43:03 -05:00
Dario Nieuwenhuis
173c65b543
stm32/dma: refactor.
2023-04-18 16:37:35 +02:00
Dario Nieuwenhuis
f681b9d4e5
Remove the _todo_embedded_hal_serial impls. EH will probably not have these serial traits.
2023-04-15 00:58:58 +02:00
Mathias
472dc6b7d1
Fix interrupt handling so it is similar to before the rework, and fix examples
2023-03-31 15:57:35 +02:00
Mathias
cfbe93c280
Rework bufferedUart to get rid of PeripheralMutex in a similar fashion as nrf & rp. Also adds embedded-hal traits to bufferedUart
2023-03-31 10:43:30 +02:00
Mathias
14f6bc88ea
Remove unnecessary lifetime
2023-03-28 14:34:36 +02:00
Mathias
2d7f35cf57
Add embedded-io blocking Read + Write for BufferedUart
2023-03-28 14:28:44 +02:00
bors[bot]
c8a7b74bc2
Merge #1192 #1193
...
1192: stm32/usart: implement stop_bits configuration r=Dirbaio a=pattop
1193: stm32/usart: fix LPUART clock multiplier r=Dirbaio a=pattop
According to RM0351 Rev 9 (L4) and RM0399 Rev 3 (H7):
baud = (256 * clock) / LPUARTDIV
Co-authored-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
2023-02-06 13:39:37 +00:00
Patrick Oppenlander
fda36fd81b
stm32/usart: fix LPUART clock multiplier
...
According to RM0351 Rev 9 (L4) and RM0399 Rev 3 (H7):
baud = (256 * clock) / LPUARTDIV
2023-02-06 11:22:41 +11:00
Patrick Oppenlander
64ebb9b7fe
stm32/usart: implement stop_bits configuration
2023-02-06 09:44:15 +11:00
huntc
6ab4ecaf83
Stop sampling when exiting the Saadc methods
...
Prior to this commit, the onDrop function was being dropped immediately and not on exiting the Saadc sampling methods.
2023-01-18 14:51:46 +11:00
Rasmus Melchior Jacobsen
16590732f8
Update mod.rs
2023-01-14 07:13:29 +01:00
Rasmus Melchior Jacobsen
816b214403
Only implement Write
2023-01-14 07:12:43 +01:00
Rasmus Melchior Jacobsen
4c4b47f78a
feat(stm32): Add embedded-io traits for UartRx and UartTx
2023-01-06 14:24:29 +01:00
Rasmus Melchior Jacobsen
5aa59e9737
feat(stm32): Let uart implement embedded-io Read/Write
2023-01-04 12:57:19 +01:00
Dario Nieuwenhuis
10c9cc31b1
Remove unnecessary use of atomic-polyfill.
...
Only use it when CAS is actually needed.
2022-12-23 20:46:49 +01:00
Vincent Stakenburg
236d104844
embassy-stm32: add rs485 driver enable to uart
2022-12-09 14:26:09 +01:00
Matous Hybl
e1d7d8d841
stm32: Enable fifo for buffered uart
2022-11-30 22:17:51 +01:00
Dario Nieuwenhuis
1e2fb0459d
Switch to async-fn-in-trait
2022-11-25 21:02:06 +01:00
Guillaume MICHEL
1365ce6ab8
embassy-stm32: Fix bug when Uart::read future is dropped and DMA request was not stopped
...
fixes issue #1045
regression was introduced with PR #1031
2022-11-07 17:46:32 +01:00
bors[bot]
1f246d0e37
Merge #1034
...
1034: stm32/usart: Fix bug where USART idle flag could end a `read` prematuraly r=Dirbaio a=guillaume-michel
on STM32, when setting USART `detect_previous_overrun = true`, the idle flag is not cleared and could result in premature end of the `read` method.
This PR fixes that.
Co-authored-by: Guillaume MICHEL <guillaume@squaremind.io>
2022-10-28 11:22:53 +00:00
Guillaume MICHEL
49e1091309
embassy-stm32: Fix bug where USART idle flag could end a read
prematuraly
2022-10-28 10:49:59 +02:00
Guillaume MICHEL
79b49c6fae
embassy-stm32: remove duplicated code for USART general configuration
2022-10-28 09:32:05 +02:00
Guillaume MICHEL
f053bf742c
embassy-stm32: Add support for hardware flow control for BufferedUart
2022-10-28 09:04:36 +02:00
Guillaume MICHEL
9423987ac5
embassy-stm32: Add hardware flow control constructor for UartRx and UartTx
2022-10-28 09:04:36 +02:00
Guillaume MICHEL
9cac649fcf
stm32: Add support for read_until_idle on UART
2022-10-26 19:06:18 +02:00
Dario Nieuwenhuis
eeb072d9cb
Update Rust nightly.
2022-10-26 16:47:29 +02:00
Mathias
66611a80ca
Introduce shared new_inner for uart instantiation
2022-10-26 11:51:37 +02:00
Mathias
d1eee52625
Merge branch 'master' of https://github.com/embassy-rs/embassy into embassy-stm32/uart-flowcontrol
2022-10-26 11:47:00 +02:00
Mathias
a283c47557
Implement embedded-hal-nb for uart
2022-09-30 06:04:19 +02:00
Mathias
f9c62d4f1d
Add flowcontrol to UART
2022-09-29 09:12:17 +02:00
Mathias
dc90006982
Remove code duplication on nb_read
2022-09-29 07:58:11 +02:00
Mathias
823bd714fb
Add E-H1 uart blocking & nb implementation
2022-09-28 05:19:43 +02:00
Guillaume MICHEL
daf2744716
Rework STM32 BufferedUart internals so we can split into Rx and Tx like embassy-nrf
2022-09-26 15:32:29 +02:00
Dario Nieuwenhuis
a0487380da
Replace futures::future::poll_fn -> core::future::poll_fn.
2022-09-22 16:42:49 +02:00
Vincent Stakenburg
c4d5c047d7
make State::new()
const, consistent with others
2022-09-15 12:34:17 +02:00
Dario Nieuwenhuis
8ba421f324
Do not use cfg_if for embedded-hal-async feature gates.
...
Old code used `cfg_if!` because rustc still parses code inside disabled cfg's, and Rust stable at that time couldn't parse the new GAT where-clause location. This is not the case anymore.
2022-08-31 03:11:21 +02:00
Dario Nieuwenhuis
21072bee48
split embassy-util
into embassy-futures
, embassy-sync
.
2022-08-22 22:18:13 +02:00
Vincent Stakenburg
51359e7d24
fix lpuart implementation when there isn't one present
2022-08-19 15:27:11 +02:00
Vincent Stakenburg
a833e02363
implement support for LPUART
2022-08-19 12:05:19 +02:00