Skip to content

Commit

Permalink
Add constants for HID sensors (#67)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom <[email protected]>
  • Loading branch information
newAM and twitchyliquid64 authored Jul 16, 2024
1 parent 919616b commit e9845ac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions macros/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ pub fn try_resolve_constant(key_name: String, path: String) -> Option<u32> {
("usage_page", "CONSUMER") => Some(0x0C),
("usage_page", "DIGITIZER") => Some(0x0D),
("usage_page", "ALPHANUMERIC_DISPLAY") => Some(0x14),
("usage_page", "SENSOR") => Some(0x20),
("usage_page", "BARCODE_SCANNER") => Some(0x8C),
("usage_page", "FIDO_ALLIANCE") => Some(0xF1D0),
("usage_page", "VENDOR_DEFINED_START") => Some(0xFF00),
Expand Down Expand Up @@ -234,6 +235,15 @@ pub fn try_resolve_constant(key_name: String, path: String) -> Option<u32> {
("usage", "GRAPHIC_EQUALIZER") => Some(0x06),
("usage", "AC_PAN") => Some(0x0238),

// sensor power states
("usage", "SENSOR_POWER_STATE") => Some(0x0319),
("usage", "SENSOR_POWER_STATE_UNDEFINED") => Some(0x0850),
("usage", "SENSOR_POWER_STATE_D0_FULL_POWER") => Some(0x0851),
("usage", "SENSOR_POWER_STATE_D1_LOW_POWER") => Some(0x0852),
("usage", "SENSOR_POWER_STATE_D2_STANDBY_WITH_WAKE") => Some(0x0853),
("usage", "SENSOR_POWER_STATE_D3_SLEEP_WITH_WAKE") => Some(0x0854),
("usage", "SENSOR_POWER_STATE_D4_POWER_OFF") => Some(0x0855),

// FIDO Alliance usage_page
("usage", "U2F_AUTHENTICATOR_DEVICE") => Some(0x1),
("usage", "INPUT_REPORT_DATA") => Some(0x20),
Expand Down

0 comments on commit e9845ac

Please sign in to comment.