Expand description
USB system call interface
This capsule provides a system call interface to the USB controller.
§Instantiation
The UsbSyscallDriver
must be created by passing a reference to something
that implements hil::usb::Client
(that is, something that is connected to
the USBC), as well as a Grant
for managing application requests. For
example:
ⓘ
// Configure the USB controller
let usb_client = static_init!(
capsules::usb::usbc_client::Client<'static, sam4l::usbc::Usbc<'static>>,
capsules::usb::usbc_client::Client::new(&sam4l::usbc::USBC));
sam4l::usbc::USBC.set_client(usb_client);
// Configure the USB userspace driver
let usb_driver = static_init!(
capsules::usb::usb_user::UsbSyscallDriver<'static,
capsules::usb::usbc_client::Client<'static, sam4l::usbc::Usbc<'static>>>,
capsules::usb::usb_user::UsbSyscallDriver::new(
usb_client, board_kernel.create_grant(&grant_cap)));