Skip to main content

hid_types/id/usage/
arcade.rs

1//! Usage ID values from the Arcade Usage Page.
2
3use num_enum::{IntoPrimitive, TryFromPrimitive};
4
5use crate::Ident;
6
7/// 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)]
14#[non_exhaustive]
15pub enum KnownUsage {
16    Undefined = 0,
17    GeneralPurposeIoCard = 0x01,
18    CoinDoor = 0x02,
19    WatchdogTimer = 0x03,
20    // 0x04..0x2F reserved
21    GeneralPurposeAnalogInputState = 0x30,
22    GeneralPurposeDigitalInputState = 0x31,
23    GeneralPurposeOpticalInputState = 0x32,
24    GeneralPurposeDigitalOutputState = 0x33,
25    NumberOfCoinDoors = 0x34,
26    CoinDrawerDropCount = 0x35,
27    CoinDrawerStart = 0x36,
28    CoinDrawerService = 0x37,
29    CoinDrawerTilt = 0x38,
30    CoinDoorTest = 0x39,
31    // 0x3A-0x3F reserved
32    CoinDoorLockout = 0x40,
33    WatchdogTimeout = 0x41,
34    WatchdogAction = 0x42,
35    WatchdogReboot = 0x43,
36    WatchdogRestart = 0x44,
37    AlarmInput = 0x45,
38    CoinDoorCounter = 0x46,
39    IoDirectionMapping = 0x47,
40    SetIoDirectionMapping = 0x48,
41    ExtendedOpticalInputState = 0x49,
42    PinPadInputState = 0x4A,
43    PinPadStatus = 0x4B,
44    PinPadOutput = 0x4C,
45    PinPadCommand = 0x4D,
46    // 0x4E-0xFFFF reserved
47}
48
49/// A __Usage ID__ value.
50pub type Usage = Ident<KnownUsage, u16>;