Commit graph

563 commits

Author SHA1 Message Date
bors[bot]
838f3065ea
Merge #936
936: Add split() method to BufferedUarte in embassy-nrf r=ZoeyR a=ZoeyR

I haven't completed testing this yet. I'm creating this PR early so that I can get corrected if I went way off course.

This PR adds a `split()` method to `BufferedUarte` as discussed on matrix.

Co-authored-by: Zoey Riordan <zoey@dos.cafe>
2022-08-31 10:20:40 +00:00
bors[bot]
1fb6bfbec9
Merge #938
938: Do not use cfg_if for embedded-hal-async feature gates. r=Dirbaio a=Dirbaio

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.


bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-08-31 01:11:49 +00: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
huntc
30641d0564 Avoid context switch and wait for stop
Should be more efficient given the sub 100 cycles to wait.
2022-08-31 08:47:44 +10:00
Zoey Riordan
171077bacf
Avoid double-borrow 2022-08-30 15:57:38 +02:00
Zoey Riordan
b2720117c4
Deduplicate IO methods 2022-08-30 15:48:50 +02:00
Zoey Riordan
4781feafc4
Add split() method to BufferedUarte in embassy-nrf 2022-08-30 15:27:25 +02:00
huntc
dcd8c62169 Permits the future to be cancelled
Includes documentation
2022-08-30 20:56:56 +10:00
huntc
c0b7fd910e Additional doco 2022-08-30 09:49:04 +10:00
huntc
9a873d1dbf Ensure that the sampling is stopped
Ensures that nRF saadc sampling is stopped and is awaited prior to exiting the two sampling methods. Not doing so causes a potential power drain and the potential for dropped buffer writes when having finished continuous sampling.
2022-08-26 14:40:20 +10:00
Dario Nieuwenhuis
91a9168a32 nrf/ppi: fix unsoundness due to task/event ptrs being public. 2022-08-24 01:54:27 +02:00
Dario Nieuwenhuis
02562ed87d nrf/ppi: feature-gate dppi stuff. 2022-08-24 01:52:15 +02:00
Dario Nieuwenhuis
21072bee48 split embassy-util into embassy-futures, embassy-sync. 2022-08-22 22:18:13 +02:00
Ulf Lilleengen
3e155d2ec3 nRF documentation warning fixes 2022-08-22 16:37:35 +02:00
Dario Nieuwenhuis
5daa173ce4 Split embassy-time from embassy-executor. 2022-08-18 01:22:30 +02:00
Dario Nieuwenhuis
fc6e1e06b3 Remove HAL initialization from #[embassy::main] macro. 2022-08-17 22:16:46 +02:00
Dario Nieuwenhuis
67edea4168 Update to critical-section 1.0, atomic-polyfill 1.0 2022-08-17 19:01:56 +02:00
bors[bot]
1924f2d67d
Merge #890
890: Implement UsbSupply for a reference of SignalledSupply r=Dirbaio a=matoushybl



Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
2022-08-02 20:29:29 +00:00
Matous Hybl
e4cfbf96ac Implement UsbSupply for a reference of SignalledSupply 2022-08-02 22:09:02 +02:00
Til Blechschmidt
43b8c0c71e
Remove commented out logging code 2022-08-01 12:57:00 +02:00
Til Blechschmidt
fa2fbcbde0
Extend QSPI config with freq, delay, spi mode, and address mode 2022-08-01 12:54:49 +02:00
Dario Nieuwenhuis
a0f1b0ee01 Split embassy crate into embassy-executor, embassy-util. 2022-07-29 23:40:36 +02:00
bors[bot]
84cffc751a
Merge #876
876: Add defmt support to embassy-embedded-hal errors r=Dirbaio a=matoushybl

`defmt::unwrap!()` should now work with shared buses. I tested it only with I2C as I don't have SPI in the target project.

Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
2022-07-24 20:15:57 +00:00
Matous Hybl
c38755c5b7 Add defmt support to embassy-embedded-hal errors 2022-07-24 22:10:50 +02:00
Dario Nieuwenhuis
709df0dc1d nrf: replace PhantomData usages with PeripheralRef. 2022-07-23 15:13:47 +02:00
Dario Nieuwenhuis
f02ba35482 Remove PeripheralRef::into_inner() 2022-07-23 14:27:45 +02:00
Dario Nieuwenhuis
4901c34d9c Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral 2022-07-23 14:00:19 +02:00
Dario Nieuwenhuis
8a9d2f59af Update embassy-stm32 2022-07-23 02:40:13 +02:00
Dario Nieuwenhuis
e0521ea249 fix nrf dppi 2022-07-23 02:17:45 +02:00
Dario Nieuwenhuis
be6408e202 Rename unsafe_impl_unborrow to impl_unborrow 2022-07-23 01:33:22 +02:00
Grant Miller
bff0ad9286 Update embassy-rp 2022-07-23 01:33:22 +02:00
Grant Miller
65a82d02d1 WIP: Make unborrow safe to use 2022-07-23 01:33:22 +02:00
bors[bot]
b916a912df
Merge #871 #872
871: nrf/saadc: add type-erased AnyInput. r=Dirbaio a=Dirbaio



872: nrf/usb: prevent user code from constructing a PowerUsb directly. r=Dirbaio a=Dirbaio

PowerUsb must be constructed through `new()` so that it sets up the IRQ.
It must have at least one private field, otherwise user code can construct
it directly with `PowerUsb{}`.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-07-22 09:14:39 +00:00
Dario Nieuwenhuis
c40d5f6e6f nrf/usb: prevent user code from constructing a PowerUsb directly.
PowerUsb must be constructed through `new()` so that it sets up the IRQ.
It must have at least one private field, otherwise user code can construct
it directly with `PowerUsb{}`.
2022-07-21 19:47:09 +02:00
Dario Nieuwenhuis
424f6ffadb nrf/saadc: add type-erased AnyInput. 2022-07-21 16:42:46 +02:00
chemicstry
53e40860c1 Move all gpio logic to Flex 2022-07-13 02:45:37 +03:00
chemicstry
a335589f34 Change get_set_level to get_output_level 2022-07-13 02:25:09 +03:00
chemicstry
8cebbde101 Add convenience GPIO functions to NRF 2022-07-13 02:21:42 +03:00
bors[bot]
9753f76794
Merge #810
810: Takes care of power for nRF USB devices r=Dirbaio a=huntc

Modifies the usb-serial example to illustrate how to setup USB for situations where the USB power can be detected and removed.

Gaps:

~~* No support for the nrf-softdevices as yet, although this should be possible via another constructor.~~
* No support for the nrf5340, although this should be possible via USBREG.

The change is tested and appears to work. Some notes:

* There's an existing field named self_powered as a UsbDevice field. It doesn't ever appear to get set. I'm wondering if this field is intended to signal that a device has the nRF VBUS power situation or not. I'm not presently using it.
* The new PowerDetected event is generated on the bus initially in situations where just new is used i.e. without power management, including on STM. We can therefore rely on this event always being generated.

Old description:

~~EnabledUsbDevice is a wrapper around the `UsbDevice` where its enablement is also subject to external events, such as `POWER` events for nRF. It is introduced generically to support other platforms should they also require external signaling for enablement.~~

Co-authored-by: huntc <huntchr@gmail.com>
2022-07-11 00:01:41 +00:00
Henrik Alsér
baae64d911 Add embassy-embedded-hal nightly feature 2022-07-09 23:41:02 +02:00
huntc
8785fbc6f1 Trait for UsbSupply
Eliminated a signal by using a simpler trait method that returns whether VBus power is available. Also includes a UsbSupply that can be signalled for use with the nRF softdevice. Includes the requirement for waiting for power to become available.
2022-07-09 17:57:31 +10:00
Henrik Alsér
d637510b44 Associated type 2022-07-09 00:00:55 +02:00
Henrik Alsér
f30ff9cadc Shared buses with SetConfig 2022-07-08 15:47:47 +02:00
huntc
81796d29b4 New constructor to cater for the softdevice
Also, correctly sets the initial power management state when using power management
2022-07-08 16:22:25 +10:00
huntc
4a8f117f25 Puts in the machinery to handle power detected/removed 2022-07-07 10:08:57 +10:00
Dario Nieuwenhuis
948bb93dc2 docs: Add $COMMIT to git srclinks. 2022-06-26 23:55:38 +02:00
Dario Nieuwenhuis
0beea82f40 nrf/uart: add support for tx-only and rx-only uart.
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.
2022-06-25 23:54:00 +02:00
Ulf Lilleengen
ca59c1ff35 Add more API docs for embassy-cortex-m and embassy-nrf 2022-06-23 13:17:56 +02:00
Dario Nieuwenhuis
1f746e0939 Remove the authors field from Cargo.tomls
It currently contains whoever was first to write some code for the crate,
even if many more people have contributed to it later.

The field is "sort of" deprecated, it was made optional recently:
https://rust-lang.github.io/rfcs/3052-optional-authors-field.html

Due the the reasons listed there I believe removing it is better than
setting it to generic fluff like "The Embassy contributors".
2022-06-18 02:16:40 +02:00
Dario Nieuwenhuis
88e36a70bd
Update to 2021 edition. (#820) 2022-06-18 02:15:48 +02:00