usbhidusage 0.1.3

A general purpose library for working with usb Human Interface Device Descriptors from the HID Usage Tables for Universal Serial Bus (USB) v1.5
Documentation
#[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq, Hash, Debug, Default)]
#[non_exhaustive]
#[repr(u16)]
pub enum DigitizersUsage {
    #[default]
    Undefined,
    Digitizer,
    Pen,
    LightPen,
    TouchScreen,
    TouchPad,
    Whiteboard,
    CoordinateMeasuringMachine,
    _3DDigitizer,
    StereoPlotter,
    ArticulatedArm,
    Armature,
    MultiplePointDigitizer,
    FreeSpaceWand,
    DeviceConfiguration,
    CapacitiveHeatMapDigitizer,
    Reserved10_1F(u16),
    Stylus = 32,
    Puck,
    Finger,
    Devicesettings,
    CharacterGesture,
    Reserved25_2F(u16),
    TipPressure = 48,
    BarrelPressure,
    InRange,
    Touch,
    Untouch,
    Tap,
    Quality,
    DataValid,
    TransducerIndex,
    TabletFunctionKeys,
    ProgramChangeKeys,
    BatteryStrength,
    Invert,
    XTilt,
    YTilt,
    Azimuth,
    Altitude,
    Twist,
    TipSwitch,
    SecondaryTipSwitch,
    BarrelSwitch,
    Eraser,
    TabletPick,
    TouchValid,
    Width,
    Height,
    Reserved4A_50(u16),
    ContactIdentifier = 81,
    DeviceMode,
    DeviceIdentifier,
    ContactCount,
    ContactCountMaximum,
    ScanTime,
    SurfaceSwitch,
    ButtonSwitch,
    PadType,
    SecondaryBarrelSwitch,
    TransducerSerialNumber,
    PreferredColor,
    PreferredColorisLocked,
    PreferredLineWidth,
    PreferredLineWidthisLocked,
    LatencyMode,
    GestureCharacterQuality,
    CharacterGestureDataLength,
    CharacterGestureData,
    GestureCharacterEncoding,
    UTF8CharacterGestureEncoding,
    UTF16LittleEndianCharacterGestureEncoding,
    UTF16BigEndianCharacterGestureEncoding,
    UTF32LittleEndianCharacterGestureEncoding,
    UTF32BigEndianCharacterGestureEncoding,
    CapacitiveHeatMapProtocolVendorID,
    CapacitiveHeatMapProtocolVersion,
    CapacitiveHeatMapFrameData,
    GestureCharacterEnable,
    TransducerSerialNumberPart2,
    NoPreferredColor,
    PreferredLineStyle,
    PreferredLineStyleisLocked,
    Ink,
    Pencil,
    Highlighter,
    ChiselMarker,
    Brush,
    NoPreference,
    Reserved78_7F(u16),
    DigitizerDiagnostic = 128,
    DigitizerError,
    ErrNormalStatus,
    ErrTransducersExceeded,
    ErrFullTransFeaturesUnavailable,
    ErrChargeLow,
    Reserved86_8F(u16),
    TransducerSoftwareInfo = 144,
    TransducerVendorId,
    TransducerProductId,
    DeviceSupportedProtocols,
    TransducerSupportedProtocols,
    NoProtocol,
    WacomAESProtocol,
    USIProtocol,
    MicrosoftPenProtocol,
    Reserved99_9F(u16),
    SupportedReportRates = 160,
    ReportRate,
    TransducerConnected,
    SwitchDisabled,
    SwitchUnimplemented,
    TransducerSwitches,
    TransducerIndexSelector,
    ReservedA7_AF(u16),
    ButtonPressThreshold = 176,
    ReservedB1_FFFF(u16),
}
impl<T> From<T> for DigitizersUsage
where
    T: TryInto<u16>,
{
    fn from(value: T) -> Self {
        let value = value.try_into().unwrap_or(0);
        match value {
            0 => Self::Undefined,
            1 => Self::Digitizer,
            2 => Self::Pen,
            3 => Self::LightPen,
            4 => Self::TouchScreen,
            5 => Self::TouchPad,
            6 => Self::Whiteboard,
            7 => Self::CoordinateMeasuringMachine,
            8 => Self::_3DDigitizer,
            9 => Self::StereoPlotter,
            10 => Self::ArticulatedArm,
            11 => Self::Armature,
            12 => Self::MultiplePointDigitizer,
            13 => Self::FreeSpaceWand,
            14 => Self::DeviceConfiguration,
            15 => Self::CapacitiveHeatMapDigitizer,
            16..32 => Self::Reserved10_1F(value),
            32 => Self::Stylus,
            33 => Self::Puck,
            34 => Self::Finger,
            35 => Self::Devicesettings,
            36 => Self::CharacterGesture,
            37..48 => Self::Reserved25_2F(value),
            48 => Self::TipPressure,
            49 => Self::BarrelPressure,
            50 => Self::InRange,
            51 => Self::Touch,
            52 => Self::Untouch,
            53 => Self::Tap,
            54 => Self::Quality,
            55 => Self::DataValid,
            56 => Self::TransducerIndex,
            57 => Self::TabletFunctionKeys,
            58 => Self::ProgramChangeKeys,
            59 => Self::BatteryStrength,
            60 => Self::Invert,
            61 => Self::XTilt,
            62 => Self::YTilt,
            63 => Self::Azimuth,
            64 => Self::Altitude,
            65 => Self::Twist,
            66 => Self::TipSwitch,
            67 => Self::SecondaryTipSwitch,
            68 => Self::BarrelSwitch,
            69 => Self::Eraser,
            70 => Self::TabletPick,
            71 => Self::TouchValid,
            72 => Self::Width,
            73 => Self::Height,
            74..81 => Self::Reserved4A_50(value),
            81 => Self::ContactIdentifier,
            82 => Self::DeviceMode,
            83 => Self::DeviceIdentifier,
            84 => Self::ContactCount,
            85 => Self::ContactCountMaximum,
            86 => Self::ScanTime,
            87 => Self::SurfaceSwitch,
            88 => Self::ButtonSwitch,
            89 => Self::PadType,
            90 => Self::SecondaryBarrelSwitch,
            91 => Self::TransducerSerialNumber,
            92 => Self::PreferredColor,
            93 => Self::PreferredColorisLocked,
            94 => Self::PreferredLineWidth,
            95 => Self::PreferredLineWidthisLocked,
            96 => Self::LatencyMode,
            97 => Self::GestureCharacterQuality,
            98 => Self::CharacterGestureDataLength,
            99 => Self::CharacterGestureData,
            100 => Self::GestureCharacterEncoding,
            101 => Self::UTF8CharacterGestureEncoding,
            102 => Self::UTF16LittleEndianCharacterGestureEncoding,
            103 => Self::UTF16BigEndianCharacterGestureEncoding,
            104 => Self::UTF32LittleEndianCharacterGestureEncoding,
            105 => Self::UTF32BigEndianCharacterGestureEncoding,
            106 => Self::CapacitiveHeatMapProtocolVendorID,
            107 => Self::CapacitiveHeatMapProtocolVersion,
            108 => Self::CapacitiveHeatMapFrameData,
            109 => Self::GestureCharacterEnable,
            110 => Self::TransducerSerialNumberPart2,
            111 => Self::NoPreferredColor,
            112 => Self::PreferredLineStyle,
            113 => Self::PreferredLineStyleisLocked,
            114 => Self::Ink,
            115 => Self::Pencil,
            116 => Self::Highlighter,
            117 => Self::ChiselMarker,
            118 => Self::Brush,
            119 => Self::NoPreference,
            120..128 => Self::Reserved78_7F(value),
            128 => Self::DigitizerDiagnostic,
            129 => Self::DigitizerError,
            130 => Self::ErrNormalStatus,
            131 => Self::ErrTransducersExceeded,
            132 => Self::ErrFullTransFeaturesUnavailable,
            133 => Self::ErrChargeLow,
            134..144 => Self::Reserved86_8F(value),
            144 => Self::TransducerSoftwareInfo,
            145 => Self::TransducerVendorId,
            146 => Self::TransducerProductId,
            147 => Self::DeviceSupportedProtocols,
            148 => Self::TransducerSupportedProtocols,
            149 => Self::NoProtocol,
            150 => Self::WacomAESProtocol,
            151 => Self::USIProtocol,
            152 => Self::MicrosoftPenProtocol,
            153..160 => Self::Reserved99_9F(value),
            160 => Self::SupportedReportRates,
            161 => Self::ReportRate,
            162 => Self::TransducerConnected,
            163 => Self::SwitchDisabled,
            164 => Self::SwitchUnimplemented,
            165 => Self::TransducerSwitches,
            166 => Self::TransducerIndexSelector,
            167..176 => Self::ReservedA7_AF(value),
            176 => Self::ButtonPressThreshold,
            177..=65535 => Self::ReservedB1_FFFF(value),
        }
    }
}