Skip to main content

hid_types/id/usage/
arcade.rs

1//! Well-known Usage ID values from the Arcade Usage Page.
2
3use num_enum::{IntoPrimitive, TryFromPrimitive};
4
5use crate::Ident;
6
7/// Well-known Usage ID values from the Arcade Usage Page.
8///
9/// See [HID Usage Tables for Universal Serial Bus](https://www.usb.org/document-library/hid-usage-tables-17),
10/// section 36.
11#[expect(missing_docs)]
12#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)]
13#[repr(u16)]
14pub enum KnownUsage {
15    Undefined = 0,
16    GeneralPurposeIoCard = 0x01,
17    CoinDoor = 0x02,
18    WatchdogTimer = 0x03,
19    // 0x04..0x2F reserved
20    GeneralPurposeAnalogInputState = 0x30,
21    GeneralPurposeDigitalInputState = 0x31,
22    GeneralPurposeOpticalInputState = 0x32,
23    GeneralPurposeDigitalOutputState = 0x33,
24    NumberOfCoinDoors = 0x34,
25    CoinDrawerDropCount = 0x35,
26    CoinDrawerStart = 0x36,
27    CoinDrawerService = 0x37,
28    CoinDrawerTilt = 0x38,
29    CoinDoorTest = 0x39,
30    // 0x3A-0x3F reserved
31    CoinDoorLockout = 0x40,
32    WatchdogTimeout = 0x41,
33    WatchdogAction = 0x42,
34    WatchdogReboot = 0x43,
35    WatchdogRestart = 0x44,
36    AlarmInput = 0x45,
37    CoinDoorCounter = 0x46,
38    IoDirectionMapping = 0x47,
39    SetIoDirectionMapping = 0x48,
40    ExtendedOpticalInputState = 0x49,
41    PinPadInputState = 0x4A,
42    PinPadStatus = 0x4B,
43    PinPadOutput = 0x4C,
44    PinPadCommand = 0x4D,
45    // 0x4E-0xFFFF reserved
46}
47
48/// A __Usage ID__ value.
49pub type Usage = Ident<KnownUsage, u16>;