Commit Graph

2940 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
fa9eadcee9 Add docserver metadata. 2022-04-06 05:38:11 +02:00
alexmoon
2ce435dc34 Add basic device state handling for endpoints. 2022-04-06 05:38:11 +02:00
alexmoon
99f95a33c3 Simplify hid output report handling 2022-04-06 05:38:11 +02:00
alexmoon
c8ad82057d Reduce memory overhead and simplify logic for merging endpoint and control request output reports. 2022-04-06 05:38:11 +02:00
alexmoon
c309531874 Remove output() and split() methods from HidClass when there is no out endpoint, and route set_report requests for output reports to RequestHandler::set_report in that case. 2022-04-06 05:38:11 +02:00
alexmoon
daf2379fa4 Make the interupt IN endpoint non-optional 2022-04-06 05:38:11 +02:00
alexmoon
a51de5a39a Remove the feature report reader 2022-04-06 05:38:11 +02:00
alexmoon
cf89c85569 Log when reports are dropped without being read. 2022-04-06 05:38:11 +02:00
alexmoon
5ee7a85b33 Async USB HID class 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
8fe3b44d82 usb: log on reset, resume, suspend 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
522a87ae42 usb: centralize all control logging in control.rs 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
d7d199f2ac nrf/usb: unify in/out wakers for ep0 2022-04-06 05:38:11 +02:00
alexmoon
f5ba022257 Refactor ControlPipe to use the typestate pattern for safety 2022-04-06 05:38:11 +02:00
alexmoon
77e0aca03b Move data chunking from the driver to the lib 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
1672fdc666 usb-serial: make inner guts private. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
cdb7bae51a examples/nrf: don't build usb stuff in stable. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
a435d78cf7 usb: cleanup and simplify error handling. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
60d3d11197 usb: cleanup logging. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
d1e4b3d7d5 usb: add -usb-serial crate, fix warnings and stable build. 2022-04-06 05:38:11 +02:00
alexmoon
c06488eb29 Support multi-frame data phase control requests 2022-04-06 05:38:11 +02:00
alexmoon
d40ebcccf6 Add handlers for standard reqs to ControlHandler 2022-04-06 05:38:11 +02:00
alexmoon
13370c28db Add a control_buf to UsbDevice 2022-04-06 05:38:11 +02:00
alexmoon
c53bb7394a Switch to ControlHandler owned bufs for control_in() 2022-04-06 05:38:11 +02:00
alexmoon
a22639ad92 Remove UnsafeCell from cdc_acm::Control 2022-04-06 05:38:11 +02:00
alexmoon
46bafecb2a Only copy through RAM when needed 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
d7b1f8ca57 usb: update docs on ControlHandler. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
e99a3a1da4 usb: simplify buffer handling for Control IN transfers. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
bfce731982 usb: nicer names for control structs. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
2b547f311e usb: move all control-related stuff to mod control. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
15cc97d794 usb: associate ControlHandlers with interfaces, automatically route requests. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
3412e5dc4a usb: cleanup giant matches in control code. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
a2f5763a67 usb: add add_class to builder, so that FooBarClass::new(&mut builder) can set up everything. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
a062baae38 nrf/usb: fix wrong DMA read size 2022-04-06 05:38:11 +02:00
alexmoon
52c622b1cd Use trait objects instead of generics for UsbDevice::classes 2022-04-06 05:38:11 +02:00
alexmoon
bdc6e0481c Add support for USB classes handling control requests. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
5c0db627fe nrf/usb: update where clause syntax. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
9a6d11281d Add some comments on the example. 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
0320500f0f Working CDC-ACM device->host 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
77ceced036 Working CDC-ACM host->device 2022-04-06 05:38:11 +02:00
Dario Nieuwenhuis
37598a5b37 wip: experimental async usb stack 2022-04-06 05:38:11 +02:00
bors[bot]
c1b3822964
Merge #695
695: Simplify Channel. r=Dirbaio a=Dirbaio

- Allow initializing in a static, without Forever.
- Remove ability to close, since in embedded enviromnents channels usually live forever and don't get closed.
- Remove MPSC restriction, it's MPMC now. Rename "mpsc" to "channel".
- `Sender` and `Receiver` are still available if you want to enforce a piece of code only has send/receive access, but are optional: you can send/receive directly into the Channel if you want.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-04-05 23:53:59 +00:00
Dario Nieuwenhuis
6731948056 Add async Mutex. 2022-04-06 01:39:58 +02:00
Dario Nieuwenhuis
27a1b0ea73 Simpler Channel.
- Allow initializing in a static, without Forever.
- Remove ability to close, since in embedded enviromnents channels usually live forever and don't get closed.
- Remove MPSC restriction, it's MPMC now. Rename "mpsc" to "channel".
- `Sender` and `Receiver` are still available if you want to enforce a piece of code only has send/receive access, but are optional: you can send/receive directly into the Channel if you want.
2022-04-06 01:34:08 +02:00
Dario Nieuwenhuis
f32fa1d33a Add select, select3, select4. 2022-04-05 21:51:43 +02:00
Dario Nieuwenhuis
b5c479fdad Remove impl Unpin for SelectAll, as it's automatically inferred. 2022-04-05 21:22:02 +02:00
Dario Nieuwenhuis
59ec634246 Remove SelectAll::into_inner.
Due to not requiring Unpin, it's not really possible to call it
after having polled it, you can only call it right after constructing it,
so in practice it's not very useful.
2022-04-05 21:20:44 +02:00
Dario Nieuwenhuis
c8bd792b7a reorganize util mod. 2022-04-05 21:17:29 +02:00
Dario Nieuwenhuis
aee19185b7 Add more docserver metadata. 2022-04-05 21:05:09 +02:00
bors[bot]
f5cf465417
Merge #693
693: no_std version of `futures::future::select_all` r=Dirbaio a=alexmoon

Here's a no-std compatible version of `select_all`. It's not quite as useful as the original because it requires an array of Unpin futures to be pre-constructed instead of taking an iterator (which could return `Pin<Box<_>>` in `std`). And, of course, you don't get a `Vec` of the unfinished futures returned at completion. Still, I think it's cleaner than a long cons of select calls.

I'll leave it up to you whether this is sufficiently general purpose to include in Embassy or not.


Co-authored-by: alexmoon <alex.r.moon@gmail.com>
2022-04-05 17:20:16 +00:00
alexmoon
e42295c4c5 Remove Unpin bound from SelectAll 2022-04-04 21:24:10 -04:00