Skip to content
Closed
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
f96c7a4
Add interrupt/isochron scheduling registers
Aug 15, 2024
2f40d35
Add helper for framelistlen
Aug 16, 2024
30f4ff1
Add doping register
Aug 18, 2024
b42fb9c
Describe Hcdma reg, add HcdmaB & split hctsiz->xfersiz for interrupt/…
Aug 19, 2024
d22bb83
Fix hcmda reg definition
Aug 19, 2024
1b3b832
Add more regs
Sep 6, 2024
e96a29f
Add descriptor DMA setting & fix perschedena
Sep 9, 2024
f81ac75
Add frame interval dynamic loading ctl
Sep 9, 2024
5793a9f
Add frame list addr register
Sep 16, 2024
143c963
Fix perschena mutability & fifo no-op
Sep 16, 2024
705d29e
Restore product_id W without no-op
Sep 16, 2024
e8459cf
Improve docs & remove unnecessary unsafe
Sep 18, 2024
5743c97
Create initial USB Host driver
ijager Jul 24, 2024
62d27c6
Create usb_host HAL driver module
ijager Aug 9, 2024
e43dc4a
Make set_address async and wait for completion
ijager Aug 9, 2024
8a696e0
Implement basic request_out api
ijager Aug 13, 2024
fa07fbe
Implement basic out_request for requesting descriptor
ijager Aug 13, 2024
95433e8
Use proper status flaxs for detecting finisheed transactions
ijager Aug 13, 2024
8781600
Implement multi packet receiving
ijager Aug 14, 2024
d3dd928
Implement Endpoint0 change max_oacket_size and realloc
ijager Aug 19, 2024
b467053
Add USBHost Trait to embassy-usb-driver crate
ijager Aug 21, 2024
24a3c63
Implement Read for non-control endpoints
ijager Aug 28, 2024
cb03291
Remove debug prints
ijager Aug 29, 2024
612e898
Reuse channel write/read for control transfers
ijager Sep 3, 2024
c198d3e
Disable channels on error
ijager Sep 3, 2024
60fe570
Make usb_host available for usb_v4 peripherals
ijager Sep 3, 2024
156bc53
Add USB Host implementation and example for stm32g0
ijager Sep 3, 2024
8a41d00
Add docstrings
ijager Sep 4, 2024
a1ebc19
Add comment about NUCLE0-G0B1RE together with X-NUCLEO-DRP1M1
ijager Sep 4, 2024
da8fe18
Try fix conditional compilation for usb_host.rs
ijager Sep 5, 2024
b5260bf
Use bitflags as alternative for defmt::bitflags in case no defmt feature
ijager Sep 5, 2024
0698817
Dereive required traits on RequestType for non-rtt
ijager Sep 5, 2024
e82b360
PoC partial usb host implementation for rp2040
nikvoid Sep 22, 2024
d5489a9
usb-host refactor, currently errors with rx timeout
nikvoid Sep 27, 2024
40422df
remove various leftovers
nikvoid Sep 28, 2024
aa4306a
fix swapped addr and packet size args...
nikvoid Sep 28, 2024
b24f214
allow to acquire host control channel, remove `usbh` leftovers, fix c…
nikvoid Sep 28, 2024
35093b6
relax usb channel wrapper generics; move its methods into separate ex…
nikvoid Sep 28, 2024
59e849e
include some endpoint description fields into channel
nikvoid Sep 28, 2024
f7bce35
fix stall on SET_CONFIGURATION
nikvoid Sep 28, 2024
8bcc926
improve channel error handling (mostly in rp2040)
nikvoid Sep 28, 2024
7ff4aae
disable channel interrupts on drop (rp2040)
nikvoid Sep 28, 2024
74a4f49
process device disconnects (poorly)
nikvoid Sep 28, 2024
4d930ef
channel link checks; shared usb device registry
nikvoid Sep 28, 2024
5ddd1fe
clear available bit on channel drop
nikvoid Sep 28, 2024
190cc9b
control channel alloc shortcut
nikvoid Oct 2, 2024
b12a0b6
usb host example with keyboard
nikvoid Oct 4, 2024
472696c
fix early return that would cause deadlock
nikvoid Oct 4, 2024
b319e34
split usb-host to multiple modules
nikvoid Oct 4, 2024
7fb3552
Initial implementation of usb hub driver, currently with LS through F…
nikvoid Oct 6, 2024
e0fc71d
send PREamble packet for interrupt endpoints (rp2040)
nikvoid Oct 7, 2024
2450c5e
Re-add handler api
Oct 7, 2024
f0f9e21
Re-add handler api
Oct 7, 2024
948138a
Convert most of the hub to the universal handler trait
Oct 9, 2024
092f717
Finish hub & Channel PoC
Oct 12, 2024
90865fe
Finished trait, and optimistically half-way impl for synopsys
Nov 1, 2024
f1e50af
Clean up and add a few docs
Nov 6, 2024
e24cc59
Refactor stm32 usb host hal for new traits and architecture
ijager Nov 7, 2024
c44dc9d
Implement detecting device connect and speed
ijager Nov 7, 2024
4f99724
Implement new UsbChannel for stm32-usb HAL
ijager Nov 11, 2024
5583946
Add request_out to USBOTG host impl & fix drop bug found by @ijager
Nov 7, 2024
934fadb
Remove completed todos
Nov 7, 2024
9e9dc8d
Compatibility
Nov 7, 2024
adab8fc
Add retries for post-changeaddr
Nov 8, 2024
96a527e
Add NAK ignore (test)
Nov 8, 2024
e6c6602
Reduce logging intensity for interrupt requests
Nov 8, 2024
e3e9528
Try fix request_in length
Nov 8, 2024
85d132c
Use critical section for alloc channels
ijager Nov 11, 2024
10b90ce
Ignore errors on SET_IDLE and SET_PROTOCOL
ijager Nov 11, 2024
860c121
Implement Drop for Channel
ijager Nov 11, 2024
302a4b2
Make KeyStatusUpdate fields public
ijager Nov 12, 2024
b9f8662
Re-add handler api
Oct 7, 2024
c409d1b
Try improve reliability
Nov 11, 2024
daccef1
Interrupt-less
Nov 13, 2024
38a7119
Try add back interrupts, with fifo leak workaround
Nov 13, 2024
01b9f83
Fix request_in
Nov 13, 2024
cb97f7e
Fix disconnect event
Nov 13, 2024
daa4991
USBOTG host cleanup
Mar 22, 2025
46a6f6e
ConfigurationDescriptor/EnumerationInfo refactor to enable larger con…
Mar 27, 2025
956251f
Add timeout to UsbHostDriver trait & refactor descriptor parsing/enum…
Apr 1, 2025
c463b80
Remove old handlers folder
Apr 1, 2025
39c9d16
Add `iter_descriptors` as proposed by @AlexCharlton & deprecate parse…
Apr 5, 2025
e067569
Add PartialEq to EndpointDescriptor & make StringIndex pub
Apr 5, 2025
fec80a7
Fix `get_configuration` (credit to @AlexCharlton)
Apr 5, 2025
455c2c7
Compile with log
AlexCharlton Apr 4, 2025
e573807
Use macro to prevent code repetition
dobrowolski-lukasz Apr 6, 2025
11cceb0
examples/rp: Allign internal crate versions
dobrowolski-lukasz Apr 4, 2025
a697023
Revert "Compile with log"
AlexCharlton Apr 4, 2025
c258635
embassy_rp: Add missing use-s
dobrowolski-lukasz Apr 4, 2025
074defe
embassy_rp: rm unused use-s
dobrowolski-lukasz Apr 4, 2025
3cf826a
embassy_rp: rm duplcated code
dobrowolski-lukasz Apr 4, 2025
6dbfacc
embassy-rp: Allign to changed traits
dobrowolski-lukasz Apr 7, 2025
28210df
embassy-rp: Remove duplicate code
dobrowolski-lukasz Apr 7, 2025
9777225
Allign to DeviceEvent::Connected being parametrized by Speed
dobrowolski-lukasz Apr 7, 2025
d5a3c8a
Remove unused use-s
dobrowolski-lukasz Apr 7, 2025
cdf6c31
Use uppercase names for globals
dobrowolski-lukasz Apr 7, 2025
fc24fad
Use EndpointInfo instead of EndpointDescriptor
dobrowolski-lukasz Apr 7, 2025
2546f79
Correct type name in doc
dobrowolski-lukasz Apr 7, 2025
793fb4d
Placeholder implementation of set_timeout to satisfy trait
dobrowolski-lukasz Apr 7, 2025
d69c13d
Fix examples/rp/.../usb_host_keyboard.rs
dobrowolski-lukasz Apr 7, 2025
cbd8538
Remove drop_channel and move to unimplemented `Drop` for Channel
Apr 9, 2025
21a66b0
Remove usize from OUT direction requests
Apr 9, 2025
16b39fa
Add missing Synopsys registers
Apr 9, 2025
6c12419
Fix compilation
dobrowolski-lukasz Apr 24, 2025
4522431
Fix channel stall
dobrowolski-lukasz Apr 24, 2025
af5f2ef
Take desc_type from argument in request_descriptor_bytes
dobrowolski-lukasz Apr 24, 2025
853f770
Merge pull request #1 from lynxD/usb-asynch-v2
i404788 Apr 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 16 additions & 30 deletions embassy-rp/src/usb.rs → embassy-rp/src/usb/device.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
//! USB driver.

use core::future::poll_fn;
use core::marker::PhantomData;
use core::slice;
use core::sync::atomic::{compiler_fence, Ordering};
use core::task::Poll;

use embassy_sync::waitqueue::AtomicWaker;
use embassy_usb_driver as driver;
use embassy_usb_driver::{
Direction, EndpointAddress, EndpointAllocError, EndpointError, EndpointInfo, EndpointType, Event, Unsupported,
};

use crate::interrupt::typelevel::{Binding, Interrupt};
use crate::{interrupt, pac, peripherals, Peripheral, RegExt};

trait SealedInstance {
fn regs() -> crate::pac::usb::Usb;
fn dpram() -> crate::pac::usb_dpram::UsbDpram;
}
use crate::{interrupt, pac, Peripheral, RegExt};

use super::{
Instance,
EndpointBuffer,
EP_MEMORY,
EP_MEMORY_SIZE,
BUS_WAKER,
EP_COUNT,
EP_IN_WAKERS,
EP_OUT_WAKERS,
In,
Out,
Dir,
};

/// USB peripheral instance.
#[allow(private_bounds)]
Expand Down Expand Up @@ -490,26 +496,6 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
}
}

trait Dir {
fn dir() -> Direction;
}

/// Type for In direction.
pub enum In {}
impl Dir for In {
fn dir() -> Direction {
Direction::In
}
}

/// Type for Out direction.
pub enum Out {}
impl Dir for Out {
fn dir() -> Direction {
Direction::Out
}
}

/// Endpoint for RP USB driver.
pub struct Endpoint<'d, T: Instance, D> {
_phantom: PhantomData<(&'d mut T, D)>,
Expand Down
Loading