Skip to content

Commit

Permalink
feat(usb): enable HS mode, update usb examples
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu authored and andelf committed Aug 23, 2024
1 parent 728b860 commit 47171a4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/hpm5300evk/src/bin/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn main(_spawner: Spawner) -> ! {

// Create embassy-usb Config
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
config.manufacturer = Some("Embassy");
config.manufacturer = Some("hpm-hal");
config.product = Some("USB-serial example");
config.serial_number = Some("12345678");

Expand Down
4 changes: 2 additions & 2 deletions examples/hpm5300evk/src/bin/usb_hid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ async fn main(_spawner: Spawner) -> ! {

// Create embassy-usb Config
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
config.manufacturer = Some("Embassy");
config.product = Some("USB-serial example");
config.manufacturer = Some("hpm-hal");
config.product = Some("USB-HID example");
config.serial_number = Some("12345678");

// Required for windows compatibility.
Expand Down
2 changes: 1 addition & 1 deletion examples/hpm6750evkmini/src/bin/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn main(_spawner: Spawner) -> ! {

// Create embassy-usb Config
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
config.manufacturer = Some("Embassy");
config.manufacturer = Some("hpm-hal");
config.product = Some("USB-serial example");
config.serial_number = Some("12345678");

Expand Down
2 changes: 1 addition & 1 deletion examples/hpm6e00evk/src/bin/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn main(_spawner: Spawner) -> ! {

// Create embassy-usb Config
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
config.manufacturer = Some("Embassy");
config.manufacturer = Some("hpm-hal");
config.product = Some("USB-serial example");
config.serial_number = Some("12345678");

Expand Down
4 changes: 2 additions & 2 deletions examples/hpm6e00evk/src/bin/usb_hid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ async fn main(_spawner: Spawner) -> ! {

// Create embassy-usb Config
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
config.manufacturer = Some("Embassy");
config.product = Some("USB-serial example");
config.manufacturer = Some("hpm-hal");
config.product = Some("USB-HID example");
config.serial_number = Some("12345678");

// Required for windows compatibility.
Expand Down
6 changes: 2 additions & 4 deletions src/usb/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,8 @@ impl<T: Instance> Bus<T> {
w.set_sts(false);
// Parallel transceiver width
w.set_ptw(false);
// Forced fullspeed mode, c_sdk commented this line out, use it only when the device runs in full speed mode
// TODO: Currently, the device can only be recognized at fs mode.
// How to switch to hs mode?
w.set_pfsc(true);
// Forced fullspeed mode
// w.set_pfsc(true);
});

// Do not use interrupt threshold
Expand Down

0 comments on commit 47171a4

Please sign in to comment.