Skip to content

Commit 039dfea

Browse files
committed
Remove imxrt-usbd dependency
Users can select their own imxrt-usbd driver and usb-device ecosystem for their system, and they can do this without waiting for an imxrt-hal update / turning off default package features. The imxrt-ral compatibility layer moves into imxrt-usbd. Right now, we're still testing the driver here, since it's also helpful as a logging backend.
1 parent bc1eaa0 commit 039dfea

20 files changed

Lines changed: 40 additions & 111 deletions

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ Users should program directly against the `Pit` type.
2626

2727
**BREAKING** The ADC driver no longer supports unproven embedded-hal 0.2 traits.
2828

29-
**BREAKING** Update `imxrt-usbd` to 0.3. Users are required to update to
30-
`usb-device` 0.3 and its compatible dependencies.
29+
**BREAKING** Remove the dependency on `imxrt-usbd` and the `usbd` module.
30+
Users should select their preferred versions of `imxrt-usbd`, `usb-device`,
31+
and other class packages.
3132

3233
**BREAKING** Update imxrt-rs dependencies that affect the public API:
3334

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ workspace = true
7272
[dependencies.imxrt-ral]
7373
workspace = true
7474

75-
[dependencies.imxrt-usbd]
76-
workspace = true
77-
optional = true
78-
7975
[package.metadata.docs.rs]
8076
default-target = "thumbv7em-none-eabihf"
8177
features = ["imxrt-ral/imxrt1062", "imxrt1060"]
@@ -85,7 +81,6 @@ features = ["imxrt-ral/imxrt1062", "imxrt1060"]
8581
###############
8682

8783
[features]
88-
default = ["imxrt-usbd"]
8984
imxrt1010 = ["imxrt-iomuxc/imxrt1010"]
9085
imxrt1020 = ["imxrt-iomuxc/imxrt1020"]
9186
imxrt1060 = ["imxrt-iomuxc/imxrt1060"]
@@ -150,6 +145,7 @@ codegen-units = 256
150145

151146
[dev-dependencies]
152147
imxrt-rt = { workspace = true }
148+
imxrt-usbd = { workspace = true }
153149
menu = "0.3.2"
154150
rtic = { version = "2.0", features = ["thumbv7-backend"] }
155151
log = "0.4"
@@ -222,3 +218,6 @@ git = "https://github.com/imxrt-rs/imxrt-ral"
222218

223219
[patch.crates-io.imxrt-iomuxc]
224220
git = "https://github.com/imxrt-rs/imxrt-iomuxc"
221+
222+
[patch.crates-io.imxrt-usbd]
223+
git = "https://github.com/imxrt-rs/imxrt-usbd"

board/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ pub mod blocking {
315315
/// features. Then, simply define the default backend in your module.
316316
#[cfg(feature = "imxrt-log")]
317317
pub mod logging {
318-
use crate::hal::{dma::channel::Channel, lpuart::Lpuart, usbd::Instances};
318+
use crate::hal::{dma::channel::Channel, lpuart::Lpuart};
319319
pub use imxrt_log::Poller;
320+
use imxrt_usbd::Instances;
320321
pub const BACKEND: Backend = crate::board_impl::DEFAULT_LOGGING_BACKEND;
321322

322323
/// Select the logging front-end.

examples/hal_logging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn main() -> ! {
5959
pit.set_interrupt_enable(PIT_CHANNEL, false);
6060
pit.enable(PIT_CHANNEL);
6161

62-
let usbd = hal::usbd::Instances {
62+
let usbd = imxrt_usbd::Instances {
6363
usb: usb1,
6464
usbnc: usbnc1,
6565
usbphy: usbphy1,

examples/hal_srtc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() -> ! {
5050
board::Specifics { led, console, .. },
5151
) = board::new();
5252

53-
let usbd = hal::usbd::Instances {
53+
let usbd = imxrt_usbd::Instances {
5454
usb: usb1,
5555
usbnc: usbnc1,
5656
usbphy: usbphy1,

examples/hal_tempmon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn main() -> ! {
6868
pit.set_interrupt_enable(PIT_CHANNEL, false);
6969
pit.enable(PIT_CHANNEL);
7070

71-
let usbd = hal::usbd::Instances {
71+
let usbd = imxrt_usbd::Instances {
7272
usb: usb1,
7373
usbnc: usbnc1,
7474
usbphy: usbphy1,

examples/hal_trng.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const MAKE_LOG_INTERVAL_MS: u32 = board::PIT_FREQUENCY / 1_000 * 250;
1111

1212
use hal::pit::Channel;
1313
use imxrt_hal as hal;
14-
1514
const FRONTEND: board::logging::Frontend = board::logging::Frontend::Log;
1615
const BACKEND: board::logging::Backend = board::logging::BACKEND;
1716
const PIT_CHANNEL: Channel = Channel::Chan2;
@@ -39,7 +38,7 @@ fn main() -> ! {
3938
pit.set_interrupt_enable(PIT_CHANNEL, false);
4039
pit.enable(PIT_CHANNEL);
4140

42-
let usbd = hal::usbd::Instances {
41+
let usbd = imxrt_usbd::Instances {
4342
usb: usb1,
4443
usbnc: usbnc1,
4544
usbphy: usbphy1,

examples/rtic_logging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ mod app {
9595
pit.set_interrupt_enable(MAKE_LOG_CHANNEL, true);
9696
pit.enable(MAKE_LOG_CHANNEL);
9797

98-
let usbd = hal::usbd::Instances {
98+
let usbd = imxrt_usbd::Instances {
9999
usb: usb1,
100100
usbnc: usbnc1,
101101
usbphy: usbphy1,

examples/rtic_sai_pcm5102.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ mod app {
135135
pit.disable(POLL_LOG_CHANNEL);
136136
}
137137

138-
let usbd = hal::usbd::Instances {
138+
let usbd = imxrt_usbd::Instances {
139139
usb: usb1,
140140
usbnc: usbnc1,
141141
usbphy: usbphy1,

examples/rtic_sai_sgtl5000.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ mod app {
8989
pit.disable(POLL_LOG_CHANNEL);
9090
}
9191

92-
let usbd = hal::usbd::Instances {
92+
let usbd = imxrt_usbd::Instances {
9393
usb: usb1,
9494
usbnc: usbnc1,
9595
usbphy: usbphy1,

0 commit comments

Comments
 (0)