aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/uarte.rs
Commit message (Collapse)AuthorAgeFilesLines
* Address @Dirbaio's commentsJustin Beaurivage2024-02-051-9/+9
|
* RustfmtJustin Beaurivage2024-01-311-3/+9
|
* Add error handling to UarteRxWithIdleJustin Beaurivage2024-01-311-12/+23
|
* Handle Uarte RX errorsJustin Beaurivage2024-01-301-11/+84
|
* Update embedded-hal to 1.0.0-rc.1 (#1783)Dario Nieuwenhuis2023-08-161-48/+0
|
* Rename embassy-hal-common to embassy-hal-internal, document it's for ↵Dario Nieuwenhuis2023-07-281-2/+2
| | | | internal use only. (#1700)
* embassy-nrf: Idle detection for RX only uarteTimo Kröger2023-06-131-44/+51
| | | | | Introduce `with_idle()` to upgrade an `UarteRx` instance to `UarteRxWithIdle`. Use the method in the split constructor aswell.
* Make interrupt module more standard.Dario Nieuwenhuis2023-06-081-11/+11
| | | | | | | | | | | | - Move typelevel interrupts to a special-purpose mod: `embassy_xx::interrupt::typelevel`. - Reexport the PAC interrupt enum in `embassy_xx::interrupt`. This has a few advantages: - The `embassy_xx::interrupt` module is now more "standard". - It works with `cortex-m` functions for manipulating interrupts, for example. - It works with RTIC. - the interrupt enum allows holding value that can be "any interrupt at runtime", this can't be done with typelevel irqs. - When "const-generics on enums" is stable, we can remove the typelevel interrupts without disruptive changes to `embassy_xx::interrupt`.
* cortex-m: remove owned interrupts.Dario Nieuwenhuis2023-06-011-7/+7
|
* nrf/uarte: fix deref warning, fix errata not being applied on nrf53.Dario Nieuwenhuis2023-05-191-6/+4
|
* Remove the _todo_embedded_hal_serial impls. EH will probably not have these ↵Dario Nieuwenhuis2023-04-151-77/+0
| | | | serial traits.
* common/peripheral: do not require mut in PeripheralRef clone_unchecked.Dario Nieuwenhuis2023-04-111-1/+1
|
* nrf/uart: switch to new interrupt binding.Dario Nieuwenhuis2023-03-061-42/+43
|
* nrf/buffered_uarte: remove PeripheralMutex, make it work without rts/cts.Dario Nieuwenhuis2023-03-041-0/+5
| | | | | | | | | | | | | | | | | | | > dirbaio: so I was checking how zephyr does UARTE RX on nRF > dirbaio: because currently we have the ugly "restart DMA on line idle to flush it" hack > dirbaio: because according to the docs "For each byte received over the RXD line, an RXDRDY event will be generated. This event is likely to occur before the corresponding data has been transferred to Data RAM." > dirbaio: so as I understood it, the only way to guarantee the data is actually transferred to RAM is to stop+restart DMA > dirbaio: well, guess what? > dirbaio: they just count RXDRDY's, and process that amount of data without restarting DMA > dirbaio: with a timer configured as counter https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/serial/uart_nrfx_uarte.c#L650-L692 > dirbaio: 🤔🤷⁉️ > dirbaio: someone saying you can do the "hook up rxdrdy to a counter" trick, someone else saying it's wrong 🤪 https://devzone.nordicsemi.com/f/nordic-q-a/28420/uarte-in-circular-mode So we're going to do just that! - BufferedUarte is lock-free now. No PeripheralMutex. - The "restart DMA on line idle to flush it" hack is GONE. This means - It'll work correctly without RTS/CTS now. - It'll have better throughput when using RTS/CTS.
* nrf: docs.Dario Nieuwenhuis2023-02-011-24/+52
|
* Fix a typoKentaro Okuda2022-12-301-1/+1
|
* nrf/uart: do not error on zero length transfers.Dario Nieuwenhuis2022-12-151-10/+10
| | | | | | It's a perfectly fine thing to do, should be just a noop. Erroring is really annoying when you're writing a payload to uart that might be zero-length or not.
* Switch to async-fn-in-traitDario Nieuwenhuis2022-11-251-2/+24
|
* Removes some of the code duplication for UarteWithIdlehuntc2022-10-091-267/+131
| | | | This commit removes some of the code duplication for UarteWithIdle at the expense of requiring a split. As the example illustrates though, this expense seems worth the benefit in terms of maintenance, and the avoidance of copying over methods. My main motivation for this commit was actually due to the `event_endtx` method not having been copied across.
* Update embedded-hal versions and explicitly pinUlf Lilleengen2022-09-291-2/+2
|
* Replace futures::future::poll_fn -> core::future::poll_fn.Dario Nieuwenhuis2022-09-221-1/+1
|
* Do not use cfg_if for embedded-hal-async feature gates.Dario Nieuwenhuis2022-08-311-49/+50
| | | | 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.
* split `embassy-util` into `embassy-futures`, `embassy-sync`.Dario Nieuwenhuis2022-08-221-1/+1
|
* Split embassy crate into embassy-executor, embassy-util.Dario Nieuwenhuis2022-07-291-1/+1
|
* nrf: replace PhantomData usages with PeripheralRef.Dario Nieuwenhuis2022-07-231-15/+14
|
* Remove PeripheralRef::into_inner()Dario Nieuwenhuis2022-07-231-21/+40
|
* Rename Unborrowed -> PeripheralRef, Unborrow -> PeripheralDario Nieuwenhuis2022-07-231-78/+78
|
* WIP: Make unborrow safe to useGrant Miller2022-07-231-53/+34
|
* nrf/uart: add support for tx-only and rx-only uart.Dario Nieuwenhuis2022-06-251-27/+149
| | | | | Allow creating UarteRx/UarteTx directly. This allows using uart unidirectionally (rx-only or tx-only), without having to 'waste' a pin for the unused direction.
* Add more API docs for embassy-cortex-m and embassy-nrfUlf Lilleengen2022-06-231-3/+3
|
* Update rust nightly. (#819)Dario Nieuwenhuis2022-06-181-3/+3
|
* Run rustfmt.Dario Nieuwenhuis2022-06-121-21/+10
|
* Add embassy-cortex-m crate.Dario Nieuwenhuis2022-06-121-2/+2
| | | | | | - Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`. - Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore) - Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`.
* Add split method to UarteWithIdleZoey Riordan2022-04-271-20/+49
|
* Switch to crates.io embedded-hal, embedded-hal-async.Dario Nieuwenhuis2022-04-221-1/+1
| | | | | This temporarily removes support for the async UART trait, since it's not yet in embedded-hal-async.
* Update rust nightly, embedded-hal 1.0, embedded-hal-async.Dario Nieuwenhuis2022-03-111-76/+49
|
* Move EasyDMA documentation to module levelTil Blechschmidt2022-03-081-1/+5
|
* Refactor _from_ram methods to use more readable copy operationTil Blechschmidt2022-03-021-6/+6
|
* Change UARTE methods to copy slice if required and add non-copying variantsTil Blechschmidt2022-03-021-1/+35
|
* Merge #613bors[bot]2022-02-121-31/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 613: Rust stable support r=Dirbaio a=Dirbaio This PR adds (limited) stable Rust support! The drawbacks are: - No `#[embassy::task]`, `#[embassy::main]`. (requires `type_alias_impl_trait`). You have to manually allocate the tasks somewhere they'll live forever. See [example](https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/raw_spawn.rs) - No async trait impls (requires GATs). Note that the full API surface of HALs is still available through inherent methods: #552 #581 - Some stuff is not constructible in const (requires `const_fn_trait_bound`), although there's an (ugly) workaround for the generic `Mutex`. So it's not that bad in the end, it's fully usable for shipping production-ready firmwares. We'll still recommend nightly as the default, until GATs and `type_alias_impl_trait` are stable. Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * embassy, embassy-nrf: add `nightly` Cargo feature to gate nightly-only features.Dario Nieuwenhuis2022-02-121-31/+30
| |
* | nrf: remove OptionalPinDario Nieuwenhuis2022-02-121-18/+102
|/
* nrf: impl embedded-hal 1.0 and embedded-hal-async traits.Dario Nieuwenhuis2022-01-131-0/+203
|
* nrf/uarte: expose all functionality as inherent methods.Dario Nieuwenhuis2022-01-131-184/+257
|
* Makes the uarte endtx event availablehuntc2022-01-101-0/+6
| | | | This commit allows event_endtx to be used outside of the Uarte itself. As a consequence, PPI can be used to drive tasks given the end of transmission on the Uarte. This is particularly useful for situations like RS485 where a GPIO must be set to high when transmitting then cleared when done. A non-ppi approach can cause a delay in the clearing of this GPIO as other Embassy tasks might become scheduled.
* Set Uarte log levels to tracehuntc2021-12-171-11/+11
| | | | I noticed lots of logging which really slows things down and is not useful outside of a debugging context, hence set to trace.
* Remove unneeded rustfmt::skipUlf Lilleengen2021-12-161-14/+28
|
* Properly initialise refcounthuntc2021-12-161-1/+5
|
* Too much copy/pastahuntc2021-12-161-109/+0
| | | | The tx permitted reads and the rx permitted writes!
* Ref count the peripheral drophuntc2021-12-161-10/+24
|