diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32f4/src/bin/usb_ethernet.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/usb_serial.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/usb_serial.rs | 4 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/usb_serial.rs | 4 | ||||
| -rw-r--r-- | examples/stm32l4/src/bin/usb_serial.rs | 4 | ||||
| -rw-r--r-- | examples/stm32u5/src/bin/usb_serial.rs | 4 |
6 files changed, 18 insertions, 6 deletions
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs index 953d99a45..b1f01417c 100644 --- a/examples/stm32f4/src/bin/usb_ethernet.rs +++ b/examples/stm32f4/src/bin/usb_ethernet.rs | |||
| @@ -52,7 +52,9 @@ async fn main(spawner: Spawner) { | |||
| 52 | 52 | ||
| 53 | // Create the driver, from the HAL. | 53 | // Create the driver, from the HAL. |
| 54 | let ep_out_buffer = &mut make_static!([0; 256])[..]; | 54 | let ep_out_buffer = &mut make_static!([0; 256])[..]; |
| 55 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, ep_out_buffer); | 55 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 56 | config.vbus_detection = true; | ||
| 57 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, ep_out_buffer, config); | ||
| 56 | 58 | ||
| 57 | // Create embassy-usb Config | 59 | // Create embassy-usb Config |
| 58 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 60 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
diff --git a/examples/stm32f4/src/bin/usb_serial.rs b/examples/stm32f4/src/bin/usb_serial.rs index f8f5940a7..4ff6452ef 100644 --- a/examples/stm32f4/src/bin/usb_serial.rs +++ b/examples/stm32f4/src/bin/usb_serial.rs | |||
| @@ -29,7 +29,9 @@ async fn main(_spawner: Spawner) { | |||
| 29 | 29 | ||
| 30 | // Create the driver, from the HAL. | 30 | // Create the driver, from the HAL. |
| 31 | let mut ep_out_buffer = [0u8; 256]; | 31 | let mut ep_out_buffer = [0u8; 256]; |
| 32 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer); | 32 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 33 | config.vbus_detection = true; | ||
| 34 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | ||
| 33 | 35 | ||
| 34 | // Create embassy-usb Config | 36 | // Create embassy-usb Config |
| 35 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 37 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
diff --git a/examples/stm32f7/src/bin/usb_serial.rs b/examples/stm32f7/src/bin/usb_serial.rs index 763309ce2..a2c76178b 100644 --- a/examples/stm32f7/src/bin/usb_serial.rs +++ b/examples/stm32f7/src/bin/usb_serial.rs | |||
| @@ -30,7 +30,9 @@ async fn main(_spawner: Spawner) { | |||
| 30 | 30 | ||
| 31 | // Create the driver, from the HAL. | 31 | // Create the driver, from the HAL. |
| 32 | let mut ep_out_buffer = [0u8; 256]; | 32 | let mut ep_out_buffer = [0u8; 256]; |
| 33 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer); | 33 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 34 | config.vbus_detection = true; | ||
| 35 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | ||
| 34 | 36 | ||
| 35 | // Create embassy-usb Config | 37 | // Create embassy-usb Config |
| 36 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 38 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
diff --git a/examples/stm32h7/src/bin/usb_serial.rs b/examples/stm32h7/src/bin/usb_serial.rs index c622f19f7..97291f60c 100644 --- a/examples/stm32h7/src/bin/usb_serial.rs +++ b/examples/stm32h7/src/bin/usb_serial.rs | |||
| @@ -29,7 +29,9 @@ async fn main(_spawner: Spawner) { | |||
| 29 | 29 | ||
| 30 | // Create the driver, from the HAL. | 30 | // Create the driver, from the HAL. |
| 31 | let mut ep_out_buffer = [0u8; 256]; | 31 | let mut ep_out_buffer = [0u8; 256]; |
| 32 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer); | 32 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 33 | config.vbus_detection = true; | ||
| 34 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | ||
| 33 | 35 | ||
| 34 | // Create embassy-usb Config | 36 | // Create embassy-usb Config |
| 35 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 37 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
diff --git a/examples/stm32l4/src/bin/usb_serial.rs b/examples/stm32l4/src/bin/usb_serial.rs index 80811a43e..410d6891b 100644 --- a/examples/stm32l4/src/bin/usb_serial.rs +++ b/examples/stm32l4/src/bin/usb_serial.rs | |||
| @@ -30,7 +30,9 @@ async fn main(_spawner: Spawner) { | |||
| 30 | 30 | ||
| 31 | // Create the driver, from the HAL. | 31 | // Create the driver, from the HAL. |
| 32 | let mut ep_out_buffer = [0u8; 256]; | 32 | let mut ep_out_buffer = [0u8; 256]; |
| 33 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer); | 33 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 34 | config.vbus_detection = true; | ||
| 35 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | ||
| 34 | 36 | ||
| 35 | // Create embassy-usb Config | 37 | // Create embassy-usb Config |
| 36 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 38 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
diff --git a/examples/stm32u5/src/bin/usb_serial.rs b/examples/stm32u5/src/bin/usb_serial.rs index f36daf91b..9e47fb18a 100644 --- a/examples/stm32u5/src/bin/usb_serial.rs +++ b/examples/stm32u5/src/bin/usb_serial.rs | |||
| @@ -31,7 +31,9 @@ async fn main(_spawner: Spawner) { | |||
| 31 | 31 | ||
| 32 | // Create the driver, from the HAL. | 32 | // Create the driver, from the HAL. |
| 33 | let mut ep_out_buffer = [0u8; 256]; | 33 | let mut ep_out_buffer = [0u8; 256]; |
| 34 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer); | 34 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 35 | config.vbus_detection = true; | ||
| 36 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | ||
| 35 | 37 | ||
| 36 | // Create embassy-usb Config | 38 | // Create embassy-usb Config |
| 37 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 39 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
