Commit Graph

4740 Commits

Author SHA1 Message Date
66622de82a fix set_handler context 2021-01-06 10:49:08 -06:00
f6be0b8d12 Add gpio WaitForFoo traits 2021-01-06 01:10:48 +01:00
61a7cf5c3d Merge pull request #6 from xoviat/stm32f4
Add stm32f4xx series serial driver
2021-01-06 00:41:19 +01:00
938919367a add levels 2021-01-05 17:38:46 -06:00
a9d9f3bf80 fix problems 2021-01-05 17:24:27 -06:00
7bee584808 remove dead code in waker 2021-01-05 17:19:05 -06:00
f62eb66bf2 add new levels 2021-01-05 17:18:24 -06:00
9bb4c97dc2 Merge pull request #14 from timokroeger/uarte-power-optimization
UARTE power optimization and improvements
2021-01-05 22:10:52 +01:00
607e67f51a Cleanup BufferedUarte 2021-01-05 21:14:04 +01:00
3a4dbfa52e Massicely simplify peripheral abstraction 2021-01-05 01:57:05 +01:00
0631623b51 uarte: Low power wait for RX drop 2021-01-04 22:55:40 +01:00
93780fa31d uarte: Wait for the peripheral to be disabled
Prevents a panic in the case of:
1. Abort a receive future
2. Free Uarte::free()
3. Uarte::new()
->  panicked at 'assertion failed: uarte.enable.read().enable().is_disabled()'
2021-01-04 22:55:40 +01:00
9b1f7b8a17 uarte: Enable peripheral with first poll
This fixes a lockup when a future is dropped before it was polled.
2021-01-04 22:55:40 +01:00
85ec9dd16f uarte: Be on safe side with potentially racy code
The PS does not specify how many cycles it takes for a STARTXX task to
generate a XXSTARTED event. I think it is instantaneous but let’s be on
the safe side for the following sequence:
1. poll() starttx
2. drop() txstarted not yet set, but future gets dropped
3. txstarted set by hardware, peripheral enabled after it was dropped
2021-01-04 22:55:40 +01:00
a3b3305b8e uarte: Only stop TX forcefully when a transmissions is running
This comes with insignificant power consumption improvements but makes
the code of the RX and TX case symmetric.
2021-01-04 22:55:40 +01:00
a7c03e4cb6 uarte: Only stop RX forcefully when a reception is running
The STOPRX task always triggers a timeout of ~55bit times until the
RXTO event is generated. Before we disabled the receiver only after
the timeout.
With this change the receiver is stopped right after reception has ended
because the DMA buffer is full.
For forced RX aborts like `stop()` or on drop still need to wait for the
RXTO event before disabling the receiver.
2021-01-04 22:55:40 +01:00
9f28c7ab8d uarte: Do not spin when stopping a receive future
Spinning on drop() is still required when the future has not been
stopped so that DMA finishes before the buffer is released.
2021-01-04 22:55:40 +01:00
9e88718fbd Add "context" pointer to owned interrupt handlers. 2021-01-04 22:25:39 +01:00
d89462fc16 remove macros 2021-01-04 12:53:27 -06:00
f3676e1eab rename examples 2021-01-04 12:52:00 -06:00
be541b94aa Merge branch 'master' into stm32f4 2021-01-04 12:50:22 -06:00
9bf09488f1 fix interrupts 2021-01-04 12:48:13 -06:00
39ca8b8ded Fix build on non-nrf52840 2021-01-03 22:30:47 +01:00
ace4f40f80 Introduce "peripheral" abstraction to share state between main and interrupt. 2021-01-03 01:40:40 +01:00
4ce51795f2 use hal::Pins for BufferedUarte 2021-01-02 20:31:50 +01:00
8fa3294f35 Update readme 2021-01-02 20:13:35 +01:00
0ab88ea279 Add Uart trait, implement it for nrf. 2021-01-02 19:59:37 +01:00
1d53985abe Remove now-stable slice_fill feature 2021-01-02 19:56:05 +01:00
3c7e7220b3 Don't use embedded_dma in nrf uarte. 2021-01-02 19:14:54 +01:00
396d7650ca Add some comments to uart example. 2021-01-01 23:04:18 +01:00
20d3dc87f9 Rename examples -> embassy-nrf-examples 2021-01-01 22:46:32 +01:00
4783222f67 Rename WakerStore -> WakerRegistration. 2021-01-01 22:30:11 +01:00
2ee2d18465 simplify impl. and add interupt idea 2021-01-01 14:59:57 -06:00
d5cb9bebaa implement on irqs 2020-12-31 17:59:01 -06:00
cc8d162859 begin integrate interrupt 2020-12-31 16:59:42 -06:00
cc0076a0eb update hal branch 2020-12-31 16:49:27 -06:00
925ede848e rename uarte as serial 2020-12-31 16:40:51 -06:00
308756f366 generalize uarte 2020-12-31 16:38:31 -06:00
142c01ad01 generalize futures 2020-12-31 16:11:23 -06:00
d52e1b2276 use transfer_complete_flag; make partially generic 2020-12-31 15:58:35 -06:00
ffb92731cd Merge pull request #12 from timokroeger/task-macro-warning
Fix warnings for tasks that take mutable parameters
2020-12-31 16:32:44 +01:00
c17954ccba Fix warnings for tasks that take mutable parameters
#[task]
pub async fn run(mut param: Param) {}

warning: variable does not need to be mutable
2020-12-31 15:38:10 +01:00
43904e8db0 clean-up example 2020-12-30 21:24:32 -06:00
2d979eb4ef add interrupts 2020-12-30 21:14:56 -06:00
ea36029a3d reformat 2020-12-30 19:50:15 -06:00
a5cf65a17b impl. poll:ready 2020-12-30 19:45:07 -06:00
de2b1adafe Merge branch 'master' of https://github.com/akiles/embassy into stm32f4 2020-12-30 13:17:47 -06:00
cd56d2621a Merge pull request #3 from timokroeger/low-power-uarte
(low power) UARTE implementation
2020-12-30 19:57:36 +01:00
c6cf9b801d minor rework to get tx working (maybe) 2020-12-30 12:27:47 -06:00
6695bf0f21 Low power UART driver 2020-12-30 19:24:12 +01:00