Skip to main content

hid_types/id/usage/
soc.rs

1//! Usage ID values from the SOC Usage Page.
2
3use num_enum::{IntoPrimitive, TryFromPrimitive};
4
5use crate::Ident;
6
7/// Usage ID values from the SOC Usage Page.
8///
9/// See [HID Usage Tables for Universal Serial Bus](https://www.usb.org/document-library/hid-usage-tables-17),
10/// section 20.
11#[expect(missing_docs)]
12#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)]
13#[repr(u16)]
14#[non_exhaustive]
15pub enum KnownUsage {
16    Undefined = 0,
17    SocControl = 0x01,
18    FirmwareTransfer = 0x02,
19    FirmwareFileId = 0x03,
20    FileOffsetInBytes = 0x04,
21    FileTransferSizeMaxInBytes = 0x05,
22    FilePayload = 0x06,
23    FilePayloadSizeInBytes = 0x07,
24    FilePayloadContainsLastBytes = 0x08,
25    FileTransferStop = 0x09,
26    FileTransferTillEnd = 0x0A,
27    // 0x0B-0xFFFF reserved
28}
29
30/// A __Usage ID__ value.
31pub type Usage = Ident<KnownUsage, u16>;