mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-27 12:20:37 +00:00
Merge pull request #3682 from Eekle/usb_composite_iars_by_default
Usb composite iads by default
This commit is contained in:
commit
2c87b31395
@ -102,13 +102,6 @@ impl<const N: usize, T: ReceiverHandler + Send + Sync> UsbLogger<N, T> {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = MAX_PACKET_SIZE;
|
config.max_packet_size_0 = MAX_PACKET_SIZE;
|
||||||
|
|
||||||
// Required for windows compatiblity.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
let mut builder = Builder::new(
|
let mut builder = Builder::new(
|
||||||
driver,
|
driver,
|
||||||
config,
|
config,
|
||||||
|
@ -34,17 +34,20 @@ pub struct Config<'a> {
|
|||||||
/// Device class code assigned by USB.org. Set to `0xff` for vendor-specific
|
/// Device class code assigned by USB.org. Set to `0xff` for vendor-specific
|
||||||
/// devices that do not conform to any class.
|
/// devices that do not conform to any class.
|
||||||
///
|
///
|
||||||
/// Default: `0x00` (class code specified by interfaces)
|
/// Default: `0xEF`
|
||||||
|
/// See also: `composite_with_iads`
|
||||||
pub device_class: u8,
|
pub device_class: u8,
|
||||||
|
|
||||||
/// Device sub-class code. Depends on class.
|
/// Device sub-class code. Depends on class.
|
||||||
///
|
///
|
||||||
/// Default: `0x00`
|
/// Default: `0x02`
|
||||||
|
/// See also: `composite_with_iads`
|
||||||
pub device_sub_class: u8,
|
pub device_sub_class: u8,
|
||||||
|
|
||||||
/// Device protocol code. Depends on class and sub-class.
|
/// Device protocol code. Depends on class and sub-class.
|
||||||
///
|
///
|
||||||
/// Default: `0x00`
|
/// Default: `0x01`
|
||||||
|
/// See also: `composite_with_iads`
|
||||||
pub device_protocol: u8,
|
pub device_protocol: u8,
|
||||||
|
|
||||||
/// Device release version in BCD.
|
/// Device release version in BCD.
|
||||||
@ -84,11 +87,14 @@ pub struct Config<'a> {
|
|||||||
|
|
||||||
/// Configures the device as a composite device with interface association descriptors.
|
/// Configures the device as a composite device with interface association descriptors.
|
||||||
///
|
///
|
||||||
/// If set to `true`, the following fields should have the given values:
|
/// If set to `true` (default), the following fields should have the given values:
|
||||||
///
|
///
|
||||||
/// - `device_class` = `0xEF`
|
/// - `device_class` = `0xEF`
|
||||||
/// - `device_sub_class` = `0x02`
|
/// - `device_sub_class` = `0x02`
|
||||||
/// - `device_protocol` = `0x01`
|
/// - `device_protocol` = `0x01`
|
||||||
|
///
|
||||||
|
/// If set to `false`, those fields must be set correctly for the classes that will be
|
||||||
|
/// installed on the USB device.
|
||||||
pub composite_with_iads: bool,
|
pub composite_with_iads: bool,
|
||||||
|
|
||||||
/// Whether the device has its own power source.
|
/// Whether the device has its own power source.
|
||||||
@ -117,9 +123,9 @@ impl<'a> Config<'a> {
|
|||||||
/// Create default configuration with the provided vid and pid values.
|
/// Create default configuration with the provided vid and pid values.
|
||||||
pub const fn new(vid: u16, pid: u16) -> Self {
|
pub const fn new(vid: u16, pid: u16) -> Self {
|
||||||
Self {
|
Self {
|
||||||
device_class: 0x00,
|
device_class: 0xEF,
|
||||||
device_sub_class: 0x00,
|
device_sub_class: 0x02,
|
||||||
device_protocol: 0x00,
|
device_protocol: 0x01,
|
||||||
max_packet_size_0: 64,
|
max_packet_size_0: 64,
|
||||||
vendor_id: vid,
|
vendor_id: vid,
|
||||||
product_id: pid,
|
product_id: pid,
|
||||||
@ -130,7 +136,7 @@ impl<'a> Config<'a> {
|
|||||||
serial_number: None,
|
serial_number: None,
|
||||||
self_powered: false,
|
self_powered: false,
|
||||||
supports_remote_wakeup: false,
|
supports_remote_wakeup: false,
|
||||||
composite_with_iads: false,
|
composite_with_iads: true,
|
||||||
max_power: 100,
|
max_power: 100,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,12 +60,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for Windows support.
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
|
@ -36,13 +36,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -53,13 +53,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
static STATE: StaticCell<State> = StaticCell::new();
|
static STATE: StaticCell<State> = StaticCell::new();
|
||||||
let state = STATE.init(State::new());
|
let state = STATE.init(State::new());
|
||||||
|
|
||||||
|
@ -41,13 +41,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -49,13 +49,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -60,12 +60,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for Windows support.
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
|
@ -37,13 +37,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -84,13 +84,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// // Required for windows compatibility.
|
|
||||||
// // https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -62,13 +62,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// // Required for windows compatibility.
|
|
||||||
// // https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -37,13 +37,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
config
|
config
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,13 +37,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -52,13 +52,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -93,12 +93,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for Windows support.
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
|
@ -71,13 +71,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -66,13 +66,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("HID mouse example");
|
config.product = Some("HID mouse example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -119,13 +119,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-raw example");
|
config.product = Some("USB-raw example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -66,13 +66,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -315,13 +315,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.product = Some("USB-audio-speaker example");
|
config.product = Some("USB-audio-speaker example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
let mut builder = embassy_usb::Builder::new(
|
let mut builder = embassy_usb::Builder::new(
|
||||||
usb_driver,
|
usb_driver,
|
||||||
config,
|
config,
|
||||||
|
@ -66,13 +66,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -51,11 +51,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-Serial Example");
|
config.product = Some("USB-Serial Example");
|
||||||
config.serial_number = Some("123456");
|
config.serial_number = Some("123456");
|
||||||
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
let mut bos_descriptor = [0; 256];
|
let mut bos_descriptor = [0; 256];
|
||||||
let mut control_buf = [0; 64];
|
let mut control_buf = [0; 64];
|
||||||
|
@ -56,13 +56,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -309,13 +309,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.product = Some("USB-audio-speaker example");
|
config.product = Some("USB-audio-speaker example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
let mut builder = embassy_usb::Builder::new(
|
let mut builder = embassy_usb::Builder::new(
|
||||||
usb_driver,
|
usb_driver,
|
||||||
config,
|
config,
|
||||||
|
@ -67,13 +67,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -70,12 +70,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.manufacturer = Some("Embassy");
|
config.manufacturer = Some("Embassy");
|
||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
|
@ -41,11 +41,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-Serial Example");
|
config.product = Some("USB-Serial Example");
|
||||||
config.serial_number = Some("123456");
|
config.serial_number = Some("123456");
|
||||||
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
let mut bos_descriptor = [0; 256];
|
let mut bos_descriptor = [0; 256];
|
||||||
let mut control_buf = [0; 64];
|
let mut control_buf = [0; 64];
|
||||||
|
@ -62,13 +62,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -72,12 +72,6 @@ async fn main(spawner: Spawner) {
|
|||||||
config.max_power = 100;
|
config.max_power = 100;
|
||||||
config.max_packet_size_0 = 64;
|
config.max_packet_size_0 = 64;
|
||||||
|
|
||||||
// Required for Windows support.
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
|
||||||
|
@ -59,13 +59,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
@ -56,13 +56,6 @@ async fn main(_spawner: Spawner) {
|
|||||||
config.product = Some("USB-serial example");
|
config.product = Some("USB-serial example");
|
||||||
config.serial_number = Some("12345678");
|
config.serial_number = Some("12345678");
|
||||||
|
|
||||||
// Required for windows compatibility.
|
|
||||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
|
||||||
config.device_class = 0xEF;
|
|
||||||
config.device_sub_class = 0x02;
|
|
||||||
config.device_protocol = 0x01;
|
|
||||||
config.composite_with_iads = true;
|
|
||||||
|
|
||||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||||
// It needs some buffers for building the descriptors.
|
// It needs some buffers for building the descriptors.
|
||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user