1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! A USB driver for i.MX RT processors
//!
//! `imxrt-usbd` provides a [`usb-device`] USB bus implementation, allowing you
//! to add USB device features to your embedded Rust program. See each module
//! for usage and examples.
//!
//! # General guidance
//!
//! The driver does not configure any of the CCM or CCM_ANALOG registers. You are
//! responsible for configuring these peripherals for proper USB functionality. See
//! the `imxrt-usbd` hardware examples to see different ways of configuring PLLs and
//! clocks.
//!
//! You, or something in your dependency hierarchy, must enable an `imxrt-ral`
//! chip feature; otherwise, this package will not build.
//!
//! [`usb-device`]: https://crates.io/crates/usb-device
//!
//! # Debugging features
//!
//! Enable the `defmt` feature to activate internal logging using defmt.
//!
//! # Example
//!
//! ```no_run
//! use imxrt_ral as ral;
//! use imxrt_usbd::{BusAdapter, Instances};
//!
//! static EP_MEMORY: imxrt_usbd::EndpointMemory<1024> = imxrt_usbd::EndpointMemory::new();
//! static EP_STATE: imxrt_usbd::EndpointState = imxrt_usbd::EndpointState::max_endpoints();
//!
//! let instances = Instances {
//! usb: unsafe { ral::usb::USB::instance() },
//! usbnc: unsafe { ral::usbnc::USBNC::instance() },
//! usbphy: unsafe { ral::usbphy::USBPHY::instance() },
//! };
//!
//! let bus_adapter = BusAdapter::new(
//! instances,
//! &EP_MEMORY,
//! &EP_STATE,
//! );
//! ```
pub use EndpointMemory;
pub use ;
pub use ;
/// Aggregate of `imxrt-ral` USB peripheral instances.
///
/// This takes ownership of USB peripheral instances for a given USB
/// controller. The const generic `N` ensures that all instances refer
/// to the same USB peripheral (e.g., USB1 or USB2).