diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e5b6ce1..ef396931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased ] +## [4.2.0] - 2022-07-16 ### Added - Support for GA402 Anime Matrix display (Author: I-Al-Istannen & Luke Jones) - Support for power-config of all LED zones. See `asusctrl led-power --help` (Author: Luke Jones, With much help from: @MNS26) - Full support for multizone LED (Author: Luke Jones, With much help from: @MNS26) - Add ability to load extra data from `/etc/asusd/asusd-user-ledmodes.toml` for LED support if file exits +- Support for G513IM LED modes ### Changed - Dbus interface for Aura config has been changed, all power control is done with `SetLedsEnabled` and `SetLedsDisabled` - Data for anime-matrix now requires passing the laptop model as enum diff --git a/daemon/src/ctrl_aura/zbus.rs b/daemon/src/ctrl_aura/zbus.rs index fadf1b9e..79f33447 100644 --- a/daemon/src/ctrl_aura/zbus.rs +++ b/daemon/src/ctrl_aura/zbus.rs @@ -26,7 +26,22 @@ impl CtrlKbdLedZbus { } } - /// Set a variety of states + /// Set a variety of states, input is array of enum. + /// + /// enum AuraControl { + /// BootLogo, + /// BootKeyb, + /// AwakeLogo, + /// AwakeKeyb, + /// SleepLogo, + /// SleepKeyb, + /// ShutdownLogo, + /// ShutdownKeyb, + /// AwakeBar, + /// BootBar, + /// SleepBar, + /// ShutdownBar, + /// } async fn set_leds_enabled( &mut self, #[zbus(signal_context)] ctxt: SignalContext<'_>, diff --git a/data/asusd-ledmodes.toml b/data/asusd-ledmodes.toml index e0c9e896..52be2355 100644 --- a/data/asusd-ledmodes.toml +++ b/data/asusd-ledmodes.toml @@ -61,6 +61,13 @@ standard = ["Static", "Breathe", "Strobe", "Rainbow", "Pulse"] multizone = [] per_key = false +[[led_data]] +prod_family = "ROG Strix" +board_names = ["G513IM"] +standard = ["Flash", "Static", "Breathe", "Strobe", "Rainbow"] +multizone = false +per_key = true + [[led_data]] prod_family = "Strix" board_names = ["G731GV", "G731GW", "G531GV"] diff --git a/rog-aura/src/usb.rs b/rog-aura/src/usb.rs index fed74faa..b04da375 100644 --- a/rog-aura/src/usb.rs +++ b/rog-aura/src/usb.rs @@ -20,6 +20,33 @@ pub const fn aura_brightness_bytes(brightness: u8) -> [u8; 17] { ] } +/// Enable/disable LED control in various states such as +/// when the device is awake, suspended, shutting down or +/// booting. +/// +/// ```text +// byte 4 in the USB packet is for keyboard + logo power states +// default is on, `ff` +// Keyboard and logo use the full range of bits (almost) +// | n1 | n2 | hex | action | bit | +// |------|------|-----|-----------------------|-------| +// | 0000 | 0000 | 00 | all off | | +// | 0000 | 0001 | 01 | logo boot | bit 1 | +// | 0000 | 0010 | 02 | keyboard boot | bit 2 | +// | 0000 | 0100 | 04 | logo awake | bit 3 | +// | 0000 | 1000 | 08 | keyboard awake | bit 4 | +// | 0001 | 0000 | 10 | logo sleep off | bit 5 | +// | 0010 | 0000 | 20 | keyboard sleep | bit 6 | +// | 0100 | 0000 | 40 | logo shutdown off | bit 7 | +// | 1000 | 0000 | 80 | keyboard shutdown off | bit 8 | + +// byte 5 = lightbar +// | 1 | 2 | hex | action | bit | +// |------|------|-----|----------------------|-------| +// | 0000 | 0010 | 02 | lightbar off boot | bit 2 | +// | 0000 | 0100 | 04 | lightbar on | bit 3 | +// | 0000 | 1000 | 08 | lightbar off sleep | bit 4 | +// | 0001 | 0000 | 10 | lightbar shtdn off | bit 5 | #[cfg_attr(feature = "dbus", derive(Type))] #[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)] #[repr(u16)]