aboutsummaryrefslogtreecommitdiffstats
path: root/usbh/src/device.rs
diff options
context:
space:
mode:
Diffstat (limited to 'usbh/src/device.rs')
-rw-r--r--usbh/src/device.rs36
1 files changed, 18 insertions, 18 deletions
diff --git a/usbh/src/device.rs b/usbh/src/device.rs
index d824aab..f300aa4 100644
--- a/usbh/src/device.rs
+++ b/usbh/src/device.rs
@@ -9,7 +9,7 @@ use log::{debug, error, info, trace};
use atsamd_hal::target_device::usb;
const MAX_DEVICES: usize = 16;
-const MAX_ENDPOINTS: usize = 8;
+const MAX_ENDPOINTS: usize = 16;
// How long to wait before talking to the device again after setting
// its address. cf ยง9.2.6.3 of USB 2.0
@@ -139,11 +139,11 @@ impl Device {
let mut pipe = pipe_table.pipe_for(host, self.addr, 0);
let mut vol_descr =
- ::vcell::VolatileCell::<USBDeviceDescriptor>::new(Default::default());
+ ::vcell::VolatileCell::<DeviceDescriptor>::new(Default::default());
pipe.control_req(
- BMRequestType::get_descr(),
- USBRequest::GetDescriptor,
- WValue::from((0, USBDescriptor::Device as u8)),
+ RequestType::get_descr(),
+ RequestCode::GetDescriptor,
+ WValue::from((0, DescriptorType::Device as u8)),
0,
Some(DataBuf::from(&mut vol_descr)),
self.millis,
@@ -161,11 +161,11 @@ impl Device {
let mut pipe = pipe_table.pipe_for(host, self.addr, 0);
let mut vol_descr =
- ::vcell::VolatileCell::<USBConfigurationDescriptor>::new(Default::default());
+ ::vcell::VolatileCell::<ConfigurationDescriptor>::new(Default::default());
pipe.control_req(
- BMRequestType::get_descr(),
- USBRequest::GetDescriptor,
- WValue::from((0, USBDescriptor::Configuration as u8)),
+ RequestType::get_descr(),
+ RequestCode::GetDescriptor,
+ WValue::from((0, DescriptorType::Configuration as u8)),
0,
Some(DataBuf::from(&mut vol_descr)),
self.millis,
@@ -178,9 +178,9 @@ impl Device {
let buf: [u8; 64] = [0; 64];
let mut tmp = &buf[..desc.w_total_length as usize];
pipe.control_req(
- BMRequestType::get_descr(),
- USBRequest::GetDescriptor,
- WValue::from((0, USBDescriptor::Configuration as u8)),
+ RequestType::get_descr(),
+ RequestCode::GetDescriptor,
+ WValue::from((0, DescriptorType::Configuration as u8)),
0,
Some(DataBuf::from(&mut tmp)),
self.millis,
@@ -195,8 +195,8 @@ impl Device {
debug!("+++ setting configuration");
let conf: u8 = 1;
pipe.control_req(
- BMRequestType::set(),
- USBRequest::SetConfiguration,
+ RequestType::set(),
+ RequestCode::SetConfiguration,
WValue::from((conf, 0)),
0,
None,
@@ -206,12 +206,12 @@ impl Device {
debug!("+++ setting idle");
pipe.control_req(
- BMRequestType::from((
+ RequestType::from((
USBSetupDirection::HostToDevice,
USBSetupType::Class,
USBSetupRecipient::Interface,
)),
- USBRequest::GetInterface, // This is also idle, but can't have two enums with the same value.
+ RequestCode::GetInterface, // This is also idle, but can't have two enums with the same value.
WValue::from((0, 0)),
0,
None,
@@ -222,12 +222,12 @@ impl Device {
debug!("+++ setting report");
let mut rep_res: u8 = 0;
pipe.control_req(
- BMRequestType::from((
+ RequestType::from((
USBSetupDirection::HostToDevice,
USBSetupType::Class,
USBSetupRecipient::Interface,
)),
- USBRequest::SetConfiguration,
+ RequestCode::SetConfiguration,
WValue::from((0, 2)),
0,
Some(DataBuf::from(&mut rep_res)),