Skip to content

Commit

Permalink
Add constants for HID sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
newAM committed May 20, 2024
1 parent 76bea16 commit b169b92
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 @@ -175,6 +175,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", "VENDOR_DEFINED_START") => Some(0xFF00),
("usage_page", "VENDOR_DEFINED_END") => Some(0xFFFF),
Expand Down Expand Up @@ -228,6 +229,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),

(_, _) => None,
}
}
Expand Down

0 comments on commit b169b92

Please sign in to comment.