Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating usb crates #469

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

* Bugfix, usb: On RM0455 and RM0468 parts, PA11/PA12 do not have an alternate function
(AF) for USB. Use `into_analog()` when passing pins to `USB1/2::new` on these parts [#464]
* [breaking] `usb-device` updated to v0.3.0

## [v0.15.0] 2023-10-09

Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bare-metal = "1.0.0"
sdio-host = { version = "0.9", optional = true }
embedded-sdmmc = { version = "0.5", optional = true }
stm32-fmc = { version = "0.3", optional = true }
synopsys-usb-otg = { version = "^0.3.0", features = ["cortex-m"], optional = true }
synopsys-usb-otg = { version = "0.4", features = ["cortex-m"], optional = true }
embedded-display-controller = { version = "^0.1.0", optional = true }
log = { version = "0.4.14", optional = true} # see also the dev-dependencies section
fdcan = { version = "0.2", optional = true }
Expand Down Expand Up @@ -76,8 +76,8 @@ cortex-m-log = { version = "0.8.0", features = ["itm", "semihosting", "log-integ
cortex-m-semihosting = "0.5.0"
panic-itm = { version = "~0.4.1" }
panic-semihosting = "0.6"
usb-device = "0.2.5"
usbd-serial = "0.1.0"
usb-device = "0.3"
usbd-serial = "0.2.0"
numtoa = "0.2.3"
tinybmp = "0.5"
embedded-graphics = "0.8"
Expand Down
16 changes: 10 additions & 6 deletions examples/usb_passthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ fn main() -> ! {
let mut serial1 = usbd_serial::SerialPort::new(&usb1_bus);
let mut usb1_dev =
UsbDeviceBuilder::new(&usb1_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")])
.unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.build();

Expand All @@ -84,9 +86,11 @@ fn main() -> ! {
let mut serial2 = usbd_serial::SerialPort::new(&usb2_bus);
let mut usb2_dev =
UsbDeviceBuilder::new(&usb2_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 2")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")])
.unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.build();

Expand Down
9 changes: 6 additions & 3 deletions examples/usb_phy_serial_interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,14 @@ unsafe fn main() -> ! {
USB_BUS_ALLOCATOR.as_ref().unwrap(),
UsbVidPid(VID, PID),
)
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")])
.unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.max_packet_size_0(64)
.unwrap()
.build();

interrupt_free(|cs| {
Expand Down
8 changes: 5 additions & 3 deletions examples/usb_rtic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ mod app {
.unwrap();
let serial = usbd_serial::SerialPort::new(usb_bus);
let usb_dev = UsbDeviceBuilder::new(usb_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")])
.unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.build();
let usb = (usb_dev, serial);
Expand Down
8 changes: 5 additions & 3 deletions examples/usb_serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ fn main() -> ! {

let mut usb_dev =
UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")])
.unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.build();

Expand Down
6 changes: 3 additions & 3 deletions src/usb_hs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use crate::rcc;
use crate::stm32;

use crate::gpio::{self, Alternate, Analog, Speed};
use crate::gpio::{self, Alternate, Speed};

use crate::time::Hertz;

Expand Down Expand Up @@ -50,8 +50,8 @@ impl USB1 {
usb_global: stm32::OTG1_HS_GLOBAL,
usb_device: stm32::OTG1_HS_DEVICE,
usb_pwrclk: stm32::OTG1_HS_PWRCLK,
_pin_dm: gpio::PA11<Analog>,
_pin_dp: gpio::PA12<Analog>,
_pin_dm: gpio::PA11<crate::gpio::Analog>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is because clippy was throwing annoying warnings when the features weren't enabled about an unused Analog import

_pin_dp: gpio::PA12<crate::gpio::Analog>,
prec: rcc::rec::Usb1Otg,
clocks: &rcc::CoreClocks,
) -> Self {
Expand Down
Loading