Commit Graph

519 Commits

Author SHA1 Message Date
4a8f117f25 Puts in the machinery to handle power detected/removed 2022-07-07 10:08:57 +10:00
948bb93dc2 docs: Add $COMMIT to git srclinks. 2022-06-26 23:55:38 +02:00
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
ca59c1ff35 Add more API docs for embassy-cortex-m and embassy-nrf 2022-06-23 13:17:56 +02:00
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
88e36a70bd Update to 2021 edition. (#820) 2022-06-18 02:15:48 +02:00
b585d54712 Update rust nightly. (#819) 2022-06-18 01:44:02 +02:00
a8703b7598 Run rustfmt. 2022-06-12 22:22:31 +02:00
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
db344c2bda common/PeripheralMutex: remove unsafe API. (#802)
Following the project's decision that "leak unsafe" APIs are not marked as "unsafe",
update PeripheralMutex to accept non-'static state without unsafe.

Fixes #801
2022-06-09 21:28:13 +02:00
2be36122c7 nrf/twim: allow zero length transfers. 2022-06-07 14:52:45 +02:00
a0d43c863d Merge #788
788: Misc USB improvements, for stm32 r=Dirbaio a=Dirbaio

See individual commit messages. 

These changes help implementing the driver for STM32 USBD (#709)

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-05-31 00:46:22 +00:00
a7383840e7 usb: make ControlPipe accept, reject async. 2022-05-30 00:35:27 +02:00
883e28a0fb usb: add first, last params to ControlPipe data_in, data_out. 2022-05-30 00:08:28 +02:00
1ec2e5672f usb: remove is_stalled, set_stalled from Endpoint.
They're unused, and I believe it's not allowed for classes to
stall EPs on their own?
2022-05-30 00:07:15 +02:00
6320e30adf Update embedded-hal-async to 0.1.0-alpha.1 2022-05-29 22:34:08 +02:00
9772645718 Revert "Fix irq pend behavior"
This reverts commit 9a447f1359.
2022-05-26 23:36:25 +03:00
9a447f1359 Fix irq pend behavior 2022-05-26 23:24:02 +03:00
c3b899c470 Implement BufRead for nrf BufferedUarte 2022-05-26 23:15:06 +03:00
47ceee47d5 Update embedded-io to 0.3 2022-05-19 00:36:18 +02:00
833b3a370a nrf/buffered_uarte: fix out of bounds on read. 2022-05-14 02:20:40 +02:00
13bcb5ffb6 Merge #768
768: nrf/usb: fix control out transfers getting corrupted due to ep0rcvout sticking from earlier. r=Dirbaio a=Dirbaio

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-05-12 16:46:35 +00:00
0764fad587 nrf/usb: fix control out transfers getting corrupted due to ep0rcvout sticking from earlier. 2022-05-12 18:45:10 +02:00
5fd55f9529 usb: parse request in embassy-usb instead of the driver. 2022-05-12 18:14:48 +02:00
93cbd079ec Remove OnDrop handler, start sampling in new 2022-05-12 15:35:32 +02:00
0be9184efc Merge branch 'embassy-rs:master' into qdec 2022-05-12 15:24:46 +02:00
6af5f8eb2d usb: merge alloc_control_pipe and into_bus into start.
This prevents calling `alloc_control_pipe` twice at compile time, which was
always an error.
2022-05-10 17:30:07 +02:00
2e104170de usb: remove address arg from endpoint allocation. 2022-05-09 02:07:48 +02:00
1ca5475010 Merge branch 'embassy-rs:master' into qdec 2022-05-07 09:47:29 +02:00
931a137f8c Replace embassy::io with embedded_io. 2022-05-07 01:45:54 +02:00
840bb2952e Add qdec module 2022-05-07 00:46:36 +02:00
0be6df168b nrf/twim: add blocking methods variants with timeout. 2022-05-03 00:52:48 +02:00
1a3f787932 nrf/twim: add option for high drive. 2022-05-03 00:52:48 +02:00
29402fa76b nrf/gpio: add input+output to Flex, for OpenDrain. 2022-05-03 00:52:48 +02:00
2ebc1186e0 Add split method to UarteWithIdle 2022-04-27 20:33:41 +02:00
11143a1be1 Merge pull request #722 from embassy-rs/usb-altsettings
usb: builtin handling of interface alternate settings
2022-04-23 06:20:11 +02:00
7778b79dc3 nrf: autoenable defmt in deps. 2022-04-23 06:03:38 +02:00
092c2b7dfe usb: builtin handling of interface alternate settings
The stack reads its own descriptors to figure out which endpoints
are used in which alt settings, and enables/disables them as needed.

The ControlHandler has a callback so it can get notified of alternate
setting changes, which is purely informative (it doesn't have to do anything).
2022-04-23 01:11:10 +02:00
3251a21fb7 Switch to crates.io embedded-hal, embedded-hal-async.
This temporarily removes support for the async UART trait, since it's
not yet in embedded-hal-async.
2022-04-22 19:58:24 +02:00
e966125d62 Add embedded-storage trait impls for QSPI
* Adds implementations of embedded-storage and embedded-storage-async
for QSPI
* Add blocking implementations of QSPI
* Use blocking implementation in new() and embedded-storage impls
* Use async implementation in embedded-storage-async impls
* Add FLASH_SIZE const generic parameter
* Own IRQ in Qspi to disable it on drop
2022-04-19 19:06:36 +02:00
2915e858ba Make Driver::disable async and fix comment 2022-04-13 14:55:02 -04:00
3a30b08936 Remove dead code on nrf5340 2022-04-13 14:55:02 -04:00
f5656e3544 Add DeviceStateHandler, DeviceCommand channel, and remote wakeup support 2022-04-13 14:55:02 -04:00
e867364d42 Unify ReadError and WriteError into EndpointError 2022-04-09 01:48:17 +02:00
9c6d49961b Add saadc::VddhDiv5Input 2022-04-08 13:41:21 -04:00
37da84129d Merge #657
657: Async usb stack r=Dirbaio a=Dirbaio

TODO

- [x] Make it work on nRF
- [x] Add a way for classes to handle their own EP0 control requests - thanks `@alexmoon!`
- [x] Handle CONTROL OUT requests with data.
- [ ] Impl AsyncRead/AsyncWrite for CDC ACM -- will do later, it's not trivial
- [x] Cleanup unwraps/asserts/panics
- [x] Cleanup logs (make everything trace/debug, not info)
- [ ] Port synopsys-usb-otg
- [ ] Port stm32-usbd
- [ ] Add more classes? HID, MSD?


Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Co-authored-by: alexmoon <alex.r.moon@gmail.com>
2022-04-07 23:03:39 +00:00
7f9dd1a37b Fix spurious ControlPipe::data_in errors 2022-04-07 10:54:21 -04:00
6abbfa9a92 Async-ify Driver::enable and UsbDeviceBuilder::build 2022-04-07 10:51:26 -04:00
eb6910fa86 Reexport unborrow macro in HALs 2022-04-07 12:57:02 +02:00
22a47aeeb2 usb: abort control data in/out on reset or when receiving another SETUP.
This removes the horrible timeout hack.
2022-04-06 05:38:11 +02:00