Dario Nieuwenhuis
404aa29289
cortex-m: remove owned interrupts.
2023-06-01 03:25:19 +02:00
Grant Miller
7be4337de9
Add #[must_use]
to all futures
2023-02-24 13:01:41 -06:00
Dario Nieuwenhuis
b5cf332cc0
nrf: docs.
2023-02-01 01:17:41 +01:00
Dario Nieuwenhuis
1e2fb0459d
Switch to async-fn-in-trait
2022-11-25 21:02:06 +01:00
Ardelean Calin
eae67d0be8
Review comments. Corrected unused fields.
2022-11-23 14:16:18 +02:00
Ardelean Calin
4f2f375777
Corrected order of use statements.
2022-11-22 17:45:05 +02:00
Ardelean Calin
e7c876d744
Changed pin to private as it is for OutputChannel
2022-11-22 17:36:22 +02:00
Ardelean Calin
64c2e1b9b6
Switched to PeripheralRef for channel.
2022-11-22 17:35:38 +02:00
Ardelean Călin Petru
a074cd0625
Update gpiote.rs
...
Adding these changes enables us to define a channel using a mutable reference to `GPIOTE_CH(n)`, similar to how we can do with other drivers.
So instead of using:
```rust
let freq_in = InputChannel::new(
p.GPIOTE_CH0,
Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
we can use:
```rust
let freq_in = InputChannel::new(
&mut p.GPIOTE_CH0,
Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
2022-11-22 16:56:04 +02:00
Ulf Lilleengen
72c2e985bb
Update embedded-hal versions and explicitly pin
2022-09-29 11:27:46 +02:00
Dario Nieuwenhuis
a0487380da
Replace futures::future::poll_fn -> core::future::poll_fn.
2022-09-22 16:42:49 +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
Dario Nieuwenhuis
a0f1b0ee01
Split embassy crate into embassy-executor, embassy-util.
2022-07-29 23:40:36 +02:00
Dario Nieuwenhuis
709df0dc1d
nrf: replace PhantomData usages with PeripheralRef.
2022-07-23 15:13:47 +02:00
Dario Nieuwenhuis
4901c34d9c
Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral
2022-07-23 14:00:19 +02:00
Dario Nieuwenhuis
be6408e202
Rename unsafe_impl_unborrow to impl_unborrow
2022-07-23 01:33:22 +02:00
Dario Nieuwenhuis
a8703b7598
Run rustfmt.
2022-06-12 22:22:31 +02:00
Dario Nieuwenhuis
5085100df2
Add embassy-cortex-m crate.
...
- 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`.
2022-06-12 21:45:38 +02:00
Dario Nieuwenhuis
6d994351a6
nrf/gpio: Make Input is_high/is_low public.
2022-03-17 23:27:55 +01:00
Dario Nieuwenhuis
9bad9365dc
Update rust nightly, embedded-hal 1.0, embedded-hal-async.
2022-03-11 00:38:07 +01:00
Dario Nieuwenhuis
20e14b8edb
embassy, embassy-nrf: add nightly
Cargo feature to gate nightly-only features.
2022-02-12 01:16:31 +01:00
Dario Nieuwenhuis
7997687f3b
nrf: impl embedded-hal 1.0 and embedded-hal-async traits.
2022-01-13 23:56:39 +01:00
Dario Nieuwenhuis
c432d036c7
nrf/gpiote: expose all functionality as inherent methods.
2022-01-13 23:56:39 +01:00
Dario Nieuwenhuis
3ca01cba8d
nrf/gpio: Rename FlexPin to Flex.
...
FlexPin sounds like it's an owned pin singleton, like AnyPin or NoPin.
2022-01-13 23:56:39 +01:00
Dario Nieuwenhuis
22bc1e4ae1
nrf/gpio: add infallible inherent methods, remove some duplication.
...
This implements Input and Output using FlexPin, to avoid some code duplication.
2021-12-20 00:55:18 +01:00
Dario Nieuwenhuis
153b1bbdbf
nrf/gpiote: remove PortInput, move impls to Input.
2021-12-14 13:23:40 +01:00
Wilfried Chauveau
d5a2462cba
Update embassy-nrf with lifetime bounds on gpio implementations.
2021-11-21 10:25:43 +00:00
Dario Nieuwenhuis
663141b4e4
nrf: add initial nrf5340 support
2021-10-28 03:36:25 +02:00
Dario Nieuwenhuis
c995a97f20
nrf91: support running in both S and NS mode.
2021-10-26 17:40:07 +02:00
Dario Nieuwenhuis
a2e7c24e00
Clippy fixes
2021-10-18 01:05:29 +02:00
Dion Dokter
2c2c284482
Undoing unnecessary changes
2021-10-12 11:55:38 +02:00
Dion Dokter
a8407c8aba
Merge remote-tracking branch 'upstream/master'
2021-10-11 10:59:34 +02:00
Dion Dokter
20674f7126
Initial support for nrf9160
2021-10-11 10:39:38 +02:00
Dario Nieuwenhuis
6e7abba9ff
nrf: rename Cargo feature references from "51" to "nrf51".
...
Note: the feature doesn't actually exist, references are there just in case
nrf51xx is supported in the future.
2021-10-11 01:09:57 +02:00
Dario Nieuwenhuis
ead987245d
embassy: Refactor module structure to remove kitchen-sink util
.
2021-09-11 02:35:35 +02:00
Dario Nieuwenhuis
7bfb763e09
Rename embassy-extras to embassy-hal-common
2021-07-29 13:44:51 +02:00
Dario Nieuwenhuis
7ebd4e3aa9
nrf/gpio: fix unused warning on chips without ports
2021-07-05 02:44:16 +02:00
Dario Nieuwenhuis
105c8504b6
Mark Unborrow as unsafe to implement
2021-05-19 23:29:33 +02:00
Dario Nieuwenhuis
32fc17f0fd
nrf/gpiote: Allow choosing IRQ priority.
2021-05-17 21:27:27 +02:00
Dario Nieuwenhuis
97b01f1c47
nrf/gpiote: initialize automatically
2021-05-17 00:57:20 +02:00
Dario Nieuwenhuis
bd9589d0ce
nrf: add support for nrf52805, nrf52811, nrf52820
2021-05-17 00:57:20 +02:00
Ulf Lilleengen
e2ad5e1395
Add detection of edge transitions for ports
2021-04-16 07:58:24 +02:00
Dario Nieuwenhuis
8b1ffb2cb7
Remove Pin from GPIO traits
2021-04-14 17:04:40 +02:00
Dario Nieuwenhuis
b6496a85d8
nrf/ppi: implement and add example
2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
646be40ac5
nrf/gpiote: make number() public, change to usize
2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
90f599bc2f
nrf/gpiote: update output channel to new API
2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
2bd9323f28
nrf/gpiote: update input channel to new API
2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
1c9f98e1b6
nrf/gpiote: fix irq race condition
...
The interrupt could fire between checking if sense=disabled and registering the waker,
in which case the future would get stuck.
2021-03-29 00:58:58 +02:00
Dario Nieuwenhuis
0e8bb5dc0b
util: Do not unregister waker on wake in AtomicWaker.
2021-03-29 00:58:58 +02:00