aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-08-11 13:01:00 -0400
committerBrian Cully <bjc@kublai.com>2019-08-11 13:01:00 -0400
commita3bcee32b84b92640b4082958ee1e0a6d078ffdd (patch)
tree73199c33069539a88908019c00bc901166d00d43 /src
parentd12984e27070d6e44841c1b22c31f235d7c27886 (diff)
downloadbootkbd-a3bcee32b84b92640b4082958ee1e0a6d078ffdd.tar.gz
bootkbd-a3bcee32b84b92640b4082958ee1e0a6d078ffdd.zip
Documentation.
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b068451..4028980 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,6 +26,7 @@ const MAX_ENDPOINTS: usize = 2;
// The maximum size configuration descriptor we can handle.
const CONFIG_BUFFER_LEN: usize = 128;
+/// Boot protocol keyboard driver for USB hosts.
pub struct BootKeyboard<F> {
devices: [Option<Device>; MAX_DEVICES],
callback: F,
@@ -40,6 +41,12 @@ impl<F> BootKeyboard<F>
where
F: FnMut(u8, &[u8]),
{
+ /// Create a new driver instance which will call
+ /// `callback(address: u8, buffer: &[u8])` when a new keyboard
+ /// report is received.
+ ///
+ /// `address` is the address of the USB device which received the
+ /// report and `buffer` is the contents of the report itself.
pub fn new(callback: F) -> Self {
Self {
devices: [None; MAX_DEVICES],