no-std kiibohd-usb

Kiibohd USB HID Interface

7 releases

0.1.6 May 19, 2023
0.1.5 Nov 29, 2022
0.1.2 Jun 5, 2022
0.1.0 Apr 30, 2022

#381 in Hardware support


Used in kiibohd-core-ffi

MIT/Apache

91KB
1.5K SLoC

kiibohd-usb

Rust docs.rs Crates.io Crates.io Crates.io

Combination USB HID interface from the kiibohd project. Instanciates the following USB HID interfaces:

  • Boot mode keyboard (supports auto-switching through SET_PROTOCOL and manual switching)
  • NKRO mode keyboard
  • Consumer Ctrl and System Ctrl
  • Mouse
  • HID-IO

Usage

let (mut kbd_producer, mut kbd_consumer) = KBD_QUEUE.split();
let (mut mouse_producer, mut mouse_consumer) = MOUSE_QUEUE.split();
let (mut ctrl_producer, mut ctrl_consumer) = CTRL_QUEUE.split();
let (mut hidio_rx_producer, mut hidio_rx_consumer) = HIDIO_RX_QUEUE.split();
let (mut hidio_tx_producer, mut hidio_tx_consumer) = HIDIO_TX_QUEUE.split();
let usb_hid = HidInterface::new(
		usb_bus, /* UsbBusAllocator */
		HidCountryCode::NotSupported,
		kbd_consumer,
		mouse_consumer,
		ctrl_consumer,
		hidio_rx_producer,
		hidio_tx_consumer,
);

usb_hid.poll(); // Poll HID-IO
usb_hid.push(); // Push hid reports and poll HID-IO

See docs.rs for more details.

WIP

  • Mouse interface not enabled yet (still some issues during allocation on atsam4s)

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~3MB
~65K SLoC