aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f4/src/bin
diff options
context:
space:
mode:
authormatteo <email>2025-09-23 20:20:43 +0200
committermatteo <email>2025-09-23 20:20:43 +0200
commit2e303c995c53a97a1c2eaecf77827f02567b8417 (patch)
tree77ab31d8cf91590a384007936dd09f69e58a475d /examples/stm32f4/src/bin
parentd72e8d9af921bfd5ddc25a17933e16b2132386b8 (diff)
update hid examples
Diffstat (limited to 'examples/stm32f4/src/bin')
-rw-r--r--examples/stm32f4/src/bin/usb_hid_keyboard.rs6
-rw-r--r--examples/stm32f4/src/bin/usb_hid_mouse.rs6
2 files changed, 10 insertions, 2 deletions
diff --git a/examples/stm32f4/src/bin/usb_hid_keyboard.rs b/examples/stm32f4/src/bin/usb_hid_keyboard.rs
index d6b4a9bc9..6ddfba83a 100644
--- a/examples/stm32f4/src/bin/usb_hid_keyboard.rs
+++ b/examples/stm32f4/src/bin/usb_hid_keyboard.rs
@@ -70,6 +70,10 @@ async fn main(_spawner: Spawner) {
70 config.serial_number = Some("12345678"); 70 config.serial_number = Some("12345678");
71 config.max_power = 100; 71 config.max_power = 100;
72 config.max_packet_size_0 = 64; 72 config.max_packet_size_0 = 64;
73 config.composite_with_iads = false;
74 config.device_class = 0;
75 config.device_sub_class = 0;
76 config.device_protocol = 0;
73 77
74 // Create embassy-usb DeviceBuilder using the driver and config. 78 // Create embassy-usb DeviceBuilder using the driver and config.
75 // It needs some buffers for building the descriptors. 79 // It needs some buffers for building the descriptors.
@@ -103,7 +107,7 @@ async fn main(_spawner: Spawner) {
103 max_packet_size: 8, 107 max_packet_size: 8,
104 }; 108 };
105 109
106 let hid = HidReaderWriter::<_, 1, 8>::new(&mut builder, &mut state, config); 110 let hid = HidReaderWriter::<_, 1, 8>::new_keyboard(&mut builder, &mut state, config);
107 111
108 // Build the builder. 112 // Build the builder.
109 let mut usb = builder.build(); 113 let mut usb = builder.build();
diff --git a/examples/stm32f4/src/bin/usb_hid_mouse.rs b/examples/stm32f4/src/bin/usb_hid_mouse.rs
index badb65e98..8d035d0d5 100644
--- a/examples/stm32f4/src/bin/usb_hid_mouse.rs
+++ b/examples/stm32f4/src/bin/usb_hid_mouse.rs
@@ -65,6 +65,10 @@ async fn main(_spawner: Spawner) {
65 config.manufacturer = Some("Embassy"); 65 config.manufacturer = Some("Embassy");
66 config.product = Some("HID mouse example"); 66 config.product = Some("HID mouse example");
67 config.serial_number = Some("12345678"); 67 config.serial_number = Some("12345678");
68 config.composite_with_iads = false;
69 config.device_class = 0;
70 config.device_sub_class = 0;
71 config.device_protocol = 0;
68 72
69 // Create embassy-usb DeviceBuilder using the driver and config. 73 // Create embassy-usb DeviceBuilder using the driver and config.
70 // It needs some buffers for building the descriptors. 74 // It needs some buffers for building the descriptors.
@@ -93,7 +97,7 @@ async fn main(_spawner: Spawner) {
93 max_packet_size: 8, 97 max_packet_size: 8,
94 }; 98 };
95 99
96 let mut writer = HidWriter::<_, 5>::new(&mut builder, &mut state, config); 100 let mut writer = HidWriter::<_, 5>::new_mouse(&mut builder, &mut state, config);
97 101
98 // Build the builder. 102 // Build the builder.
99 let mut usb = builder.build(); 103 let mut usb = builder.build();