1#![doc = include_str!("../README.md")]
2#![no_std]
3#![deny(missing_docs)]
4
5#[cfg(feature = "defmt")]
10pub mod log {
11 pub use defmt::*;
12}
13
14#[cfg(not(feature = "defmt"))]
16#[allow(missing_docs)]
17pub mod log {
18 #[macro_export]
19 macro_rules! trace {
20 ($($arg:tt)*) => {};
21 }
22 #[macro_export]
23 macro_rules! debug {
24 ($($arg:tt)*) => {};
25 }
26 #[macro_export]
27 macro_rules! info {
28 ($($arg:tt)*) => {};
29 }
30 #[macro_export]
31 macro_rules! warn {
32 ($($arg:tt)*) => {};
33 }
34 #[macro_export]
35 macro_rules! error {
36 ($($arg:tt)*) => {};
37 }
38
39 pub use crate::{debug, error, info, trace, warn};
40}
41
42pub mod bus;
45pub mod class;
46pub mod control;
47pub mod descriptor;
48pub mod device;
49pub mod endpoint;
50pub mod error;
51
52pub use bus::{InterfaceNumber, PollResult, StringIndex, UsbBus, UsbBusAllocator};
55pub use class::UsbClass;
56pub use descriptor::DescriptorWriter;
57pub use device::{DeviceInfo, DeviceState, UsbDevice, UsbDeviceBuilder};
58pub use endpoint::{
59 Direction, Endpoint, EndpointAddress, EndpointIn, EndpointOut, EndpointType, In,
60 IsoSynchronization, IsoUsage, Out,
61};
62pub use error::{UsbError, UsbResult};
63
64pub const MAX_ENDPOINTS: usize = 16;
69
70pub const CONTROL_MAX_PACKET_SIZE: u16 = 64;
72
73pub const BULK_MAX_PACKET_SIZE: u16 = 64;