From b169b924026e07690af0d4c792bd0169561f7bf9 Mon Sep 17 00:00:00 2001 From: Alex Martens Date: Sun, 19 May 2024 17:14:23 -0700 Subject: [PATCH] Add constants for HID sensors --- macros/src/spec.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macros/src/spec.rs b/macros/src/spec.rs index fd78d26..5a3df8a 100644 --- a/macros/src/spec.rs +++ b/macros/src/spec.rs @@ -175,6 +175,7 @@ pub fn try_resolve_constant(key_name: String, path: String) -> Option { ("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), @@ -228,6 +229,15 @@ pub fn try_resolve_constant(key_name: String, path: String) -> Option { ("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, } }