From e9845ac94c5810501d765e7ea629431b0d709fd7 Mon Sep 17 00:00:00 2001 From: Alex Martens Date: Mon, 15 Jul 2024 20:10:38 -0700 Subject: [PATCH] Add constants for HID sensors (#67) Co-authored-by: Tom --- macros/src/spec.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macros/src/spec.rs b/macros/src/spec.rs index f746e5c..346545a 100644 --- a/macros/src/spec.rs +++ b/macros/src/spec.rs @@ -180,6 +180,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", "FIDO_ALLIANCE") => Some(0xF1D0), ("usage_page", "VENDOR_DEFINED_START") => Some(0xFF00), @@ -234,6 +235,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), + // FIDO Alliance usage_page ("usage", "U2F_AUTHENTICATOR_DEVICE") => Some(0x1), ("usage", "INPUT_REPORT_DATA") => Some(0x20),