Compare commits

...
Author SHA1 Message Date
Adam Honse 0083d45103 Replace most instances of sprintf() with snprintf() 2023-03-02 00:14:17 -06:00
Adam Honse a67430cf04 change i2c path 2023-02-02 21:31:03 -06:00
Adam Honse b25dacd0c0 Remove unnecessary header file OpenRGB.h 2023-02-01 00:33:23 -06:00
Adam Honse b3ff39138a Save settings for wrapped HID device detectors 2023-01-31 19:18:32 -06:00
Ayexor 51a2fdb09d Gigabyte aorus geforce rtx380 ti extreme waterforce wb 12g lhr 2023-01-31 03:19:17 +00:00
Adam Honse 1930080bc6 Add Kraken X53 PID 2023-01-30 18:30:21 +00:00
Chris M a3e22bedcb Initial commit for Razer Mouse Dock Pro to resolve #3068
+ Added PID entry for the Mouse Dock Pro
+ Registered detectors
+ Added metadata to RazerDevices.cpp
+ Added capabilities to RazerController.cpp
2023-01-30 14:14:55 +00:00
Adam Honse b072b508ae Add wrapped hidapi devices to udev rules 2023-01-29 17:31:05 -06:00
Michael Stummvoll 3c7f53b544 Add support for Das Keyboard 5QS 2023-01-29 21:57:37 +00:00
Chris M 532eaa7478 Adding MSI 3090 Suprim 24G GPU
* Code clean up for the MSI GPU V1
* Registered detector in `MSIGPUControllerDetect.cpp`
* Link to [webpage](https://www.msi.com/Graphics-Card/GeForce-RTX-3090-
SUPRIM-24G/Specification)
2023-01-29 13:51:34 +11:00
Adam Honse 4c67d849b4 Use hidapi wrapper for HyperX mousemat controller 2023-01-28 11:46:31 -06:00
Adam Honse e30fbdef71 Fix build on musl and rename wrapper function to match hidapi's name 2023-01-28 11:37:18 -06:00
JDinABox 6fdc70d650 Add support for Razer Ornata V3X
Commit amended to address minor style issues by Adam Honse <[email protected]>
2023-01-27 22:39:23 -06:00
AnAvrgDev 9e9a583009 Added support for newer version (HP version) of Hyperx Pulsefire Dart (Wired & Wireless) 2023-01-27 14:26:56 +01:00
Chris M 97234c811f Adding media keys to Razer Cynosa V2 Keymap
* Resolves #3062
2023-01-27 17:52:17 +11:00
Adam Honse a7b6ef9e21 Remove redundant code that is no longer necessary with all controllers being registered via RegisterRGBController() 2023-01-26 23:07:30 -06:00
Adam Honse 92f0720639 Remove RGB controllers argument from standard detector 2023-01-26 20:36:02 -06:00
Adam Honse 060567548f Use RegisterRGBController for standard detectors 2023-01-26 20:35:52 -06:00
Adam Honse 29d34f7768 Implement the wrapper for Linux in ResourceManager, change IPU to I for HyperX Quadcast S, code cleanup 2023-01-26 23:56:36 +00:00
Adam Honse 45408ae159 Remove fake Off mode and color saving, as it was messing with the Set All Devices functionality 2023-01-26 23:56:36 +00:00
Adam Honse aec234e7c3 Update USB ID names for HyperX Quadcast S 2023-01-26 23:56:36 +00:00
Matt Silva 72fa099088 Initial commit for HyperX Quadcast S 2023-01-26 23:56:36 +00:00
Chris 856fbc1bb2 Fixing regression bug for the Logitech x56 HOTAS introduced in cac67592
* Added extra IPU detectors for the older x56 hardware
* Closes #2574
2023-01-26 04:30:00 +00:00
Shady Nawara b05b5205de Fix segments load from profile 2023-01-26 04:29:26 +00:00
Jack e15b299684 SDK Plugins Fix 2023-01-25 20:28:50 +00:00
Will Kennedy 3cf9750660 Support for Lian Li UNI Hub SL V2 2023-01-25 19:05:09 +00:00
Jack 4baf19f13a SDK plugin control 2023-01-25 17:50:28 +00:00
Wojciech Lazarski 98c5c177ab Added Polish translations 2023-01-25 15:51:20 +01:00
morg dbf055a89b HyperX Alloy Origins 60 detection fix for Linux. Closes #3074 2023-01-25 00:56:20 +00:00
Wojciech Łazarski 61b1638bb5 Added support for Mountain Everest Keyboard resolves #1085 2023-01-24 17:21:28 +00:00
Wojciech Lazarski 56e4f94be3 Added brightness support for HyperX Origin Core 2023-01-23 22:51:06 +01:00
Wojciech Lazarski 878e6c6d8b Fixed LED mapping for Aorus Master X570 2023-01-23 20:31:28 +01:00
Cyril Bosselut ec6ccf3011 Aorus rtx 4080 master 16g 2023-01-23 14:32:24 +00:00
Neshura d6ec41aba4 Support for Corsair Vengeance DDR5 2023-01-21 02:27:43 +00:00
Alexey Sokolov ba396da13e Fix build after !1239 2023-01-21 02:12:49 +00:00
flora bacbae7e7d Moved TUF RX6800 from AuraGPU to ENESMBus 2023-01-20 22:44:08 +00:00
Adam Honse c27bfe2f5f Fix zone box index processing when clicking the resize/edit button 2023-01-20 19:00:45 +00:00
Adam Honse 890a5846e6 Update UI after editing a zone to refresh zone list 2023-01-20 19:00:45 +00:00
Adam Honse b41ce2dd9d Increment plugin API version as Segments breaks the existing API 2023-01-20 19:00:45 +00:00
Adam Honse 5ee1968b25 Fix DeviceView clicking on Zone and Segment names 2023-01-20 19:00:45 +00:00
Adam Honse 72d8e66c91 Allow selection of segments within Zone box 2023-01-20 19:00:45 +00:00
Adam Honse 447e936464 Segments 2023-01-20 19:00:45 +00:00
Adam Honse ead55f4ea6 Fix is_directory on older versions of filesystem 2023-01-20 12:31:12 -06:00
flora 4913ee8502 Added colorful 4080 2023-01-20 10:48:02 +01:00
Flora Aubry 604c4cf39c Fixed incorrect detection for MSI 6700XT Gaming X closes #2994 2023-01-20 02:26:40 +00:00
flora 11ce757ae3 Support for TUF RX 6950XT 2023-01-20 02:25:24 +00:00
Markus Meissner 73d31a17ab Support for Corsair Dominator Platinum DDR5, closes #2435 2023-01-20 02:24:42 +00:00
flora ac987d5200 Ignore directories while checking for plugins 2023-01-19 19:48:05 +01:00
Flora Aubry a35521e987 Support for TUF RTX 4070TI closes #3065 2023-01-19 17:19:32 +00:00
Adam Honse 7bf0e40fd8 Load sizes for hardware controllers registered using RegisterRGBController() before putting them in the general controllers list and updating the UI 2023-01-18 22:56:44 -06:00
Shady Nawara 6cda8f56ab Asrock Polychrome USB RGSwap Reset Fix 2023-01-18 14:08:06 +00:00
Dmitry K b409b5f7cc Added support for unicode paths (filesystem::path approach) 2023-01-18 06:02:55 +00:00
Shady Nawara 351515f025 Asrock Polychrome USB Fix 2023-01-18 04:45:40 +00:00
flora edf05dc121 Support for Rog Strix RX 6800 2023-01-16 15:55:46 +01:00
Cooper Knaak 895566b8c1 Annotate RGBController_EVGAMouse.cpp to properly generate UDEV rules 2023-01-16 03:37:42 +00:00
César Navarro 6deda6f7d4 Added AORUS RTX 2070 XTREME 2nd vBIOS 2023-01-15 23:34:30 +00:00
Wojciech Łazarski e8f8d01447 Refactoring of MSI GPU 40xx 2023-01-15 23:33:28 +00:00
Flora Aubry 5c5ee6509a Support for Razer Basilisk V3 Pro 2023-01-15 19:05:51 +00:00
flora 5e1d817dea Removed IPU for viewsonic XG270QG 2023-01-15 15:18:43 +01:00
Chris 915ecefd16 Formatting and style fixes for the MSIGPUv2Controller
* Change Hex literals to uppercase
* Adjusting Metadata to correctly reflect the declared controller
* Adding defines for Speed and Brightness values and adjusting mode declarations to suit
* Replacing brightness array in favour of more flexible multiple
2023-01-14 03:26:22 +00:00
Flora Aubry 94a8ce3cbe Reworked "Save as" to include a profile list 2023-01-13 16:34:11 +00:00
Chris M 9ef8ea3fba Correction for the MSI RTX4070Ti Gaming X Trio detector name
* Minor correction to the detector name (refer #3059)
* Link to [webpage](https://www.msi.com/Graphics-Card/GeForce-RTX-4070-
Ti-GAMING-X-TRIO-12G)
2023-01-13 17:55:03 +11:00
Wojciech Łazarski 6f684f1d1e Added support for MSI 4080 & 4070TI Gaming X - closes #3059 2023-01-13 02:21:04 +00:00
Tim Demand dc92567202 Add support for Corsair HydroSeries H100i v2 2023-01-13 02:19:29 +00:00
Flora Aubry a936f91509 Support for Gigabyte 3060 eagle variant closes #3060 2023-01-12 17:12:08 +00:00
Wojciech Lazarski d6b6df3d86 Corrected IDs for MSI 4090 Suprim cards 2023-01-09 22:33:56 +01:00
LucasStf e663bc9114 Added Ionico laptop closes #2995 2023-01-09 19:25:53 +00:00
Adam Honse 2f1212444c Razer Core (v1) IPU changes 2023-01-09 02:19:44 +00:00
David Henry 9f1e53aa4e Add support for ZOTAC GAMING RTX 2070 SUPER Twin Fan 2023-01-08 18:57:41 +01:00
Chris 4cfe8c5d72 Adjusting IPU of Razer Core X Chroma due to 309557226
* Closes #2755
2023-01-08 16:29:56 +11:00
flora 1b8ae08726 Sorted GPU per Brand 2023-01-07 11:41:03 +01:00
Gianfranco Cossani Morales def6db0174 Support for MSI GeForce RTX 3070 SUPRIM 8G. Closes #3041 2023-01-07 06:55:34 +00:00
Flora Aubry f0f7301cad Support for ROG STRIX LC 6950XT 2023-01-07 03:16:52 +00:00
morg da074fbf61 Add support for ASUS ROG STRIX LC RX 6800XT O16G GAMING. Closes #2569 2023-01-06 09:40:08 +01:00
Flora Aubry 8d907e0c6f Added msi 4080 suprim X closes #3029 2023-01-05 22:23:22 +00:00
morg cd4a9098aa Add support for HyperX Alloy Origins 60 (HP version) 2023-01-05 10:03:39 +01:00
Wojciech Łazarski f824e9f653 Add support for MSI RTX 4090 Trio/Suprim/Suprim Liquid Cards - Resolves https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/2896 2023-01-04 19:34:16 +00:00
flora 6c1fec7855 Added colorful 3060 variant 2023-01-04 17:02:49 +01:00
Mola19 b9c0b274ab support for Asus ROG Chakram X 2023-01-03 23:06:25 +00:00
flora fc1395dfe6 Refactored redragon mouse controller and added M808 2023-01-03 19:26:50 +00:00
Jorge López Tello 865312b7c6 Adds Sapphire Nitro+ 7900 XTX closes #3017 2023-01-03 10:06:43 +00:00
LtdJorge fffc8e8b52 Adds Navi31 (7900XT/XTX) 2023-01-03 10:05:33 +00:00
D E c51b019ff7 Add ASUS ROG Strix Flare CoD BO4 Edition keyboard 2023-01-03 02:08:38 +00:00
Flora Aubry 84393884ca Added support for Roccat Elo 7.1 headset closes #3012 2023-01-02 21:14:24 +00:00
Shady Nawara 37fd9ced7a Per Led Support for Asrock Polychrome USB 2023-01-02 07:02:30 +00:00
Sergey Morozov 136b2c2e2c Add support for Gigabyte GeForce RTX 4080 Gaming OC 2023-01-01 09:40:37 +00:00
Simon Chopin acb313631f device page: disable resize button if there are no zones
I have an unsupported Asus GPU which shows up as a device but doesn't
have any zone configured. Clicking on the Resize button leads to an
out-of-bounds read in the empty `zones` vector to `zones[-1]` (default
value of the QComboBox property).

The fix is to entirely disable the button when we're disabling the zones
box.
2022-12-31 16:43:41 +01:00
morg b6172b71c8 Add support for Gigabyte Aorus M2 mouse - Closes #2538 2022-12-31 00:33:48 +00:00
morg 7a1af0854a Initial commit for Lenovo motherboards - #2999 2022-12-30 23:04:29 +00:00
Chris bce0efb083 Adding missing ISO keys to Huntsman V2 TKL layout to resolve #2927
* Appending the layout byte to the GetKeyboardLayoutName() in the default case
2022-12-30 23:55:46 +11:00
Chris 0fa2a6f039 Initial commit for ASUS ROG Strix RTX 4090 O24G Gaming to resolve #2991
* Adding to pci_ids.h
* Registering detector in ENESMBusControllerDetect.cpp
* Link to [webpage](https://rog.asus.com/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx4090-o24g-gaming-model)
2022-12-30 07:28:48 +00:00
thombo 6020008040 Support for MSI board 7D76 added. 2022-12-30 05:31:20 +00:00
Chris f837ed8c26 Initial commit for ASUS TUF RTX 3070 8G Gaming
* Adding to pci_ids.h
* Registering detector in ENESMBusControllerDetect.cpp
* Link to [webpage](https://www.asus.com/motherboards-components/graphics-cards/tuf-gaming/tuf-rtx3070-8g-gaming/)
2022-12-29 23:14:38 +11:00
flora ef77af5da7 Promoted sliders to QTooltipedSliders 2022-12-28 19:05:05 +00:00
Sirn Thanabulpong 8c893fba4f Fix build on musl in Nanoleaf settings 2022-12-28 00:49:47 +09:00
thombo c1dc0fdfc5 Support for MSI boards 7B16 and 7E07 added 2022-12-27 07:02:59 +00:00
morg 02ddd7378a Add support for ASUS TUF RTX 3090Ti O24G OC GAMING 2022-12-26 01:27:43 +01:00
morg 9ff31055ae Add support for ASUS KO RTX 3060 Ti OC. Closes #1236 2022-12-25 13:44:12 +01:00
Chris d49c506e63 Minor cleanup to UDEV rules build script
* Changing Asus-wmi rules to an array for consistency.
2022-12-25 02:32:56 +00:00
Flora Aubry 3a2fa82e1a Support for ROG STRIX 6750XT closes #2858 2022-12-25 02:32:11 +00:00
Flora Aubry ca85fc06b4 Support for MSI 6750XT Gaming X TRIO closes #2912 2022-12-25 02:30:26 +00:00
morg 94aca7d76f Generate CSV file of device list 2022-12-25 02:26:10 +00:00
Moshe Schmidt 26dfceaf6d Lian Li Uni Hub: Leave room in the char array for the null character 2022-12-23 17:45:41 +00:00
Misaka19465 ac2af0c788 Fixing build-udev-rules.sh 2022-12-22 23:19:43 +08:00
Misaka 19465 c88a6021f2 Adding support for ASUS TUF Laptop keyboard LED for Linux 2022-12-22 14:57:58 +00:00
TheRogueZeta 1d27ff86c8 Add EVGA RTX 3080 12GB XC3 Ultra device ID and sort list for 3080 12G ID's 2022-12-21 17:42:26 +00:00
morg b79871fb32 Fix typo in Genesis Thor 300 metadata 2022-12-21 17:41:19 +00:00
flora 0a170cfb44 Fixed typo on lianli supported devices 2022-12-21 17:40:23 +00:00
morg 54f9118dda Fix metadata for Roccat Kova controller 2022-12-21 17:39:32 +00:00
TheRogueZeta 37d58c3aec Initial commit for NVIDIA RTX 4080 Founders Edition device ID 2022-12-20 11:10:20 -08:00
Flora Aubry 23f6efdb01 Support for Aorus 3060 non lhr closes #2950 2022-12-18 20:53:39 +00:00
flora 813bc9ae67 Added 5700XT Strix Variant 2022-12-16 18:16:30 +00:00
IOXAM 2f77af535a Support for AORUS GeForce RTX 4090 MASTER 24G - resolves #2959 2022-12-16 18:12:49 +00:00
Peter Vazny 120ce6abbd Removes unnecessary memory allocation in Lenovo USB Controller 2022-12-16 18:07:20 +00:00
Chris e1a6a74ba7 Removing redundant language resource file
* languages.qrc is no longer required as the .qrc is built and embeded since commit a7adfe251
2022-12-16 17:59:49 +00:00
morg fa406216d3 Add support for Gigabyte RTX2070 Gaming OC 8GC 2022-12-16 17:49:34 +00:00
krotter0 3708eaaab4 Fix SteelSeries Rival 600 flickering when setting colors 2022-12-16 17:47:01 +00:00
Bernhard M. Wiedemann a782c00784 Sort input file list 2022-12-10 20:19:13 +00:00
morg 5da85adb90 Add support for ASUS ROG STRIX 3060 12G GAMING 2022-12-09 17:30:40 +00:00
Flora Aubry 30c1168e1c Hide bottom buttons when a plugin tab is shown 2022-12-09 17:29:49 +00:00
Codename-Antares f85dd617d3 Initial Support for Razer Thunderbolt 4 Dock Chroma 2022-12-09 00:16:52 +00:00
flora cf25ccb304 Fixing margin for plugincontainer 2022-12-08 21:51:30 +01:00
Peter Vazny f8d7eb8bb8 Fixes layout detection for Lenovo Legion 7S 2022-12-08 04:39:17 +00:00
Chris d67acee002 Simplfying the Git commands in the project file
* Allowing commands to get the `GIT_COMMIT_ID`, `GIT_COMMIT_DATE` and `GIT_BRANCH` to work with spaces in path
2022-12-08 13:57:16 +11:00
Chris 86f0ab888d Adding Malaysian translation ms_MY 2022-12-07 23:17:12 +11:00
thombo cf610fa559 MSI boards 7C87 and 7D67 added 2022-12-06 21:43:50 +01:00
Chris 612c809b75 Initial commit for the Logitech G633 to resolve #2911
* Adding the G633 PID to LogitechControllerDetect.cpp
* Registering the detector for the common controller
* Fixing the indexing swap issue for LogitechLightspeedController
* Removing the `bright_cycle_swap` hack and using the queried effects index to set the mode.value for each mode
2022-12-06 12:45:46 +11:00
Mola19 c2c9b3aa99 fixing Roccat Vulcan 120-Series Aimo US layout key map 2022-12-04 00:46:56 +01:00
TheRogueZeta 7a7cea1e1e Initial commit for EVGA RTX 2070 XC Black device ID 2022-12-03 22:58:05 +00:00
Adam Honse 032d22b7ca Add PNY XLR8 Revel EPIC-X RTX 3060 and RTX 3070 2022-12-03 15:15:39 -06:00
Gustavo Parreira 7892713683 feat: Roccat Kova support 2022-12-03 07:45:42 +00:00
Mola19 790abdd9c0 adding hardware modes and layout detection to Asus ROG Falchion to resolve #2732 2022-12-03 00:51:52 +01:00
Chris M 34cb864147 Adding New Fusion2 USB board layout to resolve #2923
* Adding MSTR_ATX_2 layout to support the new layout of the X670E AORUS
Master
2022-12-02 19:20:24 +00:00
flora e30469adc4 Support for Gigabyte 3090 Vision OC 2022-12-02 13:15:34 +01:00
Chris 5c4c4479bf Initial commit for Gigabyte RTX3080Ti Eagle OC 12G
* Added ID to pci_ids.h
* Registering detector in GigabyteRGBFusionGPUControllerDetect.cpp
* Link to [webpage](https://www.gigabyte.com/au/Graphics-Card/GV-N308TEAGLE-OC-12GD/sp#sp)
2022-12-02 03:50:49 +00:00
Chris M ec531bd9fc Correcting defined hex for Lian Li Uni Hub to resolve #2916 2022-12-02 07:35:53 +11:00
Chris M 701cc4d0b3 Initial commit for Gigabyte RTX3070 Eagle V2 OC 8G LHR
* Registering detector in GigabyteRGBFusionGPUControllerDetect.cpp
* Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-
N3070EAGLE-OC-8GD-rev-20)
2022-12-01 07:05:50 +11:00
TheRogueZeta faa6a5060b Initial commit for Colorful iGame 3070 Ultra W OC device ID 2022-11-30 00:26:56 +00:00
TheRogueZeta c0be45182b Initial commit for ASUS ROG STRIX RX 6700XT O12G GAMING 2022-11-29 18:17:24 -06:00
Adam Honse b3da8beccf Remove device listing step from tests, as it can hang when using runner machines which actually have devices present if those devices lock up 2022-11-29 15:31:51 -06:00
Adam Honse d625021eca Increment version number post-release 2022-11-29 14:06:29 -06:00
Adam Honse fb88964b8e OpenRGB version 0.8 2022-11-27 21:44:33 -06:00
Chris 18806706bd Swapping the Chinese Simplified and Chinese Traditional language labels. 2022-11-28 13:56:34 +11:00
TheRogueZeta b32bc8ac01 Reduce logging level of the plugin directory 2022-11-27 23:44:19 +00:00
TheRogueZeta ed123e8439 Add alternate ID for ASUS ROG-STRIX-RTX2080TI-11G-GAMING 2022-11-27 23:36:36 +00:00
Adam Honse 428692fa3a Basic i2c 2022-11-27 23:15:53 +00:00
Alexey Sokolov e0be60de21 Add ability for distro packagers to load plugins from package manager 2022-11-27 21:17:08 +00:00
flora 6da8171257 Support for MSI 6950XT NAVI21_DEV3 2022-11-27 18:43:04 +00:00
Flora Aubry 47a194e8cf Added missing french translations 2022-11-27 18:42:47 +00:00
Chris cdfaaceb7d Adding code to select the "System Default" language on first run.
* Fixes crash when `language` not present in config
2022-11-27 20:39:13 +11:00
Chris 0e96effc94 Adding Wave mode to Razer Mamba Elite to resolve #2874 2022-11-27 09:15:56 +00:00
Adam Honse 81cb2cb2bf Update README.md with changes from !1412 2022-11-27 03:09:05 -06:00
Adam Honse be90537d10 Fix warnings 2022-11-27 02:52:39 -06:00
Adam Honse 755ce20794 Fix 180 LED issue with SRGBMods Pi Pico controller 2022-11-27 02:03:45 -06:00
Adam Honse a7c2b7bd2c Fix MacOS build and incorrect string format in language change log 2022-11-26 23:56:40 -06:00
Chris 2e02f1d782 Adding ability to switch language files at runtime to resolve #2743
* Removing .qm files from Windows build as they are inbuilt as of a7adfe251
* Moving translation change code to the OpenRGBSettingsPage
* Adding a changeEvent() to applicable Widgets to facilitate language updates
* Workaround added to TabLabel to accomodate translation context origin
* Added zh_TW locale to OpenRGB.pro
* Updated all translations to include the latest untranslated strings
2022-11-27 04:07:30 +00:00
Adam Honse 530d667328 Add second SRGBMods Pi Pico string for updated code 2022-11-26 21:26:08 -06:00
TheRogueZeta 1c8b3a2d49 Add Asus TUF 6900XT T16G device ID 2022-11-27 01:22:54 +00:00
Aitor Astorga b2c3656b75 Implements MSI PRO B650M-A WIFI motherboard 2022-11-26 22:42:19 +00:00
thombo 0aabae5f41 New MSI boards 7D69, 7D91 and 7E06 added, direct mode for 7C81 enabled 2022-11-26 20:37:03 +01:00
TheRogueZeta 8f89863ab9 Update name for Gigabyte AORUS RTX2080 SUPER 8G Rev 1.0 2022-11-26 07:24:56 +00:00
flora 5b2016729b Fixed plugin link not opening 2022-11-26 08:13:42 +01:00
Chris 5912683ce7 Adding link to OpenRGB.org plugins in Plugin settings 2022-11-26 04:30:51 +00:00
Adam Honse 248b3e85b6 Don't delete the controller pointer in DeviceView destructor 2022-11-25 22:29:00 -06:00
TheRogueZeta c4d11993b6 Add logging for ADL GPU device ID's 2022-11-25 17:24:29 -08:00
Chris 7f6599658d Small fixes to the OpenRGB.pro file to improve list order 2022-11-26 00:34:26 +00:00
Chris 04127cb201 Resolves clamp is not a member of std error reintroduced in f8745221.
* Original issue in Debian Buster build https://gitlab.com/CalcProgrammer1/OpenRGB/-/jobs/3359116111#L207
2022-11-26 11:17:17 +11:00
Chris 085e1fca41 Initial commit for the Steelseries Apex 3 TKL to resolve #1902
* Combining the Apex3 Full size and TKL controllers
* Cleanup of controllers for readability and optimisation
2022-11-25 23:55:49 +00:00
Paul Konstantin Gerke df1c0a0dad Initial commit for SteelSeriesApex3TKLController to resolve #1902 2022-11-25 23:55:49 +00:00
Mola19 88136152fc support for ASUS ROG Strix XG27AQM 2022-11-25 20:15:00 +01:00
flora c9af45bf92 Edited resize popup so it does not break anymore when resizing 2022-11-25 04:21:15 +00:00
flora 8465d78b7b Fixed incoherence in information tab and changed a bit the ui 2022-11-24 20:14:21 +01:00
Chris 455a1f9172 Adjust Windows Logitech Lightspeed detection to resolve #2621
+ Changing to IPU detector to ensure 1 hit (per device)
+ Bundling all usages on Interface 2
2022-11-24 18:22:14 +00:00
Chris f8745221d4 Added string indexing to -d option to resolve #2854
+ Added zone to `options.device` in cli.cpp
+ replace current_device & current_zone references in parser with
temporary device vector
+ Changed code to accomodate
2022-11-24 18:20:35 +00:00
Chris 40f09406d0 Re-timing DeviceView set up to avoid crash resolving #2564
* Allowing the paintEvent to drive the initial setup of the DeviceView to delay accessing controller features during OpenRGB initialisation.
2022-11-24 09:06:42 +11:00
Chris 1ff192bda2 Resolves clamp is not a member of std error with Buster build.
* https://gitlab.com/CalcProgrammer1/OpenRGB/-/jobs/3359116111#L207
2022-11-23 21:38:33 +11:00
flora ce5ab1ccf1 Added autofillbackground to frames 2022-11-22 01:08:38 +00:00
Chris M 32015f1bcb Added -b & --brightness parameters to resolve #2854
* Added the ability to set mode brightness from the command line
2022-11-21 10:28:01 +11:00
Mola19 e1ee139691 Adding layout detection for Roccat Vulcan 120-Series Aimo 2022-11-20 01:32:06 +01:00
Flora Aubry 541b9433b3 Added support for colorful 3070ti 2022-11-18 17:29:58 +00:00
Chris de3d2c7e22 Initial commit for the Corsair K60 RGB PRO to resolve #1240
+ Adding K60 and K60 Low Profile PID to CorsairPeripheralV2Devices.h
+ Adding device layout
+ Registering detector
+ Adding pointer layout map and changing calls to accomodate.
2022-11-18 17:26:25 +00:00
Joseph East a1be27ad61 Remove null terminations in fwver string when reading from Steelseries Apex keyboards. 2022-11-18 22:21:09 +10:30
Jan Baier 6cb1169801 Initial commit for Genesis Thor 300 RGB (Sinowealth based) keyboard 2022-11-17 04:30:24 +00:00
Defend 5b57e7f84f Move Gigabyte RTX 3060Ti LHR 8G GPU to Gigabyte Fusion 2 GPU Controller detector
Commit amended to remove old location in Fusion GPU Controller and clean up merge by Adam Honse <[email protected]>
2022-11-16 18:06:49 -06:00
morg 2fc15e1da4 E1.31 settings: correctly fill matrix height input 2022-11-15 11:32:03 +01:00
TheReal Monkey 0b9825ca19 Adding Elgato Keylight
Code style changes by Adam Honse <[email protected]>
2022-11-14 23:36:02 -06:00
Mola19 a64894445d support for Asus ROG Gladius III to resolve #2872 2022-11-14 14:04:11 +00:00
Adam Honse 0d545fa9e3 Reverse order of LEDs in ring zone 2022-11-12 21:56:03 -06:00
Adam Honse ecc837b565 Get both direct and effect modes working together 2022-11-13 02:58:55 +00:00
Adam Honse b760ffc085 Implement direct mode for AMD Wraith Prism, other functionality is removed for now 2022-11-13 02:58:55 +00:00
Chris 15698547b0 Adding Intel Raptor Lake Motherboard SubID 2022-11-12 17:51:12 +11:00
Thomas Boos f5b4fe1830 New MSI boards and some cleanup 2022-11-11 17:25:15 +00:00
Michael Oberpriller 0bae5e0def Fixed Logitech G213 Inconsistent Lighting Changes 2022-11-09 13:43:00 +00:00
Chris M 52b369a2e8 Adding MSI 3060 Gaming X 12G GPU to resolve #2864
* Registered detector in `MSIGPUControllerDetect.cpp`
* Link to [webpage](https://www.msi.com/Graphics-Card/GeForce-RTX-3060-
GAMING-X-12G)
2022-11-09 02:14:19 +00:00
Peter Vazny 6890f2f71a Change keyboard map for Y750,Y750S,Y760,Y760S 2022-11-08 17:28:04 +00:00
Adam Honse ca49748603 Hide device view when a mode that doesn't have per-LED is active 2022-11-07 09:24:27 -06:00
Mola19 11bc9d6521 fix device category for Asus Cerberus Mech 2022-11-07 15:11:21 +01:00
Matthew Lloyd e214cfbc5c Add NVIDIA 4090 Founders Edition 2022-11-06 21:12:19 -05:00
Joseph E 2bb27223f4 Multi-region SKU support for Steelseries Apex Pro 2022-11-06 03:07:59 +00:00
cafeed28 d5c1402c30 Add Red Square Keyrox TKL support 2022-11-05 15:03:47 +05:00
Kirill Boyarshinov 57910fc981 Add SteelSeries Qck Prism XL CS:GO Neon Rider edition 2022-11-05 04:04:39 +00:00
morg 0933eb0db4 Add EVGA GeForce GTX 1080 FTW2 Gaming variant 2022-11-04 19:53:51 +01:00
Adam Honse 182966768d Include <algorithm> in IntelArcA770LEController.cpp for std::max 2022-11-04 11:27:07 -05:00
Mola19 5c0660091f support for asus rog claymore to resolve #923 2022-11-03 16:55:10 +00:00
roycwc 3146d8def4 Add Razer Ornata V3 2022-11-03 11:45:26 -05:00
1 dd5934b18c Added PNY XLR8 OC EDITION RTX 2060 2022-11-03 16:36:18 +00:00
flora de6c3879cc Support for MSI 2080TI Z TRIO 2022-11-03 16:35:01 +00:00
Flora Aubry e884a4e6c1 Support for ASUS ROG STRIX 1050TI non OC Closes #2852 2022-11-03 16:33:51 +00:00
Adam Honse 6a457896aa Initial support for Intel Arc A770 Limited Edition RGB controller 2022-11-02 17:21:06 -05:00
Flora Aubry f9bacba037 Support for colorful RTX 3060 Closes #2625 2022-11-01 20:27:53 +00:00
flora 5d64a4ff7c Support for colorful 3070 variant 2022-11-01 13:49:56 +01:00
Joseph E 0de010a009 Add Korean/Japanese/Nordic key names to RGBController 2022-10-31 23:56:42 +00:00
Marcelo Bezerra dc28e6748c Add non-OC ASUS RTX 4090 TUF 2022-10-31 20:41:58 +00:00
Royal~Jelly 88f46d3b85 Update for Asus Strix Scope TKL keyboard variant. 2022-10-31 17:44:39 +00:00
Peter Vazny ccdf1af948 Lenovo - layout detection fix, additional logging, LED id fixes 2022-10-30 19:30:05 +00:00
morg 3b9f06b10b Implemented ColorfulGPUController to support iGame 3070. Closes #2841 2022-10-30 19:18:24 +00:00
Flora Aubry 4d4c18f1ef Support for AORUS 2080 SUPER Variant 2022-10-27 16:25:24 +00:00
Mola19 694e150c53 support for Asus Cerberus Mech 2022-10-27 04:46:30 +00:00
Marcelo Bezerra b3d787ddc4 Enable MSI TRX40 PRO WIFI support 2022-10-27 03:00:29 +00:00
Flora Aubry fbbcf83bf7 Add MSI Gaming X TRIO RX6900XT variant 2022-10-26 19:28:02 +00:00
Marcelo Bezerra a27e16e04b Add support for ASUS TUF RTX 4090 GAMING OC 2022-10-26 13:18:00 +00:00
Teemu Linkoaho 972f9001bd Add ASUS TUF RX6700XT O12G GAMING 2022-10-25 19:18:54 +00:00
morg 467f7d016f Add support for ASUS ROG STRIX RX470 Gaming 2022-10-25 19:15:59 +00:00
morg 77aa9f4ea1 Add support for HyperX Alloy Origins Core PID variant 2022-10-25 15:07:43 +02:00
Frederik Madsen 838164e549 Added functionality to get device/keyboard information for Razer devices
Amended to remove out-of-scope changes, rebase to master, and update all Razer keymaps by Adam Honse <[email protected]>
2022-10-24 22:40:18 -05:00
Katherine 47bebc0616 Attempt to add support for Corsair K70 LUX (Non-RBG) 2022-10-24 22:58:32 +00:00
Gabriel 7bc1bb16be Fix inverted brightness handling when updating UI 2022-10-24 21:02:45 +00:00
Gabriel 62317408cf Fix Alienware color updating 2022-10-24 20:54:31 +00:00
Derek Huber 79471ad42c HyperX Alloy Origins 60 initial commit 2022-10-24 16:37:56 +00:00
flora c1cca4ced4 Fixed column stretch to maintain ui ratio 2022-10-24 10:19:52 +02:00
TheRogueZeta 08071fd6a2 Add recomended VSCode extensions 2022-10-23 17:58:36 -07:00
Flora Aubry 1a10ea79aa Added some changes to device tab UI 2022-10-23 16:25:18 +00:00
rom4ster 31c24eb649 Initial commit for the Steelseries Aerox 9 2022-10-22 23:53:13 +00:00
Thomas Boos c7326f73a3 Detection of MSI 156x devices made working for all types (fixes #2802) 2022-10-22 19:13:28 +00:00
morg 2ba69fc2e9 Add support for MSI GeForce RTX 2070 SUPER ARMOR OC 2022-10-22 06:04:23 +00:00
flora 77958d2667 Added and renamed corsair K100 variant 2022-10-21 20:18:02 +00:00
Codename-Antares ae8f40db00 Add Type Keypad & Tartarus Pro Layout for Razer 2022-10-21 16:52:09 +00:00
Flora Aubry 525f561b6e Added support for B360M AORUS Gaming 3-CF 2022-10-21 13:08:19 +00:00
morg 97acf8ac1d Use the correct case for pt_BR translation file 2022-10-21 06:25:21 +02:00
Gabriel Felipe 73f00c27d5 Add Brazilian Portuguese translation 2022-10-21 00:24:23 +00:00
Alex Zoboo e397d89886 Update PNYGPUControllerDetect.cpp 2022-10-20 16:40:32 +00:00
Chris M 204ad90ec7 Minor spelling correction to HyperX meta data
* Correcting the metadata names for the HyperX Pulsefire Dart and Raid.
2022-10-20 16:38:50 +00:00
Codename-Antares 7f690b7027 Initial Support for My lovely new Razer Strider Chroma 2022-10-20 16:37:45 +00:00
Chris dbad6ce90d Updating pipeline Windows QT5 downloads
* Win32 and Win64 QT5 packages in pipeline now point to generic package registry
2022-10-15 09:10:26 +11:00
Shady Nawara 6f477d6c4c Shared SMBus Access Using Global Mutex on Windows 2022-10-14 00:58:54 +00:00
Chris M be90ba335e Initial commit for the Coolermaster ARGB Gen2 A1 V2
* Adding new PID and registering detector in
CoolerMasterControllerDetect.cpp
* Resolves #2783
2022-10-14 07:26:53 +11:00
Oliver P 52c510dca9 Add support for Lian Li Uni Hub - AL firmware v1.0 and v1.7 2022-10-13 17:36:34 +00:00
TheRogueZeta 238c704f57 Initial commit for EVGA 3070ti FTW3 Ultra v2 device ID 2022-10-13 16:43:37 +00:00
Teemu Linkoaho c5cad07319 Fixed AMD Radeon RX 6900 XT device ID. 2022-10-12 18:39:03 +00:00
Adam Honse c3c57d1f37 Change to a different qt mirror 2022-10-11 17:36:27 -05:00
TheRogueZeta 37fe5ab68d Revert !1216 and add device ID for EVGA RTX3070 TI XC3 Ultra v2 2022-10-11 18:02:50 +00:00
morg c14f26e4d5 Add support for Gigabyte 2080ti GAMING OC 11G 2022-10-11 18:00:47 +00:00
TheRogueZeta 27440d52e0 Initial commit for EVGA 3080 FTW3 Ultra LHR v2 device ID 2022-10-11 17:53:35 +00:00
TheRogueZeta afbb2a0064 Initial commit for ASUS ROG STRIX RTX 3080 12G 2022-10-11 17:46:18 +00:00
TheRogueZeta ff35373c38 Remove redundant memory sizes in AsusAuraGPUControllerDetect.cpp 2022-10-11 17:30:28 +00:00
TheRogueZeta 30ea9e73e8 Add alternate ID for Asus Rog Strix RTX 2060 O6G 2022-10-11 17:30:28 +00:00
TheRogueZeta f1b47de46f Initial commit for Gigabyte RTX3060 EAGLE 12G LHR V2.0 device ID 2022-10-10 21:53:12 -07:00
morg 81c8b82d0b Add hyperx alloys origin new vid/pid (firmware update) 2022-10-10 20:00:57 +00:00
TheRogueZeta dcbe64c288 Initial commit for ASUS ROG STRIX RTX 3080 10G V2 device ID 2022-10-10 20:00:14 +00:00
thombo b45853d885 Retrieve MSI board configuration on startup 2022-10-08 15:50:04 +02:00
Ethan Stevenson 51e99d7363 Fix name of Cooler Master 750 keyboard
Commit amended by Adam Honse <[email protected]>
2022-10-03 11:31:31 -05:00
Adam Honse b4ea36f997 If read byte fails, use read byte data for detecting ENE controller
* The Nuvoton NCT6793D Super-IO SMBus controller does not actually support read byte or quick operations.  The driver used for Windows and in the OpenRGB kernel patch will perform a read byte data operation in its place with a dummy address, but the driver I'm submitting upstream is not going to have this hack.  All controllers that could be used on a Nuvoton SMBus will need a detection path that doesn't rely only on byte read or quick operations.
2022-10-03 00:11:41 -05:00
Chris 572d1d2416 Correcting Fedora links to resolve #2773 2022-10-02 14:49:35 +11:00
morg aafac9862a Add HyperX Pulsfire mousemat support 2022-10-01 19:25:57 +00:00
Chris 615d793912 Adjusting build-supported-devices-md.sh for website deployment
* Changing wiki characters to Unicode equivalents
* Removing whitespace from links
2022-10-01 17:04:12 +10:00
Rodrigo Henrique 86758e39f1 Initial commit for KFA2 RTX 2080 Super EX OC 2022-09-30 19:08:41 +00:00
Adam Honse a6cbde0bcc Remove RX6900XT from AsusAuraGPUController as it is actually an ENE based GPU and shares its ID with the RX6800XT just added 2022-09-30 11:21:47 -05:00
Adam Honse 6341d629d8 AMD ADL SMBus improvements
* Allow word (2 byte) transfers
  * Fix block writes not sending data size
2022-09-30 09:42:19 -05:00
Adam Honse f4f97c61ea Add ASUS TUF RX 6800XT O16 GAMING to ENESMBusController 2022-09-29 11:49:31 -05:00
Chris M 8f2b33ce3e Initial commit for Gigabyte RTX3070 MASTER 8G LHR to resolve #2761
* Registering detector in GigabyteRGBFusion2GPUControllerDetect.cpp
* Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-
N3070AORUS-M-8GD-rev-20)
2022-09-28 19:50:45 +10:00
nomeat 3a251e1e47 Initial commit for Cooler Master MM730 2022-09-27 22:07:22 +00:00
Codename-Antares 57cb3ef9cd Initial Implementation for a MSI GPU FPS Limiter (tested and working)
Commit amended for code style by Adam Honse <[email protected]
2022-09-27 11:36:07 -05:00
Aleš Nezbeda 2603dbe4ab Fix profile not being applied when I2C bus ID changes on reboot 2022-09-27 02:29:59 +00:00
Teemu Linkoaho c1d7daf8c0 Adding ASUS TUF RX 6900 XT OC GPU 2022-09-25 20:46:36 -05:00
Adam Honse 3219dbfdc4 Fix read() warnings 2022-09-25 19:39:22 -05:00
Thomas Boos bf7f470dc5 Support for more ARGB LEDs in Per-LED mode for MSI boards added 2022-09-25 19:45:40 +00:00
Adam Honse 19218f4513 Fix warnings in cli.cpp 2022-09-25 01:03:25 -05:00
Adam Honse dff6b0e494 Fix warning in RGBController_GigabyteRGBFusion2USB.h 2022-09-25 00:11:44 -05:00
Gwen b75e3af5dc Add GV-N3090AORUSX W-24GD Support 2022-09-25 03:44:40 +00:00
Adam Honse 9aa4b5b817 Fix warning in RGBController_Debug.cpp 2022-09-24 22:25:50 -05:00
Adam Honse ab918dada0 Fix warning in RGBController_Sinowealth1007.cpp 2022-09-24 21:14:03 -05:00
Adam Honse ece626828a Fix warnings in RGBController_QMKOpenRGBRevE.cpp 2022-09-24 20:31:49 -05:00
Adam Honse 4b575a780a Fix warnings in RGBController_QMKOpenRGBRevD.cpp 2022-09-24 20:28:29 -05:00
Adam Honse fad91f9a46 Fix warnings in RGBController_QMKOpenRGBRevB.cpp 2022-09-24 17:47:43 -05:00
Adam Honse d68831a116 Fix warning in SteelSeriesSenseiController.cpp 2022-09-24 12:12:51 -05:00
Adam Honse 7f3d4f0dfb Fix warning in SteelSeriesOldApexController.cpp 2022-09-23 22:35:45 -05:00
Adam Honse f6bd67c5a3 Fix warnings in RGBController_SinowealthGMOW.cpp 2022-09-23 22:24:37 -05:00
Adam Honse 75f3f3a3cb Fix warnings in RGBController_QMKOpenRGBRev9.cpp 2022-09-23 18:01:34 -05:00
Adam Honse 20cc60c901 Fix warning in NZXTHuePlusControllerDetect.cpp 2022-09-23 17:58:13 -05:00
Adam Honse f4dd9135dc Fix warnings in LogitechProtocolCommon.cpp 2022-09-23 17:14:37 -05:00
Adam Honse f5ddbed890 Fix warning in LogitechProtocolCommon.h 2022-09-23 17:14:37 -05:00
Peter Vazny 89a6abd9ed Adds support for Lenovo Legion Y740 15" and 17" 2022-09-23 19:10:42 +00:00
Adam Honse b198a6db21 Fix warning in StrimerLConnectController.cpp 2022-09-23 12:46:00 -05:00
Adam Honse db070be161 Fix warning in RGBController_LenovoUSB.cpp 2022-09-23 12:44:53 -05:00
Adam Honse 86eb4dd2e2 Fix warnings in LianLiUniHubController.cpp 2022-09-23 12:44:07 -05:00
Adam Honse e30fdb06d1 Fix more warnings in GigabyteRGBFusion2GPUController.cpp 2022-09-23 12:42:33 -05:00
Adam Honse c4902b7476 Fix warnings in GigabyteRGBFusion2GPUController.cpp 2022-09-21 19:34:08 -05:00
Adam Honse ae350f23a4 Fix warnings in RGBController_GigabyteRGBFusion2GPU.cpp 2022-09-21 19:26:16 -05:00
Adam Honse 54b3828e52 Fix warning in GaiZhongGaiKeyboardController.cpp 2022-09-21 19:24:53 -05:00
Adam Honse 186dd2b672 Fix warning in EVGAKeyboardController.cpp 2022-09-21 19:23:48 -05:00
Adam Honse b84ca30a14 Fix warnings in CorsairPeripheralV2Controller 2022-09-21 12:42:20 -05:00
Adam Honse e51b4ce324 Fix multiply defined warnings in CorsairPeripheralV2Devices controller 2022-09-19 23:14:02 -05:00
Peter Vazny 91879cd063 2502 - adds Lenovo Legion 7 gen 5, Slim 7 gen 5 and Slim 7 gen 6 2022-09-19 16:36:20 +00:00
Tony Stipanic a876d7b120 Add support for Sapphire Radeon RX 6950 XT Nitro+ 2022-09-17 17:10:11 +00:00
Adam Honse ecdb1c8c50 Add another NZXT motherboard ID to Hue 2 controller 2022-09-16 20:31:17 -05:00
Adam Honse a82a6e96ed Fix warnings in RGBController_EVGAGPUv3.cpp 2022-09-16 12:08:11 -05:00
Adam Honse c84cf9392f Fix warning in EVGAGPUv3Controller.cpp 2022-09-16 12:07:56 -05:00
Adam Honse 48b819218d Fix warning in RGBController_EVGAGP102.cpp 2022-09-16 12:07:41 -05:00
Adam Honse 0a1306aefa Turn off explicit fallthrough warning in Linux (GCC) 2022-09-16 12:07:26 -05:00
Adam Honse 541819dd79 Fix warning in CorsairPeripheralV2Controller.cpp 2022-09-16 12:07:09 -05:00
Adam Honse c177016801 Fix multiply defined warning in CM Small ARGB Controller 2022-09-16 12:06:51 -05:00
Adam Honse de1d62cef2 Fix warning in RGBController_CorsairK100.cpp 2022-09-15 19:16:53 -05:00
Adam Honse 75104ba424 Fix error from multiply defined name across different files 2022-09-15 18:21:46 -05:00
Ryan Frankcombe 777d292c7c Initial commit for Gigabyte Super-IO motherboard controller (X570-UD) 2022-09-15 22:40:13 +00:00
Adam Honse e855e19a09 Fix warnings in RGBController_CorsairK100.cpp 2022-09-15 11:41:52 -05:00
Adam Honse 34fc9fbdee Fix warnings in RGBController_AsusAuraKeyboard.cpp 2022-09-15 11:33:08 -05:00
Adam Honse 211bc2359f Fix warning in OpenRGBNanoleafScanningThread.cpp 2022-09-15 11:27:16 -05:00
Adam Honse 219483267c Fix MacOS warning in NetworkClient.cpp 2022-09-14 23:14:55 -05:00
Adam Honse 8bf6514ae3 Fix warnings in Corsair Peripheral V2 Controller 2022-09-14 23:03:33 -05:00
Adam Honse efc9c1fa38 Fix warnings in RGBController_CMR6000Controller.cpp 2022-09-14 22:57:30 -05:00
Adam Honse b027de02a3 Fix warnings in RGBController_CMMMController.cpp and RGBController_CMMM711Controller.cpp 2022-09-14 22:53:29 -05:00
Adam Honse 4ff5e8c9cf Fix warning in ROGStrixLC_Controller.cpp 2022-09-14 22:49:37 -05:00
Adam Honse a1b3a805e4 Fix warning in AsusAuraRyuoAIOController.cpp 2022-09-14 22:46:08 -05:00
Adam Honse e9cf78cb7f Fix warning in AsusAuraMouseController.cpp 2022-09-14 22:43:29 -05:00
Adam Honse 19459edbc9 Fix warning in OpenRGBDevicePage.cpp 2022-09-14 22:38:50 -05:00
Adam Honse c0cb942ea7 Fix warning in cli.cpp 2022-09-14 22:34:30 -05:00
Shayne Hartford 7836a637b9 New Wooting PIDs 2022-09-15 01:48:07 +00:00
Mola19 15757d2736 Adjusting metadata for Asus Strix Claw to fix supported devices list 2022-09-14 01:09:48 +02:00
thombo 295adfb3e7 Support for MSI board 7D19 added and configuration for 7D15 and 7D59 corrected 2022-09-11 19:33:01 +02:00
XPRAMT f44cd6919f Added support for Traditional Chinese internationalization 2022-09-07 21:09:37 +00:00
Flora Aubry 2fc79a8e93 Add support for Sapphire Toxic 6900xt variant 2022-09-07 21:05:10 +00:00
Tiago Oliveira ae460fa10a Add device ASUS TUF RX6800 OC to GPU vendor list 2022-09-06 00:16:01 +00:00
Chris 6d7aa82b8b Adjust Razer meta data to reflect changes in commit cc1a9212b 2022-09-05 09:50:13 +10:00
Adam Honse cc1a9212b4 Update unknown type Razer devices to valid types 2022-09-04 23:23:10 +00:00
Adam Honse bbaac044df Move Razer constant data to a cpp file to fix multiple definition warnings 2022-09-04 20:44:28 +00:00
Thomas Boos e4262af2e7 Support for MSI boards 7D36 and 7D43 added, configuration for MSI board 7D09 corrected (fixes #2643 and #2711) 2022-09-04 20:24:00 +00:00
nick black 99cd322721 i2c_smbus_linux: closedir() on error path 2022-09-03 03:08:33 -04:00
Chris c69a8d15f2 Correcting regression bug in metadata caused by commit 20286c285 2022-09-02 23:31:38 +10:00
Chris c1f57477e8 Adding MSI 3090Ti Gaming X Trio 24G GPU to resolve #2717
* Added card id `0x5091` to pci_ids.h
* Registered detector in `MSIGPUControllerDetect.cpp`
* Link to [webpage](https://www.msi.com/Graphics-Card/GeForce-RTX-3090-Ti-GAMING-X-TRIO-24G)
2022-09-02 12:52:38 +10:00
SjG 4a47d33e5f Add Gainward RTX 3080 Ti Phoenix 2022-09-01 10:31:05 +00:00
Adam Honse 8dd50f4cd7 Fix error 2022-08-31 20:20:10 -05:00
Chris 9fe664ee72 Adding DEVICE_TYPE_ACCESSORY to enum
+ Adding Accessory icons for light and dark theme
+ Adding entry into OpenRGBDialog2 to display icon
+ Creating `Accessory` category in "Supported Devices"
2022-09-01 05:19:09 +00:00
Adam Honse 03d99d135c Address a bunch of warnings 2022-08-31 19:16:57 -05:00
Elchanan Haas e7c385bd71 Add support for MSI GL66 2022-09-01 03:24:51 +00:00
Matt Silva 7c227108bb Sinowealth detector: fix for rgb controller not being added when USE_HID_USAGE isn't defined 2022-09-01 03:22:30 +00:00
flora f53173c55b Add ASUS STRIX 3070 O8G OC non LHR 2022-09-01 03:21:14 +00:00
Codename-Antares 30ff0f04e6 Fix wrong Assinged Keymap ID for Apex Keyboard 2022-09-01 03:19:23 +00:00
Chris 1f6580ebc5 Fixing regression bug caused by DELIMITER change in the supported devices script
+ Adding ability to manually run "Supported Devices" job
+ Changing `Delimiter` from UTF8 to ASCII character
2022-09-01 03:14:37 +00:00
Codename-Antares ec6a19eef9 change name of StrimerLConnect 2022-09-01 03:13:47 +00:00
Niels Westphal 053a492b0a Add Gainward RTX 2080 2022-08-29 15:59:54 +00:00
crashniels 09789de591 Add ID for KFA 2080 TI EX OC 2022-08-29 01:02:30 +02:00
Thomas Boos 6d1f8967a0 Support for Corsair K55 RGB PRO XT (fixes issue #2555) 2022-08-27 19:13:42 +00:00
Chris 38dd53b945 Initial commit for the Gigabyte 3060 EAGLE OC 12G GPU
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N3060EAGLE-OC-12GD-rev-10#kf)
2022-08-27 04:29:13 +00:00
Chris 116d6c4282 Initial commit for the Sapphire 6900 XT Nitro+ GPU to resolve #2710
+ Added card id `0x440E` to pci_ids.h
+ Register detector in SapphireGPUControllerDetect.cpp
+ Link to [webpage](https://www.sapphiretech.com/en/consumer/nitro-radeon-rx-6900-xt-se-16g-gddr6)
2022-08-27 11:12:35 +10:00
Chris 09ef1689dc Adding EVGA 3090Ti FTW3 Ultra Gaming GPU
* Added card id `0x4985` to pci_ids.h
* Registered detector in `EVGAAmpereGPUControllerDetect.cpp`
* Link to [webpage](https://www.evga.com/products/product.aspx?pn=24G-P5-4985-KR)
2022-08-23 13:49:40 +00:00
Chris 8f3ed4c869 Initial commit for the ASUS Strix RTX 3070 O8G V2 White GPU to resolve #2697
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://rog.asus.com/us/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx3070-o8g-white-model/)
2022-08-23 13:44:43 +00:00
Thomas Boos 8c315f5e6e Update hidapi to version 0.12.0. Direct mode stabilization of Logitech G203 Lightsync (fixes #877). 2022-08-23 13:42:15 +00:00
Chris 8fb373a851 Correct Corsair V2 peripheral Detector metadata to resolve #2690 2022-08-23 04:06:35 +00:00
Chris fe98af43ee Changing automatic Faustus udev rules to resolve #2695 2022-08-23 04:05:50 +00:00
Alexey Sokolov 1d5faef123 Fix build with latest nlohmann json lib 2022-08-23 04:05:30 +00:00
Peter Vazny 044917e2f1 Lenovo refactor - adds framework for detecting keyboard layout 2022-08-22 18:48:06 +00:00
Yanzgz 8bb77e1715 Added support for Chinese internationalization 2022-08-22 14:56:06 +00:00
Adam Honse 64199ec939 Remove SetCustomMode from GaiZhongGaiKeyboardController 2022-08-21 23:09:18 -05:00
Yanzgz 68df4d4b00 [New Device/Implements] CH551G open source keyboard (Rebase) 2022-08-22 03:26:17 +00:00
Adam Honse 389cdf340f Allow mode specific color mode for SetCustomMode 2022-08-21 22:08:23 -05:00
Adam Honse 1396cc8f92 Remove SetCustomMode from all controllers beginning with the letters V, W, Y, and Z 2022-08-21 21:37:21 -05:00
Adam Honse 9d7fef5bbc Remove SetCustomMode from all controllers beginning with the letter T 2022-08-21 21:26:41 -05:00
Adam Honse 126e5f4341 Remove SetCustomMode from all controllers beginning with the letter S 2022-08-21 19:31:01 -05:00
Adam Honse 66c856f49a Remove SetCustomMode from all controllers beginning with the letter R 2022-08-21 18:23:34 -05:00
Adam Honse 933370537d Remove SetCustomMode from all controllers beginning with the letter Q 2022-08-21 17:44:31 -05:00
Adam Honse 215183f9c5 Remove SetCustomMode from all controllers beginning with the letter P 2022-08-21 16:24:44 -05:00
Adam Honse bc1ba87e13 Remove SetCustomMode from all controllers beginning with the letter N 2022-08-21 16:04:10 -05:00
Chris 07f55095d5 Adjusting the Razer Huntsman V2 key layout to resolve #2673
* Adding `huntsman_v2_device` to device list
* Regression bug introduce with 942a842a
2022-08-18 00:20:32 +10:00
Chris 8926d29300 Initial commit for Razer Deathadder Essential V2 to resolve #2651
+ Added PID entry for the Deathadder Essential V2
+ Registered detectors
+ Added metadata to RazerDevices.h
+ Added capabilities to RazerController.cpp
+ Added `GetMaxBrightness()` to account for difference in brightness value
2022-08-15 20:08:47 +00:00
Adam Honse 3ac70cd8a6 Fix string in log 2022-08-15 15:07:33 -05:00
Chris 3a71b76075 Initial commit for the Corsair MM700 to resolve #1718
+ Adding CorsairPeripheralV2Controller base class
+ Adding CorsairPeripheralV2Devices.h metadata file
+ Renaming CorsairK55RGBPROController to CorsairPeripheralV2SWController
+ Adjusting CorsairPeripheralV2SWController to accomodate base class changes
+ Renaming RGBController_CorsairK55RGBPRO to RGBController_CorsairV2SW
+ Adjusting RGBController_CorsairV2SW to handle device set up from meta data
+ Adding PID `0x1B9B` and registering detector in CorsairPeripheralV2ControllerDetect.cpp
2022-08-15 12:43:49 +10:00
Adam Honse 9caf7802ed Remove SetCustomMode from all controllers beginning with the letter M 2022-08-14 18:49:41 -05:00
Mike C 69f916c389 Add Support for Asus ROG Strix XG27W Gaming Monitor 2022-08-14 23:26:08 +00:00
Adam Honse 6f1e76c8b1 Remove SetCustomMode from all controllers beginning with the letter L 2022-08-14 13:24:38 -05:00
Adam Honse b6b59db12f Remove SetCustomMode from all controllers beginning with the letter K 2022-08-14 13:08:43 -05:00
Christopher Wróbel 10f9bf4441 Add missing german translation for settings 2022-08-14 17:19:51 +00:00
Adam Honse 35e049a8bb Remove SetCustomMode from all controllers beginning with the letter H 2022-08-14 01:55:19 -05:00
Adam Honse 94603fbfb9 Remove SetCustomMode from all controllers beginning with the letters F and G 2022-08-14 01:44:30 -05:00
TheRogueZeta 27d1831035 Initial commit for EVGA 3080 FTW3 12GB Hydro Copper 2022-08-12 00:19:22 -07:00
Adam Honse 859f15a5b4 Remove SetCustomMode from all controllers beginning with the letter E 2022-08-11 20:18:45 -05:00
Adam Honse 100e6ddb2a Remove SetCustomMode from all controllers beginning with the letter D 2022-08-10 16:04:23 -05:00
Adam Honse f8916f2bcb Remove SetCustomMode from all controllers beginning with the letters B and C, except Cooler Master 2022-08-10 09:52:38 -05:00
Adam Honse eab96d1b36 Remove SetCustomMode from all controllers beginning with the letter A 2022-08-09 22:58:40 -05:00
Adam Honse 58b1a29076 Remove SetCustomMode from some controllers (the ones in my PC) 2022-08-09 21:07:22 -05:00
Adam Honse afb975e5fc Add generic implementation of SetCustomMode to RGBController class 2022-08-09 20:49:38 -05:00
Adam Honse 3af17b6d8e Apply changes from \!1275 code review 2022-08-09 19:06:51 -05:00
Shaun McThomas 8b02484456 Create "Direct" Mode for ASRock Polychrome USB device. 2022-08-09 23:59:04 +00:00
Chris 6292ee1664 Initial commit for the Cougar 700K EVO Keyboard to resolve #2310
* Adding entry for the Cougar 700K EVO VID & PID
* Registered detectors
* Creating CougarKeyboardController class
* Creating RGBController_CougarKeyboard class
2022-08-09 18:43:18 +00:00
Chris cac67592b7 Correcting the metadata for the Logitech x56 HOTAS to resolve #2574
* Changing detector to IPU to remove duplicate detection
+ Adding Save() method to controller
+ Adding Brightness
2022-08-09 18:24:12 +00:00
Chris 4f649795b3 Fixing regression to the DetectCoolerMasterMouse callback made in f33fc268
* Changed the `if` to a `switch case` to correct the MM720 triggering the callback but not creating a controller.
* Code cleanup and readability changes.
* Related to !1116
2022-08-09 20:58:22 +10:00
Mola19 f637d64dcb Support for Asus Strix Claw 2022-08-08 15:06:53 +00:00
Chris f1860bf742 Initial commit for Razer Naga Classic to resolve #2646
+ Adding PID entry for the Naga Classic
+ Registered detectors
+ Added metadata to RazerDevices.h
+ Added capabilities to RazerController.cpp
2022-08-08 23:28:30 +10:00
MOVZX b1f560d28d Add support for MSI Radeon RX 6900/6950 XT Gaming X Trio 2022-08-08 02:27:13 +00:00
Chris 1c1bfee727 Initial commit for the Asus ROG Strix SCAR 15 to resolve #2622
+ Adding AsusAuraCoreLaptopController and RGBController_AsusAuraCoreLaptop
+ Adding PID `0x19B6` and registering detector in AsusAuraCoreControllerDetect.cpp
2022-08-08 09:38:10 +10:00
Chris 4d7fe885c9 Adding a name to the LIFX controller 2022-08-08 02:02:43 +10:00
Chris 223ec45a75 Adding Laptop Stand Chroma Device to razer device list. 2022-08-06 19:56:48 +00:00
Chris 95f7cc1010 Initial commit for 3 versions of the Gigabyte 3060 Vision OC 12G GPU to resolve #2393
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N3060VISION-OC-12GD-rev-20)
2022-08-06 19:43:32 +00:00
Chris be4c4bfabe Adjusting Blackwidow V3 key map layout to resolve #2583 2022-08-06 19:42:35 +00:00
MOVZX ecdad8c3de Add support for MSI Radeon RX 6700 XT Gaming X & MSI Radeon RX 6800 XT Gaming X Trio 2022-08-06 19:40:43 +00:00
morg 551c30e6e6 Add support for PNY GeForce RTX 3080 10GB XLR8 Gaming REVEL EPIC-X RGB 2022-08-03 14:38:56 +00:00
reklrekl f46d86303c Add ISO keycodes 0x32 and 0x64 to QMK controller 2022-08-03 14:38:12 +00:00
Vladimir fef0bfe3bd Switched from C-style arrays to std::vector to fix C++17 std::size() not being available on some Linux dists to fix !1343 build failures 2022-08-03 02:14:27 +00:00
Chris 102d7cecef Initial commit for Razer Laptop Stand Chroma to resolve #2638
+ Adding PID entry for the Laptop Stand Chroma
+ Registered detectors
+ Added metadata to RazerDevices.h
+ Added capabilities to RazerController.cpp
2022-08-02 21:05:03 +00:00
Chris 864422b4bc Fixing regression from 942a842a
+ Adding ZONE_EN_KEYBOARD constant char* to KeyNames
+ Replacing declarations of "Keyboard" zone with new constant char*
+ Adding "Keyboard" zone check RGBController_Razer.cpp before hiding keys
2022-08-02 21:03:28 +00:00
edbgon 2fae06a49a Add HID to Logitech Lightspeed location string so that profile loading is successful. 2022-08-02 16:25:54 +02:00
morg 5ad475befe Add support for PNY GeForce RTX 3060 Ti XLR8 variant 2022-08-01 10:23:13 +02:00
Vladimir 153c1579b5 Fix RGBController_MSIGPU's interaction with mode speed and brightness values to resolve #2637 2022-07-31 06:55:00 +00:00
Min Gu Kang f511ceac14 Initial commit for Glorious Model D Wireless 2022-07-31 06:53:33 +00:00
Carter Miller d918917c73 Removing some duplicated code and comments from NvAPI Illumination Controller, likely result of some git issue (my fault) during original merge 2022-07-31 06:52:54 +00:00
cmill f5f4040f58 Added support line for GA104 version of PNY 3060 XLR8 Revel Epic-x 2022-07-31 02:10:10 +00:00
Chris 306d9cc8ea Initial commit for the Gigabyte RTX 3070 Vision OC 8G LHR GPU to resolve #2639
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N3070VISION-OC-8GD-rev-20#kf)
2022-07-30 17:25:55 +10:00
Chris 6b55bbc8aa Adding MSI 6600XT Gaming X 8G GPU to resolve #2384
* Added card id `0x5020` to pci_ids.h
* Registered detector in `MSIGPUControllerDetect.cpp`
* Link to [webpage](https://www.msi.com/Graphics-Card/Radeon-RX-6600-XT-GAMING-X-8G)
2022-07-29 11:58:31 +10:00
Chris 20286c285d Improving targeted detection for the Das 4Q Keyboard to resolve #2633
+ Changing to IPU detector to accurately detect keyboard first time
* Avoiding errors by adding new detector callback function
2022-07-28 17:15:38 +00:00
Vladimir c7881890d0 Initial commit for the MSI RTX 3090 Ti Suprim X 24G to resolve #2409 2022-07-28 11:46:43 +03:00
Matt Silva 773fac2240 Initial commit for Glorious Model O Wireless - Sinowealth 2022-07-27 04:03:45 +00:00
Chris 5991d566c2 Initial commit for the Gigabyte RTX 3060Ti Vision OC 8G GPU to resolve #2627
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N306TVISION-OC-8GD-rev-20#kf)
2022-07-27 12:33:56 +10:00
Chris 40bcddf569 Adding the Gigabyte Z370 AORUS Ultra Gaming-CF to resolve #2623 2022-07-27 01:32:44 +00:00
Chris fa84a587b5 Changing detector type for NVidia Illumination GPUs to resolve #2617
+ Switching the detector registration to allow enabling / disabling.
2022-07-26 23:33:29 +10:00
Chris 148f69b929 Initial commit for the Gigabyte Aorus 2080 XTREME 8G GPU to resolve #2615
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusion2GPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N2080AORUS-X-8GC#kf)
2022-07-25 20:31:48 +10:00
Adam Honse b6af69cd50 Remove Ubuntu 21.10 test 2022-07-24 16:47:58 -05:00
Adam Honse c6c9bd9f24 Fix race condition crash in SRGBmodsPicoController 2022-07-24 16:10:43 -05:00
Chris a0f9e4ed01 Initial commit for the AMD RX 6900 XT reference GPU to resolve #2612
+ Adding USB PID `0x015B` to the existing controller.
+ Adding missing colour modes `Rainbow Wave`, `Swirl`, `Chase` and `Bounce`
2022-07-25 03:33:50 +10:00
thombo 20c50ba367 Support for MSI boards 7D18 and 7D51 added 2022-07-23 17:39:55 +00:00
Chris 462da9663f Adding the GA104 variant of the MSI 3060 Gaming X 12G GPU to resolve #2613
* Related to !1317
* Registered detector in `MSIGPUControllerDetect.cpp`
2022-07-23 10:04:47 +10:00
Chris 942a842a32 Hiding non-keys from Razer keymaps
+ Setting matrix map key value if not found in defined layout
+ Correcting layout for `blackwidow_chroma_te_keymap` to include missing keys
2022-07-23 01:51:50 +10:00
Adam Honse 16effbe35b Initial support for SRGBmods Raspberry Pi Pico LED Controller 2022-07-22 03:23:31 +00:00
Chris 3f03e4b550 Initial commit for Razer Blade 15 Base 2021 V2 to resolve #2599
+ Adding entry for the Blade 15 Base V2
+ Registered detectors
+ Added metadata to RazerDevices.h
+ Added capabilities to RazerController.cpp
2022-07-22 09:04:07 +10:00
Chris 9147e65963 Adding en_AU and en_GB locales to resolve #2500
* Adjusted main.cpp to accomodate the full locale name
2022-07-21 13:37:10 +10:00
flora fd4db35940 Add support for Sapphire RX6900XT Toxic Limited Edition 2022-07-20 16:57:00 +00:00
Chris 40ed7bdf83 Initial commit for the Lian Li Strimer L Connect to resolve #2563
+ Adding StrimerLConnectController
+ Adding RGBController_StrimerLConnect
+ Adding ENEUSBControllersDetect.cpp to register StrimerLConnect detector
2022-07-21 00:14:58 +10:00
Adam Honse 75711744e7 Use 16-LED linear layout for Blade Stealth Late 2020 2022-07-20 13:03:13 +00:00
Chris b1b07db406 Adding MSI 3060 Gaming X 12G GPU to resolve #2610
* Added card id `0x3976` to pci_ids.h
* Registered detector in `MSIGPUControllerDetect.cpp`
* Link to [webpage](https://www.msi.com/Graphics-Card/GeForce-RTX-3060-GAMING-X-12G)
2022-07-20 04:44:48 +00:00
Chris c479a06312 Adding qt5-linguist to Fedora build dependencies 2022-07-20 14:34:13 +10:00
Chris d33c410ea6 Adding new receiver for the Logitech G915 Wireless Keyboard
+ Adding new PID `0xC547`
+ Registering detector in LogitechControllerDetect.cpp
2022-07-19 20:06:40 +00:00
Adam Honse ced081d168 Fix more warnings 2022-07-19 00:48:35 -05:00
Adam Honse bf6ae63ae6 Fix some Windows build warnings 2022-07-18 20:46:13 -05:00
morg c0851f3b1e Add support for Cooler Master Addressable Gen 2 RGB LED Controller A1. Closes #2256 2022-07-18 23:58:44 +00:00
Adam Honse bba7fa9fd2 Fix a bunch of compiler warnings 2022-07-17 22:33:20 -05:00
flora be10133bce removed dualsense detect.h from .pro 2022-07-18 02:43:44 +00:00
Chris d6cc7ff984 Adding MSI 3080 SUPRIM X 12G LHR GPU to resolve #2602
* Registered detector in `MSIGPUControllerDetect.cpp`
* Link to [webpage](https://www.msi.com/Graphics-Card/GeForce-RTX-3080-SUPRIM-X-12G-LHR)
2022-07-18 02:43:17 +00:00
B Horn a54f03e199 Fixing MacOS / Clang builds 2022-07-18 02:32:28 +00:00
B Horn 640eb7905c SDK Listening Options 2022-07-17 20:30:15 +00:00
Chris M 241ea0a8ef Adding ability to load profile on GUI shutdown to resolve #1694 2022-07-17 05:48:49 +00:00
thombo f737ef1214 Support for MSI boards 7D08, 7D30 and 7D59 added, some configurations corrected 2022-07-15 19:19:07 +02:00
Chris 6aff7254b7 Change Non-Mainline pipelines to be manually triggered 2022-07-15 23:48:38 +10:00
morg ea24729808 Add bookworm and ubuntu jammy builds and tests 2022-07-15 13:33:21 +00:00
TheRogueZeta c8ce5dc973 Rework and fix Polychrome v1 controller 2022-07-15 00:10:10 +00:00
TheRogueZeta ce9895412a Initial commit for ASUS ROG Strix LC 3080TI O12G Gaming 2022-07-14 01:34:27 +00:00
Thomas Karl Pietrowski a9d67cd10f debian: Adding qttools5-dev-tools to build deps 2022-07-14 01:32:39 +00:00
Aytaç Kayadelen 75527b3989 Change Aurora Link to New Repository 2022-07-14 01:31:32 +00:00
Chris 554bbb65b3 Adding EVGA 3080 FTW3 Ultra Hybrid Gaming LHR GPU to resolve #2589
* Added card id `0x4878` to pci_ids.h
* Registered detector in `EVGAAmpereGPUControllerDetect.cpp`
* Link to [webpage](https://www.evga.com/products/product.aspx?pn=12G-P5-4878-KL)
2022-07-13 02:35:17 +00:00
HorrorTroll 3217bd7ceb Fixed some issues of new QMK Protocol 2022-07-12 21:29:23 +07:00
HorrorTroll 4fd156d373 Updated RGB effect list for QMK protocol 2022-07-11 13:09:43 +00:00
Chris daf1ccf668 Initial commit for the PNY 3060 XLR8 Gaming REVEL EPIC-X GPU to resolve #2575
+ Add id to pci_ids.h
+ Register detector in NVIDIAIlluminationControllerDetect.cpp
+ Link to [webpage](https://www.pny.com/geforce-rtx-3060-12gb-xlr8-gaming-revel-epic-x-rgb-df)
2022-07-11 13:02:37 +00:00
Chris c7d40b78a7 Initial commit for the Gigabyte Eagle 3060 OC 12G GPU
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N3060EAGLE-OC-12GD-rev-20#kf)
2022-07-11 13:41:32 +10:00
Adam Honse 8681e9f026 Remove PID check to test to see if these changes work for all boards 2022-07-08 19:00:58 -05:00
Adam Honse 852475736d Set zone type to single if zone size is 1 on MSI 162-byte controller 2022-07-08 23:43:06 +00:00
Adam Honse b626d88a24 MSI improvements cleanup
* Only create resizable zones if the board supports per-LED and the zone is one of the ARGB zones
  * Default resizable zones to zero size, per convention
  * Set fixed-size single LED zones to single type
2022-07-08 23:43:06 +00:00
thombo 537b9d4569 Special treatment of MSI board 0x7B93 added 2022-07-08 23:43:06 +00:00
Thomas Boos 98ebcb2ee0 MSI Mystic Light Rework
* Direct mode for certain 185-byte boards based on Aleksandr Garashchenko's mystic-why project
  * Improved detector to automatically determine controller type (162 vs 185 byte)
  * Re-enable missing modes and improve mode control
  * Code cleanup

Commits squashed and amended by Adam Honse <[email protected]> as part of !1181
2022-07-08 23:43:06 +00:00
rob Dunn 185c1c3cae Fix Windows crash on startup in Intel i801 detection (Jeampan fix) https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/766
Commit amended by Adam Honse <[email protected]>
2022-07-08 18:41:09 -05:00
Flora Aubry 3168212214 Add support for Sony DualSense closes #2013 2022-07-08 23:31:07 +00:00
Chris M da6e790ee6 Initial commit for the Bloody MP 50RS to resolve #2579 2022-07-08 20:29:58 +00:00
Chris c2dd179145 Initial commit for the ASUS Strix RTX 2080 O8G V2 Gaming GPU to resolve #2580
+ Add id to pci_ids.h
+ Register detector in AsusAuraGPUControllerDetect.cpp
+ Link to [webpage](https://rog.asus.com/us/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx2080-o8g-gaming-model/)
2022-07-07 14:16:06 +10:00
Milan Cermak 7dbf4c8624 Add support for Gigabyte X299 Designare EX motherboard 2022-07-06 09:19:36 +02:00
George Whiteside a66fca1172 fixed a small typo preventing the EVGA 3060ti FTW3 Ultra (non-LHR) from being detected 2022-07-04 23:30:16 -05:00
Chris f3eac499d4 Allow for server side controller resizing
* Save sizes profile on the server
* Update RGBController_Network size on the client
2022-07-04 20:16:39 +00:00
TheRogueZeta 3f79cc41c8 Inital split for ASRock SMBus controllers 2022-07-04 20:15:58 +00:00
Obiwac 6def6a7772 FreeBSD: Fix compilation 2022-07-04 20:13:36 +00:00
Chris 2414b41b94 Initial commit for the Bloody W60 Pro to resolve #2560
+ Adding BloodyMouseController
+ Adding RGBController_BloodyMouse
+ Adding A4Tech_Detector to register Bloody W60 detector
2022-07-04 01:56:32 +10:00
morg 9bd4afe010 Fix the file filter in the install plugin file dialog 2022-07-03 01:40:24 +00:00
Chris 439afed737 Fix for pipes | in device names being interpreted as Markdown control character
* Fixes the EVGA K|NGP|N text names in supported devices pages
2022-07-01 15:38:06 +00:00
morg 833be22b33 Fix Corsair K65 mini detection 2022-07-01 15:35:29 +00:00
Chris 2770206a8d Normalising config directory to ensure it has trailing path separator resolving #2552
* Moved Setter next to Getter
* Set `config_dir` to ensure consistent directory for all files resolving #2551
* Changed PluginManager loading log message to include directory
2022-07-01 15:33:38 +00:00
Shaun McThomas 663b28508c Adding Gigabyte AORUS RTX3070Ti Masters GPU 2022-07-01 15:31:49 +00:00
Name 4c8315e1c2 Add support for MSI 3070 Suprim X 2022-07-01 15:29:29 +00:00
TheRogueZeta 366cd3097d Initial commit for EVGA RTX 2080 Ti XC HYDRO COPPER GAMING 2022-07-01 15:27:16 +00:00
TheRogueZeta 4e304ce6e8 Initial commit for Gigabyte Aorus RTX 2080Ti EXTREME 11G 2022-07-01 15:23:41 +00:00
TheRogueZeta a182f7a96f Initial Commit for ASUS TUF RTX 3080 10G GAMING with SVID 0x87B2 2022-06-30 23:57:40 +00:00
Konstantin A. Zolotukhin bbc6c3b84f Add Palit 3080Ti Gamerock PCI sub device id 2022-06-30 14:40:28 +07:00
Chris 673ae40d19 Initial commit for the ASUS TUF 3080Ti 12G Gaming GPU to resolve #2548
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://www.asus.com/Motherboards-Components/Graphics-Cards/TUF-Gaming/TUF-RTX3080TI-12G-GAMING/)
2022-06-30 00:34:48 +00:00
Chris e773dcb6ef Initial commit for the ASUS KO 3060 O12G V2 Gaming GPU to resolve #2559
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://www.asus.com/Motherboards-Components/Graphics-Cards/KO/KO-RTX3060-O12G-V2-GAMING/)
2022-06-30 00:33:46 +00:00
Chris 2c7ec0cd44 Initial commit for the ASUS ROG Strix 3080 10G Gaming GPU to resolve #2562
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://rog.asus.com/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx3080-10g-gaming-model/)
2022-06-30 09:49:00 +10:00
Chris 709c6a0970 Adding I2C PCI Detector names to the detector config to resolve #2554
* Adding i2c_pci detector iterator under `UpdateDetectorSettings()` in the ResourceManager
* Prefixing all Sapphire GPU detector strings with `Sapphire ` to align with other detectors
* Splitting the V1 and V3 detector code paths to populate Supported Devices acccurately
* RGBController code cleanup to align with current style guidlines.
2022-06-28 10:57:57 +10:00
Carter Miller 81b385a67e Add Support for direct NV_API Illumination Controlled GPUs 2022-06-23 14:23:29 +00:00
Chris 8f8764232e Adding Legend to Suported Devices
+ Adding 🤖 symbol for Automatic saving
+ Changing ⚠️ to 🚨 for better visibility
+ Adding :tools: symbol to mean `partial support`
+ Adding ⭕ symbol to mean not currently implemented by OpenRGB
2022-06-21 16:37:20 +00:00
morg f870ad20f2 CorsairPeripherals: add hardware modes 2022-06-21 16:36:50 +00:00
Robert Hanzel e1e9af2f5d Add MSI GeForce RTX 3080 12G GAMING Z TRIO LHR support 2022-06-20 03:57:49 +00:00
Chris a961bf87b4 Initial commit for the Steelseries Aerox 3 mouse to resolve #2492
+ Adding STEELSERIES_AEROX_3_PID and registering detector
+ Adding Abstract SteelSeriesMouseController class to accomodate new mouse
+ Adding SteelSeriesAerox3Controller class
* Rewrote SteelSeriesRival3Controller to align with abstract class
* Adjusted RGBController_SteelSeriesRival3 class to align with both mice
2022-06-20 11:54:19 +10:00
morg d193c93e6d Add support for Corsair K95 Platinum XT. Closes #2511 2022-06-19 21:33:26 +00:00
Chris a39f8dd560 Initial commit for Razer Laptop Stand V2 Chroma
+ Adding entry for the Laptop Stand V2 Chroma PID
+ Registered detectors
+ Added metadata to RazerDevices.h
+ Added capabilities to RazerController.cpp
+ Links to [webpage](https://www.razer.com/gaming-pc-accessories/razer-laptop-stand-chroma-v2)
2022-06-19 21:28:08 +00:00
Flora Aubry fda0455b97 Remade OpenRGB.ico Closes #2537 2022-06-19 21:24:27 +00:00
Chris 7900e52291 Adding status check for GetSerial() for the EVGA Keyboard to resolve #2531
* Adding status check for `hid_get_serial_number_string()` to ensure serial string is valid.
2022-06-16 10:49:44 +10:00
Chris 0282f761cd Formatting fixes for Supported Devices pages
+ Correcting detector references for EVGA V2 and V3
+ Correcting "Mice" anchor link
+ Updating GPU / USB table header labels
+ Removing leading whitespace from GPU IDs
2022-06-15 15:47:18 +10:00
Chris 5a3dd972f7 Correcting metadata for the Roccat Burst Controller. 2022-06-14 10:06:15 +10:00
B Horn 937451d6e8 SDK Client Disconnection Fixes 2022-06-12 04:43:15 +00:00
TheRogueZeta 003f4ba641 Add H60i RGB PRO XT AIO PID to CorsairHydroPlatinumControllerDetect.cpp 2022-06-12 03:30:03 +00:00
BillCipher-exe ac67a24a8c added support for ASUS ROG STRIX RTX 2080 8G Gaming Closes #2518 2022-06-11 03:46:37 +00:00
morg 98e7126184 Add support for Roccat Burst Pro. Closes #1561 2022-06-10 03:52:46 +00:00
Chris 70fdf54d5e Adding DEVICE_TYPE_MICROPHONE to enum
+ Adding microphone icons for light and dark theme
+ Adding entry into OpenRGBDialog2 to display icon
+ Creating `Microphone` category in "Supported Devices"
+ Changing Razer Seiren Emote to a `Microphone`
2022-06-10 10:40:58 +10:00
TheRogueZeta 9786ad5e16 Update EVGAAmpereGPUControllerDetect to use REGISTER_I2C_PCI_DETECTOR 2022-06-09 23:00:25 +00:00
TheRogueZeta 49b91b1a4e Update EVGATuringGPUControllerDetect to use REGISTER_I2C_PCI_DETECTOR 2022-06-09 00:23:41 -07:00
morg 90606b647a Add support for generic optical USB mouse (NA5312A) Closes #1959 2022-06-07 20:45:24 +00:00
Chris 23188e07a7 Improved targeting of metadata
* Ensured extended comments are not truncated
* Script now allows `@` in comment
2022-06-07 01:09:10 +10:00
Chris d56bf03440 Updating @comment on LenovoUSB to detail process to add new devices 2022-06-06 13:22:53 +00:00
Chris 2d6fb91d0a Initial commit for the ASUS ROG Strix 3080 O12G OC GPU to resolve #2508
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://rog.asus.com/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx3080-o12g-gaming-model/)
2022-06-06 17:21:09 +10:00
Chris d18f82d5e7 Initial commit for the ASUS TUF 3080 O12G GPU to resolve #2336
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://www.asus.com/Motherboards-Components/Graphics-Cards/TUF-Gaming/TUF-RTX3080-O12G-GAMING/)
2022-06-05 01:07:31 +10:00
Cooper Hall f3663af404 Add ROG Ryuo Water Cooler 2022-06-04 04:42:35 +00:00
Cooper Hall 15be3f6336 [new device] a very well tested addition for the Lenovo Legion 7, with a framework for adding more Lenovo Devices 2022-06-03 23:02:15 +00:00
morg e8e24ac243 Add support for HyperX Pulsefire Raid mouse. Closes #1745 2022-06-02 18:03:43 +00:00
morg 7495fe998e Add support for Roccat Burst Core. Closes #2491 2022-06-02 18:02:36 +00:00
morg ad6ade21ad Add support for MSI Vigor GK30 keyboard. Closes #2490 2022-06-02 18:01:24 +00:00
TheRogueZeta 4b43c78299 Add ID for Corsair Hydro H100i Pro XT v2 2022-06-02 17:56:07 +00:00
Codename-Antares 46905e8249 KrakenX63 Fix 2022-06-02 17:55:29 +00:00
Chris f812b26fdf Initial commit for Razer DeathAdder V2 Mini to resolve #2380
+ Adding entry for the DeathAdder V2 Mini
+ Registered detectors
+ Added metadata to RazerDevices.h
+ Added capabilities to RazerController.cpp
2022-06-02 09:08:19 +00:00
Mola19 f4cee9d626 Translation Mistake Fix in German translation 2022-06-02 09:06:03 +00:00
Chris c2163e2b99 Small formatting fix to print the newline between HID and I2C lists 2022-06-02 09:02:42 +00:00
TheRogueZeta 30c8c56a5e Add Device ID for ASUS GTX1080 ROG Strix OC 11Gbps 2022-06-02 09:01:39 +00:00
TheRogueZeta d19f186198 Correct type casting on log prints 2022-05-31 01:04:26 -07:00
TheRogueZeta a3924001e3 Update .gitignore to include *.qrc files related to i18n update 2022-05-31 06:14:53 +00:00
Shady Nawara e9c382d2e6 Add support for Intel i801 SMBus on MacOS 2022-05-31 00:59:07 +00:00
Chris 524675108d Automatic generation of markdown pages for supported devices
+ Added build-supported-devices.sh script
+ Added new target in CI/CD to build at compile time
2022-05-30 13:30:44 +10:00
Chris a7adfe251b Adding i18n resource file generation into .pro
+ Adding `lrelease` and `embed_translations` to .pro CONFIG as per [translation config](https://doc.qt.io/qt-5/qmake-variable-reference.html#translations)
- Removing `generate-qm-files` step from CI/CD
+ Adjusting "how to" comment to reflect changes
2022-05-28 22:41:36 +10:00
YegorMi f0895fdebf Add MSI GeForce GTX 1660 Ti GAMING 6G support 2022-05-26 08:28:18 +00:00
morg f7f41596cc Multilanguage support using I18n (German, Spanish, French, Russian) 2022-05-25 13:07:50 +00:00
Adam Honse e4bb578801 Update PNY GPU controller to use I2C PCI detector 2022-05-25 00:04:28 -05:00
Adam Honse 6bfe682d7b Update type for Asus Aura GPU from SMBus to I2C 2022-05-24 23:51:50 -05:00
Adam Honse 2f6cf34b15 Update Sapphire GPU controller to use I2C PCI detector 2022-05-24 23:49:21 -05:00
morg 9001659832 Add support for MSI GeForce RTX 2080 Ti GAMING TRIO variant 2022-05-24 21:56:05 +02:00
TheRogueZeta 692c232396 Initial commit for EVGA 3090Ti FTW3 Gaming 2022-05-23 21:08:29 -07:00
Adam Honse a3a9817eaa Update MSI GPU controller to use I2C PCI detector 2022-05-23 19:09:53 -05:00
Adam Honse 8a807a7cf7 Remove -pipe flag from gcc options as it conflicts with -save-temps and causes warnings 2022-05-23 11:44:10 -05:00
Adam Honse ef4faedb26 Remove GPU table from ENE controller 2022-05-23 11:33:15 -05:00
TheRogueZeta fe5789846b Add alternate address for Gigabyte RTX 2070 Super GAMING OC X3 2022-05-23 00:27:05 -07:00
Adam Honse 106f6c2fc5 Update ENE GPU controller to use I2C PCI detector 2022-05-22 19:22:56 -05:00
Adam Honse 147adf6623 Update ASUS Aura GPU controller to use I2C PCI detector 2022-05-22 19:09:11 -05:00
Adam Honse b780c440e7 Update Gainward GPU controller to use I2C PCI detector 2022-05-22 19:03:41 -05:00
Adam Honse 4f52ffd480 Update Galax GPU controller to use I2C PCI detector 2022-05-22 18:55:35 -05:00
Adam Honse 99595c57d3 Update Gigabyte RGB Fusion 2 GPU controller to use I2C PCI detector 2022-05-22 18:48:21 -05:00
Adam Honse 00e35e9e01 Add I2C PCI detector type for registering GPU detectors, update Gigabyte RGB Fusion GPU controller to use it 2022-05-22 18:23:46 -05:00
Mola19 4f9b81661c Support for Asus ROG Strix Impact II design variants 2022-05-22 00:19:20 +00:00
Toby Kao bcc89af4e9 Add ASUS ROG PG32UQ Monitor Support 2022-05-21 00:52:41 +00:00
TheRogueZeta 89cc3f4961 Correct Subvendor ID for EVGA RTX3070 TI XC3 Ultra 2022-05-20 13:41:03 -07:00
Chris e2a4ef45cf Adding greyscale OpenRGB lightbulb as the tray icon to resolve #2453
* Created OpenRGBGreyscale.png from original SVG
* Added to resources.qrc
2022-05-20 23:29:07 +10:00
Mola19 952d0fe505 support for Asus ROG Strix Impact II Wireless to resolve #2446 2022-05-19 23:55:13 +00:00
morg 95bac267c8 Add support for MSI GeForce RTX 3060 12GB Gaming X Trio 2022-05-19 23:53:35 +00:00
ParkerMc 6342ecff60 Commander core fw update 2022-05-19 23:52:24 +00:00
TheRogueZeta 3045e86046 Update .gitignore to ignore the auto generated 60-openrgb.rules file 2022-05-16 17:01:24 +00:00
TheRogueZeta 4941f2d31c Update .gitignore to add *.ii and *.s files 2022-05-16 03:23:36 +00:00
TheRogueZeta 5999cfb1c8 Initial commit for Corsair Scimitar RGB 2022-05-16 03:23:13 +00:00
Chris 6b6caa66c0 Initial commit for the ASUS ROG Strix 3060Ti O8G V2 GPU to resolve #2442
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://rog.asus.com/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx3060ti-o8g-v2-gaming-model/)
2022-05-14 22:39:24 +10:00
Chris cc304007a0 Initial commit for the Steelseries QMK Prism XL Destiny Ed. to resolve #2437
+ Added PID and registered detector in SteelSeriesControllerDetect.cpp
+ Link to [webpage](https://steelseries.com/gaming-mousepads/qck-prism-xl-destiny-edition)
2022-05-13 10:21:34 +10:00
Mola19 699fd4050d support for Asus ROG Gladius III Wireless to resolve #1972 2022-05-11 16:38:07 +00:00
Chris 2485c24560 Adding DUMMY_DEVICE_DETECTORS to supplement dynamic UDEV rules
* USB devices that are **not** registering a detector that includes the VID and PID will need to specify these details separately to be added to the UDEV rules
at compile time
* Resolves #2440
2022-05-08 19:37:57 +00:00
void-spark1 c4708eb39b Fix layout for Razer Huntsman V2 TKL 2022-05-08 15:44:47 +00:00
Chris 6ad7882472 Adding EVGA XC3 Ultra Gaming GPU
* Added card id `0x3955` to pci_ids.h
* Registered detector in `EVGAAmpereGPUControllerDetect.cpp`
* Link to [webpage](https://www.evga.com/products/product.aspx?pn=12G-P5-3955-KR)
2022-05-07 16:51:11 +10:00
Chris 2db2b1dd2f Alinging Wraith Prism mode names to "Common Modes" convention
* As per mode names in https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/Common-Modes
2022-05-07 12:05:12 +10:00
Chris M b08b6fe398 Switching VID & PID declarations in SonyDS4ControllerDetect.cpp to #defines 2022-05-06 16:39:39 +00:00
Lanzaa 04ba474030 Logitech G915 TKL mode support 2022-05-05 22:56:30 +00:00
Lanzaa 817d5d55df Add ViewSonic Elite XG270QG
Amended for code style by Adam Honse <[email protected]>
2022-05-04 21:48:58 -05:00
Cooper Knaak 0d7e947575 Add Support for EVGA X20 Gaming Mouse
Commit amended to remove udev rules (which is now autogenerated) and fix build by Adam Honse <[email protected]>
2022-05-04 20:27:34 -05:00
radekw8733 3aa5e2648f Fixed Gigabyte GTX 1050 Ti detecting
Commit amended for code style by Adam Honse <[email protected]>
2022-05-04 19:41:52 -05:00
Chris 1f3415bdab Changed UDEV build-udev-rules.sh to allow for DOS encoded files 2022-05-04 05:46:53 +00:00
Adam Honse 9200834172 More cleanup, add metadata 2022-05-04 05:39:09 +00:00
Adam Honse f569077c68 Implement POST in httplib 2022-05-04 05:39:09 +00:00
Adam Honse 2cb08ec4b4 Replace curl with httplib 2022-05-04 05:39:09 +00:00
Nikita Rushmanov aeb1e364c4 Fix memory leak in Nanoleaf Controller 2022-05-04 05:39:09 +00:00
Adam Honse e61b6cd3d7 Implement direct control for v2 protocol (Canvas and Shapes), clean up some formatting with v1 to match. 2022-05-04 05:39:09 +00:00
Adam Honse 7276d254d6 Code style cleanup of Nanoleaf code - comment style, controller pointer name 2022-05-04 05:39:09 +00:00
Nikita Rushmanov 79b49873ec Add Nanoleaf support 2022-05-04 05:39:09 +00:00
Vidar Karlsen 7faa3b4875 Unbreak macOS build 2022-05-04 04:32:24 +00:00
Vidar Karlsen 6ae5242ed5 Add FreeBSD support 2022-05-03 16:41:11 +00:00
Diego Vargas 45755c79ae Add support for Patriot Viper Steel Direct mode 2022-05-02 20:51:25 +00:00
kent 2f720615c2 Add Palit RTX 3060 Ti (+OC) support 2022-05-02 00:05:32 +00:00
Aleš Nezbeda 48118821d7 Patriot Viper RAM reimplementation 2022-05-01 00:31:52 +00:00
Serge Doda d75556c3cb [FIX] wrong RTX2070 super gaming PCI ID 2022-04-28 19:07:52 +00:00
Serge Doda 95bdcbc5c2 [New Device] GeForce RTX 2070 SUPER GAMING 2022-04-28 15:18:59 +00:00
Shady Nawara bc5fedbbec Hide dock icon on minimize macOS 2022-04-28 05:20:37 +00:00
Adam Honse 6cd4dc8674 Modify Patriot Viper detection to not depend on detecting SPD slot address (0x36) as this doesn't work on some SMBus controllers 2022-04-27 20:09:20 -05:00
morg a81d22ee0a Add support for Gainward Phoenix GTX 1080 Ti 2022-04-26 09:30:16 +02:00
Pavel Kuzminov 4f50b64e1d Add support for Gigabyte GeForce RTX 3080 VISION OC 10G REV2.0 2022-04-22 16:31:44 +00:00
morg 0aae02feab Add support for AORUS GeForce RTX 3080 XTREME WATERFORCE WB 10G 2022-04-20 21:07:02 +02:00
Qwex 0029046b9a Update the bug report template 2022-04-20 16:38:23 +00:00
Chris e9eca70e72 Initial commit for the Dark Project KD3B Keyboard to resolve #2292
* Creating detector class and adding entry for the Dark Project KD3B VID & PID
* Registered detectors
* Creating DarkProjectKeyboardController class
* Creating RGBController_DarkProjectKeyboard class
* Added UDEV rule to 60-openrgb.rules
2022-04-20 16:29:48 +00:00
Piotr Adamczyk 42b95509ac Add support for MSI Radeon RX 6800 XT Gaming Z Trio 2022-04-20 14:07:02 +00:00
Michael Moore 87778842c9 PCB RGB support for the ASRock B550 Phantom Gaming-ITX/ax 2022-04-20 13:40:32 +00:00
Chris 30c80adbe1 Fixes to Automatic UDEV generation
+ Removing blank vid & pids entries to avoid `invalid value` warnings
+ Changing incorrect syntax from `ATTR` to `ATTRS`
+ Adding `Release` build check to .pro to work around code syntax highlighting issue in QTcreator
2022-04-20 01:04:19 +10:00
Chris 0b515ba901 Some edits to the Readme.md for version 0.8
+ Refomatted and expanded the "Installing OpenRGB" on Linux section
+ Added link to new automated UDEV rules file `60-openrgb.rules`
+ Removed reference to `chmod` for SMBus access to resolve #2343
2022-04-19 06:56:43 +00:00
Mola19 eca8ee3a31 Add missing modes to AsusAuraMousepad to resolve #780 and #1199 2022-04-19 06:52:57 +00:00
alpemwarrior 1ac4e127cb Create fedora 36 pipeline and deprecate f34 pipeline in favour of f35 2022-04-18 07:12:53 +00:00
Shady Nawara f91d4d7af1 Add fan sync to plugin list 2022-04-17 03:27:30 +00:00
Chris bc10e3f772 Automatic generation of udev rules for supported devices
+ Added build-udev-rules.sh script
+ Added new custom target in Linux section of .pro to accommodate new rules location
2022-04-17 12:31:02 +10:00
Mola19 fb7e388e3f Adjusting Interface for Asus ROG Gladius II origin COD 2022-04-12 16:39:59 +00:00
Hacker Bonsai 54ba9aca02 Remove unnecessary context creation from ADL I2C controller 2022-04-12 16:39:11 +00:00
Mola19 6709fe4a1a Support for asus rog strix impact 2022-04-12 16:37:16 +00:00
Chris b0ed2684a2 Initial commit for the EVGA Z20 Keyboard to resolve #2157
* Cleaned up cherry picked commit from @Elteeb96
* Added UDEV rule to 60-openrgb.rules
2022-04-12 13:36:25 +10:00
Elteeb 452ea9ec91 Added rudimentary Z20 support, added icons for macro keys and ‘feature buttons’. I.E. The ‘game mode’ button on the Z20.
(cherry picked from commit 9d73df25fdc896a0363b2fe0e43aca13dd8663b6)
2022-04-12 13:36:25 +10:00
morg 45478b0d9f Set the correct speeds for polychrome V2 (SMBUS) 2022-04-08 23:21:54 +02:00
Werseter 14c73d2eac Add basic support for EVGA GeForce RTX 2070 SUPER FTW3 Ultra 2022-04-06 13:32:18 +00:00
Jan-Ole Hübner 328e5f562f Added Device Corsair Scimitar Elite ( Resolves #987 ) 2022-04-06 13:31:05 +00:00
Nikita Rushmanov aae734a361 Fix segfault when destructing udp_client 2022-04-05 10:26:00 -07:00
Chris b4231e2a6e Reverting change to the CM RGB detector made in f33fc268
* Related to !1116
2022-04-05 11:55:05 +10:00
jld3103 139a9c4010 cli: Validate hex color length 2022-04-04 17:56:34 +02:00
jimcx 8619d77445 Add support for MSI MEG Z690I Unify 2022-04-04 14:38:48 +00:00
Chris 34b20a78ea LED ID correction and zone fix for Basilisk V3
* Change LED ID to 0
* Swap Logo and Scroll Wheel Zone order
* Created `SupportsBreathing()` function to allow removal of hardware mode for the Basilisk V3
2022-04-04 14:35:08 +10:00
Mola19 9cf99d142b fixing udev rules for Asus USB devices 2022-04-03 19:16:35 +02:00
Chris e0ef12af10 Follow up to commit 0d0ac0af52 adding the PIDs to UDEV rules 2022-04-03 15:14:49 +10:00
morg a70b616a1b Add support for ASUS ROG STRIX RTX2080S O8G WHITE 2022-04-03 04:42:37 +00:00
Kyle Heide 0d0ac0af52 Support Full Range of Riing Quad Controllers 2022-04-03 04:36:45 +00:00
Chris f4da04f544 Adding Asus Aura TUF K3 keyboard PID to UDEV rules to resolve #1719 2022-04-02 03:49:45 +00:00
Mola19 a03c4674cf support for Asus ROG Throne Qi GUNDAM to resolve #2340 2022-04-02 03:45:02 +00:00
Der Informatiker 2c1c80334b Add grouping for unicast E1.31 devices 2022-04-02 02:15:52 +02:00
Adam Honse b2c6028cb8 Always overwrite file when updating plugins, add additional logging to plugin management 2022-04-01 17:55:26 -05:00
Mola19 41389f4746 support for Asus ROG Strix XG27AQ 2022-03-31 21:32:47 +00:00
Mola19 0c784ac560 Add mode support to roccat vulcan 120 2022-03-31 20:52:49 +00:00
Mola19 119f20cfee support for asus tuf k3 2022-03-31 22:06:56 +02:00
Chris 795427bcb7 Initial commit for the EVGA Z15 Keyboard to resolve #1909
* Added RGBController_EVGA_Keyboard_Controller.h / RGBController_EVGA_Keyboard_Controller.cpp
* Added EVGA_Keyboard_Controller.h / EVGA_Keyboard_Controller.cpp
* Added EVGAUSBControllerDetect.cpp
* Adding UDEV rule to 60-openrgb.rules
* Adding Folder to CODEOWNERS
2022-03-30 17:00:11 +00:00
Renars 6e3c418264 Add support for steelseries rival 106 2022-03-30 15:57:27 +00:00
Mola19 a56b0da600 Support for asus rog keris wireless 2022-03-30 15:54:21 +00:00
Mola19 505d7f89ad Replacing Tabs with Spaces in AsusAuraUSBController 2022-03-30 02:46:56 +02:00
Adam Honse 04c1ad363e Add some modes to ROG Balteus controller 2022-03-27 20:37:46 -05:00
Dracrius e0e2c9e20b Cleaned Up the Hue Controllers 2022-03-25 22:45:03 +00:00
morg 19c2b98e8a Add support for Trust GXT 180 mouse. Closes #2330 2022-03-24 21:40:44 +00:00
Dracrius 14d7347d66 Added Colours to QMK Gradient Modes 2022-03-24 17:23:44 +00:00
Chris c013d476ba Initial commit for ASUS ROG Strix LC120 to resolve #1068
+ Adding entry for the ROG Strix LC120 PID
+ Registered detectors
+ Added ROGStrixLC_Controller to address protocol differences
+ Added RGBController_ROGStrixLC_Controller to allow for mode differences
+ Added UDEV rule to 60-openrgb.rules
2022-03-24 17:20:54 +00:00
Chris 8fa85b3f27 Initial commit for the ASUS ROG Strix RTX 2080Ti A11G Gaming GPU to resolve #2323
+ Add id to pci_ids.h
+ Register detector in AsusAuraGPUControllerDetect.cpp
+ Link to [webpage](https://rog.asus.com/us/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx2080ti-a11g-gaming-model/)
2022-03-24 16:59:22 +00:00
TheRogueZeta 965380b6f6 Inital support for EVGA RTX 3090 FTW3 Ultra 3842:3387 2022-03-23 22:03:46 -07:00
morg eddbcc2b8b Add support for Gigabyte AORUS RTX3080 XTREME WATERFORCE 10G Rev 2.0 2022-03-23 22:33:16 +00:00
morg 7d27fadbc4 Add support for ASUS ROG STRIX RTX 3080 O10G V2 GAMING 2022-03-22 18:41:19 +00:00
Chris 8a7f3b4a3a Initial commit for the Gigabyte 2080S Waterforce WB 8G GPU to resolve #2319
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusion2GPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N208SAORUS-WB-8GC#kf)
2022-03-23 00:52:26 +11:00
Chris 4f9eb7e4be Initial commit for the Gigabyte AORUS 2070 Super 8G GPU
* Small fix to zone enumeration
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusion2GPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N207SAORUS-8GC-rev-10-11#kf)
2022-03-22 05:13:13 +00:00
Adam Honse 97155d240b Disable Sinowealth Keyboard controller due to reports of bricking 2022-03-22 00:12:41 -05:00
morg a935e15631 Fix typo in Corsair Vengeance RGB PRO name 2022-03-22 01:32:10 +00:00
morg 39b36bbc28 Add support for ASUS TUF 3060 O12G V2 GAMING variant 2022-03-22 01:31:41 +00:00
Dracrius b586a631b6 Update gitignore 2022-03-21 21:29:47 +00:00
Dracrius f33fc26810 Added Support for MM530 2022-03-21 15:34:25 +00:00
morg 3c1b168676 Add Corsair K65 Mini support - Closes #2275 2022-03-21 13:37:28 +00:00
morg 7ab784aa16 Add support for Steelseries arctis 5. Closes #1015 2022-03-21 13:35:14 +00:00
morg 56334ed7c5 Add support for Cougar Revenger ST - Closes #2312 2022-03-20 16:00:11 +00:00
TheRogueZeta 0b202fc1ba Inital commit to .editorconfig file 2022-03-14 03:34:18 +00:00
Adam Honse c8b34ccb0d Update contributing guide formatting, link to the contributing guide in the readme 2022-03-13 13:35:47 -05:00
Chris a07425026c Initial commit for the ASUS TUF RTX3070TI O8G V2 Gaming GPU to resolve #2300
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
+ Link to [webpage](https://www.asus.com/Motherboards-Components/Graphics-Cards/TUF-Gaming/TUF-RTX3070TI-O8G-GAMING/)
2022-03-14 02:31:48 +11:00
Arnaud MAURIN 287618ebe5 Add new device type "Case" 2022-03-13 04:49:18 +00:00
Chris f96028cba4 Adjusting IPU of Coolermaster RGB due to 30955722 2022-03-13 10:30:23 +11:00
Dracrius 17b7a5f518 Fix Philips Hue First Time Setup Bug 2022-03-12 23:25:15 +00:00
Chris 74b9253c25 Adding template for "New Device" Merge Requests 2022-03-12 10:26:08 +11:00
morg 0311aa399f Add support for Roccat Horde Aimo Keyboard - Closes #2028 2022-03-11 21:41:57 +00:00
Chris 2c8a826c11 Initial commit for the Logitech G935 to resolve #2214
+ Added PID and registering detector for the common controller
+ Added entry for udev rules
2022-03-10 19:26:25 +11:00
Adam Honse c9572bd4e0 Add CONTRIBUTING 2022-03-09 22:45:08 +00:00
Adam Honse 1a34d3d167 Get Gigabyte DRAM functional 2022-03-09 20:12:53 +00:00
Dracrius bf5ce6c239 Fixed an issue with the Philips Hue Entertainment Groups 2022-03-09 19:49:04 +00:00
Chris a712c64ece Adding logging for Success / Failure on Gigabyte RGBFusion2SMBus DMI check 2022-03-08 13:37:33 +11:00
morg ae84bcb862 Add Keychron keyboards support - Closes #1790 2022-03-07 01:17:09 +00:00
[email protected] ae1c73497a chore: fixed OpenRGBE131ReceiverPlugin repo url in readme 2022-03-04 10:10:18 +00:00
morg 4538085e1e Set a darker color for window base so the checkboxes can be seen 2022-03-03 21:04:15 +00:00
morg 70b2a9c842 Fixes a few memory leaks 2022-03-03 14:42:54 +01:00
Evan Weiler 8bb7ab8099 Add support for MSI MPG Z690 EDGE WIFI DDR4 motherboard 2022-03-03 00:48:51 +00:00
morg d8f28b546d Add error logs for non logged exceptions 2022-02-28 22:08:41 +00:00
Adam Honse ddeb5de65e Code cleanup 2022-02-28 16:07:09 -06:00
Chris d8e7cd694d Small fix to --config parameter to allow for an argument
+ Added check to test for a valid directory
2022-02-27 13:07:04 +11:00
Chris a84842730e Initial commit for the Gigabyte 3050 Gaming OC 8G GPU to resolve #2264
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N3050GAMING-OC-8GD#kf)
2022-02-26 15:31:29 +11:00
Chris 268ed8abde Reverting workaround added in !688 to resolve #1654
+ LTO issue should now be resolved by 59732ed47e
+ Re-Enabling Link Time Optimisation for Debian builds that was disabled by 87ba08602f
2022-02-25 03:42:17 +00:00
Chris d3629a1d34 Initial commit for the Gigabyte 1060 G1 Gaming 6G GPU
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/au/Graphics-Card/GV-N1060G1-GAMING-6GD-rev-10#kf)
2022-02-25 14:09:31 +11:00
Adam Honse c226e2c4fb Code cleanup for NZXT controllers 2022-02-24 16:59:07 -06:00
alpemwarrior 2bb5cfcab8 Revert "Disable lto build (fedora)" 2022-02-24 20:38:38 +00:00
Chris 59732ed47e Updating HuePlusPlus json.hpp library to resolve #2218
+ LTO is causing a segfault error because there are 2 different versions of nlohmann/json (3.9.1 vs 3.7.3)
2022-02-24 05:19:15 +00:00
morg ea0c19d31e Add Lexip Gaming mouse support - Closes #2245 2022-02-24 01:32:26 +00:00
Mola19 8120fcdd5a Fix for asus mice not sending response 2022-02-23 04:18:42 +00:00
Adam Honse 41ef951e8b Clean up DeviceView initialzation code
- Move scaling to after calculating positions to make the math easier to follow
  - Move unchanged variables to defined constants
  - Add comments
  - Use local variables to avoid looking stuff up from controller pointer repeatedly
2022-02-21 21:03:16 -06:00
Adam Honse 8b5a23148a Clean up RGBController.h 2022-02-21 12:08:59 -06:00
morg 06f4851ddc Add NVIDIA ESA support - Closes #2236 2022-02-21 13:34:59 +00:00
morg 238d1c0162 Add support for Gigabyte RTX 3080 Gaming OC 10G 2022-02-18 18:18:05 +01:00
Adam Honse 783259a870 Fix Tab key name 2022-02-17 15:26:02 -06:00
morg e1513f9abe Add support for Gigabyte RTX 3080 Gaming OC 12G 2022-02-17 05:59:15 +00:00
ElJeffe bcd97dd51d Update README.md - link to self-signed cert creation macos 2022-02-17 03:04:07 +00:00
Habetdin 9b5d200a36 Add ASUS ROG Strix GTX1070Ti 8G Gaming (0x861D) GPU 2022-02-16 14:10:21 +00:00
Mola19 823809718e Changing USB interface for ASUS ROG Strix Impact II to resolve #2201 2022-02-16 06:26:35 +00:00
Chris 72ab809d25 Initial commit for the ASUS ROG Strix RTX2060S A8G Gaming GPU to resolve #2229
+ Add id to pci_ids.h
+ Register detector in AsusAuraGPUControllerDetect.cpp
+ Link to [webpage](https://rog.asus.com/us/graphics-cards/graphics-cards/rog-strix/rog-strix-rtx2060s-a8g-gaming-model/)
2022-02-16 11:58:46 +11:00
morg 9f29af1852 Add support for Gigabyte GeForce RTX 3060 GAMING OC 12G (rev. 2.0) 2022-02-16 00:07:17 +00:00
Chris a926d4ec43 Initial commit for the Gigabyte 1070 G1 Gaming 8G V1 GPU
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N1070G1-GAMING-8GD-rev-10#kf)
2022-02-14 13:11:45 +11:00
Vaker 3bcfa7cc7e Add support for ZET Fury Pro 2022-02-14 01:23:30 +00:00
Adam Honse be15e5a1cf Re-enable Zalman Z-Sync 2022-02-13 20:17:22 +00:00
morg a47ae7ed48 Migrate from QSS to QPalette 2022-02-13 11:42:15 +01:00
Adam Honse f1c5905cba Move definitions of key name memory constants to a separate .cpp file, hopefully to cut down on file size 2022-02-13 00:48:55 -06:00
Chris d8e023b4c8 Initial commit for a canonical list of key names
+ Created RGBControllerKeyNames.h
* Adjusted every reference for key names found in `DeviceView`
* Formatting corrections
2022-02-13 15:40:15 +11:00
alpemwarrior aabba4ed62 Avoid double or triple mode updates 2022-02-12 23:31:09 +00:00
Adam Honse 0e750b6e9e Initial LIFX commit 2022-02-12 04:45:22 +00:00
morg 069e07c690 Adds ZET-GAMING-Edge-Air-Pro mouse support 2022-02-12 04:15:33 +00:00
morg e1f0cd785d Adds Trust GXT 114 support 2022-02-12 04:13:38 +00:00
Chris 6709cfb735 Aligning Direction updates for consistency and readability
+ Adding check to see if the UI DirectionBox is enabled before executing changes to the box.
2022-02-11 20:53:26 +00:00
morg 5b4d55bb42 Add pre detection hooks to resource manager. Closes #2184 2022-02-11 18:54:30 +00:00
TheRogueZeta 5ae6ef2c79 Split EVGA GPU controllers into individual controllers/folders 2022-02-11 18:52:38 +00:00
Chris 236154da67 Initial commit for the Gigabyte 2060 Super Gaming OC 3X V2 GPU
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
+ Link to [webpage](https://www.gigabyte.com/Graphics-Card/GV-N206SGAMING-OC-8GD-rev-20#kf)
2022-02-11 06:34:45 +00:00
Sam Mitchell 0f23fe27a9 Add support for Asus TUF 3060 Gaming (#13)
* Add support for Asus TUF 3060 Gaming

* Changed O in O12G to the letter O instead of zero.
2022-02-11 01:29:44 +00:00
Chris 8156b0167a Adding EVGA 1080 SC2 Gaming GPU to resolve #2213
* Added card to pci_ids.h
* Registered detector in `EVGAGPUControllerDetect.cpp`
* Link to [webpage](https://www.evga.com/products/specs/gpu.aspx?pn=61e6d689-506e-45df-8202-b49614e9d54d)
2022-02-10 14:11:29 +11:00
morg 79134859cd Add GIGABYTE GTX1660 GAMING OC 6G support 2022-02-08 00:37:19 +00:00
Dan 14f77e0d1e Added more lighting modes to Hue 2 devices 2022-02-08 00:33:40 +00:00
TheRogueZeta 8b8845105a Initial commit for Asus Arez Strix Vega 56 O8G 2022-02-06 13:13:39 -08:00
Chris 601b5c08ad Swapping Num3 and Num6 for the HyperX Alloy Elite2 to resolve #2186 2022-02-03 00:05:50 +11:00
Chris d7a6f2ebba Fixing Direct mode assignment for Coolermaster ARGB Small controller to resolve #2174
* Only adding `Direct` mode for controllers with FW0012 or newer
* Changing the value assignment to an index in `SetCustomMode()`
2022-02-02 11:38:06 +11:00
Vaker 9bcc3e5a4f Sinowealth detector refactoring 2022-02-01 18:10:24 +00:00
TheRogueZeta e3cc9b9dac Enable B350 KRAIT GAMING (MS-7B08) in the MSIRGBcontroller 2022-01-31 14:49:06 +00:00
Chris e322835f89 Initial commit for the Gigabyte 3060Ti Eagle OC GPU to resolve #2173
+ Add id to pci_ids.h
+ Register detector in GigabyteRGBFusionGPUControllerDetect.cpp
2022-01-30 20:30:07 +00:00
TheRogueZeta dbc503b3e1 Change pump LED limit to 33 on CorsairCommanderCoreController 2022-01-30 20:27:19 +00:00
Chris be46543f4c Initial commit for the ASUS KO 3070 O8G V2 Gaming GPU to resolve #2182
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-30 11:42:22 +11:00
Chris c966b04e45 Changing the Apex3 driver to more accurately represent the keyboard layout
+ Changing from Ten Zones with 1 LED to One zone with 10 LEDs
* Minor code cleanup
2022-01-28 21:40:05 +11:00
Adam Honse 08549c43d7 Add note for debhelper dependency when building Debian package
Addresses #1607
2022-01-28 00:12:38 -06:00
Michael Alexander 972d199a90 Add basic support for EVGA GeForce RTX 2070 SUPER FTW3 Ultra+ 2022-01-28 05:53:18 +00:00
Adam Honse d5850f1694 Use debug log for ASUS Aura USB config table 2022-01-27 23:52:40 -06:00
Adam Honse dab2f8cc39 Add automatic save flag to HyperX Alloy Elite and Poseidon Z RGB modes except Direct
Fixes issue #2058
2022-01-27 22:35:42 -06:00
TheEvilSkeleton dfb8eb54ac Add Developers name 2022-01-28 04:25:44 +00:00
Adam Honse e9401d6f46 Move NZXT Hue 2 device printout to debug log 2022-01-27 20:57:45 -06:00
Adam Honse 6c58f9ffb6 Fix direction flag for NZXT Hue 2 devices
Resolves #337
2022-01-27 20:49:38 -06:00
Roberto 45fafdbadb Add support for MSI 3060Ti GAMING X LHR 2022-01-27 23:04:34 +01:00
Frederik Madsen db458fbb80 Add support for wired/wireless Razer Naga Pro 2022-01-27 19:26:11 +00:00
1000001101000 0bbc63aaf5 fix ptr/address of ptr confusion? 2022-01-27 19:19:36 +00:00
Luke D. Jones f2cb861ec7 Add support for Gigabyte AORUS RTX3060 Ti ELITE 8G LHR 2022-01-27 19:15:03 +00:00
Chris 9a68c4d3ba Initial commit for the ASUS ROG Strix 2070S O8G Gaming (0x8729) GPU
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-27 22:55:10 +11:00
Chris c5a337f389 Initial commit for the ASUS TUF 3060 O12G V2 Gaming GPU to resolve #2158
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-26 03:16:40 +11:00
Mola19 5a1d2affb5 support for Asus ROG Keris Mouse 2022-01-25 03:13:59 +00:00
Krystof Pistek 7ea36a5948 Add support (detection code only) for MSI B350M Mortar motherboard
(MS-7A37)
2022-01-25 00:10:33 +01:00
Vaker ce71a3d566 Add support for ZET Blade Optical 2022-01-24 21:29:48 +00:00
djdox23 36382b6526 Move Gigabyte 3060Ti Gaming OC PRO rev 1.0 and rev 3.0 from GigabyteRGBFusionGPUController to GigabyteRGBFusion2GPUController 2022-01-24 20:02:54 +00:00
Chris c335afa6b6 Adding EVGA 1070 FTW2 Gaming GPU
* Added card to pci_ids.h
* Registered detector in `EVGAGPUControllerDetect.cpp`
* Link to [webpage](https://au.evga.com/products/product.aspx?pn=08G-P4-6676-KR)
2022-01-24 21:30:27 +11:00
Shady Nawara cd06401edd Switched InpOut32 with WinRing0 2022-01-24 04:15:06 +00:00
Chris 8b1424a150 Adding Unicode symbols for Media keys
+ Play/Pause, Stop, Previous & Next Track
+ Mute, Volume Up & Down
2022-01-24 11:33:16 +11:00
Shady Nawara d90ea6b843 Reduce CPU usage when accessing i2c smbus devices on windows (AMD) 2022-01-24 00:20:03 +00:00
Alex 3e45e4201d Add Gigabyte RTX3080 Ti Gaming OC 12G 2022-01-23 22:48:21 +00:00
Mola19 cbe79f7c6a fix for asus gladius 2 origin pink 2022-01-23 22:47:25 +00:00
Chris 7f5fc72af0 Adding keymap for the Razer Cynosa V2 2022-01-22 23:39:51 +11:00
Jack 5c988f5786 Adds debug logging and a fix for incorrectly mapped keyboards to QMKOpenRGBController 2022-01-21 14:15:51 +00:00
morg fe51cc7c5d Hide the led view to prevent a paint event on rescan #1871 2022-01-21 04:02:16 +00:00
TheRogueZeta 05d4f8e7a8 Add Gigabyte AORUS RTX 2080S device ID 2022-01-20 23:25:48 +00:00
Chris 0d296b5b3b Adding a CODEOWNERS file
* Currently limited to the `/Controllers/` directory
2022-01-20 22:27:20 +11:00
Adam Honse f1ed2abe53 Code cleanup round 6 2022-01-19 23:08:29 -06:00
Chris f11f242ded Initial commit for the ASUS ROG Strix 3060Ti O8G Gaming (0x87BA) GPU to resolve #2136
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-19 19:42:01 +11:00
Adam Honse a219ac693c Code cleanup round 5 2022-01-18 22:35:21 -06:00
Chris e448143377 Initial commit for the ASUS ROG Strix 2070S 8G Gaming (0x8707) GPU
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-19 15:26:25 +11:00
Adam Honse c07f43c8d5 Code cleanup round 4 2022-01-18 21:01:12 -06:00
Adam Honse c09e4c9c92 Code cleanup round 3 2022-01-17 21:28:08 -06:00
1vivy 97e154ea84 Add ASUS KO RTX 3060Ti O8G V2 GAMING GPU 2022-01-18 02:52:22 +00:00
Adam Honse 26ba09fee1 Code cleanup round 2 2022-01-17 20:50:22 -06:00
Adam Honse 7d34e27019 Code cleanup, mostly updating name of controller pointer in RGBController classes for consistency 2022-01-17 19:27:50 -06:00
morg e7f4b9f921 Add debug logs to corsair dominator platinum 2022-01-18 00:18:27 +00:00
proEndreeper f8e34104af Added support for EVGA GeForce RTX 3080 FTW3 Ultra 12GB 2022-01-17 16:14:20 -07:00
JJTech 59b34a9dcf Add support for MSI GeForce RTX 3060 12G Gaming X Trio LHR 2022-01-17 07:16:19 +00:00
morg 97d5a9e84d MSI OPTIX MAG271CQR Monitor support 2022-01-17 07:08:04 +00:00
Chris 25d86c7d33 Initial commit for the ASUS KO 3060 OC O12G Gaming GPU to resolve #2042
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-17 10:17:18 +11:00
Chris 1e0169bed9 Initial commit for Razer Basilisk V3 to resolve #2007
+ Adding entry for the Basilisk V3 PID
+ Registered detectors
+ Added metadata to RazerDevices.h
+ Added capabilities to RazerController.cpp
+ Added UDEV rule to 60-openrgb.rules
* Small readability changes
2022-01-16 15:37:03 +00:00
Chris 390d4de256 Initial commit for the ASUS TUF 3080Ti O12G Gaming GPU
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-16 20:20:52 +11:00
Adam Honse 8120a348bf Update detection parameters for ASUS ROG Balteus/Balteus Qi 2022-01-15 20:13:21 -06:00
morg 01041a56b8 Add Electric Ultramarine color 2022-01-16 01:26:41 +00:00
Aurélien Labrosse d6b5032a5c Implement Asus TUF 3060 Ti 8G OC (v2.0) 2022-01-16 00:35:23 +00:00
TheRogueZeta fa105550a5 Add Asus TUF RTX 3070Ti O8G Gaming Device ID 2022-01-16 00:28:11 +00:00
Dmitry K f01557a3fa #1267 Fix Set All Devices function turns off all lights when windows number format is not in English 2022-01-16 00:27:33 +00:00
Chris 1568d6f612 Initial commit for the ASUS Strix 3060 O12G LHR Gaming GPU
+ Add id to pci_ids.h
+ Register detector in ENESMBusControllerDetect.cpp
2022-01-15 21:14:40 +00:00
Chris 73ace603ac Fixing Typo in Razer Basilisk V2 device declaration 2022-01-15 21:18:56 +11:00
TheRogueZeta 4332659b86 Update log messages in Corsair Vengeance Pro to be more descriptive 2022-01-14 01:41:38 +00:00
TheRogueZeta a079e4a7f1 Add Asus ROG STRIX 2080S A8G device ID and sort device list 2022-01-14 01:00:41 +00:00
TheRogueZeta e0f5e06559 Add alternate device ID for Asus ROG Strix GTX1050TI 04G 2022-01-13 23:34:51 +00:00
morg 661218b4f1 Add razer kitty black edition PID 2022-01-13 19:13:54 +01:00
Frederik Madsen cb6b701b8d Add keymap for Razer Blade Pro 17 2021 2022-01-12 17:23:25 +00:00
Aurelien Labrosse c901144ede feat: detection of Asus TUF 3060TI 8G Gaming 2022-01-11 19:50:56 +01:00
Adam Honse b36af1b917 Add ASUS ROG Balteus Qi, also direct mode only for now as it shares the same controller 2022-01-10 21:15:39 -06:00
Adam Honse be3846cf8b Initial support for ASUS ROG Balteus mousemat (direct mode only for now) 2022-01-10 20:24:47 -06:00
morg c5364264b1 Add debug logs to corsair vengeance rgb pro 2022-01-09 20:18:05 +01:00
TheRogueZeta 85dcb31c5c Add EVGA RTX 2080 Super XC Ultra Devcie ID 2022-01-09 00:59:06 +00:00
TheRogueZeta 15a7c87056 Add Corsair NightSword VID and align detectors 2022-01-08 14:01:44 -08:00
morg 4281ada659 Add razer extras plugin link to readme 2022-01-08 07:36:59 +00:00
TheRogueZeta 8e44d59b6a Add ASUS ROG-STRIX-RTX2060-O6G-GAMING Device ID 2022-01-07 19:48:22 -08:00
Julien Nicoulaud 79272f9e2f add link to openrgb-rs (Rust SDK client) 2022-01-07 17:10:10 +00:00
morg 4d26af6422 Fix corsair k70 mk2 skipped keys. 2022-01-07 17:06:57 +00:00
TheRogueZeta d8637af917 Add ASUS ROG STRIX 3090 24G Gaming device ID 2022-01-05 14:44:45 -08:00
morg f89c56d864 Review TabLabel UI. Fix #2055 2022-01-04 18:57:40 +00:00
morg f4c4d13f6d Add support for Corsair K55 RGB PRO keyboard 2022-01-04 17:48:28 +00:00
morg b9407606bd Crucial static mode needs to be updated for color changes 2022-01-04 17:46:05 +00:00
alpemwarrior 165798628b SteelSeries rival: skip firmware check for unsupported models and add manual saving to more modes. 2022-01-04 17:43:55 +00:00
doctor64 a1dd83240d Fix out of range cycle in zone setup for Asrock Polychrome V1 boards 2022-01-03 20:00:31 +00:00
Chris 22cf62af29 Adding EVGA FTW3 2080S Hybrid 8G GPU
* Added card ID
* Registered detector in `EVGAGPUControllerDetect.cpp`
* Link to [webpage](https://au.evga.com/products/product.aspx?pn=08G-P4-3287-KR)
2022-01-03 23:57:29 +11:00
Thomas Amerongen 3b78a7bca9 Add support for Gigabyte RTX 3070 Eagle OC + color cycle option for all Gigabyte GPUs 2022-01-03 06:27:43 +00:00
Rebecca Wallander fd1af2f45d Add firmware getter to SteelSeries Controller 2022-01-02 20:08:19 +00:00
Érico Rolim 48d1a4f7b6 Don't use glibc specific function. 2022-01-02 20:01:01 +00:00
Chris c6bb160bfe Adding ISO \ to Logitech G815 mapping 2022-01-02 19:57:30 +00:00
Rebecca Wallander 7dba4e318a Simplify SteelSeries Rival 700 communication 2022-01-02 19:56:48 +00:00
TheEvilSkeleton 01eba8968b Add release 0.7 in appstream 2022-01-01 07:06:45 +00:00
Tomasz Torcz 2d8700c28d Add ASUS ROG STRIX RX560 Gaming id 2022-01-01 00:33:21 +00:00
Chris 09bae42c3b Fixing detection for the Razer Kitty Chroma to resolve #2066
+ Correcting another detector that relied on the IPU bug fixed in 3095572260
2022-01-01 10:26:16 +11:00
TheRogueZeta 72563a3883 Add Gigabyte AORUS 2080 8G device ID 2021-12-31 06:09:17 +00:00
Chris d6a9f664ff Initial commit for Razer Viper 8kHz to resolve #1755
* Adding entry for the Viper 8kHz PID
* Registered detectors
* Added metadata to RazerDevices.h
* Added capabilities to RazerController.cpp
* Added UDEV rule to 60-openrgb.rules
2021-12-31 04:49:19 +00:00
Chris de7abef0e9 Changed Logitech G733 detector to resolve #1235
* Changed Logitech G733 detector from Interface `2` to `3`
2021-12-31 04:46:47 +00:00
Chris 1d6e43d516 Initial commit for Razer Huntsman V2 to resolve #1999
* Adding entry for the Huntsman V2 PID
* Registered detectors
* Added metadata to RazerDevices.h
* Added capabilities to RazerController.cpp
* Added UDEV rule to 60-openrgb.rules
2021-12-31 15:13:48 +11:00
Adam Honse 914c4be553 Update timeout on Corsair Lighting Node controller 2021-12-31 03:51:24 +00:00
TheRogueZeta d7c08bcf91 Add NVIDIA 2080S device ID to the detector 2021-12-30 18:30:55 -06:00
1048 changed files with 132794 additions and 36991 deletions
+17
View File
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
# We recommend you to keep these unchanged
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
indent_size = 4
+114 -6
View File
@@ -1,11 +1,119 @@
*.pro.user*
*.o
ui_*
moc_*
qrc_*
# This file is used to ignore files that should not be pushed to the repo.
# ----------------------------------------------------------------------------
# OpenRGB Specific
OpenRGB
openrgb
Makefile
OpenRGB-x86_64.AppImage
60-openrgb.rules
# Directories
.build/
.cache/
.moc/
.obj/
.pch/
.rcc/
.uic/
.clangd/
*_debug/
*_release/
debug/
release/
build/
Build/
.qmake.cache
.qmake.stash
.vscode
.vs
# Generic Files
.DS_Store
Thumbs.db
# Binaries
*.exe
!dependencies/**/*.exe
*.bat
!dependencies/**/*.bat
# C++ objects and libs
*.a
*.dll
*.dylib
*.ii
*.la
*.lai
*.lo
*.o
*.s
*.slo
*.so
*.so.*
!dependencies/**/*.dll
# Qt-es
object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
Makefile*
*build-*
*.qm
*.prl
# Qt unit tests
target_wrapper.*
# QtCreator
*.autosave
# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCreator CMake
CMakeLists.txt.user*
# QtCreator 4.8< compilation database
compile_commands.json
# QtCreator local machine specific files for imported projects
*creator.user*
*.qrc
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.ncb
*.opensdf
*.pdb
*.sdf
*.sln
*.suo
*.vcproj
*.vcxproj
*vcproj.*.*.user
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Clang tooling files
compile_commands.json
# Generated i18n files
*.qm
+267 -53
View File
@@ -13,7 +13,7 @@
- shared-windows
- windows
- windows-1809
stages:
- build
- test
@@ -27,6 +27,35 @@ before_script:
- export QT_SELECT=qt5
- export APPIMAGE_EXTRACT_AND_RUN=1
#-----------------------------------------------------------------------#
# Supported Devices Build Target #
#-----------------------------------------------------------------------#
"Supported Devices":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64
stage: build
script:
- qmake
- make -j$(nproc)
- ./scripts/build-supported-devices-md.sh $CI_PROJECT_DIR $CI_COMMIT_SHORT_SHA
artifacts:
name: "${CI_PROJECT_NAME}_Supported_Devices_${CI_COMMIT_SHORT_SHA}"
paths:
- ./*.md
- Supported Devices.csv
exclude:
- README.md
- CONTRIBUTING.md
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (AppImage) 32-bit Build Target #
#-----------------------------------------------------------------------#
@@ -37,7 +66,7 @@ before_script:
script:
- export $(dpkg-architecture)
- ./scripts/build-appimage.sh
artifacts:
name: "${CI_PROJECT_NAME}_Linux_32_${CI_COMMIT_SHORT_SHA}"
paths:
@@ -46,6 +75,13 @@ before_script:
- README.md
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (AppImage) 64-bit Build Target #
#-----------------------------------------------------------------------#
@@ -56,7 +92,7 @@ before_script:
script:
- export $(dpkg-architecture)
- ./scripts/build-appimage.sh
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_${CI_COMMIT_SHORT_SHA}"
paths:
@@ -75,7 +111,7 @@ before_script:
script:
- dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.deb
- rm -v ../openrgb-dbgsym*.*deb
- mv -v ../openrgb*.deb ./
artifacts:
@@ -83,9 +119,16 @@ before_script:
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.deb
- openrgb-dbgsym*.*deb
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Buster (Legacy) 64-bit Build Target #
#-----------------------------------------------------------------------#
@@ -96,7 +139,7 @@ before_script:
script:
- dpkg-architecture -l
- dpkg-buildpackage -us -B
- rm -v ../openrgb-dbgsym*.deb
- rm -v ../openrgb-dbgsym*.*deb
- mv -v ../openrgb*.deb ./
artifacts:
@@ -104,9 +147,16 @@ before_script:
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.deb
- openrgb-dbgsym*.*deb
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 32-bit Build Target #
#-----------------------------------------------------------------------#
@@ -117,6 +167,62 @@ before_script:
script:
- dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.*deb
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_32_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.*deb
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 .deb (Debian Bullseye)":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64
stage: build
script:
- dpkg-architecture -l
- dpkg-buildpackage -us -B
- rm -v ../openrgb-dbgsym*.*deb
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
- openrgb-dbgsym*.*deb
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bookworm 32-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 32 .deb (Debian Bookworm)":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-32
stage: build
script:
- dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.deb
- mv -v ../openrgb*.deb ./
@@ -127,13 +233,20 @@ before_script:
exclude:
- openrgb-dbgsym*.deb
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 64-bit Build Target #
# Linux (.deb) Debian Bookworm 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 .deb (Debian Bullseye)":
"Linux 64 .deb (Debian Bookworm)":
<<: *ccache_init
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-64
stage: build
script:
- dpkg-architecture -l
@@ -149,15 +262,22 @@ before_script:
- openrgb-dbgsym*.deb
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (.rpm) 64-bit Build Target #
# Linux (.rpm, f35) 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 rpm":
image: fedora:34
"Linux 64 f35 rpm":
image: fedora:35
stage: build
script:
- dnf install rpmdevtools dnf-plugins-core -y
- rpmdev-setuptree
- dnf install rpmdevtools dnf-plugins-core -y
- rpmdev-setuptree
- ls /root/
- cp fedora/OpenRGB.spec /root/rpmbuild/SPECS
- cp ../OpenRGB /root/rpmbuild/SOURCES/ -r
@@ -176,6 +296,47 @@ before_script:
- openrgb*.rpm
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Linux (.rpm, f36) 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 f36 rpm":
image: fedora:36
stage: build
script:
- dnf install rpmdevtools dnf-plugins-core libcurl-devel -y
- rpmdev-setuptree
- ls /root/
- cp fedora/OpenRGB.spec /root/rpmbuild/SPECS
- cp ../OpenRGB /root/rpmbuild/SOURCES/ -r
- cd /root/rpmbuild/SOURCES
- tar -cf OpenRGB.tar.gz OpenRGB/
- cd ..
- dnf builddep SPECS/OpenRGB.spec -y
- rpmbuild -ba SPECS/OpenRGB.spec
- cd RPMS/x86_64/
- mv openrgb*.rpm ${CI_PROJECT_DIR}/
- cd ${CI_PROJECT_DIR}
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_rpm_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.rpm
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Debian 32 Buster test #
#-----------------------------------------------------------------------#
@@ -186,7 +347,6 @@ before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 32 .deb (Debian Buster)"
@@ -203,7 +363,6 @@ before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Buster)"
@@ -220,7 +379,6 @@ before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 32 .deb (Debian Bullseye)"
@@ -237,13 +395,44 @@ before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Bullseye)"
needs:
- "Linux 64 .deb (Debian Bullseye)"
#-----------------------------------------------------------------------#
# Debian 32 Bookworm test #
#-----------------------------------------------------------------------#
"Debian 32 Bookworm":
image: i386/debian:bookworm
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*i386.deb
- openrgb --version
- apt remove -y openrgb
dependencies:
- "Linux 32 .deb (Debian Bookworm)"
needs:
- "Linux 32 .deb (Debian Bookworm)"
#-----------------------------------------------------------------------#
# Debian 64 Bookworm test #
#-----------------------------------------------------------------------#
"Debian 64 Bookworm":
image: amd64/debian:bookworm
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Bookworm)"
needs:
- "Linux 64 .deb (Debian Bookworm)"
#-----------------------------------------------------------------------#
# Ubuntu 64 20.04LTS test #
#-----------------------------------------------------------------------#
@@ -254,7 +443,6 @@ before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Buster)"
@@ -262,37 +450,50 @@ before_script:
- "Linux 64 .deb (Debian Buster)"
#-----------------------------------------------------------------------#
# Ubuntu 64 21.10 test #
# Ubuntu 64 22.04 test #
#-----------------------------------------------------------------------#
"Ubuntu 64 21.10":
image: ubuntu:impish
"Ubuntu 64 22.04LTS":
image: ubuntu:jammy
stage: test
script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends ./openrgb*amd64.deb
- openrgb --version
- openrgb -l
- apt remove -y openrgb
dependencies:
- "Linux 64 .deb (Debian Bullseye)"
- "Linux 64 .deb (Debian Bookworm)"
needs:
- "Linux 64 .deb (Debian Bullseye)"
- "Linux 64 .deb (Debian Bookworm)"
#-----------------------------------------------------------------------#
# Fedora 64 v34 test #
# Fedora 64 v35 test #
#-----------------------------------------------------------------------#
"Fedora 64 v34":
image: fedora:34
"Fedora 64 v35":
image: fedora:35
stage: test
script:
- yum -y localinstall ./openrgb*64.rpm
- openrgb --version
- openrgb -l
- yum -y remove openrgb
dependencies:
- "Linux 64 rpm"
- "Linux 64 f35 rpm"
needs:
- "Linux 64 rpm"
- "Linux 64 f35 rpm"
#-----------------------------------------------------------------------#
# Fedora 64 v36 test #
#-----------------------------------------------------------------------#
"Fedora 64 v36":
image: fedora:36
stage: test
script:
- yum -y localinstall ./openrgb*64.rpm
- openrgb --version
- yum -y remove openrgb
dependencies:
- "Linux 64 f36 rpm"
needs:
- "Linux 64 f36 rpm"
#-----------------------------------------------------------------------#
# Windows (32-bit) Build Target #
@@ -314,42 +515,42 @@ before_script:
- '& cmd.exe /C "vcvarsall.bat x86 & set" | Foreach-Object { if ($_ -match "(.*?)=(.*)") { Set-Item -force -path "Env:\$($matches[1])" -value "$($matches[2])" } }'
- Pop-Location
- _fold_final_
- _fold_start_ 'downloading precompiled versions of qtbase, qttools (for windeployqt) and jom (for a more parallel nmake)'
- mkdir _qt
- mkdir _qt_download
- Push-Location _qt_download
- curl.exe -LJ -o qt-base.7z 'https://qt-mirror.dannhauer.de/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win32_msvc2019/5.15.0-0-202005150700qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86.7z'
- curl.exe -LJ -o qt-tools.7z 'https://qt-mirror.dannhauer.de/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win32_msvc2019/5.15.0-0-202005150700qttools-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86.7z'
- curl.exe -LJ -o qt-jom.zip 'https://qt-mirror.dannhauer.de/official_releases/jom/jom.zip'
- curl.exe -LJ -o qt-base.7z 'https://gitlab.com/OpenRGBDevelopers/openrgb-linux-ci-deb-builder/-/package_files/55610076/download'
- curl.exe -LJ -o qt-tools.7z 'https://gitlab.com/OpenRGBDevelopers/openrgb-linux-ci-deb-builder/-/package_files/55610097/download'
- curl.exe -LJ -o qt-jom.zip 'https://gitlab.com/OpenRGBDevelopers/openrgb-linux-ci-deb-builder/-/package_files/55610138/download'
- _fold_final_
- _fold_start_ 'extracting the downloaded qt binaries'
- 7z x qt-base.7z '-o../_qt' -y
- 7z x qt-tools.7z '-o../_qt' -y
- 7z x qt-jom.zip '-o../_qt' -y
- _fold_final_
- _fold_start_ 'turn the qt install from enterprise to foss; remove the licensing checks'
- ${qconfig-pri-folder} = '..\_qt\5.15.0\msvc2019\mkspecs\qconfig.pri'
- (Get-Content ${qconfig-pri-folder}).replace('QT_EDITION = Enterprise', 'QT_EDITION = OpenSource') | Set-Content ${qconfig-pri-folder}
- (Get-Content ${qconfig-pri-folder}).replace('QT_LICHECK = licheck.exe', '') | Set-Content ${qconfig-pri-folder}
- Pop-Location
- _fold_final_
- _fold_start_ 'run qmake and generate the msvc nmake makefile'
- mkdir _build; cd _build
- ..\_qt\5.15.0\msvc2019\bin\qmake ..\OpenRGB.pro
- _fold_final_
- _fold_start_ 'start the actual build with jom instead of nmake; for speed'
- ..\_qt\jom
- _fold_final_
- _fold_start_ 'run windeployqt to automatically copy the needed dll files'
- ..\_qt\5.15.0\msvc2019\bin\windeployqt --no-angle --no-translations --no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --no-webkit2 .\release\
- _fold_final_
- _fold_start_ 'Moving results for upload'
- mv release ../'OpenRGB Windows 32-bit'
- _fold_final_
@@ -363,6 +564,13 @@ before_script:
- 'OpenRGB Windows 32-bit'
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
#-----------------------------------------------------------------------#
# Windows (64-bit) Build Target #
#-----------------------------------------------------------------------#
@@ -383,42 +591,42 @@ before_script:
- '& cmd.exe /C "vcvarsall.bat x64 & set" | Foreach-Object { if ($_ -match "(.*?)=(.*)") { Set-Item -force -path "Env:\$($matches[1])" -value "$($matches[2])" } }'
- Pop-Location
- _fold_final_
- _fold_start_ 'downloading precompiled versions of qtbase, qttools (for windeployqt) and jom (for a more parallel nmake)'
- mkdir _qt
- mkdir _qt_download
- Push-Location _qt_download
- curl.exe -LJ -o qt-base.7z 'https://qt-mirror.dannhauer.de/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win64_msvc2019_64/5.15.0-0-202005150700qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z'
- curl.exe -LJ -o qt-tools.7z 'https://qt-mirror.dannhauer.de/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win64_msvc2019_64/5.15.0-0-202005150700qttools-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z'
- curl.exe -LJ -o qt-jom.zip 'https://qt-mirror.dannhauer.de/official_releases/jom/jom.zip'
- curl.exe -LJ -o qt-base.7z 'https://gitlab.com/OpenRGBDevelopers/openrgb-linux-ci-deb-builder/-/package_files/55610116/download'
- curl.exe -LJ -o qt-tools.7z 'https://gitlab.com/OpenRGBDevelopers/openrgb-linux-ci-deb-builder/-/package_files/55610131/download'
- curl.exe -LJ -o qt-jom.zip 'https://gitlab.com/OpenRGBDevelopers/openrgb-linux-ci-deb-builder/-/package_files/55610138/download'
- _fold_final_
- _fold_start_ 'extracting the downloaded qt binaries'
- 7z x qt-base.7z '-o../_qt' -y
- 7z x qt-tools.7z '-o../_qt' -y
- 7z x qt-jom.zip '-o../_qt' -y
- _fold_final_
- _fold_start_ 'turn the qt install from enterprise to foss; remove the licensing checks'
- ${qconfig-pri-folder} = '..\_qt\5.15.0\msvc2019_64\mkspecs\qconfig.pri'
- (Get-Content ${qconfig-pri-folder}).replace('QT_EDITION = Enterprise', 'QT_EDITION = OpenSource') | Set-Content ${qconfig-pri-folder}
- (Get-Content ${qconfig-pri-folder}).replace('QT_LICHECK = licheck.exe', '') | Set-Content ${qconfig-pri-folder}
- Pop-Location
- _fold_final_
- _fold_start_ 'run qmake and generate the msvc nmake makefile'
- mkdir _build; cd _build
- ..\_qt\5.15.0\msvc2019_64\bin\qmake ..\OpenRGB.pro
- _fold_final_
- _fold_start_ 'start the actual build with jom instead of nmake; for speed'
- ..\_qt\jom
- _fold_final_
- _fold_start_ 'run windeployqt to automatically copy the needed dll files'
- ..\_qt\5.15.0\msvc2019_64\bin\windeployqt --no-angle --no-translations --no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --no-webkit2 .\release\
- _fold_final_
- _fold_start_ 'Moving results for upload'
- mv release ../'OpenRGB Windows 64-bit'
- _fold_final_
@@ -456,6 +664,9 @@ before_script:
when: on_success
- if: '$BUILD_MACOS =~ /.+/'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
"MacOS Intel":
tags:
@@ -478,3 +689,6 @@ before_script:
when: on_success
- if: '$BUILD_MACOS =~ /.+/'
when: on_success
- if: $CI_PIPELINE_SOURCE == "push"
when: manual
allow_failure: true
+108
View File
@@ -0,0 +1,108 @@
# OpenRGB CODEOWNERS
# Default Code Owner
* @Calcprogrammer1
CODEOWNERS @Calcprogrammer1
#-----------------------------------------------------------------------------#
# Controllers - Directories #
#-----------------------------------------------------------------------------#
[Controllers]
/Controllers/AMDWraithPrismController/
/Controllers/ASRockPolychromeUSBController/
/Controllers/ASRockSMBusController/
/Controllers/AlienwareController/
/Controllers/AlienwareKeyboardController/
/Controllers/AnnePro2Controller/
/Controllers/AsusAuraCoreController/
/Controllers/AsusAuraGPUController/
/Controllers/AsusAuraUSBController/
/Controllers/AsusTUFLaptopController/
/Controllers/BlinkyTapeController/
/Controllers/CoolerMasterController/ @Dr_No
/Controllers/CorsairCommanderCoreController/
/Controllers/CorsairDominatorPlatinumController/
/Controllers/CorsairHydroController/
/Controllers/CorsairHydroPlatinumController/
/Controllers/CorsairLightingNodeController/
/Controllers/CorsairPeripheralController/
/Controllers/CorsairVengeanceController/
/Controllers/CorsairVengeanceProController/
/Controllers/CorsairWirelessController/
/Controllers/CreativeController/
/Controllers/CrucialController/
/Controllers/DasKeyboardController/
/Controllers/DebugController/
/Controllers/DuckyKeyboardController/
/Controllers/DygmaRaiseController/
/Controllers/E131Controller/
/Controllers/EKController/ @Dr_No
/Controllers/ENESMBusController/
/Controllers/EVGAAmpereGPUController/ @TheRogueZeta
/Controllers/EVGAGP102GPUController/
/Controllers/EVGAPascalGPUController/
/Controllers/EVGATuringGPUController/ @TheRogueZeta
/Controllers/EVGAUSBController/ @Dr_No
/Controllers/EVisionKeyboardController/
/Controllers/EspurnaController/
/Controllers/FanBusController/
/Controllers/FaustusController/
/Controllers/GainwardGPUController/
/Controllers/GalaxGPUController/
/Controllers/GigabyteAorusCPUCoolerController/
/Controllers/GigabyteRGBFusion2DRAMController/
/Controllers/GigabyteRGBFusion2GPUController/
/Controllers/GigabyteRGBFusion2SMBusController/ @Dr_No
/Controllers/GigabyteRGBFusion2USBController/ @Dr_No
/Controllers/GigabyteRGBFusionController/
/Controllers/GigabyteRGBFusionGPUController/
/Controllers/HPOmen30LController/
/Controllers/HoltekController/
/Controllers/HyperXDRAMController/
/Controllers/HyperXKeyboardController/
/Controllers/HyperXMouseController/
/Controllers/HyperXMousematController/
/Controllers/LEDStripController/
/Controllers/LianLiController/
/Controllers/LinuxLEDController/
/Controllers/LogitechController/ @Dr_No
/Controllers/MSI3ZoneController/
/Controllers/MSIGPUController/
/Controllers/MSIMysticLightController/
/Controllers/MSIRGBController/
/Controllers/NZXTHue2Controller/
/Controllers/NZXTHuePlusController/
/Controllers/NZXTKrakenController/
/Controllers/OpenRazerController/
/Controllers/PNYGPUController/
/Controllers/PatriotViperController/
/Controllers/PhilipsHueController/
/Controllers/PhilipsWizController/
/Controllers/QMKOpenRGBController/
/Controllers/RazerController/
/Controllers/RedragonController/
/Controllers/RoccatController/
/Controllers/SapphireGPUController/
/Controllers/SinowealthController/
/Controllers/SonyDS4Controller/
/Controllers/SteelSeriesController/
/Controllers/TecknetController/
/Controllers/ThermaltakePoseidonZRGBController/
/Controllers/ThermaltakeRiingController/
/Controllers/ThingMController/
/Controllers/WootingKeyboardController/ @Dr_No
/Controllers/YeelightController/
/Controllers/ZalmanZSyncController/
#-----------------------------------------------------------------------------#
# Controllers - File exceptions #
# #
# As sections get combined and the last rule applies any specific file #
# that is an exception to the above should be explicitly named here #
#-----------------------------------------------------------------------------#
[Controllers]
/Controllers/ASRockSMBusController/ASRockPolychromeV1SMBusController.cpp @TheRogueZeta
/Controllers/ASRockSMBusController/ASRockPolychromeV1SMBusController.h @TheRogueZeta
/Controllers/ASRockSMBusController/RGBController_ASRockPolychromeV1SMBus.cpp @TheRogueZeta
/Controllers/ASRockSMBusController/RGBController_ASRockPolychromeV1SMBus.h @TheRogueZeta
+14
View File
@@ -1,6 +1,7 @@
<!--
Found a bug? Something isn't working as expected?
To help us keep track of the requests please start the title with [Bug Report]
But before that, first you should check it out with the latest pipeline.
-->
### Description of Bug
@@ -10,7 +11,20 @@ Explain any steps taken to reproduce the bug
and what you expect the correct behavior to be.
-->
### Attached Log
<!--
Please attach a verbose log, you can do it by running the exe from cmd with '--loglevel 6' flag.
You can locate them using the Settings tab and click the 'Open Settings Folder' button.
Important!! Please upload the logs made with the latest pipeline build of OpenRGB.
-->
### Operating System
<!--
Please write down which OS and which version did you encounter the issue with.
-->
~"OS - Linux"
~"OS - MacOS"
~"OS - Windows"
### Hardware Configuration
<!--
Please list the RGB hardware that you are using with OpenRGB.
@@ -0,0 +1,24 @@
<!--
Please put "Initial commit for" name of the product, including manufacturer above this line
and a description of the additions / removals / changes done below the line.
-->
<!-- For admin purposes: Please leave this section as is -->
# Checklist for Accepting a Merge Request for a New Device
- [ ] The `New Device` issue raised for this device is linked to this MR with a keyword `Closes / Resolves / Implements`
- [ ] There is a device protocol page in the [Developer Wiki](https://gitlab.com/OpenRGBDevelopers/OpenRGB-Wiki) or there is enough information / captures in the `New Device` issue to provide ongoing support.
- [ ] The code to be merged follows the style guide and change requirements as [documented in the contributing guide](https://gitlab.com/CalcProgrammer1/OpenRGB/-/blob/master/CONTRIBUTING.md).
<!--
The metadata for this controller is required to produce both the udev permissions and
the supported device page for this device. A stub can be found in the RGBController_Dummy.cpp
-->
- [ ] Meta data for the device is included in `RGBController_*` file
- [ ] This device is detected and is working on Windows 10 and / or 11
- [ ] This device is detected and is working on Linux (Please specify distribution and releases tested)
- [ ] Logging for Info, Warnings and Errors has been added for troubleshooting purposes
<!-- For admin purposes: Please leave this section as is -->
+10
View File
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"EditorConfig.EditorConfig"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
-851
View File
@@ -1,851 +0,0 @@
#---------------------------------------------------------------#
# OpenRGB udev rules #
# #
# Adam Honse (CalcProgrammer1) 5/29/2020 #
#---------------------------------------------------------------#
#---------------------------------------------------------------#
# User I2C/SMBus Access #
#---------------------------------------------------------------#
KERNEL=="i2c-[0-99]*", TAG+="uaccess"
#---------------------------------------------------------------#
# Super I/O Access #
#---------------------------------------------------------------#
KERNEL=="port", TAG+="uaccess"
#---------------------------------------------------------------#
# User hidraw Access #
#---------------------------------------------------------------#
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", TAG+="uaccess"
#---------------------------------------------------------------#
# AMD Wraith Prism #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0051", TAG+="uaccess"
#---------------------------------------------------------------#
# Aorus Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1044", ATTR{idProduct}=="7a42", TAG+="uaccess"
#---------------------------------------------------------------#
# ASRock Devices #
# #
# ASRock Polychrome USB #
# ASRock Deskmini Addressable LED Strip #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="26ce", ATTR{idProduct}=="01a2", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="26ce", ATTR{idProduct}=="01a6", TAG+="uaccess"
#---------------------------------------------------------------#
# ASUS Aura Core Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1854", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1869", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1866", TAG+="uaccess"
#---------------------------------------------------------------#
# ASUS Aura USB Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1867", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1872", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1889", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18a3", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18f3", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18a5", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1939", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18af", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="193c", TAG+="uaccess", TAG+="ROG_Falchion_Wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="193e", TAG+="uaccess", TAG+="ROG_Falchion_Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1875", TAG+="uaccess", TAG+="ROG_Strix_Flare"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18cf", TAG+="uaccess", TAG+="ROG_Strix_Flare_Pink"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18f8", TAG+="uaccess", TAG+="ROG_Strix_Scope"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1951", TAG+="uaccess", TAG+="ROG_Strix_Scope_RX"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="190c", TAG+="uaccess", TAG+="ROG_Strix_Scope_TKL"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18a0", TAG+="uaccess", TAG+="TUF_K7_Gaming"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18dd", TAG+="uaccess", TAG+="ROG_Gladius_II_Core"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1845", TAG+="uaccess", TAG+="ROG_Gladius_II"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1877", TAG+="uaccess", TAG+="ROG_Gladius_II_Origin"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18cd", TAG+="uaccess", TAG+="ROG_Gladius_II_Origin_Pink"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18b1", TAG+="uaccess", TAG+="ROG_Gladius_II_Origin_COD"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="189e", TAG+="uaccess", TAG+="ROG_Gladius_II_Wireless1"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18a0", TAG+="uaccess", TAG+="ROG_Gladius_II_Wireless2"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18e5", TAG+="uaccess", TAG+="ROG_Chakram_Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18e3", TAG+="uaccess", TAG+="ROG_Chakram_Wired1"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1958", TAG+="uaccess", TAG+="ROG_Chakram_Wired2"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1846", TAG+="uaccess", TAG+="ROG_Pugio"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1906", TAG+="uaccess", TAG+="ROG_Pugio_II_Wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1908", TAG+="uaccess", TAG+="ROG_Pugio_II_Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18e1", TAG+="uaccess", TAG+="ROG_Strix_Impact_II"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="1910", TAG+="uaccess", TAG+="TUF_M3_&_M7"
#---------------------------------------------------------------#
# ASUS TUF Laptops (faustus) #
#---------------------------------------------------------------#
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="faustus", RUN+="/bin/chmod a+w /sys/bus/platform/devices/%k/kbbl/kbbl_blue"
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="faustus", RUN+="/bin/chmod a+w /sys/bus/platform/devices/%k/kbbl/kbbl_flags"
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="faustus", RUN+="/bin/chmod a+w /sys/bus/platform/devices/%k/kbbl/kbbl_green"
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="faustus", RUN+="/bin/chmod a+w /sys/bus/platform/devices/%k/kbbl/kbbl_mode"
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="faustus", RUN+="/bin/chmod a+w /sys/bus/platform/devices/%k/kbbl/kbbl_red"
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="faustus", RUN+="/bin/chmod a+w /sys/bus/platform/devices/%k/kbbl/kbbl_set"
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="faustus", RUN+="/bin/chmod a+w /sys/bus/platform/devices/%k/kbbl/kbbl_speed"
#---------------------------------------------------------------#
# Cooler Master Peripheral Devices #
# #
# Mice: #
# Cooler Master MM711 #
# Cooler Master MM720 #
# Mousemats: #
# Cooler Master MP750 #
# Controllers: #
# ARGB Device #
# Small ARGB Device #
# Graphics Cards: #
# Radeon RX6000 Series Reference Cards #
# Keyboards: #
# Masterkeys Pro L #
# Masterkeys Pro L White #
# Masterkeys Pro S #
# Masterkeys MK750 #
# Masterkeys SK630 #
# Masterkeys SK650 #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0101", TAG+="uaccess", TAG+="MM711"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0141", TAG+="uaccess", TAG+="MM720"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0109", TAG+="uaccess", TAG+="MP750_XL"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0107", TAG+="uaccess", TAG+="MP750_L"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0105", TAG+="uaccess", TAG+="MP750_M"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="1011", TAG+="uaccess", TAG+="ARGB"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="1000", TAG+="uaccess", TAG+="Small_ARGB"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="004f", TAG+="uaccess", TAG+="RGB"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="014d", TAG+="uaccess", TAG+="Radeon_6000"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="003b", TAG+="uaccess", TAG+="Masterkeys_Pro_L"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0047", TAG+="uaccess", TAG+="Masterkeys_Pro_L_White"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="003c", TAG+="uaccess", TAG+="Masterkeys_Pro_S"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0067", TAG+="uaccess", TAG+="Masterkeys_MK750"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0089", TAG+="uaccess", TAG+="Masterkeys_SK630"
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="008d", TAG+="uaccess", TAG+="Masterkeys_SK650"
#---------------------------------------------------------------#
# Corsair Hydro Series Devices #
# #
# Corsair H100i Pro RGB #
# Corsair H115i Pro RGB #
# Corsair H150i Pro RGB #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c15", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c13", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c12", TAG+="uaccess"
#---------------------------------------------------------------#
# Corsair Hydro Platinum Series Devices #
# #
# Corsair H100i Platinum RGB #
# Corsair H100i Platinum SE RGB #
# Corsair H115i Platinum RGB #
# Corsair H100i Pro XT RGB #
# Corsair H115i Pro XT RGB #
# Corsair H150i Pro XT RGB #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c18", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c19", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c17", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c20", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c21", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c22", TAG+="uaccess"
#---------------------------------------------------------------#
# Corsair Lighting Node Devices #
# #
# Corsair Lighting Node Core #
# Corsair Lighting Node Pro #
# Corsair Commander Pro #
# Corsair LS100 #
# Corsair 1000D Obsidian #
# Corsair Spec Omega RGB #
# Corsair LT100 #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c1a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c0b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c10", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c1e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1d00", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1d04", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c23", TAG+="uaccess"
#---------------------------------------------------------------#
# Corsair Peripheral Devices #
# #
# Keyboards: #
# Corsair K55 RGB #
# Corsair K65 RGB #
# Corsair K65 RGB Lux #
# Corsair K65 RGB Rapidfire #
# Corsair K68 RGB #
# Corsair K70 RGB #
# Corsair K70 RGB Lux #
# Corsair K70 RGB Rapidfire #
# Corsair K70 RGB MK2 #
# Corsair K70 RGB MK2 SE #
# Corsair K70 RGB MK2 LP #
# Corsair K95 RGB #
# Corsair K95 Platinum #
# Corsair K100 #
# Corsair Strafe #
# Corsair Strafe MK2 #
# #
# Mice: #
# Corsair M65 Pro #
# Corsair M65 RGB Elite #
# Corsair Glaive RGB #
# Corsair Glaive RGB Pro #
# Corsair Harpoon RGB #
# Corsair Harpoon RGB Pro #
# Corsair Scimitar Pro RGB #
# Corsair Sabre RGB #
# #
# Mousemats: #
# Corsair MM800 RGB Polaris #
# #
# Headset Stands: #
# Corsair ST100 #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b3d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b17", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b37", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b39", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b4f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b13", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b33", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b38", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b49", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b6b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b55", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b11", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b2d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b20", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b48", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b7c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b34", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b74", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b3c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b75", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b5d", TAG+="uaccess", TAG+="Ironclaw"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b12", TAG+="uaccess", TAG+="M65"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b2e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b5a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b3e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b2f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b3b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0a34", TAG+="uaccess"
#---------------------------------------------------------------#
# Corsair Wireless Devices #
# #
# Keyboards: #
# Corsair K57 RGB Wired #
# Corsair K57 RGB Wireless #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b6e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b62", TAG+="uaccess"
#---------------------------------------------------------------#
# Creative Devices #
# #
# Devices: #
# Creative SoundblasterX G6 #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="041e", ATTR{idProduct}=="3256", TAG+="uaccess"
#---------------------------------------------------------------#
# Dell G Series Devices #
# #
# #
# Controllers: #
# Dell G Series LED Controller #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="187c", ATTR{idProduct}=="0550", TAG+="uaccess"
#---------------------------------------------------------------#
# Ducky Keyboard Devices #
# #
# Keyboards: #
# Ducky Shine 7 One 2 RGB #
# Ducky One 2 RGB TKL #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="0348", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="0356", TAG+="uaccess"
#---------------------------------------------------------------#
# EK Controller Devices #
# #
# Controllers: #
# EK Loop Connect #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="5750", TAG+="uaccess"
#---------------------------------------------------------------#
# Holtek Devices #
# #
# Mice: #
# Holtek A070 #
# Mousemats: #
# Holtek A1FA #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="a070", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="a1fa", TAG+="uaccess"
#---------------------------------------------------------------#
# HyperX Peripheral Devices #
# #
# Keyboards: #
# HyperX Alloy Elite #
# HyperX Alloy Elite 2 #
# HyperX Alloy FPS RGB #
# HyperX Alloy Origins #
# HyperX Alloy Origins Core #
# #
# Mice: #
# HyperX Pulsefire Surge #
# HyperX Pulsefire FPS Pro #
# HyperX Pulsefire Dart Wireless #
# HyperX Pulsefire Dart Wired #
# #
# Mousemats: #
# HyperX Fury Ultra #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16be", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="1711", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16dc", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16e5", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16e6", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16d3", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16d7", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16e1", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16e2", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="1705", TAG+="uaccess"
#---------------------------------------------------------------#
# Lian Li Uni Hub #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="0cf2", ATTR{idProduct}=="7750", TAG+="uaccess"
#---------------------------------------------------------------#
# Logitech Peripheral Devices #
# #
# Keyboards: #
# Logitech G213 #
# Logitech G512 #
# Logitech G512 RGB #
# Logitech G610 #1 #
# Logitech G610 #2 #
# Logitech G810 #1 #
# Logitech G810 #2 #
# Logitech G813 #
# Logitech G815 #
# Logitech G915 #
# Logitech G Pro #
# #
# Mice: #
# Logitech G203 Prodigy #
# Logitech G203 Lightsync #
# Logitech G303 #
# Logitech G403 Prodigy #
# Logitech G403 Hero #
# Logitech G502 Proteus Spectrum #
# Logitech G502 Hero #
# Logitech G502 Wireless #
# Logitech G703 Wireless #
# Logitech G703 Hero Wireless #
# Logitech G900 Wireless #
# Logitech G903 Wireless #
# Logitech G Lightspeed Wireless Gaming Mouse #
# Logitech G Pro Wireless Gaming Mouse (Wired) #
# Logitech G Pro Hero Gaming Mouse (Wired) #
# #
# Mousemats: #
# Logitech G Powerplay Mousepad with Lightspeed #
# #
# Speakers: #
# Logitech G560 #
# #
# Headsets: #
# Logitech G933 #
# #
# Joysticks: #
# Logitech Rhino X56 Hotas (Throttle and Stick) #
# #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c336", TAG+="uaccess", TAG+="G213"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c342", TAG+="uaccess", TAG+="G512"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c33c", TAG+="uaccess", TAG+="G512_RGB"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c333", TAG+="uaccess", TAG+="G610"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c338", TAG+="uaccess", TAG+="G610"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c331", TAG+="uaccess", TAG+="G810"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c337", TAG+="uaccess", TAG+="G810"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c339", TAG+="uaccess", TAG+="G_Pro"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c232", TAG+="uaccess", TAG+="G813"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c33f", TAG+="uaccess", TAG+="G815"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c335", TAG+="uaccess", TAG+="G910"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c541", TAG+="uaccess", TAG+="G915_Receiver"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c33e", TAG+="uaccess", TAG+="G915_Wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c084", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c092", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c083", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c08f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c082", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="405d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c332", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c08b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c08d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="407f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c087", TAG+="uaccess", TAG+="G703"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="4070", TAG+="uaccess", TAG+="G703_Virtual"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c090", TAG+="uaccess", TAG+="G703_Hero"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="4086", TAG+="uaccess", TAG+="G703_Hero_Virtual"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c081", TAG+="uaccess", TAG+="G900_wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="4053", TAG+="uaccess", TAG+="G900_wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c086", TAG+="uaccess", TAG+="G903_wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c091", TAG+="uaccess", TAG+="G903_V2_wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="4067", TAG+="uaccess", TAG+="G903_wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="4087", TAG+="uaccess", TAG+="G903_V2_wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c539", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c085", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c08c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c088", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="4079", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c53a", TAG+="uaccess", TAG+="Powerplay_Mat_Reciever"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="405f", TAG+="uaccess", TAG+="Powerplay_Mat_Virtual"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="0a78", TAG+="uaccess", TAG+="G560"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="0a5b", TAG+="uaccess", TAG+="G933"
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="0ab5", TAG+="uaccess", TAG+="G733"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0738", ATTR{idProduct}=="2221", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0738", ATTR{idProduct}=="a221", TAG+="uaccess"
#---------------------------------------------------------------#
# Metadot Das Keyboard 4Q + 5Q #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="24f0", ATTR{idProduct}=="2037", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="24f0", ATTR{idProduct}=="2020", TAG+="uaccess"
#---------------------------------------------------------------#
# MSI Mysticlight #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="3ea4", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="4459", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="1720", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7b10", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7b12", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7b17", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7b85", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7b93", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7b94", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7b96", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c34", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c35", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c36", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c37", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c42", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c56", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c59", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c60", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c67", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c70", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c71", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c73", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c75", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c76", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c77", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c79", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c80", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c81", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c82", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c83", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c84", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c85", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c86", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c87", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c88", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c89", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c90", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c91", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c92", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c94", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c95", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c96", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c98", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7c99", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7d06", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7d07", TAG+="uaccess", TAG+="MPG_Z590_GAMING_EDGE_WIFI"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="7d09", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1462", ATTR{idProduct}=="905d", TAG+="uaccess"
#---------------------------------------------------------------#
# MSI/SteelSeries 3-Zone Laptop Keyboard #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1770", ATTR{idProduct}=="ff00", TAG+="uaccess"
#---------------------------------------------------------------#
# NZXT Hue+ #
#---------------------------------------------------------------#
KERNEL=="ttyACM[0-9]*", ATTR{idVendor}=="04d8", ATTR{idProduct}=="00df", TAG+="uaccess"
#---------------------------------------------------------------#
# NZXT Hue 2 Devices #
# #
# NZXT Hue 2 #
# NZXT Hue 2 Ambient #
# NZXT Motherboard #
# NZXT Smart Device V2 #
# NZXT Kraken X3 #
# NZXT RGB Fan Controller #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2001", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2002", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2005", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2006", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2007", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2009", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="200d", TAG+="uaccess"
#---------------------------------------------------------------#
# NZXT Kraken #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="170e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="1715", TAG+="uaccess"
#---------------------------------------------------------------#
# Razer Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0241", TAG+="uaccess", TAG+="Blackwidow_2019"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0203", TAG+="uaccess", TAG+="Blackwidow_Chroma"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0209", TAG+="uaccess", TAG+="Blackwidow_Chroma_TE"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0221", TAG+="uaccess", TAG+="Blackwidow_Chroma_V2"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0228", TAG+="uaccess", TAG+="Blackwidow_Elite"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0237", TAG+="uaccess", TAG+="Blackwidow_Essential"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0235", TAG+="uaccess", TAG+="Blackwidow_Lite"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0211", TAG+="uaccess", TAG+="Blackwidow_Overwatch"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025a", TAG+="uaccess", TAG+="Blackwidow_V3_Pro-Wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025b", TAG+="uaccess", TAG+="Blackwidow_V3_Pro-Bluetooth"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025c", TAG+="uaccess", TAG+="Blackwidow_V3_Pro-Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0a24", TAG+="uaccess", TAG+="Blackwidow_V3_TKL"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0258", TAG+="uaccess", TAG+="Blackwidow_V3_Mini-Wired"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0271", TAG+="uaccess", TAG+="Blackwidow_V3_Mini-Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0216", TAG+="uaccess", TAG+="Blackwidow_X Chroma"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="021a", TAG+="uaccess", TAG+="Blackwidow_X_Chroma_TE"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="020f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0224", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0233", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="023b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0240", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="023a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0246", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0245", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="024d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0253", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0255", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="026a", TAG+="uaccess", TAG+="Razer_Book_13-2020"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="026f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0210", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0225", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="022f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0234", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="024c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0205", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0220", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="022d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0232", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0239", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="024a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0252", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0259", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="022a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="023f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025e", TAG+="uaccess", TAG+="Cynosa_Chroma_V2"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0204", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0226", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0227", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0257", TAG+="uaccess", TAG+="Huntsman_Mini"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0243", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="026B", TAG+="uaccess", TAG+="Huntsman_V2_TKL"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0207", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0266", TAG+="uaccess", TAG+="Huntsman V2 Analog"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="021e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="025d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0208", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="022b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0020", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="005e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="006a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="006b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0042", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="005b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0062", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0064", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0065", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0086", TAG+="uaccess", TAG+="Basilisk_Ultimate"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0088", TAG+="uaccess", TAG+="Basilisk_Ultimate-Wireless"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0083", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0085", TAG+="uaccess", TAG+="Basilisk_V2"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0038", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="004f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0037", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0016", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0054", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0043", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="005c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="006e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0071", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="008c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0084", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="007c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="007d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="004c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="002f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0060", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0059", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="005a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0070", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="006f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0024", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0025", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0044", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0045", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0073", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0072", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="006c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0046", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="002e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0040", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0053", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="003f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="003e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0041", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0036", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0050", TAG+="uaccess", TAG+="Naga_Hex_V2"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="008d", TAG+="uaccess", TAG+="Naga_Left_Handed"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0067", TAG+="uaccess", TAG+="Naga_Trinity"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0013", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0039", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0048", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0032", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0034", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="008a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0078", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="007a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="007b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0506", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0501", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f19", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0504", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0527", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0510", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f03", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f08", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f20", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f26", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f1f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f09", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f07", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f0e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0215", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0068", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0c00", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0c04", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0c02", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0c01", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f1d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="007e", TAG+="uaccess", TAG+="Razer_Mouse_Dock_Chroma"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0517", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0518", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f13", TAG+="uaccess", TAG+="O11_Dynamic_Razer_Ed"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1532", ATTR{idProduct}=="0f1b", TAG+="uaccess", TAG+="Razer_Seiren_Emote"
#---------------------------------------------------------------#
# Roccat Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e7d", ATTR{idProduct}=="2e27", TAG+="uaccess", TAG+="Roccat_Kone_Aimo"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e7d", ATTR{idProduct}=="2e2c", TAG+="uaccess", TAG+="Roccat_Kone_Aimo_16K"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1e7d", ATTR{idProduct}=="3098", TAG+="uaccess", TAG+="Roccat_Vulcan_120_Aimo"
#---------------------------------------------------------------#
# Redragon Peripheral Devices #
# #
# Keyboards: #
# Redragon K550 Yama #
# Redragon K552 Kumara #
# Redragon K556 Devarajas #
# Tecware Phantom Elite #
# #
# Mice: #
# Redragon M711 Cobra #
# Redragon M715 Dagger #
# Redragon M716 Inquisitor #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="0c45", ATTR{idProduct}=="5204", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0c45", ATTR{idProduct}=="5104", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0c45", ATTR{idProduct}=="5004", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="0c45", ATTR{idProduct}=="652f", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="fc30", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="fc39", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="fc3a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="fc4d", TAG+="uaccess"
#---------------------------------------------------------------#
# Gigabyte/Aorus RGB Fusion 2 USB #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="8297", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="5702", TAG+="uaccess"
#---------------------------------------------------------------#
# Sinowealth USB #
# Glorious Model O / O- #
# Glorious Model D / D- #
# Everest GT-100 RGB #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="258a", ATTR{idProduct}=="0036", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="258a", ATTR{idProduct}=="0033", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="258a", ATTR{idProduct}=="0029", TAG+="uaccess"
#---------------------------------------------------------------#
# Sony Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="05c4", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="09cc", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="0ba0", TAG+="uaccess"
#---------------------------------------------------------------#
# SteelSeries Peripheral Devices #
# #
# Mice: #
# SteelSeries Rival 100 #
# SteelSeries Rival 100 DotA 2 Edition #
# SteelSeries Rival 105 #
# SteelSeries Rival 110 #
# SteelSeries Rival 300 #
# Acer Predator Gaming Mouse (Rival 300) #
# SteelSeries Rival 300 CS:GO Fade Edition #
# SteelSeries Rival 300 CS:GO Fade Edition (stm32) #
# SteelSeries Rival 300 CS:GO Hyperbeast Edition #
# SteelSeries Rival 300 Dota 2 Edition #
# SteelSeries Rival 300 HP Omen Edition #
# SteelSeries Rival 300 Blackops Edition #
# SteelSeries Rival 310 #
# SteelSeries Rival 310 CS:GO Howl Edition #
# SteelSeries Rival 310 PubG Edition #
# SteelSeries Rival 650 Wireless #
# SteelSeries Rival 3 #
# SteelSeries Rival Sensei Ten #
# SteelSeries Rival Sensei Ten CS:GO Neon Rider #
# SteelSeries Rival Sensei 310 #
# Headsets: #
# SteelSeries Siberia 350 #
# Keyboards: #
# SteelSeries Apex 3 #
# SteelSeries Apex 5 #
# SteelSeries Apex 7 #
# SteelSeries Apex 7 TKL #
# SteelSeries Apex Pro #
# SteelSeries Apex Pro TKL #
# SteelSeries Apex M750 #
# SteelSeries Apex OG #
# SteelSeries Apex 350 #
# Mousemats: #
# SteelSeries QCK Prism Cloth Medium #
# SteelSeries QCK Prism Cloth XL #
# SteelSeries QCK Prism Cloth 3XL #
# SteelSeries QCK Prism Cloth 4XL #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1702", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="170c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1814", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1729", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1710", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1714", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1394", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1716", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="171a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1392", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1718", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1720", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="171e", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1736", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1832", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1834", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1722", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1726", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="172b", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1824", TAG+="uaccess", TAG+="Rival3_Old"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="184c", TAG+="uaccess", TAG+="Rival3"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1229", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="161c", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1612", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1618", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1610", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1614", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="161a", TAG+="uaccess", TAG+="Apex3"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="0616", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1202", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1206", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="150a", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="150d", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1516", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1518", TAG+="uaccess"
#---------------------------------------------------------------#
# Tecknet Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="fc05", TAG+="uaccess"
#---------------------------------------------------------------#
# Thermaltake Poseidon Z RGB Keyboard #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="264a", ATTR{idProduct}=="3006", TAG+="uaccess"
#---------------------------------------------------------------#
# Thermaltake Riing Controllers #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="264a", ATTR{idProduct}=="1fa[5-9]", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="264a", ATTR{idProduct}=="1fa[a-f]", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="264a", ATTR{idProduct}=="1fb[0-5]", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTR{idVendor}=="264a", ATTR{idProduct}=="226[0-3]", TAG+="uaccess"
#---------------------------------------------------------------#
# ThingM Controllers #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="27b8", ATTR{idProduct}=="01ed", TAG+="uaccess"
#---------------------------------------------------------------#
# Wooting Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="ff01", TAG+="uaccess", TAG+="WootingOne"
SUBSYSTEMS=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="ff02", TAG+="uaccess", TAG+="WootingTwo"
SUBSYSTEMS=="usb", ATTR{idVendor}=="31e3", ATTR{idProduct}=="1210", TAG+="uaccess", TAG+="WootingTwo_LE"
SUBSYSTEMS=="usb", ATTR{idVendor}=="31e3", ATTR{idProduct}=="1220", TAG+="uaccess", TAG+="WootingTwo_HE"
#---------------------------------------------------------------#
# Zalman ZSync Devices #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="1c57", ATTR{idProduct}=="7ed0", TAG+="uaccess"
+175
View File
@@ -0,0 +1,175 @@
#include "AutoStart-FreeBSD.h"
#include "LogManager.h"
#include "filesystem.h"
#include <fstream>
#include <iostream>
#include <limits.h>
#include <unistd.h>
#include <sstream>
/*-----------------------------------------------------*\
| FreeBSD AutoStart Implementation |
| Public Methods |
\*-----------------------------------------------------*/
AutoStart::AutoStart(std::string name)
{
InitAutoStart(name);
}
bool AutoStart::DisableAutoStart()
{
std::error_code autostart_file_remove_errcode;
bool success = false;
/*-------------------------------------------------*\
| Check if the filename is valid |
\*-------------------------------------------------*/
if(autostart_file != "")
{
/*---------------------------------------------*\
| If file doesn't exist, disable is successful |
\*---------------------------------------------*/
if(!filesystem::exists(autostart_file))
{
success = true;
}
/*---------------------------------------------*\
| Otherwise, delete the file |
\*---------------------------------------------*/
else
{
success = filesystem::remove(autostart_file, autostart_file_remove_errcode);
if(!success)
{
LOG_ERROR("[AutoStart] An error occurred removing the auto start file.");
}
}
}
else
{
LOG_ERROR("Could not establish correct autostart file path.");
}
return(success);
}
bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
{
bool success = false;
/*-------------------------------------------------*\
| Check if the filename is valid |
\*-------------------------------------------------*/
if(autostart_file != "")
{
std::ofstream autostart_file_stream(autostart_file, std::ios::out | std::ios::trunc);
/*---------------------------------------------*\
| Error out if the file could not be opened |
\*---------------------------------------------*/
if(!autostart_file_stream)
{
LOG_ERROR("Could not open %s for writing.", autostart_file.c_str());
success = false;
}
/*---------------------------------------------*\
| Otherwise, write the file |
\*---------------------------------------------*/
else
{
//autostart_file_stream << desktop_file;
autostart_file_stream.close();
success = !autostart_file_stream.fail();
if (!success)
{
LOG_ERROR("An error occurred writing the auto start file.");
}
}
}
else
{
LOG_ERROR("Could not establish correct autostart file path.");
}
return(success);
}
bool AutoStart::IsAutoStartEnabled()
{
/*-------------------------------------------------*\
| Check if the filename is valid |
\*-------------------------------------------------*/
if(autostart_file != "")
{
return(filesystem::exists(autostart_file));
}
else
{
return(false);
}
}
std::string AutoStart::GetExePath()
{
/*-------------------------------------------------*\
| Create the OpenRGB executable path |
\*-------------------------------------------------*/
char exepath[ PATH_MAX ];
ssize_t count = readlink("/proc/self/exe", exepath, PATH_MAX);
return(std::string(exepath, (count > 0) ? count : 0));
}
void AutoStart::InitAutoStart(std::string name)
{
std::string autostart_dir;
autostart_name = name;
/*-------------------------------------------------*\
| Get home and config paths |
\*-------------------------------------------------*/
const char *xdg_config_home = getenv("XDG_CONFIG_HOME");
const char *home = getenv("HOME");
/*-------------------------------------------------*\
| Determine where the autostart .desktop files are |
| kept |
\*-------------------------------------------------*/
if(xdg_config_home != NULL)
{
autostart_dir = xdg_config_home;
autostart_dir = autostart_dir + "/autostart/";
}
else if(home != NULL)
{
autostart_dir = home;
autostart_dir = autostart_dir + "/.config/autostart/";
}
/*-------------------------------------------------*\
| Check if the filename is valid |
\*-------------------------------------------------*/
if(autostart_dir != "")
{
std::error_code ec;
bool success = true;
if(!filesystem::exists(autostart_dir))
{
success = filesystem::create_directories(autostart_dir, ec);
}
if(success)
{
autostart_file = autostart_dir + autostart_name + ".desktop";
}
}
}
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <string>
#include "AutoStart.h"
class AutoStart: public AutoStartInterface
{
public:
AutoStart(std::string name);
bool DisableAutoStart();
bool EnableAutoStart(AutoStartInfo autostart_info);
bool IsAutoStartEnabled();
std::string GetExePath();
private:
void InitAutoStart(std::string name);
std::string GenerateLaunchAgentFile(AutoStartInfo autostart_info);
};
+5 -1
View File
@@ -37,4 +37,8 @@ protected:
#ifdef __APPLE__
#include "AutoStart-MacOS.h"
#endif
#endif
#ifdef __FreeBSD__
#include "AutoStart-FreeBSD.h"
#endif
+68
View File
@@ -0,0 +1,68 @@
# Contributing to OpenRGB
The OpenRGB project welcomes contributions from the community. The project would not support the number of devices it does today without the amazing contributions from community developers. If you want to add a new device, fix a bug, or add a feature, feel free to open a merge request on the OpenRGB GitLab (https://gitlab.com/CalcProgrammer1/OpenRGB).
## Creating a Merge Request
To create a merge request, log into GitLab and fork the OpenRGB project. Push your changes to your fork and then use the Create Merge Request option. Before opening a merge request, please review the following best practices to help your merge request get merged without excessive delay.
* Please keep the scope of each merge request limited to one functional area. If you wish to add a new device controller, for instance, don't also do code cleanup in another controller as part of the same merge request.
* Explain what your merge request is changing, why you feel the change is necessary, and add any additional information you feel is needed to best understand your change in the merge request description.
* Mark your merge request as a draft (start title with "Draft:") until it has been tested and verified working.
* Follow the Style Guidelines below when making your code changes.
* Avoid using `git merge` when updating your fork. The OpenRGB project uses a linear git history, meaning all changes are rebased onto the tip of master. By using `git rebase` to update your fork, you will make it easier to accept merge requests.
### Pipelines, Shared Runners and Quotas
Since mid 2022 Gitlab has limited the usage of shared runners to all projects and whilst quite geneorous quotas are allowed
for open source projects it is possible to exhaust them. With that in mind not all jobs within the pipeline build are
triggered to automatically run with every push to your branch with the exception of the Windows 64bit and Linux Appimage 64bit
jobs. If you need to test or share another build you can still start it manually from your pipeline queue.
Once a merge request is created all architectures and platforms will be compiled to ensure that they are ready to merge.
Please refer to the following link for [further information relating to minutes and quotas](https://docs.gitlab.com/ee/ci/pipelines/cicd_minutes.html).
## Style Guidelines
OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake build system. While OpenRGB does use C++, I am primarily a C programmer and prefer doing things "C Style" vs. C++ style. C++'s object oriented programming features fit the needs of a program such as OpenRGB where there are many implementations of a single interface so I chose to write it in C++ over C. Still, however, I prefer using C-style code where possible. When making changes to existing code files, try to follow the existing style. Merge requests that go out of their way to restyle code will not be accepted and will be sent back for rework.
### Functional Style
* Limit use of C++ std library data types
* For fixed-length containers, use C arrays
* For list constants, use const C arrays
* For fixed-length strings, use C char buffers ("C strings"), though using std::string is acceptable if the value will be placed in a std::string
* For basic types, prefer using the non-typedef'd basic types (char, short, int, etc) over typedef'd (uint8_t, uint16_t, uint32_t, etc)
* Unless defined in an OpenRGB API or the file is implementing an existing API using these types (such as i2c_smbus)
* For hard-coded values, use `#define`s over const variables unless you need a pointer to the value
* For variable-length containers, use std::vector
* For variable-length strings, use std::string
* `struct` should not include any functions, only variables
* `class` should only be used for objects containing functions
* Other std types may be used sparingly if necessary
* Only use Qt libraries, types, and functionality in user interface files
* Anything under the qt/ folder basically
* Do not use QDebug, use our LogManager instead. If you use QDebug during development, please remove it before submitting your merge request
* Use C-style indexed for loops when iterating through an array or vector
* Use C-style casts unless necessary
* Avoid the `auto` type. It makes code more difficult to read
* Do not use `printf` or `cout` for debug messages, use LogManager instead
* Don't define namespaces unless necessary
### Non-functional Style
* Set your editor's tab settings to insert spaces, using 4 spaces per tab stop
* Always put opening and closing braces `{`, `}` on their own lines
* Indent code inside the braces, do not indent the braces themselves
* Capitalize hexadecimal literals (`0xFF` not `0xff`) except in the udev rules file (which must be lowercase to work)
* No space between keyword and open parenthesis (`if(TRUE)` not `if (TRUE)`). There are some instances of this that haven't been cleaned up in the code.
* Generally, `snake_case` is used for variable names and `CamelCase` is used for function and class names
* Add a header comment to new files with the filename, description, original author, and date (this is missing on most Detect files)
* Line up `=` when doing a lot of assignments together
* Use this comment box style when adding comments:
```
/*--------------------------------*\
| This is a comment |
\*_-------------------------------*/
```
+1
View File
@@ -50,6 +50,7 @@
#define COLOR_AQUAMARINE 0x7fffd4
#define COLOR_MAROON 0x800000
#define COLOR_PURPLE 0x800080
#define COLOR_ELECTRIC_ULTRAMARINE 0x4000FF
#define COLOR_OLIVE 0x808000
#define COLOR_GRAY 0x808080
#define COLOR_GREY 0x808080
@@ -0,0 +1,34 @@
/*-----------------------------------------------------*\
| OpenRGB includes |
\*-----------------------------------------------------*/
#include <hidapi/hidapi.h>
#include "Detector.h"
#include "LogManager.h"
#include "RGBController.h"
/*-----------------------------------------------------*\
| A4 Tech specific includes |
\*-----------------------------------------------------*/
#include "RGBController_BloodyMouse.h"
/*-----------------------------------------------------*\
| A4 Tech USB vendor ID |
\*-----------------------------------------------------*/
#define A4_TECH_VID 0x09DA
void DetectA4TechMouseControllers(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id);
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
REGISTER_HID_DETECTOR_IPU("Bloody W60 Pro", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W60_PRO_PID, 2, 0xFF33, 0x0529);
REGISTER_HID_DETECTOR_IPU("Bloody MP 50RS", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_MP_50RS_PID, 2, 0xFFF2, 0x6009);
@@ -0,0 +1,81 @@
/*---------------------------------------------------------------------*\
| BloodyMouseController.cpp |
| |
| Driver for BloodyMouse USB Controller |
| |
| Chris M (Dr_No) 30 Jun 2022 |
| |
\*---------------------------------------------------------------------*/
#include "BloodyMouseController.h"
BloodyMouseController::BloodyMouseController(hid_device* dev_handle, const char* path, uint16_t product_id)
{
dev = dev_handle;
location = path;
pid = product_id;
InitDevice();
}
BloodyMouseController::~BloodyMouseController()
{
hid_close(dev);
}
uint16_t BloodyMouseController::GetPid()
{
return pid;
}
std::string BloodyMouseController::GetSerial()
{
const uint8_t sz = HID_MAX_STR;
wchar_t tmp[sz];
int ret = hid_get_serial_number_string(dev, tmp, sz);
if (ret != 0)
{
LOG_DEBUG("[BloodyMouse] Get HID Serial string failed");
return("");
}
std::wstring w_tmp = std::wstring(tmp);
std::string serial = std::string(w_tmp.begin(), w_tmp.end());
return serial;
}
std::string BloodyMouseController::GetLocation()
{
return("HID: " + location);
}
void BloodyMouseController::InitDevice()
{
uint8_t buffer[BLOODYMOUSE_WRITE_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 };
hid_send_feature_report(dev, buffer, BLOODYMOUSE_WRITE_PACKET_SIZE);
buffer[BLOODYMOUSE_MODE_BYTE] = 0;
buffer[BLOODYMOUSE_DATA_BYTE] = 1;
hid_send_feature_report(dev, buffer, BLOODYMOUSE_WRITE_PACKET_SIZE);
}
void BloodyMouseController::SetLedsDirect(std::vector<RGBColor> colors)
{
uint8_t buffer[BLOODYMOUSE_WRITE_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00 };
for(uint8_t i = 0; i < colors.size(); i++)
{
uint8_t offset = 3 * (colors[i] >> 24) + BLOODYMOUSE_DATA_BYTE;
buffer[offset] = RGBGetRValue(colors[i]);
buffer[offset + 1] = RGBGetGValue(colors[i]);
buffer[offset + 2] = RGBGetBValue(colors[i]);
}
hid_send_feature_report(dev, buffer, BLOODYMOUSE_WRITE_PACKET_SIZE);
}
@@ -0,0 +1,63 @@
/*---------------------------------------------------------------------*\
| BloodyMouseController.h |
| |
| Driver for BloodyMouse USB Controller |
| |
| Chris M (Dr_No) 30 Jun 2022 |
| |
\*---------------------------------------------------------------------*/
#include <string>
#include <hidapi/hidapi.h>
#include "LogManager.h"
#include "RGBController.h"
#pragma once
/*-----------------------------------------------------*\
| Mouse product IDs |
\*-----------------------------------------------------*/
#define BLOODY_W60_PRO_PID 0x37EA
/*-----------------------------------------------------*\
| Mousemat product IDs |
\*-----------------------------------------------------*/
#define BLOODY_MP_50RS_PID 0xFA60
#define HID_MAX_STR 255
#define BLOODYMOUSE_WRITE_PACKET_SIZE 64
#define BLOODYMOUSE_BRIGHTNESS_MIN 0
#define BLOODYMOUSE_BRIGHTNESS_MAX 255
enum
{
BLOODYMOUSE_MODE_DIRECT = 0x01, //Direct Led Control - Independently set LEDs in zone
};
enum
{
BLOODYMOUSE_REPORT_BYTE = 1,
BLOODYMOUSE_COMMAND_BYTE = 2,
BLOODYMOUSE_MODE_BYTE = 3,
BLOODYMOUSE_DATA_BYTE = 8,
};
class BloodyMouseController
{
public:
BloodyMouseController(hid_device* dev_handle, const char* path, uint16_t product_id);
~BloodyMouseController();
uint16_t GetPid();
std::string GetSerial();
std::string GetLocation();
void SetLedsDirect(std::vector<RGBColor> colors);
private:
uint16_t pid;
std::string location;
hid_device* dev;
void InitDevice();
};
@@ -0,0 +1,176 @@
/*---------------------------------------------------------------------*\
| RGBController_BloodyMouse.cpp |
| |
| Driver for BloodyMouse USB Controller |
| |
| Chris M (Dr_No) 30 Jun 2022 |
| |
\*---------------------------------------------------------------------*/
#include "RGBController_BloodyMouse.h"
static const mouse_layout w60_pro
{
{
"Scroll Wheel", { 14 }
},
{
"Mid Line", { 0, 1, 2, 9, 3, 4, 5, 6 }
},
{
"Logo", { 10 }
},
{
"Rear", { 8, 7, 13, 12, 11 }
}
};
static const mouse_layout mp_50rs
{
{
"Mouse Pad", { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
}
};
/**------------------------------------------------------------------*\
@name BloodyMouse
@category Mouse
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectA4TechMouseControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_BloodyMouse::RGBController_BloodyMouse(BloodyMouseController *controller_ptr)
{
controller = controller_ptr;
switch(controller->GetPid())
{
case BLOODY_MP_50RS_PID:
type = DEVICE_TYPE_MOUSEMAT;
break;
default:
type = DEVICE_TYPE_MOUSE;
}
name = "BloodyMouse";
vendor = "Bloody";
description = "Controller compatible with the Bloody W60 Pro and MP 50RS";
serial = controller->GetSerial();
location = controller->GetLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = BLOODYMOUSE_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
}
RGBController_BloodyMouse::~RGBController_BloodyMouse()
{
delete controller;
}
void RGBController_BloodyMouse::SetupZones()
{
/*-------------------------------------------------*\
| Clear any existing color/LED configuration |
\*-------------------------------------------------*/
leds.clear();
colors.clear();
/*-------------------------------------------------*\
| Select layout from PID |
\*-------------------------------------------------*/
mouse_layout layout;
switch(controller->GetPid())
{
case BLOODY_W60_PRO_PID:
layout = w60_pro;
break;
case BLOODY_MP_50RS_PID:
layout = mp_50rs;
break;
}
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
for(uint8_t zone_idx = 0; zone_idx < layout.size(); zone_idx++)
{
mouse_zone mz = layout[zone_idx];
bool bool_single = mz.zone_leds.size() == 1;
zone new_zone;
new_zone.name = mz.name;
new_zone.leds_min = mz.zone_leds.size();
new_zone.leds_max = new_zone.leds_min;
new_zone.leds_count = new_zone.leds_min;
new_zone.type = bool_single ? ZONE_TYPE_SINGLE : ZONE_TYPE_LINEAR;
new_zone.matrix_map = NULL;
zones.push_back(new_zone);
for(unsigned int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
{
led new_led;
new_led.value = mz.zone_leds[lp_idx];
if(bool_single)
{
new_led.name = mz.name + " LED";
}
else
{
new_led.name = mz.name;
new_led.name.append(" LED " + std::to_string(lp_idx));
}
leds.push_back(new_led);
}
}
SetupColors();
}
void RGBController_BloodyMouse::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_BloodyMouse::DeviceUpdateLEDs()
{
std::vector<RGBColor> colour;
for(size_t i = 0; i < colors.size(); i++)
{
RGBColor c = colors[i] | (leds[i].value << 24);
colour.push_back(c);
}
controller->SetLedsDirect(colour);
}
void RGBController_BloodyMouse::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_BloodyMouse::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_BloodyMouse::DeviceUpdateMode()
{
/*---------------------------------------------------------*\
| This device only supports Direct mode |
\*---------------------------------------------------------*/
}
@@ -0,0 +1,41 @@
/*---------------------------------------------------------------------*\
| RGBController_BloodyMouse.h |
| |
| Driver for BloodyMouse USB Controller |
| |
| Chris M (Dr_No) 30 Jun 2022 |
| |
\*---------------------------------------------------------------------*/
#pragma once
#include <vector>
#include "LogManager.h"
#include "RGBController.h"
#include "BloodyMouseController.h"
struct mouse_zone
{
std::string name;
std::vector<uint8_t> zone_leds;
};
typedef std::vector<mouse_zone> mouse_layout;
class RGBController_BloodyMouse : public RGBController
{
public:
RGBController_BloodyMouse(BloodyMouseController* controller_ptr);
~RGBController_BloodyMouse();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
BloodyMouseController* controller;
};
@@ -17,8 +17,6 @@ AMDWraithPrismController::AMDWraithPrismController(hid_device* dev_handle, const
dev = dev_handle;
location = path;
strcpy(device_name, "AMD Wraith Prism");
current_fan_mode = AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC;
current_fan_speed = 0xFF;
current_fan_random_color = false;
@@ -33,8 +31,6 @@ AMDWraithPrismController::AMDWraithPrismController(hid_device* dev_handle, const
current_ring_speed = 0xFF;
current_ring_direction = false;
current_ring_brightness = 0xFF;
SendEnableCommand();
}
AMDWraithPrismController::~AMDWraithPrismController()
@@ -47,11 +43,6 @@ std::string AMDWraithPrismController::GetLocationString()
return("HID: " + location);
}
char* AMDWraithPrismController::GetDeviceName()
{
return device_name;
}
std::string AMDWraithPrismController::GetSerialString()
{
wchar_t serial_string[128];
@@ -68,41 +59,6 @@ std::string AMDWraithPrismController::GetSerialString()
return(return_string);
}
std::string AMDWraithPrismController::GetEffectChannelString(unsigned char channel)
{
std::string ret_string = "";
unsigned char usb_buf[] =
{
0x00,
0x40, 0x21, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
usb_buf[0x03] = channel;
hid_write(dev, usb_buf, 65);
hid_read(dev, usb_buf, 64);
ret_string.append((char *)&usb_buf[0x08]);
return(ret_string);
}
std::string AMDWraithPrismController::GetFirmwareVersionString()
{
std::string ret_string = "";
@@ -232,7 +188,7 @@ void AMDWraithPrismController::SetRingEffectChannel(unsigned char channel)
SendChannelRemap(channel, AMD_WRAITH_PRISM_EFFECT_CHANNEL_LOGO_LED, AMD_WRAITH_PRISM_EFFECT_CHANNEL_FAN_LED);
}
void AMDWraithPrismController::SendEnableCommand()
void AMDWraithPrismController::SendEnableCommand(bool direct)
{
unsigned char usb_buf[] =
{
@@ -255,6 +211,11 @@ void AMDWraithPrismController::SendEnableCommand()
0x00, 0x00, 0x00, 0x00,
};
if(direct)
{
usb_buf[0x02] = 0x03;
}
hid_write(dev, usb_buf, 65);
hid_read(dev, usb_buf, 64);
}
@@ -286,6 +247,48 @@ void AMDWraithPrismController::SendApplyCommand()
hid_read(dev, usb_buf, 64);
}
void AMDWraithPrismController::SendDirectPacket
(
unsigned char size,
unsigned char * led_ids,
RGBColor * colors
)
{
unsigned char usb_buf[] =
{
0x00,
0xC0, 0x01, size, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
for(unsigned int led_idx = 0; led_idx < size; led_idx++)
{
unsigned int index = led_idx * 4;
usb_buf[index + 5] = led_ids[led_idx];
usb_buf[index + 6] = RGBGetRValue(colors[led_idx]);
usb_buf[index + 7] = RGBGetGValue(colors[led_idx]);
usb_buf[index + 8] = RGBGetBValue(colors[led_idx]);
}
hid_write(dev, usb_buf, 65);
hid_read(dev, usb_buf, 64);
}
void AMDWraithPrismController::SendEffectChannelUpdate
(
unsigned char effect_channel,
@@ -10,6 +10,8 @@
#include <string>
#include <hidapi/hidapi.h>
#include "RGBController.h"
#pragma once
#define AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX 0xFF
@@ -74,6 +76,7 @@ enum
AMD_WRAITH_PRISM_EFFECT_CHANNEL_CHASE = 0x09, /* Chase effect channel */
AMD_WRAITH_PRISM_EFFECT_CHANNEL_SWIRL = 0x0A, /* Swirl effect channel */
AMD_WRAITH_PRISM_EFFECT_CHANNEL_MORSE = 0x0B, /* Morse code effect channel */
AMD_WRAITH_PRISM_EFFECT_CHANNEL_DIRECT = 0xFF, /* Value for direct mode */
};
enum
@@ -91,29 +94,11 @@ public:
AMDWraithPrismController(hid_device* dev_handle, const char* path);
~AMDWraithPrismController();
char* GetDeviceName();
std::string GetEffectChannelString(unsigned char channel);
std::string GetFirmwareVersionString();
std::string GetLocationString();
std::string GetSerialString();
void SetRingEffectChannel(unsigned char channel);
void SetFanMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color);
void SetFanColor(unsigned char red, unsigned char green, unsigned char blue);
void SetLogoMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color);
void SetLogoColor(unsigned char red, unsigned char green, unsigned char blue);
void SetRingMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool direction, bool random_color);
void SetRingColor(unsigned char red, unsigned char green, unsigned char blue);
private:
char device_name[32];
hid_device* dev;
std::string location;
unsigned char current_fan_mode;
unsigned char current_fan_speed;
unsigned char current_fan_brightness;
@@ -130,10 +115,30 @@ private:
bool current_ring_direction;
bool current_ring_random_color;
void SendEnableCommand();
void SetFanMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color);
void SetFanColor(unsigned char red, unsigned char green, unsigned char blue);
void SetLogoMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color);
void SetLogoColor(unsigned char red, unsigned char green, unsigned char blue);
void SetRingMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool direction, bool random_color);
void SetRingColor(unsigned char red, unsigned char green, unsigned char blue);
void SendDirectPacket
(
unsigned char size,
unsigned char * led_ids,
RGBColor * colors
);
void SendEnableCommand(bool direct);
void SendApplyCommand();
private:
hid_device* dev;
std::string location;
void SetRingEffectChannel(unsigned char channel);
void SendEffectChannelUpdate
(
unsigned char effect_channel,
@@ -20,7 +20,7 @@ void DetectAMDWraithPrismControllers(hid_device_info* info, const std::string&)
hid_device* dev = hid_open_path(info->path);
if( dev )
{
AMDWraithPrismController* controller = new AMDWraithPrismController(dev, info->path);
AMDWraithPrismController* controller = new AMDWraithPrismController(dev, info->path);
RGBController_AMDWraithPrism* rgb_controller = new RGBController_AMDWraithPrism(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
@@ -9,47 +9,57 @@
#include "RGBController_AMDWraithPrism.h"
RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismController* wraith_ptr)
/**------------------------------------------------------------------*\
@name AMD Wraith Prism
@category Cooler
@type USB
@save :o:
@direct :white_check_mark:
@effects :tools:
@detectors DetectAMDWraithPrismControllers
@comment The Wraith Prism comes with 2 cables but is only detectable
and controlable when using the USB cable. `Morse Code` and `Mirage`
modes have not been implemented. Saving to flash is supported by
the device but not yet implemented.
\*-------------------------------------------------------------------*/
RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismController* controller_ptr)
{
wraith = wraith_ptr;
controller = controller_ptr;
name = "AMD Wraith Prism";
vendor = "Cooler Master";
type = DEVICE_TYPE_COOLER;
description = "AMD Wraith Prism Device";
version = wraith->GetFirmwareVersionString();
location = wraith->GetLocationString();
/*-----------------------------------------------------*\
| Don't use HID serial string, it is inconsistent on my |
| Wraith Prism |
\*-----------------------------------------------------*/
serial = "";//wraith->GetSerialString();
version = controller->GetFirmwareVersionString();
location = controller->GetLocationString();
mode Direct;
Direct.name = "Direct";
Direct.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_STATIC;
Direct.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Direct.brightness_min = 0;
Direct.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Direct.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Direct.brightness_max = 0;
Direct.brightness = 0;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
Breathing.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST;
Breathing.brightness_min = 0;
Breathing.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Breathing.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Breathing.color_mode = MODE_COLORS_PER_LED;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.speed = AMD_WRAITH_PRISM_SPEED_NORMAL;
Breathing.colors.resize(3);
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.name = "Spectrum Cycle";
ColorCycle.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_COLOR_CYCLE;
ColorCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
ColorCycle.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
@@ -62,7 +72,7 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
modes.push_back(ColorCycle);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.name = "Rainbow Wave";
Rainbow.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
Rainbow.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
@@ -90,27 +100,29 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
mode Chase;
Chase.name = "Chase";
Chase.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_CHASE;
Chase.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Chase.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Chase.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
Chase.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST;
Chase.brightness_min = 0;
Chase.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Chase.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Chase.color_mode = MODE_COLORS_PER_LED;
Chase.color_mode = MODE_COLORS_MODE_SPECIFIC;
Chase.speed = AMD_WRAITH_PRISM_SPEED_NORMAL;
Chase.colors.resize(3);
modes.push_back(Chase);
mode Swirl;
Swirl.name = "Swirl";
Swirl.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_SWIRL;
Swirl.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Swirl.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Swirl.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
Swirl.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST;
Swirl.brightness_min = 0;
Swirl.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Swirl.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX;
Swirl.color_mode = MODE_COLORS_PER_LED;
Swirl.color_mode = MODE_COLORS_MODE_SPECIFIC;
Swirl.speed = AMD_WRAITH_PRISM_SPEED_NORMAL;
Swirl.colors.resize(3);
modes.push_back(Swirl);
SetupZones();
@@ -118,11 +130,19 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
RGBController_AMDWraithPrism::~RGBController_AMDWraithPrism()
{
delete wraith;
delete controller;
}
void RGBController_AMDWraithPrism::SetupZones()
{
/*---------------------------------------------------------*\
| LED maps |
\*---------------------------------------------------------*/
const unsigned int logo_leds[1] = { 0x00 };
const unsigned int fan_leds[1] = { 0x01 };
const unsigned int ring_leds[14] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x10, 0x0F,
0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09 };
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
@@ -146,27 +166,39 @@ void RGBController_AMDWraithPrism::SetupZones()
zone ring_zone;
ring_zone.name = "Ring";
ring_zone.type = ZONE_TYPE_SINGLE;
ring_zone.leds_min = 1;
ring_zone.leds_max = 1;
ring_zone.leds_count = 1;
ring_zone.type = ZONE_TYPE_LINEAR;
ring_zone.leds_min = 14;
ring_zone.leds_max = 14;
ring_zone.leds_count = 14;
ring_zone.matrix_map = NULL;
zones.push_back(ring_zone);
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
led logo_led;
logo_led.name = "Logo LED";
leds.push_back(logo_led);
for(unsigned int led_idx = 0; led_idx < 1; led_idx++)
{
led logo_led;
logo_led.name = "Logo LED";
logo_led.value = logo_leds[led_idx];
leds.push_back(logo_led);
}
led fan_led;
fan_led.name = "Fan LED";
leds.push_back(fan_led);
for(unsigned int led_idx = 0; led_idx < 1; led_idx++)
{
led fan_led;
fan_led.name = "Fan LED";
fan_led.value = fan_leds[led_idx];
leds.push_back(fan_led);
}
led ring_led;
ring_led.name = "Ring LED";
leds.push_back(ring_led);
for(unsigned int led_idx = 0; led_idx < 14; led_idx++)
{
led ring_led;
ring_led.name = "Ring LED";
ring_led.value = ring_leds[led_idx];
leds.push_back(ring_led);
}
SetupColors();
}
@@ -180,87 +212,113 @@ void RGBController_AMDWraithPrism::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_AMDWraithPrism::DeviceUpdateLEDs()
{
unsigned char red = RGBGetRValue(colors[0]);
unsigned char grn = RGBGetGValue(colors[0]);
unsigned char blu = RGBGetBValue(colors[0]);
wraith->SetLogoColor(red, grn, blu);
red = RGBGetRValue(colors[1]);
grn = RGBGetGValue(colors[1]);
blu = RGBGetBValue(colors[1]);
wraith->SetFanColor(red, grn, blu);
red = RGBGetRValue(colors[2]);
grn = RGBGetGValue(colors[2]);
blu = RGBGetBValue(colors[2]);
wraith->SetRingColor(red, grn, blu);
}
void RGBController_AMDWraithPrism::UpdateZoneLEDs(int zone)
{
RGBColor color = colors[zone];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
if(zone == 0)
if(modes[active_mode].color_mode == MODE_COLORS_PER_LED)
{
wraith->SetLogoColor(red, grn, blu);
unsigned char led_ids[15];
RGBColor color_buf[15];
unsigned int leds_count = 0;
for(unsigned int led_idx = 0; led_idx < colors.size(); led_idx++)
{
led_ids[leds_count] = (unsigned char)leds[led_idx].value;
color_buf[leds_count] = colors[led_idx];
leds_count++;
if(leds_count >= 15)
{
controller->SendDirectPacket(15, led_ids, color_buf);
leds_count = 0;
}
}
if(leds_count > 0)
{
controller->SendDirectPacket(leds_count, led_ids, color_buf);
}
}
else if(zone == 1)
else if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
wraith->SetFanColor(red, grn, blu);
unsigned char red = RGBGetRValue(modes[active_mode].colors[0]);
unsigned char grn = RGBGetGValue(modes[active_mode].colors[0]);
unsigned char blu = RGBGetBValue(modes[active_mode].colors[0]);
controller->SetLogoColor(red, grn, blu);
red = RGBGetRValue(modes[active_mode].colors[1]);
grn = RGBGetGValue(modes[active_mode].colors[1]);
blu = RGBGetBValue(modes[active_mode].colors[1]);
controller->SetFanColor(red, grn, blu);
red = RGBGetRValue(modes[active_mode].colors[2]);
grn = RGBGetGValue(modes[active_mode].colors[2]);
blu = RGBGetBValue(modes[active_mode].colors[2]);
controller->SetRingColor(red, grn, blu);
}
else if(zone == 2)
else
{
wraith->SetRingColor(red, grn, blu);
controller->SetLogoColor(0, 0, 0);
controller->SetFanColor(0, 0, 0);
controller->SetRingColor(0, 0, 0);
}
}
void RGBController_AMDWraithPrism::UpdateSingleLED(int led)
void RGBController_AMDWraithPrism::UpdateZoneLEDs(int /*zone*/)
{
UpdateZoneLEDs(led);
DeviceUpdateLEDs();
}
void RGBController_AMDWraithPrism::SetCustomMode()
void RGBController_AMDWraithPrism::UpdateSingleLED(int /*led*/)
{
active_mode = 0;
DeviceUpdateLEDs();
}
void RGBController_AMDWraithPrism::DeviceUpdateMode()
{
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
wraith->SetRingMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, modes[active_mode].direction, random);
switch(modes[active_mode].value)
{
case AMD_WRAITH_PRISM_EFFECT_CHANNEL_DIRECT:
controller->SendEnableCommand(true);
controller->SendApplyCommand();
break;
case AMD_WRAITH_PRISM_EFFECT_CHANNEL_COLOR_CYCLE:
wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SendEnableCommand(false);
controller->SetRingMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, modes[active_mode].direction, random);
controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
break;
case AMD_WRAITH_PRISM_EFFECT_CHANNEL_RAINBOW:
case AMD_WRAITH_PRISM_EFFECT_CHANNEL_BOUNCE:
wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, (modes[active_mode].brightness >> 1), random);
wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, (modes[active_mode].brightness >> 1), random);
controller->SendEnableCommand(false);
controller->SetRingMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, modes[active_mode].direction, random);
controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, (modes[active_mode].brightness >> 1), random);
controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, (modes[active_mode].brightness >> 1), random);
break;
case AMD_WRAITH_PRISM_EFFECT_CHANNEL_BREATHING:
wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_BREATHING, modes[active_mode].speed, modes[active_mode].brightness, random);
wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_BREATHING, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SendEnableCommand(false);
controller->SetRingMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, modes[active_mode].direction, random);
controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_BREATHING, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_BREATHING, modes[active_mode].speed, modes[active_mode].brightness, random);
break;
default:
if(random)
{
wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SendEnableCommand(false);
controller->SetRingMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, modes[active_mode].direction, random);
controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random);
}
else
{
wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[active_mode].speed, modes[active_mode].brightness, random);
wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SendEnableCommand(false);
controller->SetRingMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, modes[active_mode].direction, random);
controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[active_mode].speed, modes[active_mode].brightness, random);
controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[active_mode].speed, modes[active_mode].brightness, random);
}
break;
}
@@ -1,33 +1,32 @@
/*-----------------------------------------*\
| RGBController_AMDWraithPrism.h |
| |
| Generic RGB Interface for AMD Wraith |
| Prism |
| |
| Adam Honse (CalcProgrammer1) 12/25/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AMDWraithPrismController.h"
class RGBController_AMDWraithPrism : public RGBController
{
public:
RGBController_AMDWraithPrism(AMDWraithPrismController* wraith_ptr);
~RGBController_AMDWraithPrism();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AMDWraithPrismController* wraith;
};
/*-----------------------------------------*\
| RGBController_AMDWraithPrism.h |
| |
| Generic RGB Interface for AMD Wraith |
| Prism |
| |
| Adam Honse (CalcProgrammer1) 12/25/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AMDWraithPrismController.h"
class RGBController_AMDWraithPrism : public RGBController
{
public:
RGBController_AMDWraithPrism(AMDWraithPrismController* controller_ptr);
~RGBController_AMDWraithPrism();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
AMDWraithPrismController* controller;
};
@@ -1,353 +0,0 @@
/*-----------------------------------------*\
| ASRockPolychromeSMBusController.cpp |
| |
| Driver for for ASRock ASR LED and |
| Polychrome RGB lighting controller |
| |
| Adam Honse (CalcProgrammer1) 12/14/2019 |
\*-----------------------------------------*/
#include "ASRockPolychromeSMBusController.h"
#include <cstring>
#include "dependencies/dmiinfo.h"
#include "LogManager.h"
#define ASROCK_ZONE_LED_COUNT_MESSAGE_EN "[%s] Zone %i LED count: %02d"
using namespace std::chrono_literals;
PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev)
{
this->bus = bus;
this->dev = dev;
DMIInfo dmi;
device_name = "ASRock " + dmi.getMainboard();
fw_version = ReadFirmwareVersion();
unsigned char major_version = fw_version >> 8;
/*-----------------------------------------------------*\
| Determine whether the device uses ASR LED or |
| Polychrome protocol by checking firmware version. |
| Versions: 1.xx are ASR RGB LED |
| 2.xx are Polychrome v1 |
| 3.xx are Polychrome v2 |
\*-----------------------------------------------------*/
switch(major_version)
{
case ASROCK_TYPE_ASRLED:
LOG_TRACE("[%s] Device type is ASR RGB LED", ASROCK_CONTROLLER_NAME);
asrock_type = ASROCK_TYPE_ASRLED;
memset(zone_led_count, 0, sizeof(zone_led_count));
break;
case ASROCK_TYPE_POLYCHROME_V1:
LOG_TRACE("[%s] Device type is Polychrome v1", ASROCK_CONTROLLER_NAME);
asrock_type = ASROCK_TYPE_POLYCHROME_V1;
ReadLEDConfiguration();
break;
case ASROCK_TYPE_POLYCHROME_V2:
LOG_TRACE("[%s] Device type is Polychrome v2", ASROCK_CONTROLLER_NAME);
asrock_type = ASROCK_TYPE_POLYCHROME_V2;
ReadLEDConfiguration();
break;
default:
LOG_TRACE("[%s] Got Unknown version!", ASROCK_CONTROLLER_NAME);
asrock_type = ASROCK_TYPE_UNKNOWN;
break;
}
}
PolychromeController::~PolychromeController()
{
}
unsigned int PolychromeController::GetASRockType()
{
return(asrock_type);
}
std::string PolychromeController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
return_string.append(addr);
return("I2C: " + return_string);
}
std::string PolychromeController::GetDeviceName()
{
return(device_name);
}
std::string PolychromeController::GetFirmwareVersion()
{
unsigned char major_version = fw_version >> 8;
unsigned char minor_version = fw_version & 0xFF;
return(std::to_string(major_version) + "." + std::to_string(minor_version));
}
unsigned short PolychromeController::ReadFirmwareVersion()
{
// The firmware register holds two bytes, so the first read should return 2
// If not, report invalid firmware revision FFFF
LOG_DEBUG("[%s] Reading back device firmware version", ASROCK_CONTROLLER_NAME);
// Version response array needs to be 32 bytes to prevent non ASRock board from stack smashing
unsigned char asrock_version[I2C_SMBUS_BLOCK_MAX] = { 0x00, 0x00 };
if (bus->i2c_smbus_read_block_data(dev, ASROCK_REG_FIRMWARE_VER, asrock_version) == 0x02)
{
unsigned char major = asrock_version[0];
unsigned char minor = asrock_version[1];
LOG_DEBUG("[%s] Device firmware version: v%02d.%02d", ASROCK_CONTROLLER_NAME, major, minor);
return((major << 8) | minor);
}
else
{
LOG_WARNING("[%s] Firmware readback failed; Returning 0xFFFF", ASROCK_CONTROLLER_NAME);
return(0xFFFF);
}
}
void PolychromeController::ReadLEDConfiguration()
{
/*---------------------------------------------------------------------------------*\
| The LED configuration register holds 6 bytes, so the first read should return 6 |
| If not, set all zone sizes to zero |
\*---------------------------------------------------------------------------------*/
LOG_DEBUG("[%s] Reading LED config from controller", ASROCK_CONTROLLER_NAME);
unsigned char asrock_zone_count[I2C_SMBUS_BLOCK_MAX] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
if (bus->i2c_smbus_read_block_data(dev, POLYCHROME_REG_LED_CONFIG, asrock_zone_count) == 0x06)
{
zone_led_count[POLYCHROME_ZONE_1] = asrock_zone_count[0];
zone_led_count[POLYCHROME_ZONE_2] = asrock_zone_count[1];
zone_led_count[POLYCHROME_ZONE_3] = asrock_zone_count[2];
zone_led_count[POLYCHROME_ZONE_4] = asrock_zone_count[3];
zone_led_count[POLYCHROME_ZONE_5] = asrock_zone_count[4];
zone_led_count[POLYCHROME_ZONE_ADDRESSABLE] = asrock_zone_count[5];
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, ASROCK_CONTROLLER_NAME, POLYCHROME_ZONE_1, zone_led_count[POLYCHROME_ZONE_1]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, ASROCK_CONTROLLER_NAME, POLYCHROME_ZONE_2, zone_led_count[POLYCHROME_ZONE_2]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, ASROCK_CONTROLLER_NAME, POLYCHROME_ZONE_3, zone_led_count[POLYCHROME_ZONE_3]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, ASROCK_CONTROLLER_NAME, POLYCHROME_ZONE_4, zone_led_count[POLYCHROME_ZONE_4]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, ASROCK_CONTROLLER_NAME, POLYCHROME_ZONE_5, zone_led_count[POLYCHROME_ZONE_5]);
LOG_DEBUG("[%s] Addressable Zone LED count: %02d", ASROCK_CONTROLLER_NAME, zone_led_count[POLYCHROME_ZONE_ADDRESSABLE]);
}
else
{
LOG_WARNING("[%s] LED config read failed", ASROCK_CONTROLLER_NAME);
memset(zone_led_count, 0, sizeof(zone_led_count));
}
}
unsigned int PolychromeController::GetMode()
{
return(active_mode);
}
void PolychromeController::SetColorsAndSpeed(unsigned char led, unsigned char red, unsigned char green, unsigned char blue)
{
unsigned char color_speed_pkt[4] = { red, green, blue, active_speed };
unsigned char select_led_pkt[1] = { led };
switch(asrock_type)
{
case ASROCK_TYPE_ASRLED:
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
if(active_mode != ASRLED_MODE_OFF)
{
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
}
switch(active_mode)
{
/*-----------------------------------------------------*\
| These modes take 4 bytes in R/G/B/S order |
\*-----------------------------------------------------*/
case ASRLED_MODE_BREATHING:
case ASRLED_MODE_STROBE:
case ASRLED_MODE_SPECTRUM_CYCLE:
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 3 bytes in R/G/B order |
\*-----------------------------------------------------*/
default:
case ASRLED_MODE_STATIC:
case ASRLED_MODE_MUSIC:
bus->i2c_smbus_write_block_data(dev, active_mode, 3, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 1 byte - speed |
\*-----------------------------------------------------*/
case ASRLED_MODE_RANDOM:
case ASRLED_MODE_WAVE:
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &active_speed);
break;
/*-----------------------------------------------------*\
| These modes take no bytes |
\*-----------------------------------------------------*/
case ASRLED_MODE_OFF:
break;
}
std::this_thread::sleep_for(1ms);
break;
case ASROCK_TYPE_POLYCHROME_V1:
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
if(active_mode != ASRLED_MODE_OFF)
{
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
}
switch(active_mode)
{
/*-----------------------------------------------------*\
| These modes take 4 bytes in R/G/B/S order |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_BREATHING:
case POLYCHROME_V1_MODE_STROBE:
case POLYCHROME_V1_MODE_SPECTRUM_CYCLE:
case POLYCHROME_V1_MODE_SPRING:
case POLYCHROME_V1_MODE_METEOR:
case POLYCHROME_V1_MODE_STACK:
case POLYCHROME_V1_MODE_CRAM:
case POLYCHROME_V1_MODE_SCAN:
case POLYCHROME_V1_MODE_NEON:
case POLYCHROME_V1_MODE_WATER:
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 3 bytes in R/G/B order |
\*-----------------------------------------------------*/
default:
case POLYCHROME_V1_MODE_STATIC:
case POLYCHROME_V1_MODE_MUSIC:
bus->i2c_smbus_write_block_data(dev, active_mode, 3, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 1 byte - speed |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_RANDOM:
case POLYCHROME_V1_MODE_WAVE:
case POLYCHROME_V1_MODE_RAINBOW:
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &active_speed);
break;
/*-----------------------------------------------------*\
| These modes take no bytes |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_OFF:
break;
}
std::this_thread::sleep_for(1ms);
break;
case ASROCK_TYPE_POLYCHROME_V2:
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
switch(active_mode)
{
case POLYCHROME_V2_MODE_OFF:
case POLYCHROME_V2_MODE_RAINBOW:
case POLYCHROME_V2_MODE_SPECTRUM_CYCLE:
break;
default:
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Polychrome firmware always writes color to fixed reg |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_COLOR, 3, color_speed_pkt);
std::this_thread::sleep_for(1ms);
break;
}
break;
}
}
void PolychromeController::SetMode(unsigned char zone,unsigned char mode, unsigned char speed)
{
unsigned char led_count_pkt[1] = { 0x00 };
active_zone = zone;
active_mode = mode;
active_speed = speed;
switch(asrock_type)
{
case ASROCK_TYPE_ASRLED:
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
break;
case ASROCK_TYPE_POLYCHROME_V1:
/*-----------------------------------------------------*\
| Make sure set all register is set to 0 |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_SET_ALL, 1, led_count_pkt);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Set the zone we are working on |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, &active_zone);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Write the mode |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
break;
case ASROCK_TYPE_POLYCHROME_V2:
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Select a single LED |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_LED_COUNT, 0, led_count_pkt);
std::this_thread::sleep_for(1ms);
switch(active_mode)
{
/*-----------------------------------------------------*\
| These modes don't take a speed |
\*-----------------------------------------------------*/
case POLYCHROME_V2_MODE_OFF:
case POLYCHROME_V2_MODE_STATIC:
break;
/*-----------------------------------------------------*\
| All other modes, write speed to active mode register |
\*-----------------------------------------------------*/
default:
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &speed);
std::this_thread::sleep_for(1ms);
break;
}
break;
}
}
@@ -1,92 +0,0 @@
#include "Detector.h"
#include "ASRockPolychromeSMBusController.h"
#include "LogManager.h"
#include "RGBController.h"
#include "RGBController_ASRockPolychromeSMBus.h"
#include "i2c_smbus.h"
#include "pci_ids.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
/******************************************************************************************\
* *
* TestForPolychromeSMBusController *
* *
* Tests the given address to see if an ASRock Polychrome RGB controller exists there.*
* First does a quick write to test for a response *
* *
\******************************************************************************************/
bool TestForPolychromeSMBusController(i2c_smbus_interface* bus, unsigned char address)
{
bool pass = false;
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
if (res >= 0)
{
pass = true;
}
return(pass);
} /* TestForPolychromeController() */
/******************************************************************************************\
* *
* DetectPolychromeControllers *
* *
* Detect ASRock Polychrome RGB SMBus controllers on the enumerated I2C busses at *
* address 0x6A. *
* *
* bus - pointer to i2c_smbus_interface where Polychrome device is connected *
* dev - I2C address of Polychrome device *
* *
\******************************************************************************************/
void DetectPolychromeSMBusControllers(std::vector<i2c_smbus_interface*>& busses)
{
PolychromeController* new_polychrome;
RGBController_Polychrome* new_controller;
for (unsigned int bus = 0; bus < busses.size(); bus++)
{
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
{
if(busses[bus]->pci_subsystem_vendor == ASROCK_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
// Check for Polychrome controller at 0x6A
if (TestForPolychromeSMBusController(busses[bus], SMBUS_ADDRESS))
{
LOG_DEBUG("[%s] Detected a device at address %02X, testing for a known controller", ASROCK_DETECTOR_NAME, SMBUS_ADDRESS);
new_polychrome = new PolychromeController(busses[bus], SMBUS_ADDRESS);
if(new_polychrome->GetASRockType() != ASROCK_TYPE_UNKNOWN)
{
LOG_DEBUG("[%s] Found a known Polychrome device", ASROCK_DETECTOR_NAME);
new_controller = new RGBController_Polychrome(new_polychrome);
ResourceManager::get()->RegisterRGBController(new_controller);
}
else
{
LOG_DEBUG("[%s] Not a Polychrome device or unknown type", ASROCK_DETECTOR_NAME);
delete new_polychrome;
}
}
else
{
LOG_DEBUG("[%s] Bus %02d no response at %02X", ASROCK_DETECTOR_NAME, bus, SMBUS_ADDRESS);
}
}
else
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_FAILURE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME);
}
}
}
} /* DetectSMBusPolychromeControllers() */
REGISTER_I2C_DETECTOR("ASRock Polychrome SMBus", DetectPolychromeSMBusControllers);
@@ -1,642 +0,0 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromeSMBus.cpp |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#include "RGBController_ASRockPolychromeSMBus.h"
#define ASROCK_MAX_ZONES 4
#define ASROCK_MAX_LEDS 22
static const char* polychrome_v1_zone_names[] =
{
"RGB LED 1 Header",
"RGB LED 2 Header",
"PCH",
"IO Cover",
"Audio",
"Addressable Header"
};
static const char* polychrome_v2_zone_names[] =
{
"RGB LED 1 Header",
"RGB LED 2 Header",
"Audio",
"PCH",
"IO Cover",
"Addressable Header"
};
RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychrome_ptr)
{
polychrome = polychrome_ptr;
name = polychrome->GetDeviceName();
vendor = "ASRock";
version = polychrome->GetFirmwareVersion();
type = DEVICE_TYPE_MOTHERBOARD;
location = polychrome->GetDeviceLocation();
switch(polychrome->GetASRockType())
{
case ASROCK_TYPE_ASRLED:
{
description = "ASRock ASR RGB LED Device";
mode Off;
Off.name = "Off";
Off.value = ASRLED_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = ASRLED_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = ASRLED_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.speed_min = ASRLED_SPEED_MIN;
Breathing.speed_max = ASRLED_SPEED_MAX;
Breathing.speed = ASRLED_SPEED_DEFAULT;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = ASRLED_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Strobe.speed_min = ASRLED_SPEED_MIN;
Strobe.speed_max = ASRLED_SPEED_MAX;
Strobe.speed = ASRLED_SPEED_DEFAULT;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = ASRLED_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED;
SpectrumCycle.speed_min = ASRLED_SPEED_MIN;
SpectrumCycle.speed_max = ASRLED_SPEED_MAX;
SpectrumCycle.speed = ASRLED_SPEED_DEFAULT;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = ASRLED_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED;
Random.speed_min = ASRLED_SPEED_MIN;
Random.speed_max = ASRLED_SPEED_MAX;
Random.speed = ASRLED_SPEED_DEFAULT;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Music;
Music.name = "Music";
Music.value = ASRLED_MODE_MUSIC;
Music.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Music.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Music);
mode Wave;
Wave.name = "Wave";
Wave.value = ASRLED_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED;
Wave.speed_min = ASRLED_SPEED_MIN;
Wave.speed_max = ASRLED_SPEED_MAX;
Wave.speed = ASRLED_SPEED_DEFAULT;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
}
break;
case ASROCK_TYPE_POLYCHROME_V1:
{
description = "ASRock Polychrome v1 Device";
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_V1_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = POLYCHROME_V1_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = POLYCHROME_V1_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.speed_min = POLYCHROME_V1_SPEED_MIN_BREATHING;
Breathing.speed_max = POLYCHROME_V1_SPEED_MAX_BREATHING;
Breathing.speed = POLYCHROME_V1_SPEED_DEFAULT_BREATHING;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = POLYCHROME_V1_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Strobe.speed_min = POLYCHROME_V1_SPEED_MIN_STROBE;
Strobe.speed_max = POLYCHROME_V1_SPEED_MAX_STROBE;
Strobe.speed = POLYCHROME_V1_SPEED_DEFAULT_STROBE;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = POLYCHROME_V1_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED;
SpectrumCycle.speed_min = POLYCHROME_V1_SPEED_MIN_CYCLE;
SpectrumCycle.speed_max = POLYCHROME_V1_SPEED_MAX_CYCLE;
SpectrumCycle.speed = POLYCHROME_V1_SPEED_DEFAULT_CYCLE;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = POLYCHROME_V1_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED;
Random.speed_min = POLYCHROME_V1_SPEED_MIN_RANDOM;
Random.speed_max = POLYCHROME_V1_SPEED_MAX_RANDOM;
Random.speed = POLYCHROME_V1_SPEED_DEFAULT_RANDOM;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Music;
Music.name = "Music";
Music.value = POLYCHROME_V1_MODE_MUSIC;
Music.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Music.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Music);
mode Wave;
Wave.name = "Wave";
Wave.value = POLYCHROME_V1_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED;
Wave.speed_min = POLYCHROME_V1_SPEED_MIN_WAVE;
Wave.speed_max = POLYCHROME_V1_SPEED_MAX_WAVE;
Wave.speed = POLYCHROME_V1_SPEED_DEFAULT_WAVE;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
/*---------------------------------------------------------------------*\
| Comment out until per zone modes are working. These are only for ARGB |
\*---------------------------------------------------------------------*/
/*
mode Spring;
Spring.name = "Spring";
Spring.value = POLYCHROME_V1_MODE_SPRING;
Spring.flags = MODE_FLAG_HAS_SPEED;
Spring.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Spring.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Spring.speed = POLYCHROME_V1_SPEED_DEFAULT_SPRING;
Spring.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Spring);
mode Stack;
Stack.name = "Stack";
Stack.value = POLYCHROME_V1_MODE_STACK;
Stack.flags = MODE_FLAG_HAS_SPEED;
Stack.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Stack.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Stack.speed = POLYCHROME_V1_SPEED_DEFAULT_STACK;
Stack.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Stack);
mode Cram;
Cram.name = "Cram";
Cram.value = POLYCHROME_V1_MODE_CRAM;
Cram.flags = MODE_FLAG_HAS_SPEED;
Cram.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Cram.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Cram.speed = POLYCHROME_V1_SPEED_DEFAULT_CRAM;
Cram.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Cram);
mode Scan;
Scan.name = "Scan";
Scan.value = POLYCHROME_V1_MODE_SCAN;
Scan.flags = MODE_FLAG_HAS_SPEED;
Scan.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Scan.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Scan.speed = POLYCHROME_V1_SPEED_DEFAULT_SCAN;
Scan.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Scan);
mode Neon;
Neon.name = "Neon";
Neon.value = POLYCHROME_V1_MODE_NEON;
Neon.flags = MODE_FLAG_HAS_SPEED;
Neon.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Neon.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Neon.speed = POLYCHROME_V1_SPEED_DEFAULT_NEON;
Neon.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Neon);
mode Water;
Water.name = "Water";
Water.value = POLYCHROME_V1_MODE_WATER;
Water.flags = MODE_FLAG_HAS_SPEED;
Water.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Water.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Water.speed = POLYCHROME_V1_SPEED_DEFAULT_WATER;
Water.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Water);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = POLYCHROME_V1_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED;
Rainbow.speed_min = POLYCHROME_V1_SPEED_MIN_RAINBOW;
Rainbow.speed_max = POLYCHROME_V1_SPEED_MAX_RAINBOW;
Rainbow.speed = POLYCHROME_V1_SPEED_DEFAULT_RAINBOW;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
*/
}
break;
case ASROCK_TYPE_POLYCHROME_V2:
{
description = "ASRock Polychrome v2 Device";
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_V2_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = POLYCHROME_V2_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = POLYCHROME_V2_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.speed_min = POLYCHROME_V2_SPEED_MIN;
Breathing.speed_max = POLYCHROME_V2_SPEED_MAX;
Breathing.speed = POLYCHROME_V2_SPEED_DEFAULT;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = POLYCHROME_V2_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
Strobe.speed_min = POLYCHROME_V2_SPEED_MIN;
Strobe.speed_max = POLYCHROME_V2_SPEED_MAX;
Strobe.speed = POLYCHROME_V2_SPEED_DEFAULT;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = POLYCHROME_V2_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED;
SpectrumCycle.speed_min = POLYCHROME_V2_SPEED_MIN;
SpectrumCycle.speed_max = POLYCHROME_V2_SPEED_MAX;
SpectrumCycle.speed = POLYCHROME_V2_SPEED_DEFAULT;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = POLYCHROME_V2_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED;
Random.speed_min = POLYCHROME_V2_SPEED_MIN;
Random.speed_max = POLYCHROME_V2_SPEED_MAX;
Random.speed = POLYCHROME_V2_SPEED_DEFAULT;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Wave;
Wave.name = "Wave";
Wave.value = POLYCHROME_V2_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED;
Wave.speed_min = POLYCHROME_V2_SPEED_MIN;
Wave.speed_max = POLYCHROME_V2_SPEED_MAX;
Wave.speed = POLYCHROME_V2_SPEED_DEFAULT;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
mode Spring;
Spring.name = "Spring";
Spring.value = POLYCHROME_V2_MODE_SPRING;
Spring.flags = MODE_FLAG_HAS_SPEED;
Spring.speed_min = POLYCHROME_V2_SPEED_MIN;
Spring.speed_max = POLYCHROME_V2_SPEED_MAX;
Spring.speed = POLYCHROME_V2_SPEED_DEFAULT;
Spring.color_mode = MODE_COLORS_NONE;
modes.push_back(Spring);
mode Stack;
Stack.name = "Stack";
Stack.value = POLYCHROME_V2_MODE_STACK;
Stack.flags = MODE_FLAG_HAS_SPEED;
Stack.speed_min = POLYCHROME_V2_SPEED_MIN;
Stack.speed_max = POLYCHROME_V2_SPEED_MAX;
Stack.speed = POLYCHROME_V2_SPEED_DEFAULT;
Stack.color_mode = MODE_COLORS_NONE;
modes.push_back(Stack);
mode Cram;
Cram.name = "Cram";
Cram.value = POLYCHROME_V2_MODE_CRAM;
Cram.flags = MODE_FLAG_HAS_SPEED;
Cram.speed_min = POLYCHROME_V2_SPEED_MIN;
Cram.speed_max = POLYCHROME_V2_SPEED_MAX;
Cram.speed = POLYCHROME_V2_SPEED_DEFAULT;
Cram.color_mode = MODE_COLORS_NONE;
modes.push_back(Cram);
mode Scan;
Scan.name = "Scan";
Scan.value = POLYCHROME_V2_MODE_SCAN;
Scan.flags = MODE_FLAG_HAS_SPEED;
Scan.speed_min = POLYCHROME_V2_SPEED_MIN;
Scan.speed_max = POLYCHROME_V2_SPEED_MAX;
Scan.speed = POLYCHROME_V2_SPEED_DEFAULT;
Scan.color_mode = MODE_COLORS_NONE;
modes.push_back(Scan);
mode Neon;
Neon.name = "Neon";
Neon.value = POLYCHROME_V2_MODE_NEON;
Neon.flags = 0;
Neon.color_mode = MODE_COLORS_NONE;
modes.push_back(Neon);
mode Water;
Water.name = "Water";
Water.value = POLYCHROME_V2_MODE_WATER;
Water.flags = MODE_FLAG_HAS_SPEED;
Water.speed_min = POLYCHROME_V2_SPEED_MIN;
Water.speed_max = POLYCHROME_V2_SPEED_MAX;
Water.speed = POLYCHROME_V2_SPEED_DEFAULT;
Water.color_mode = MODE_COLORS_NONE;
modes.push_back(Water);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = POLYCHROME_V2_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED;
Rainbow.speed_min = POLYCHROME_V2_SPEED_MIN;
Rainbow.speed_max = POLYCHROME_V2_SPEED_MAX;
Rainbow.speed = POLYCHROME_V2_SPEED_DEFAULT;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
}
break;
}
SetupZones();
}
RGBController_Polychrome::~RGBController_Polychrome()
{
delete polychrome;
}
void RGBController_Polychrome::SetupZones()
{
switch(polychrome->GetASRockType())
{
/*---------------------------------------------------------*\
| ASR LED motherboards only have a single zone/LED |
\*---------------------------------------------------------*/
case ASROCK_TYPE_ASRLED:
{
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
zone* new_zone = new zone();
/*---------------------------------------------------------*\
| Set single zone name to "Motherboard" |
\*---------------------------------------------------------*/
new_zone->name = "Motherboard";
new_zone->type = ZONE_TYPE_SINGLE;
new_zone->leds_min = 1;
new_zone->leds_max = 1;
new_zone->leds_count = 1;
new_zone->matrix_map = NULL;
/*---------------------------------------------------------*\
| Push new zone to zones vector |
\*---------------------------------------------------------*/
zones.push_back(*new_zone);
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
led* new_led = new led();
/*---------------------------------------------------------*\
| Set single LED name to "Motherboard" |
\*---------------------------------------------------------*/
new_led->name = "Motherboard";
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
\*---------------------------------------------------------*/
leds.push_back(*new_led);
}
break;
/*---------------------------------------------------------*\
| Polychrome motherboards should set up zones based on LED |
| configuration register read from device |
\*---------------------------------------------------------*/
case ASROCK_TYPE_POLYCHROME_V1:
case ASROCK_TYPE_POLYCHROME_V2:
{
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_ZONE_COUNT; zone_idx++)
{
if(polychrome->zone_led_count[zone_idx] > 0)
{
zone* new_zone = new zone();
/*---------------------------------------------------------*\
| Set zone name to channel name |
\*---------------------------------------------------------*/
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
new_zone->name = polychrome_v1_zone_names[zone_idx];
}
else
{
new_zone->name = polychrome_v2_zone_names[zone_idx];
}
if(zone_idx == POLYCHROME_ZONE_ADDRESSABLE)
{
new_zone->leds_min = 1;
new_zone->leds_max = 1;
new_zone->leds_count = 1;
}
else
{
new_zone->leds_min = polychrome->zone_led_count[zone_idx];
new_zone->leds_max = polychrome->zone_led_count[zone_idx];
new_zone->leds_count = polychrome->zone_led_count[zone_idx];
}
if(new_zone->leds_count > 1)
{
new_zone->type = ZONE_TYPE_LINEAR;
}
else
{
new_zone->type = ZONE_TYPE_SINGLE;
}
new_zone->matrix_map = NULL;
/*---------------------------------------------------------*\
| Push new zone to zones vector |
\*---------------------------------------------------------*/
zones.push_back(*new_zone);
}
}
unsigned int led_count = 0;
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_ZONE_COUNT; zone_idx++)
{
if(polychrome->zone_led_count[zone_idx] > 0)
{
for(unsigned int led_idx = 0; led_idx < polychrome->zone_led_count[zone_idx]; led_idx++)
{
/*---------------------------------------------------------*\
| Each zone only has one LED |
\*---------------------------------------------------------*/
led* new_led = new led();
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
new_led->name = polychrome_v1_zone_names[zone_idx];
}
else
{
new_led->name = polychrome_v2_zone_names[zone_idx];
}
new_led->name.append(" " + std::to_string(led_idx + 1));
new_led->value = 0;
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
new_led->value = zone_idx;
}
else if(zone_idx == POLYCHROME_ZONE_ADDRESSABLE)
{
new_led->value = 0x19;
}
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
\*---------------------------------------------------------*/
leds.push_back(*new_led);
led_count++;
if(zone_idx == POLYCHROME_ZONE_ADDRESSABLE)
{
break;
}
}
}
}
}
break;
}
SetupColors();
}
void RGBController_Polychrome::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_Polychrome::DeviceUpdateLEDs()
{
for (std::size_t led = 0; led < colors.size(); led++)
{
UpdateSingleLED(led);
}
}
void RGBController_Polychrome::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_Polychrome::UpdateSingleLED(int led)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
/*---------------------------------------------------------*\
| If the LED value is non-zero, this LED overrides the LED |
| index |
\*---------------------------------------------------------*/
if(leds[led].value != 0)
{
led = leds[led].value;
}
polychrome->SetColorsAndSpeed(led, red, grn, blu);
}
void RGBController_Polychrome::SetCustomMode()
{
active_mode = 1;
}
void RGBController_Polychrome::DeviceUpdateMode()
{
if(polychrome->GetASRockType() == ASROCK_TYPE_POLYCHROME_V1)
{
for(unsigned int led_idx = 0; led_idx <= leds.size(); led_idx++)
{
polychrome->SetMode(led_idx, modes[active_mode].value, modes[active_mode].speed);
}
}
else
{
polychrome->SetMode(0, modes[active_mode].value, modes[active_mode].speed);
}
DeviceUpdateLEDs();
}
@@ -5,21 +5,37 @@
| lighting controller |
| |
| Ed Kambulow (dredvard) 12/20/2020 |
| Shady Nawara (ShadyNawara) 01/16/2023 |
\*-----------------------------------------*/
#include "RGBController.h"
#include "ASRockPolychromeUSBController.h"
#include <cstring>
#include <stdio.h>
#include "RGBController.h"
#include "ResourceManager.h"
#include "ASRockPolychromeUSBController.h"
#include "dependencies/dmiinfo.h"
#define POLYCHROME_USB_READ_ZONE_CONFIG 0x11
#define POLYCHROME_USB_READ_HEADER 0x14
#define POLYCHROME_USB_WRITE_HEADER 0x15
#define POLYCHROME_USB_SET_ZONE 0x10
#define POLYCHROME_USB_INITIAL_CHUNK 0xE3
#define POLYCHROME_USB_SEND_CHUNK 0xE4
#define POLYCHROME_USB_INIT 0xA4
#define POLYCHROME_USB_COMMIT 0x12
const char* polychrome_USB_zone_names[] =
{
"RGB LED 1 Header",
"RGB LED 2 Header",
"Addressable Header 1",
"Addressable Header 2",
"PCH",
"IO Cover",
"PCB",
"Addressable Header 3/Audio",
};
PolychromeUSBController::PolychromeUSBController(hid_device* dev_handle, const char* path)
{
DMIInfo dmi;
@@ -70,16 +86,69 @@ std::string PolychromeUSBController::GetSerialString()
void PolychromeUSBController::SetDeviceInfo()
{
PolychromeDeviceInfo newdev_info;
ReadConfigTables();
/*--------------------------------------------------*\
| Read settings to check for configured RGSwap |
\*--------------------------------------------------*/
const std::string detector_name = "ASRock Polychrome USB";
const std::string json_rgswap = "RGSwap";
SettingsManager* settings_manager = ResourceManager::get()->GetSettingsManager();
json device_settings = settings_manager->GetSettings(detector_name);
/*---------------------------------------------------------*\
| Get RGSwap settings from the settings manager |
| If RGSwap settings are not found then write them out |
| Onboard leds are set to their existing values, |
| Addressable RGB and RGB headers are set to false |
\*---------------------------------------------------------*/
if(!device_settings.contains(json_rgswap))
{
device_settings[json_rgswap][polychrome_USB_zone_names[0]] = false;
device_settings[json_rgswap][polychrome_USB_zone_names[1]] = false;
device_settings[json_rgswap][polychrome_USB_zone_names[2]] = false;
device_settings[json_rgswap][polychrome_USB_zone_names[3]] = false;
device_settings[json_rgswap][polychrome_USB_zone_names[4]] = ((configtable[8] >> 4) & 1) ? true : false;
device_settings[json_rgswap][polychrome_USB_zone_names[5]] = ((configtable[8] >> 5) & 1) ? true : false;
device_settings[json_rgswap][polychrome_USB_zone_names[6]] = ((configtable[8] >> 6) & 1) ? true : false;
device_settings[json_rgswap][polychrome_USB_zone_names[7]] = false;
settings_manager->SetSettings(detector_name, device_settings);
settings_manager->SaveSettings();
}
else
{
for(std::size_t idx = 0; idx < 8; idx++)
{
if(device_settings[json_rgswap].contains(polychrome_USB_zone_names[idx]))
{
rgswapconfig[idx] = device_settings[json_rgswap][polychrome_USB_zone_names[idx]];
}
}
}
bool rgswap_final[8] = {0};
for (unsigned int zonecnt = 0; zonecnt < POLYCHROME_USB_ZONE_MAX_NUM; zonecnt++)
{
if(configtable[zonecnt] == 0x1E)
if(configtable[zonecnt] == 0x1E || !((configtable[9] >> zonecnt) & 1))
{
break;
/*-----------------------------------------------------------------------*\
| If we don't have this device type (0x1E) we will skip it and continue. |
| Or if the device is not available we skip it and continue |
\*-----------------------------------------------------------------------*/
continue;
}
newdev_info.num_leds = configtable[zonecnt];
newdev_info.rgswap = ((configtable[8] >> zonecnt) & 1) || rgswapconfig[zonecnt];
rgswap_final[zonecnt] = newdev_info.rgswap;
/*--------------------------------------------------------------------------------------------------*\
| We will need to know what zone type this is, so that we can look up the name and make calls later. |
\*--------------------------------------------------------------------------------------------------*/
newdev_info.zone_type = zonecnt;
switch (zonecnt)
{
@@ -88,6 +157,11 @@ void PolychromeUSBController::SetDeviceInfo()
\*-----------------------------------------*/
case POLYCHROME_USB_ZONE_ARGB1:
case POLYCHROME_USB_ZONE_ARGB2:
/*---------------------------------------------*\
| The last led channel is allocated to a |
| third ARGB header on some newer motherboards |
\*---------------------------------------------*/
case POLYCHROME_USB_ZONE_AUDIO:
newdev_info.device_type = PolychromeDeviceType::ADDRESSABLE;
break;
@@ -97,10 +171,9 @@ void PolychromeUSBController::SetDeviceInfo()
case POLYCHROME_USB_ZONE_PCH:
case POLYCHROME_USB_ZONE_IOCOVER:
case POLYCHROME_USB_ZONE_PCB:
case POLYCHROME_USB_ZONE_AUDIO:
newdev_info.device_type = PolychromeDeviceType::FIXED;
break;
/*-----------------------------------------*\
| Type: Fixed |
\*-----------------------------------------*/
@@ -113,6 +186,26 @@ void PolychromeUSBController::SetDeviceInfo()
device_info.push_back(newdev_info);
}
// set rgswap to match our settings
WriteRGSwap(rgswap_final[0], rgswap_final[1], rgswap_final[2], rgswap_final[3], rgswap_final[4], rgswap_final[5], rgswap_final[6], rgswap_final[7]);
}
void PolychromeUSBController::ResizeZone(int zone, int new_size)
{
unsigned char zonecfg[POLYCHROME_USB_ZONE_MAX_NUM];
memset(zonecfg, POLYCHROME_USB_ZONE_UNAVAILABLE, POLYCHROME_USB_ZONE_MAX_NUM);
configtable[zone] = new_size;
for(unsigned int i = 0; i < POLYCHROME_USB_ZONE_MAX_NUM; i++)
{
zonecfg[i] = configtable[i];
}
unsigned char zonecmd = POLYCHROME_USB_LEDCOUNT_CFG;
WriteHeader(zonecmd, zonecfg, sizeof(zonecfg));
}
void PolychromeUSBController::WriteZone
@@ -124,6 +217,12 @@ void PolychromeUSBController::WriteZone
bool allzone = false
)
{
/*----------------------------------------------------*\
| Get the device info so we can look up the zone type. |
\*----------------------------------------------------*/
PolychromeDeviceInfo device_info = GetPolychromeDevices()[zone];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
@@ -135,10 +234,20 @@ void PolychromeUSBController::WriteZone
| Set up message packet with leading 00 |
\*-----------------------------------------------------*/
usb_buf[0x01] = POLYCHROME_USB_SET_ZONE;
usb_buf[0x03] = zone;
usb_buf[0x03] = device_info.zone_type;
usb_buf[0x04] = mode;
usb_buf[0x05] = RGBGetRValue(rgb);
usb_buf[0x06] = RGBGetGValue(rgb);
if(device_info.rgswap)
{
usb_buf[0x05] = RGBGetRValue(rgb);
usb_buf[0x06] = RGBGetGValue(rgb);
}
else
{
usb_buf[0x05] = RGBGetGValue(rgb);
usb_buf[0x06] = RGBGetRValue(rgb);
}
usb_buf[0x07] = RGBGetBValue(rgb);
usb_buf[0x08] = speed;
usb_buf[0x09] = 0xFF;
@@ -151,34 +260,128 @@ void PolychromeUSBController::WriteZone
hid_read(dev, usb_buf, 64);
};
void PolychromeUSBController::WriteRGSwap
void PolychromeUSBController::WriteAllZones
(
bool ahdr1,
bool ahdr0,
bool hdr1,
bool hdr0
const std::vector<PolychromeZoneInfo>& zones_info,
const std::vector<zone>& zones
)
{
unsigned char usb_buf[65];
std::vector<unsigned char> combined_leds_rgb;
std::size_t max_led_count = 0;
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++){
PolychromeDeviceInfo device_info = GetPolychromeDevices()[zone_idx];
for(std::size_t led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
{
if(device_info.rgswap)
{
combined_leds_rgb.push_back(RGBGetRValue(zones[zone_idx].colors[led_idx]));
combined_leds_rgb.push_back(RGBGetGValue(zones[zone_idx].colors[led_idx]));
}
else
{
combined_leds_rgb.push_back(RGBGetGValue(zones[zone_idx].colors[led_idx]));
combined_leds_rgb.push_back(RGBGetRValue(zones[zone_idx].colors[led_idx]));
}
combined_leds_rgb.push_back(RGBGetBValue(zones[zone_idx].colors[led_idx]));
}
max_led_count += zones[zone_idx].leds_max;
}
combined_leds_rgb.resize((max_led_count + 8) * 3, 0);
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Set up message packet with leading 00 |
| Set up initial message packet with leading 00 |
\*-----------------------------------------------------*/
usb_buf[0x01] = POLYCHROME_USB_WRITE_HEADER;
usb_buf[0x01] = POLYCHROME_USB_SET_ZONE;
usb_buf[0x03] = 0xFF;
usb_buf[0x04] = POLYCHROME_USB_INITIAL_CHUNK;
usb_buf[0x07] = 0xFF;
usb_buf[0x40] = 0x65;
usb_buf[0x04] = POLYCHROME_USB_RGSWAP_CFG;
usb_buf[0x05] = ((ahdr1 << 3) & (ahdr0 << 2) & (hdr1 << 1) & hdr0) & 0x40;
std::size_t initial_led_offset = 9;
std::size_t message_byte_capacity = 54; // 18 leds * 3 bytes
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
hid_read(dev, usb_buf, 64);
std::size_t led_byte_idx = 0;
while(led_byte_idx < combined_leds_rgb.size())
{
for(std::size_t byte_idx = 0; byte_idx < message_byte_capacity; byte_idx++)
{
usb_buf[initial_led_offset + byte_idx] = combined_leds_rgb[led_byte_idx++];
if(led_byte_idx >= combined_leds_rgb.size())
{
break;
}
}
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Set up message packet with leading 00 |
\*-----------------------------------------------------*/
usb_buf[0x01] = POLYCHROME_USB_SET_ZONE;
usb_buf[0x03] = 0xFF;
usb_buf[0x04] = POLYCHROME_USB_SEND_CHUNK;
usb_buf[0x40] = 0x65;
initial_led_offset = 5;
message_byte_capacity = 57; // 19 leds * 3 bytes
}
}
/*-----------------------------------------------------*\
| If reset is true, rgswap is set to the values |
| specified in the settings file, otherwise set to off |
\*-----------------------------------------------------*/
void PolychromeUSBController::SetRGSwap(bool reset)
{
if(reset)
{
bool rg[8] = {0};
std::vector<PolychromeDeviceInfo> devices_info = GetPolychromeDevices();
for (PolychromeDeviceInfo device : devices_info)
{
rg[device.zone_type] = device.rgswap;
}
WriteRGSwap(rg[0], rg[1], rg[2], rg[3], rg[4], rg[5], rg[6], rg[7]);
}
else
{
/*-----------------------------------------------------------------*\
| Disable RGSwap as it causes flashing on each update in direct mode|
\*-----------------------------------------------------------------*/
WriteRGSwap(0, 0, 0, 0, 0, 0, 0, 0);
}
}
void PolychromeUSBController::WriteRGSwap
(
bool hdr0,
bool hdr1,
bool ahdr0,
bool ahdr1,
bool pch,
bool io,
bool pcb,
bool chnl8
)
{
unsigned char rgconfig[1] = {static_cast<unsigned char>(((chnl8 << 7) | (pcb << 6) | (io << 5) | (pch << 4) | (ahdr1 << 3) | (ahdr0 << 2) | (hdr1 << 1) | hdr0))};
WriteHeader(POLYCHROME_USB_RGSWAP_CFG, rgconfig, 1);
}
void PolychromeUSBController::WriteHeader
@@ -211,9 +414,13 @@ void PolychromeUSBController::WriteHeader
PolychromeZoneInfo PolychromeUSBController::GetZoneConfig(unsigned char zone)
{
/*-----------------------------------------------------*\
| Get the device info so we can look up the zone type |
\*-----------------------------------------------------*/
PolychromeDeviceInfo device_info = GetPolychromeDevices()[zone];
unsigned char usb_buf[65];
PolychromeZoneInfo zoneinfo;
//unsigned char all;
unsigned char r;
unsigned char g;
unsigned char b;
@@ -227,7 +434,7 @@ PolychromeZoneInfo PolychromeUSBController::GetZoneConfig(unsigned char zone)
| Set up config table request packet |
\*-----------------------------------------------------*/
usb_buf[0x01] = POLYCHROME_USB_READ_ZONE_CONFIG;
usb_buf[0x03] = zone;
usb_buf[0x03] = device_info.zone_type;
/*-----------------------------------------------------*\
| Send packet |
@@ -244,11 +451,25 @@ PolychromeZoneInfo PolychromeUSBController::GetZoneConfig(unsigned char zone)
g = usb_buf[0x06];
b = usb_buf[0x07];
zoneinfo.mode = usb_buf[0x04];
zoneinfo.color = ToRGBColor(r,g,b);
/*------------------------------------------------------*\
| Set Chroma mode (0xE2) & Per-Led mode (0xE3) as Direct |
\*------------------------------------------------------*/
zoneinfo.mode = usb_buf[0x04] != 0xE2 && usb_buf[0x04] != 0xE3 && usb_buf[0x04] < 0x0F ? usb_buf[0x04] : 0x0F;
/*------------------------------------------------------*\
| G & R are swapped since RGSwap is disabled on init, |
| Unless overwritten in settings |
\*------------------------------------------------------*/
if(device_info.rgswap)
{
zoneinfo.color = ToRGBColor(r,g,b);
}
else
{
zoneinfo.color = ToRGBColor(g,r,b);
}
zoneinfo.speed = usb_buf[0x08];
zoneinfo.zone = usb_buf[0x03];
//all = usb_buf[0x10];
return(zoneinfo);
}
@@ -257,7 +478,7 @@ void PolychromeUSBController::ReadConfigTables()
{
unsigned char usb_buf[65];
unsigned char maxzoneleds[8];
unsigned char rgbswap;
unsigned char rgswap;
unsigned char header1;
/*-----------------------------------------------------*\
@@ -284,7 +505,7 @@ void PolychromeUSBController::ReadConfigTables()
/*-----------------------------------------------------*\
| Reads in format: RGB1, RGB2, ARGB1, ARGB2, PCH, IO, |
| PCB, AUDIO |
| PCB, AUDIO/ARGB3 |
\*-----------------------------------------------------*/
memcpy(&maxzoneleds,&usb_buf[0x04],8);
@@ -304,10 +525,10 @@ void PolychromeUSBController::ReadConfigTables()
hid_read(dev, usb_buf, 64);
/*-----------------------------------------------------*\
| Reads bitwise in format: AUDIO, PCB, IO, PCH, ARGB2, |
| ARGB1, RGB2, RGB1 if available |
| Reads bitwise in format: AUDIO/ARGB3, PCB, IO, PCH, |
| ARGB2,ARGB1, RGB2, RGB1 if available |
\*-----------------------------------------------------*/
rgbswap=usb_buf[4];
rgswap=usb_buf[4];
/*-----------------------------------------------------*\
| Zero out buffer |
@@ -323,10 +544,15 @@ void PolychromeUSBController::ReadConfigTables()
hid_write(dev, usb_buf, 64);
memset(usb_buf, 0x00, sizeof(usb_buf));
hid_read(dev, usb_buf, 64);
/*-----------------------------------------------------*\
| Reads bitwise in format: AUDIO/ARGB3, PCB, IO, PCH, |
| ARGB2,ARGB1, RGB2, RGB1 if available |
\*-----------------------------------------------------*/
header1=usb_buf[4];
memcpy(configtable,&maxzoneleds,8);
configtable[8]=rgbswap;
configtable[8]=rgswap;
configtable[9]=header1;
return;
}
@@ -5,6 +5,7 @@
| lighting controller |
| |
| Ed Kambulow (dredvard) 12/20/2020 |
| Shady Nawara (ShadyNawara) 01/16/2023 |
\*-----------------------------------------*/
#include "RGBController.h"
@@ -16,7 +17,7 @@
/*----------------------------------------------------------------------------------------------*\
| Definitions for Polychrome USB |
\*----------------------------------------------------------------------------------------------*/
#define POLYCHROME_USB_NUM_MODES 15 /* Number of Polychrome USB modes */
#define POLYCHROME_USB_NUM_MODES 16 /* Number of Polychrome USB modes */
enum
{
@@ -35,6 +36,7 @@ enum
POLYCHROME_USB_MODE_NEON = 0x0C, /* Neon effect mode */
POLYCHROME_USB_MODE_WATER = 0x0D, /* Water effect mode */
POLYCHROME_USB_MODE_RAINBOW = 0x0E, /* Rainbow effect mode */
POLYCHROME_USB_MODE_DIRECT = 0x0F, /* CHROMA CONNECT effect mode */
};
enum
@@ -57,17 +59,7 @@ enum
POLYCHROME_USB_ZONE_UNAVAILABLE = 0x1E, // Value from LEDCOUNT CFG if zone not present
};
static const char* polychrome_USB_zone_names[] =
{
"RGB LED 1 Header",
"RGB LED 2 Header",
"Addressable Header 1",
"Addressable Header 2",
"PCH",
"IO Cover",
"PCB",
"Audio",
};
extern const char* polychrome_USB_zone_names[];
enum
{
@@ -78,7 +70,7 @@ enum
POLYCHROME_USB_ZONE_PCH = 0X04, // PCH
POLYCHROME_USB_ZONE_IOCOVER = 0X05, // IOCOVER
POLYCHROME_USB_ZONE_PCB = 0X06, // PCB - Could be mixed swapped with 0x07
POLYCHROME_USB_ZONE_AUDIO = 0X07 // AUDIO
POLYCHROME_USB_ZONE_AUDIO = 0X07 // AUDIO/ARGB Header 3
};
enum class PolychromeDeviceType
@@ -99,6 +91,8 @@ struct PolychromeDeviceInfo
{
unsigned char effect_channel;
unsigned char num_leds;
unsigned char zone_type;
bool rgswap;
PolychromeDeviceType device_type;
};
@@ -126,6 +120,12 @@ public:
bool allzone
);
void WriteAllZones
(
const std::vector<PolychromeZoneInfo> &zones_info,
const std::vector<zone> &zones
);
void WriteHeader
(
unsigned char cfg,
@@ -133,17 +133,31 @@ public:
unsigned int configsize
);
void ResizeZone(int zone, int new_size);
void SetRGSwap(bool reset);
protected:
hid_device* dev;
std::vector<PolychromeDeviceInfo> device_info;
std::string location;
void WriteRGSwap(bool ahdr1, bool ahdr0, bool hdr1, bool hdr0);
void WriteRGSwap
(
bool hdr0,
bool hdr1,
bool ahdr0,
bool ahdr1,
bool pch,
bool io,
bool pcb,
bool chnl8
);
private:
unsigned int led_count;
std::string device_name;
unsigned char configtable[12];
bool rgswapconfig[8] = { 0 };
void SetDeviceInfo();
void ReadConfigTables();
@@ -5,6 +5,7 @@
| ASRock Polychrome USB Driver |
| |
| Ed Kambulow (Dredvard) 12/26/2020 |
| Shady Nawara (ShadyNawara) 01/16/2023 |
\*-----------------------------------------*/
#include "RGBController_ASRockPolychromeUSB.h"
@@ -13,15 +14,26 @@
#define ASROCK_USB_MAX_ZONES 8
#define ASROCK_ADDRESSABLE_MAX_LEDS 100
RGBController_PolychromeUSB::RGBController_PolychromeUSB(PolychromeUSBController* polychrome_ptr)
{
polychrome = polychrome_ptr;
/**------------------------------------------------------------------*\
@name ASrock Polychrome USB
@category Motherboard
@type USB
@save :robot:
@direct :x:
@effects :white_check_mark:
@detectors DetectPolychromeUSBControllers
@comment ASRock Polychrome controllers will save with each update.
\*-------------------------------------------------------------------*/
name = polychrome->GetDeviceName();
RGBController_PolychromeUSB::RGBController_PolychromeUSB(PolychromeUSBController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
description = "ASRock Polychrome USB Device";
vendor = "ASRock";
type = DEVICE_TYPE_MOTHERBOARD;
location = polychrome->GetDeviceLocation();
location = controller->GetDeviceLocation();
mode Off;
Off.name = "Off";
@@ -161,12 +173,14 @@ RGBController_PolychromeUSB::RGBController_PolychromeUSB(PolychromeUSBController
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
SetupZones();
mode Direct;
Direct.name = "Direct";
Direct.value = POLYCHROME_USB_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
/*-------------------------------------------------*\
| Initialize active mode |
\*-------------------------------------------------*/
active_mode = GetDeviceMode(1);
SetupZones();
}
void RGBController_PolychromeUSB::SetupZones()
@@ -176,31 +190,31 @@ void RGBController_PolychromeUSB::SetupZones()
\*-------------------------------------------------*/
leds.clear();
colors.clear();
zones.resize(polychrome->GetChannelCount());
zones.resize(controller->GetChannelCount());
/*-------------------------------------------------*\
| Set zones and leds |
\*-------------------------------------------------*/
for(unsigned int channel_idx = 0; channel_idx < zones.size(); channel_idx++)
{
PolychromeDeviceInfo device_info = polychrome->GetPolychromeDevices()[channel_idx];
PolychromeDeviceInfo device_info = controller->GetPolychromeDevices()[channel_idx];
zones[channel_idx].type = ZONE_TYPE_LINEAR;
if(device_info.device_type== PolychromeDeviceType::ADDRESSABLE)
{
zones[channel_idx].name = polychrome_USB_zone_names[channel_idx];
zones[channel_idx].name = polychrome_USB_zone_names[device_info.zone_type];
zones[channel_idx].leds_min = 0;
zones[channel_idx].leds_max = ASROCK_ADDRESSABLE_MAX_LEDS;
zones[channel_idx].leds_count = device_info.num_leds;
zones[channel_idx].leds_count = device_info.num_leds;
}
else if(device_info.device_type==PolychromeDeviceType::FIXED)
else if(device_info.device_type==PolychromeDeviceType::FIXED)
{
zones[channel_idx].name = polychrome_USB_zone_names[channel_idx];
zones[channel_idx].name = polychrome_USB_zone_names[device_info.zone_type];
zones[channel_idx].leds_min = device_info.num_leds;
zones[channel_idx].leds_max = device_info.num_leds;
zones[channel_idx].leds_count = device_info.num_leds;
}
zones[channel_idx].leds_count = device_info.num_leds;
}
for(unsigned int led_ch_idx = 0; led_ch_idx < zones[channel_idx].leds_count; led_ch_idx++)
@@ -219,16 +233,6 @@ void RGBController_PolychromeUSB::SetupZones()
SetupColors();
/*---------------------------------------------------------*\
| Initialize colors for each LED |
\*---------------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
unsigned char led = (unsigned char)leds[led_idx].value;
colors[led_idx] = polychrome->GetZoneConfig(led).color; // TODO Get addressable instead of zone idx
}
/*---------------------------------------------------------*\
| Initialize zone info to track zone, speed, mode |
| B550 Boards have modes, speed for each zone |
@@ -236,34 +240,50 @@ void RGBController_PolychromeUSB::SetupZones()
for (unsigned int channel_idx = 0; channel_idx < zones.size(); channel_idx++)
{
PolychromeZoneInfo zoneinfo;
zoneinfo = polychrome->GetZoneConfig(channel_idx);
zoneinfo = controller->GetZoneConfig(channel_idx);
zones_info.push_back(zoneinfo);
}
/*---------------------------------------------------------*\
| Initialize colors for each LED |
| We cannot currently get the individual led color so |
| we use the zone color in each zone to set all leds |
| !!TODO: in Per-Led mode, zone color is always black |
\*---------------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
unsigned char led = (unsigned char)leds[led_idx].value;
colors[led_idx] = zones_info[led].color;
}
/*-------------------------------------------------*\
| Initialize active mode |
\*-------------------------------------------------*/
active_mode = zones_info.size() > 1 ? zones_info[0].mode : 0x0;
/*-----------------------------------------------------*\
| If in Direct mode, reset all Leds to match interface |
\*-----------------------------------------------------*/
if(active_mode == 0x0F)
{
controller->WriteAllZones(zones_info, zones);
}
}
void RGBController_PolychromeUSB::ResizeZone(int zone, int new_size)
{
unsigned char zonecfg[ASROCK_USB_MAX_ZONES];
/*---------------------------------------------------------*\
| This device does not currently support resizing zones |
\*---------------------------------------------------------*/
zones[zone].leds_count = (unsigned char) new_size;
memset(zonecfg, POLYCHROME_USB_ZONE_UNAVAILABLE, ASROCK_USB_MAX_ZONES);
for(unsigned int i = 0; i < zones.size(); i++)
{
zonecfg[i]=zones[i].leds_count;
}
// unsigned char zonecmd = POLYCHROME_USB_LEDCOUNT_CFG;
// WriteHeader(zonecmd, zonecfg, sizeof(zonecfg));
controller->ResizeZone(zones_info[zone].zone, new_size);
}
void RGBController_PolychromeUSB::DeviceUpdateLEDs()
{
if(POLYCHROME_USB_MODE_DIRECT == zones_info[0].mode )
{
controller->WriteAllZones(zones_info,zones);
return;
}
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
unsigned char set_mode = zones_info[zone_idx].mode;
@@ -273,7 +293,7 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
set_mode = active_mode;
}
polychrome->WriteZone(zone_idx, set_mode, zones_info[zone_idx].speed, zones[zone_idx].colors[0], false);
controller->WriteZone(zone_idx, set_mode, zones_info[zone_idx].speed, zones[zone_idx].colors[0], false);
}
}
@@ -286,7 +306,7 @@ void RGBController_PolychromeUSB::UpdateZoneLEDs(int zone)
set_mode = active_mode;
}
polychrome->WriteZone(zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
controller->WriteZone(zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
}
void RGBController_PolychromeUSB::UpdateSingleLED(int led)
@@ -299,26 +319,27 @@ void RGBController_PolychromeUSB::UpdateSingleLED(int led)
set_mode = active_mode;
}
polychrome->WriteZone(channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
controller->WriteZone(channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
}
unsigned char RGBController_PolychromeUSB::GetDeviceMode(unsigned char zone)
{
int dev_mode;
dev_mode = polychrome->GetZoneConfig(zone).mode;
dev_mode = controller->GetZoneConfig(zone).mode;
active_mode = dev_mode;
return(active_mode);
}
void RGBController_PolychromeUSB::SetCustomMode()
{
active_mode = POLYCHROME_USB_MODE_STATIC;
return(active_mode);
}
void RGBController_PolychromeUSB::DeviceUpdateMode()
{
/*-----------------------------------------------------------------*\
| Disable RGSwap as it causes flashing on each update in direct mode|
| Otherwise, reset to values specified in settings.json |
\*-----------------------------------------------------------------*/
controller->SetRGSwap(modes[active_mode].name != "Direct");
for(unsigned int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
if(zones[zone_idx].leds_count > 0)
@@ -326,13 +347,13 @@ void RGBController_PolychromeUSB::DeviceUpdateMode()
unsigned char set_mode =(unsigned char) modes[active_mode].value;
zones_info[zone_idx].mode =(unsigned char) modes[active_mode].value;
zones_info[zone_idx].speed =(unsigned char) modes[active_mode].speed;
if(set_mode > modes.size())
{
set_mode = active_mode;
set_mode = active_mode;
}
polychrome->WriteZone(zone_idx, set_mode, zones_info[zone_idx].speed, zones[zone_idx].colors[0], false);
controller->WriteZone(zone_idx, set_mode, zones_info[zone_idx].speed, zones[zone_idx].colors[0], false);
}
}
}
@@ -5,6 +5,7 @@
| ASRock Polychrome USB Driver |
| |
| Ed Kambulow (Dredvard) 12/26/2020 |
| Shady Nawara (ShadyNawara) 01/16/2023 |
\*-----------------------------------------*/
#pragma once
@@ -15,7 +16,7 @@
class RGBController_PolychromeUSB : public RGBController
{
public:
RGBController_PolychromeUSB(PolychromeUSBController* polychrome_ptr);
RGBController_PolychromeUSB(PolychromeUSBController* controller_ptr);
void SetupZones();
@@ -25,12 +26,11 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
bool initializedMode;
PolychromeUSBController* polychrome;
PolychromeUSBController* controller;
std::vector<PolychromeZoneInfo> zones_info;
unsigned char GetDeviceMode(unsigned char zone);
@@ -0,0 +1,122 @@
/*-----------------------------------------*\
| ASRockPolychromeSMBusController.cpp |
| |
| Driver for for ASRock ASR LED and |
| Polychrome RGB lighting controller |
| |
| Adam Honse (CalcProgrammer1) 12/14/2019 |
\*-----------------------------------------*/
#include "ASRockASRRGBSMBusController.h"
#include <cstring>
#include "dependencies/dmiinfo.h"
#include "LogManager.h"
#define ASROCK_ZONE_LED_COUNT_MESSAGE_EN "[%s] Zone %i LED count: %02d"
using namespace std::chrono_literals;
ASRockASRRGBSMBusController::ASRockASRRGBSMBusController(i2c_smbus_interface* bus, polychrome_dev_id dev)
{
this->bus = bus;
this->dev = dev;
DMIInfo dmi;
device_name = "ASRock " + dmi.getMainboard();
}
ASRockASRRGBSMBusController::~ASRockASRRGBSMBusController()
{
}
std::string ASRockASRRGBSMBusController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
return_string.append(addr);
return("I2C: " + return_string);
}
std::string ASRockASRRGBSMBusController::GetDeviceName()
{
return(device_name);
}
std::string ASRockASRRGBSMBusController::GetFirmwareVersion()
{
uint8_t major_version = fw_version >> 8;
uint8_t minor_version = fw_version & 0xFF;
return(std::to_string(major_version) + "." + std::to_string(minor_version));
}
uint8_t ASRockASRRGBSMBusController::GetMode()
{
return(active_mode);
}
void ASRockASRRGBSMBusController::SetColorsAndSpeed(uint8_t led, uint8_t red, uint8_t green, uint8_t blue)
{
uint8_t color_speed_pkt[4] = { red, green, blue, active_speed };
uint8_t select_led_pkt[1] = { led };
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
if(active_mode != ASRLED_MODE_OFF)
{
bus->i2c_smbus_write_block_data(dev, ASROCK_ASR_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
}
switch(active_mode)
{
/*-----------------------------------------------------*\
| These modes take 4 bytes in R/G/B/S order |
\*-----------------------------------------------------*/
case ASRLED_MODE_BREATHING:
case ASRLED_MODE_STROBE:
case ASRLED_MODE_SPECTRUM_CYCLE:
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 3 bytes in R/G/B order |
\*-----------------------------------------------------*/
default:
case ASRLED_MODE_STATIC:
case ASRLED_MODE_MUSIC:
bus->i2c_smbus_write_block_data(dev, active_mode, 3, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 1 byte - speed |
\*-----------------------------------------------------*/
case ASRLED_MODE_RANDOM:
case ASRLED_MODE_WAVE:
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &active_speed);
break;
/*-----------------------------------------------------*\
| These modes take no bytes |
\*-----------------------------------------------------*/
case ASRLED_MODE_OFF:
break;
}
std::this_thread::sleep_for(1ms);
}
void ASRockASRRGBSMBusController::SetMode(uint8_t zone,uint8_t mode, uint8_t speed)
{
active_zone = zone;
active_mode = mode;
active_speed = speed;
bus->i2c_smbus_write_block_data(dev, ASROCK_ASR_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
}
@@ -0,0 +1,76 @@
/*-----------------------------------------*\
| ASRockASRRGBSMBusController.h |
| |
| Definitions and types for ASRock |
| ASR LED and Polychrome RGB lighting |
| controller |
| |
| Adam Honse (CalcProgrammer1) 12/13/2019 |
\*-----------------------------------------*/
#include "i2c_smbus.h"
#include <string>
#pragma once
typedef uint8_t polychrome_dev_id;
#define ASROCK_ASR_CONTROLLER_NAME "ASRock ASR RGB SMBus Controller"
enum
{
/*------------------------------------------------------------------------------------------*\
| ASRock Common Registers |
\*------------------------------------------------------------------------------------------*/
ASROCK_ASR_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
ASROCK_ASR_REG_MODE = 0x30, /* Mode selection register */
ASROCK_ASR_REG_LED_SELECT = 0x31, /* LED selection register */
};
/*----------------------------------------------------------------------------------------------*\
| Definitions for ASR LED |
\*----------------------------------------------------------------------------------------------*/
#define ASRLED_NUM_MODES 8 /* Number of ASR LED modes */
enum
{
ASRLED_MODE_OFF = 0x10, /* OFF mode */
ASRLED_MODE_STATIC = 0x11, /* Static color mode */
ASRLED_MODE_BREATHING = 0x12, /* Breathing effect mode */
ASRLED_MODE_STROBE = 0x13, /* Strobe effect mode */
ASRLED_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
ASRLED_MODE_RANDOM = 0x15, /* Random effect mode */
ASRLED_MODE_MUSIC = 0x17, /* Music effect mode */
ASRLED_MODE_WAVE = 0x18, /* Wave effect mode */
};
enum
{
ASRLED_SPEED_MIN = 0x05, /* Slowest speed */
ASRLED_SPEED_DEFAULT = 0x03, /* Default speed */
ASRLED_SPEED_MAX = 0x00, /* Fastest speed */
};
class ASRockASRRGBSMBusController
{
public:
ASRockASRRGBSMBusController(i2c_smbus_interface* bus, polychrome_dev_id dev);
~ASRockASRRGBSMBusController();
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetFirmwareVersion();
uint8_t GetMode();
void SetColorsAndSpeed(uint8_t led, uint8_t red, uint8_t green, uint8_t blue);
void SetMode(uint8_t zone, uint8_t mode, uint8_t speed);
uint16_t fw_version;
private:
std::string device_name;
uint8_t active_zone;
uint8_t active_mode;
uint8_t active_speed;
i2c_smbus_interface* bus;
polychrome_dev_id dev;
};
@@ -0,0 +1,308 @@
/*-----------------------------------------*\
| ASRockPolychromeV1SMBusController.cpp |
| |
| Driver for for ASRock ASR LED and |
| Polychrome RGB lighting controller |
| |
| Adam Honse (CalcProgrammer1) 12/14/2019 |
\*-----------------------------------------*/
#include "ASRockPolychromeV1SMBusController.h"
#include <cstring>
#include "dependencies/dmiinfo.h"
#include "LogManager.h"
#define ASROCK_ZONE_LED_COUNT_MESSAGE_EN "[%s] Zone %i LED count: %02d"
using namespace std::chrono_literals;
ASRockPolychromeV1SMBusController::ASRockPolychromeV1SMBusController(i2c_smbus_interface* bus, polychrome_dev_id dev)
{
this->bus = bus;
this->dev = dev;
DMIInfo dmi;
device_name = "ASRock " + dmi.getMainboard();
ReadLEDConfiguration();
}
ASRockPolychromeV1SMBusController::~ASRockPolychromeV1SMBusController()
{
}
std::string ASRockPolychromeV1SMBusController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
return_string.append(addr);
return("I2C: " + return_string);
}
std::string ASRockPolychromeV1SMBusController::GetDeviceName()
{
return(device_name);
}
std::string ASRockPolychromeV1SMBusController::GetFirmwareVersion()
{
uint8_t major_version = fw_version >> 8;
uint8_t minor_version = fw_version & 0xFF;
return(std::to_string(major_version) + "." + std::to_string(minor_version));
}
void ASRockPolychromeV1SMBusController::ReadLEDConfiguration()
{
/*---------------------------------------------------------------------------------*\
| The LED configuration register holds 6 bytes, so the first read should return 6 |
| If not, set all zone sizes to zero |
\*---------------------------------------------------------------------------------*/
LOG_DEBUG("[%s] Reading Zone sizes from controller", device_name.c_str());
uint8_t asrock_zone_count[I2C_SMBUS_BLOCK_MAX] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
if (bus->i2c_smbus_read_block_data(dev, POLYCHROME_V1_REG_ZONE_SIZE, asrock_zone_count) == 0x06)
{
zone_led_count[POLYCHROME_V1_ZONE_1] = asrock_zone_count[0];
zone_led_count[POLYCHROME_V1_ZONE_2] = asrock_zone_count[1];
zone_led_count[POLYCHROME_V1_ZONE_3] = asrock_zone_count[2];
zone_led_count[POLYCHROME_V1_ZONE_4] = asrock_zone_count[3];
zone_led_count[POLYCHROME_V1_ZONE_5] = asrock_zone_count[4];
zone_led_count[POLYCHROME_V1_ZONE_ADDRESSABLE] = asrock_zone_count[5];
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V1_ZONE_1, zone_led_count[POLYCHROME_V1_ZONE_1]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V1_ZONE_2, zone_led_count[POLYCHROME_V1_ZONE_2]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V1_ZONE_3, zone_led_count[POLYCHROME_V1_ZONE_3]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V1_ZONE_4, zone_led_count[POLYCHROME_V1_ZONE_4]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V1_ZONE_5, zone_led_count[POLYCHROME_V1_ZONE_5]);
LOG_DEBUG("[%s] Addressable Zone LED count: %02d", device_name.c_str(), zone_led_count[POLYCHROME_V1_ZONE_ADDRESSABLE]);
}
else
{
LOG_WARNING("[%s] LED config read failed", device_name.c_str());
memset(zone_led_count, 0, sizeof(zone_led_count));
}
}
uint8_t ASRockPolychromeV1SMBusController::GetARGBColorOrder()
{
uint8_t temp[1] = { 0x00 };
LOG_TRACE("[%s] Reading ARGB color order config from the controller", device_name.c_str());
//Read the data
if(bus->i2c_smbus_read_block_data(dev, POLYCHROME_V1_REG_ARGB_GRB, temp) == 0x01)
{
if(temp[0] == 1)
{
LOG_DEBUG("[%s] Color order is GRB for the ARGB header", device_name.c_str());
}
else
{
LOG_DEBUG("[%s] Color order is RGB for the ARGB header", device_name.c_str());
}
return temp[0];
}
else
{
return 0;
}
}
RGBColor ASRockPolychromeV1SMBusController::GetZoneColor(uint8_t zone)
{
LOG_TRACE("[%s] Reading color from zone %02d", device_name.c_str(), zone);
return zone_config[zone].color;
}
uint8_t ASRockPolychromeV1SMBusController::GetZoneMode(uint8_t zone)
{
LOG_TRACE("[%s] Retreving mode %02X from zone_modes for zone %02d", device_name.c_str(), zone_config[zone].mode, zone);
return(zone_config[zone].mode);
}
void ASRockPolychromeV1SMBusController::LoadZoneConfig()
{
uint8_t zone[1] = { 0x00 };
uint8_t mode[1] = { 0xFF };
uint8_t color_speed_pkt[4] = { 0, 0, 0, 0 };
LOG_TRACE("[%s] Reading modes from all zones", device_name.c_str());
//Polychrome v1 supports per zone modes so we need to set the zone before we can read the mode.
//Write the zone index.
for(uint8_t zone_idx = 0 ; zone_idx < POLYCHROME_V1_ZONE_COUNT; zone_idx ++)
{
if(zone_led_count[zone_idx] > 0)
{
zone[0] = zone_idx;
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_ZONE_SELECT, 1, zone);
//Read the data back.
if(bus->i2c_smbus_read_block_data(dev, POLYCHROME_V1_REG_ZONE_SELECT, zone) == 0x01)
{
//Validate that we changed correctly.
if(zone[0] == zone_idx)
{
//Read the mode for the zone.
if(bus->i2c_smbus_read_block_data(dev, POLYCHROME_V1_REG_MODE, mode) == 0x01)
{
LOG_DEBUG("[%s] Mode 0x%02x for zone %02d", device_name.c_str(), mode[0], zone_idx);
zone_config[zone_idx].mode = mode[0];
bus->i2c_smbus_read_block_data(dev, zone_config[zone_idx].mode, color_speed_pkt);
zone_config[zone_idx].color = color_speed_pkt[0] << 16 | color_speed_pkt[1] << 8 | color_speed_pkt[2];
zone_config[zone_idx].speed = color_speed_pkt [3];
LOG_TRACE("[%s] Mode config: %06X, %02X", device_name.c_str(), zone_config[zone_idx].color, zone_config[zone_idx].speed );
}
}
else
{
LOG_WARNING("[%s] Zone mode register failed to change!", device_name.c_str() );
}
}
}
else
{
zone_config[zone_idx].mode = 0;
zone_config[zone_idx].color = 0;
zone_config[zone_idx].speed = 0;
}
}
}
void ASRockPolychromeV1SMBusController::SetARGBColorOrder(bool value)
{
uint8_t temp[1] = { 0x00 };
LOG_TRACE("[%s] Setting ARGB color order config to the controller", device_name.c_str());
temp[0] = (value) ? 0x01 : 0x00;
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_ARGB_GRB, 1, temp);
GetARGBColorOrder();
}
bool ASRockPolychromeV1SMBusController::SetARGBSize(uint8_t new_size)
{
LOG_DEBUG("[%s] Setting ARGB header to %02d.", device_name.c_str(), new_size);
uint8_t asrock_zone_count[6] = { 0x0 };
uint8_t new_asrock_zone_count[6] = { 0x0 };
//memcpy(new_asrock_zone_count, zone_led_count, sizeof(new_asrock_zone_count - 1));
new_asrock_zone_count[POLYCHROME_V1_ZONE_1] = zone_led_count[POLYCHROME_V1_ZONE_1];
new_asrock_zone_count[POLYCHROME_V1_ZONE_2] = zone_led_count[POLYCHROME_V1_ZONE_2];
new_asrock_zone_count[POLYCHROME_V1_ZONE_3] = zone_led_count[POLYCHROME_V1_ZONE_3];
new_asrock_zone_count[POLYCHROME_V1_ZONE_4] = zone_led_count[POLYCHROME_V1_ZONE_4];
new_asrock_zone_count[POLYCHROME_V1_ZONE_5] = zone_led_count[POLYCHROME_V1_ZONE_5];
new_asrock_zone_count[POLYCHROME_V1_ZONE_ADDRESSABLE] = new_size;
//Write the new config to the register
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_ZONE_SIZE, 6, new_asrock_zone_count);
//Validate the write
if (bus->i2c_smbus_read_block_data(dev, POLYCHROME_V1_REG_ZONE_SIZE, asrock_zone_count) == 0x06)
{
for (uint8_t i = 0; i < 6; i++)
{
if (new_asrock_zone_count[i] != asrock_zone_count[i])
{
LOG_WARNING("[%s] Failed to validate zone %02d size!", device_name.c_str(), i);
return false;
}
}
LOG_DEBUG("[%s] Zone configuration validation completed.", device_name.c_str());
return true;
}
return false;
}
void ASRockPolychromeV1SMBusController::SetColorsAndSpeed(uint8_t zone, uint8_t red, uint8_t green, uint8_t blue)
{
LOG_TRACE("[%s] Updating color and speed for zone %02d: 0x%06X", device_name.c_str(), zone, (red << 16 | green << 8 | blue));
uint8_t color_speed_pkt[4] = { red, green, blue, zone_config[zone].speed };
uint8_t select_zone_pkt[1] = { zone };
/*-----------------------------------------------------*\
| Select Zone |
\*-----------------------------------------------------*/
if(zone_config[zone].mode != POLYCHROME_V1_MODE_OFF)
{
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_ZONE_SELECT, 1, select_zone_pkt);
std::this_thread::sleep_for(1ms);
}
switch(zone_config[zone].mode)
{
/*-----------------------------------------------------*\
| These modes take 4 bytes in R/G/B/S order |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_BREATHING:
case POLYCHROME_V1_MODE_STROBE:
case POLYCHROME_V1_MODE_SPECTRUM_CYCLE:
case POLYCHROME_V1_MODE_SPRING:
case POLYCHROME_V1_MODE_METEOR:
case POLYCHROME_V1_MODE_STACK:
case POLYCHROME_V1_MODE_CRAM:
case POLYCHROME_V1_MODE_SCAN:
case POLYCHROME_V1_MODE_NEON:
case POLYCHROME_V1_MODE_WATER:
bus->i2c_smbus_write_block_data(dev, zone_config[zone].mode, 4, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 3 bytes in R/G/B order |
\*-----------------------------------------------------*/
default:
case POLYCHROME_V1_MODE_STATIC:
case POLYCHROME_V1_MODE_MUSIC:
bus->i2c_smbus_write_block_data(dev, zone_config[zone].mode, 3, color_speed_pkt);
break;
/*-----------------------------------------------------*\
| These modes take 1 byte - speed |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_RANDOM:
case POLYCHROME_V1_MODE_WAVE:
case POLYCHROME_V1_MODE_RAINBOW:
bus->i2c_smbus_write_block_data(dev, zone_config[zone].mode, 1, &zone_config[zone].speed);
break;
/*-----------------------------------------------------*\
| These modes take no bytes |
\*-----------------------------------------------------*/
case POLYCHROME_V1_MODE_OFF:
break;
}
std::this_thread::sleep_for(1ms);
}
void ASRockPolychromeV1SMBusController::SetMode(uint8_t zone, uint8_t mode, uint8_t speed)
{
LOG_TRACE("[%s] Updating mode for zone %02d, Mode 0x%02X, Speed 0x%02X", device_name.c_str(), zone, mode, speed);
uint8_t led_count_pkt[1] = { 0x00 };
zone_config[zone].mode = mode;
zone_config[zone].speed = speed;
/*-----------------------------------------------------*\
| Make sure set all register is set to 0 |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_SET_ALL, 1, led_count_pkt);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Set the zone we are working on |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_ZONE_SELECT, 1, &zone);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Write the mode |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_MODE, 1, &zone_config[zone].mode);
std::this_thread::sleep_for(1ms);
}
@@ -1,5 +1,5 @@
/*-----------------------------------------*\
| ASRockPolychromeSMBusController.h |
| ASRockPolychromeV1SMBusController.h |
| |
| Definitions and types for ASRock |
| ASR LED and Polychrome RGB lighting |
@@ -9,84 +9,38 @@
\*-----------------------------------------*/
#include "i2c_smbus.h"
#include "RGBController.h"
#include <string>
#pragma once
typedef unsigned char polychrome_dev_id;
typedef uint8_t polychrome_dev_id;
#define ASROCK_CONTROLLER_NAME "ASRock Polychrome SMBus Controller"
#define ASROCK_DETECTOR_NAME "ASRock Polychrome SMBus Detect"
#define VENDOR_NAME "ASRock"
#define SMBUS_ADDRESS 0x6A
enum
{
ASROCK_TYPE_UNKNOWN = 0x00, /* Unknown Type or Not ASRock Device */
ASROCK_TYPE_ASRLED = 0x01, /* ASRock Firmware 1.x - ASR LED */
ASROCK_TYPE_POLYCHROME_V1 = 0x02, /* ASRock Firmware 2.x - Polychrome V1 */
ASROCK_TYPE_POLYCHROME_V2 = 0x03, /* ASRock Firmware 3.x - Polychrome V2 */
};
#define ASROCK_V1_CONTROLLER_NAME "ASRock Polychrome v1 SMBus Controller"
enum
{
/*------------------------------------------------------------------------------------------*\
| ASRock Common Registers |
\*------------------------------------------------------------------------------------------*/
ASROCK_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
ASROCK_REG_MODE = 0x30, /* Mode selection register */
ASROCK_REG_LED_SELECT = 0x31, /* LED selection register */
/*------------------------------------------------------------------------------------------*\
| ASRock Polychrome V1/V2 Common Registers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_REG_LED_CONFIG = 0x33, /* LED configuration register */
/*------------------------------------------------------------------------------------------*\
| ASRock Polychrome V1 (Firmware 2.x) Registers |
| ASRock Polychrome v1 Registers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V1_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
POLYCHROME_V1_REG_MODE = 0x30, /* Mode selection register */
POLYCHROME_V1_REG_ZONE_SELECT = 0x31, /* Zone selection register */
POLYCHROME_V1_REG_SET_ALL = 0x32, /* Set All register 0x1 = set all */
POLYCHROME_V1_REG_ARGB_GRB = 0x35, /* ARGB bistream reversing register */
/*------------------------------------------------------------------------------------------*\
| ASRock Polychrome V2 (Firmware 3.x) Registers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V2_REG_LED_COUNT = 0x32, /* Additional LED count register */
POLYCHROME_V2_REG_COLOR = 0x34, /* Color register: Red, Green, Blue */
POLYCHROME_V2_REG_ARGB_GRB = 0x35, /* ARGB bistream reversing register */
POLYCHROME_V1_REG_ZONE_SIZE = 0x33, /* Zone size configuration register */
POLYCHROME_V1_REG_ARGB_GRB = 0x35, /* ARGB bitstream reversing register */
};
enum
{
POLYCHROME_ZONE_1 = 0x00, /* RGB LED 1 Header */
POLYCHROME_ZONE_2 = 0x01, /* RGB LED 2 Header */
POLYCHROME_ZONE_3 = 0x02, /* Audio/PCH Zone LEDs */
POLYCHROME_ZONE_4 = 0x03, /* Audio/PCH Zone LEDs */
POLYCHROME_ZONE_5 = 0x04, /* IO Cover Zone LEDs */
POLYCHROME_ZONE_ADDRESSABLE = 0x05, /* Addressable LED header */
POLYCHROME_ZONE_COUNT = 0x06, /* Total number of zones */
POLYCHROME_ZONE_ADDRESSABLE_MAX = 0x64, /* Maxinum number of ARGB LEDs */
};
/*----------------------------------------------------------------------------------------------*\
| Definitions for ASR LED |
\*----------------------------------------------------------------------------------------------*/
#define ASRLED_NUM_MODES 8 /* Number of ASR LED modes */
enum
{
ASRLED_MODE_OFF = 0x10, /* OFF mode */
ASRLED_MODE_STATIC = 0x11, /* Static color mode */
ASRLED_MODE_BREATHING = 0x12, /* Breathing effect mode */
ASRLED_MODE_STROBE = 0x13, /* Strobe effect mode */
ASRLED_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
ASRLED_MODE_RANDOM = 0x15, /* Random effect mode */
ASRLED_MODE_MUSIC = 0x17, /* Music effect mode */
ASRLED_MODE_WAVE = 0x18, /* Wave effect mode */
};
enum
{
ASRLED_SPEED_MIN = 0x05, /* Slowest speed */
ASRLED_SPEED_DEFAULT = 0x03, /* Default speed */
ASRLED_SPEED_MAX = 0x00, /* Fastest speed */
POLYCHROME_V1_ZONE_1 = 0x00, /* RGB LED 1 Header */
POLYCHROME_V1_ZONE_2 = 0x01, /* RGB LED 2 Header */
POLYCHROME_V1_ZONE_3 = 0x02, /* PCH Zone */
POLYCHROME_V1_ZONE_4 = 0x03, /* IO Cover Zone */
POLYCHROME_V1_ZONE_5 = 0x04, /* Audio Zone LEDs */
POLYCHROME_V1_ZONE_ADDRESSABLE = 0x05, /* Addressable LED header */
POLYCHROME_V1_ZONE_COUNT = 0x06, /* Total number of zones */
POLYCHROME_V1_ZONE_ADDRESSABLE_MAX = 0x64, /* Maximum number of ARGB LEDs */
};
/*----------------------------------------------------------------------------------------------*\
@@ -98,7 +52,7 @@ enum
{
POLYCHROME_V1_MODE_OFF = 0x10, /* OFF mode */
POLYCHROME_V1_MODE_STATIC = 0x11, /* Static color mode */
POLYCHROME_V1_MODE_BREATHING = 0x12, /* Breating effect mode */
POLYCHROME_V1_MODE_BREATHING = 0x12, /* Breathing effect mode */
POLYCHROME_V1_MODE_STROBE = 0x13, /* Strobe effect mode */
POLYCHROME_V1_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
POLYCHROME_V1_MODE_RANDOM = 0x15, /* Random effect mode */
@@ -166,62 +120,40 @@ enum
POLYCHROME_V1_SPEED_MAX_ARGB = 0x02, /* Fastest speed */
};
/*----------------------------------------------------------------------------------------------*\
| Definitions for Polychrome V2 |
\*----------------------------------------------------------------------------------------------*/
#define POLYCHROME_V2_NUM_MODES 14 /* Number of Polychrome V2 modes */
enum
struct zone_cfg
{
POLYCHROME_V2_MODE_OFF = 0x10, /* OFF mode */
POLYCHROME_V2_MODE_STATIC = 0x11, /* Static color mode */
POLYCHROME_V2_MODE_BREATHING = 0x12, /* Breating effect mode */
POLYCHROME_V2_MODE_STROBE = 0x13, /* Strobe effect mode */
POLYCHROME_V2_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
POLYCHROME_V2_MODE_RANDOM = 0x15, /* Random effect mode */
POLYCHROME_V2_MODE_WAVE = 0x17, /* Wave effect mode */
POLYCHROME_V2_MODE_SPRING = 0x18, /* Spring effect mode */
POLYCHROME_V2_MODE_STACK = 0x19, /* Stack effect mode */
POLYCHROME_V2_MODE_CRAM = 0x1A, /* Cram effect mode */
POLYCHROME_V2_MODE_SCAN = 0x1B, /* Scan effect mode */
POLYCHROME_V2_MODE_NEON = 0x1C, /* Neon effect mode */
POLYCHROME_V2_MODE_WATER = 0x1D, /* Water effect mode */
POLYCHROME_V2_MODE_RAINBOW = 0x1E, /* Rainbow effect mode */
uint8_t mode;
uint8_t speed;
RGBColor color;
};
enum
{
POLYCHROME_V2_SPEED_MIN = 0x05, /* Slowest speed */
POLYCHROME_V2_SPEED_DEFAULT = 0x03, /* Default speed */
POLYCHROME_V2_SPEED_MAX = 0x00, /* Fastest speed */
};
class PolychromeController
class ASRockPolychromeV1SMBusController
{
public:
PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev);
~PolychromeController();
ASRockPolychromeV1SMBusController(i2c_smbus_interface* bus, polychrome_dev_id dev);
~ASRockPolychromeV1SMBusController();
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetFirmwareVersion();
unsigned int GetMode();
unsigned int GetASRockType();
void SetColorsAndSpeed(unsigned char led, unsigned char red, unsigned char green, unsigned char blue);
void SetMode(unsigned char zone, unsigned char mode, unsigned char speed);
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetFirmwareVersion();
uint8_t GetARGBColorOrder();
RGBColor GetZoneColor(uint8_t zone);
uint8_t GetZoneMode(uint8_t zone);
void LoadZoneConfig();
void SetARGBColorOrder(bool value);
bool SetARGBSize(uint8_t led_count);
void SetColorsAndSpeed(uint8_t led, uint8_t red, uint8_t green, uint8_t blue);
void SetMode(uint8_t zone, uint8_t mode, uint8_t speed);
uint8_t zone_led_count[6];
zone_cfg zone_config[6];
uint16_t fw_version;
unsigned char zone_led_count[6];
private:
unsigned int asrock_type;
unsigned short fw_version;
std::string device_name;
unsigned char active_zone;
unsigned char active_mode;
unsigned char active_speed;
i2c_smbus_interface* bus;
polychrome_dev_id dev;
unsigned short ReadFirmwareVersion();
void ReadLEDConfiguration();
void ReadLEDConfiguration();
};
@@ -0,0 +1,156 @@
/*-----------------------------------------*\
| ASRockPolychromeV2SMBusController.cpp |
| |
| Driver for for ASRock ASR LED and |
| Polychrome RGB lighting controller |
| |
| Adam Honse (CalcProgrammer1) 12/14/2019 |
\*-----------------------------------------*/
#include "ASRockPolychromeV2SMBusController.h"
#include <cstring>
#include "dependencies/dmiinfo.h"
#include "LogManager.h"
#define ASROCK_ZONE_LED_COUNT_MESSAGE_EN "[%s] Zone %i LED count: %02d"
using namespace std::chrono_literals;
ASRockPolychromeV2SMBusController::ASRockPolychromeV2SMBusController(i2c_smbus_interface* bus, polychrome_dev_id dev)
{
this->bus = bus;
this->dev = dev;
DMIInfo dmi;
device_name = "ASRock " + dmi.getMainboard();
ReadLEDConfiguration();
}
ASRockPolychromeV2SMBusController::~ASRockPolychromeV2SMBusController()
{
}
std::string ASRockPolychromeV2SMBusController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
return_string.append(addr);
return("I2C: " + return_string);
}
std::string ASRockPolychromeV2SMBusController::GetDeviceName()
{
return(device_name);
}
std::string ASRockPolychromeV2SMBusController::GetFirmwareVersion()
{
uint8_t major_version = fw_version >> 8;
uint8_t minor_version = fw_version & 0xFF;
return(std::to_string(major_version) + "." + std::to_string(minor_version));
}
void ASRockPolychromeV2SMBusController::ReadLEDConfiguration()
{
/*---------------------------------------------------------------------------------*\
| The LED configuration register holds 6 bytes, so the first read should return 6 |
| If not, set all zone sizes to zero |
\*---------------------------------------------------------------------------------*/
LOG_DEBUG("[%s] Reading LED config from controller", device_name.c_str());
uint8_t asrock_zone_count[I2C_SMBUS_BLOCK_MAX] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
if (bus->i2c_smbus_read_block_data(dev, POLYCHROME_V2_REG_LED_CONFIG, asrock_zone_count) == 0x06)
{
zone_led_count[POLYCHROME_V2_ZONE_1] = asrock_zone_count[0];
zone_led_count[POLYCHROME_V2_ZONE_2] = asrock_zone_count[1];
zone_led_count[POLYCHROME_V2_ZONE_3] = asrock_zone_count[2];
zone_led_count[POLYCHROME_V2_ZONE_4] = asrock_zone_count[3];
zone_led_count[POLYCHROME_V2_ZONE_5] = asrock_zone_count[4];
zone_led_count[POLYCHROME_V2_ZONE_ADDRESSABLE] = asrock_zone_count[5];
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V2_ZONE_1, zone_led_count[POLYCHROME_V2_ZONE_1]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V2_ZONE_2, zone_led_count[POLYCHROME_V2_ZONE_2]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V2_ZONE_3, zone_led_count[POLYCHROME_V2_ZONE_3]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V2_ZONE_4, zone_led_count[POLYCHROME_V2_ZONE_4]);
LOG_DEBUG(ASROCK_ZONE_LED_COUNT_MESSAGE_EN, device_name.c_str(), POLYCHROME_V2_ZONE_5, zone_led_count[POLYCHROME_V2_ZONE_5]);
LOG_DEBUG("[%s] Addressable Zone LED count: %02d", device_name.c_str(), zone_led_count[POLYCHROME_V2_ZONE_ADDRESSABLE]);
}
else
{
LOG_WARNING("[%s] LED config read failed", device_name.c_str());
memset(zone_led_count, 0, sizeof(zone_led_count));
}
}
uint8_t ASRockPolychromeV2SMBusController::GetMode()
{
return(active_mode);
}
void ASRockPolychromeV2SMBusController::SetColorsAndSpeed(uint8_t led, uint8_t red, uint8_t green, uint8_t blue)
{
uint8_t color_speed_pkt[4] = { red, green, blue, active_speed };
uint8_t select_led_pkt[1] = { led };
/*-----------------------------------------------------*\
| Select LED |
\*-----------------------------------------------------*/
switch(active_mode)
{
case POLYCHROME_V2_MODE_OFF:
case POLYCHROME_V2_MODE_RAINBOW:
case POLYCHROME_V2_MODE_SPECTRUM_CYCLE:
break;
default:
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_LED_SELECT, 1, select_led_pkt);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Polychrome firmware always writes color to fixed reg |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_COLOR, 3, color_speed_pkt);
std::this_thread::sleep_for(1ms);
break;
}
}
void ASRockPolychromeV2SMBusController::SetMode(uint8_t zone,uint8_t mode, uint8_t speed)
{
uint8_t led_count_pkt[1] = { 0x00 };
active_zone = zone;
active_mode = mode;
active_speed = speed;
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_MODE, 1, &active_mode);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Select a single LED |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_LED_COUNT, 0, led_count_pkt);
std::this_thread::sleep_for(1ms);
switch(active_mode)
{
/*-----------------------------------------------------*\
| These modes don't take a speed |
\*-----------------------------------------------------*/
case POLYCHROME_V2_MODE_OFF:
case POLYCHROME_V2_MODE_STATIC:
break;
/*-----------------------------------------------------*\
| All other modes, write speed to active mode register |
\*-----------------------------------------------------*/
default:
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &speed);
std::this_thread::sleep_for(1ms);
break;
}
}
@@ -0,0 +1,145 @@
/*-----------------------------------------*\
| ASRockPolychromeSMBusController.h |
| |
| Definitions and types for ASRock |
| ASR LED and Polychrome RGB lighting |
| controller |
| |
| Adam Honse (CalcProgrammer1) 12/13/2019 |
\*-----------------------------------------*/
#include "i2c_smbus.h"
#include <string>
#pragma once
typedef uint8_t polychrome_dev_id;
#define ASROCK_V2_CONTROLLER_NAME "ASRock Polychrome v2 SMBus Controller"
enum
{
/*------------------------------------------------------------------------------------------*\
| ASRock Polychrome v2 Registers |
\*------------------------------------------------------------------------------------------*/
POLYCHROME_V2_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
POLYCHROME_V2_REG_MODE = 0x30, /* Mode selection register */
POLYCHROME_V2_REG_LED_SELECT = 0x31, /* LED selection register */
POLYCHROME_V2_REG_LED_COUNT = 0x32, /* Additional LED count register */
POLYCHROME_V2_REG_LED_CONFIG = 0x33, /* LED configuration register */
POLYCHROME_V2_REG_COLOR = 0x34, /* Color register: Red, Green, Blue */
POLYCHROME_V2_REG_ARGB_GRB = 0x35, /* ARGB bistream reversing register */
};
enum
{
POLYCHROME_V2_ZONE_1 = 0x00, /* RGB LED 1 Header */
POLYCHROME_V2_ZONE_2 = 0x01, /* RGB LED 2 Header */
POLYCHROME_V2_ZONE_3 = 0x02, /* Audio/PCH Zone LEDs */
POLYCHROME_V2_ZONE_4 = 0x03, /* Audio/PCH Zone LEDs */
POLYCHROME_V2_ZONE_5 = 0x04, /* IO Cover Zone LEDs */
POLYCHROME_V2_ZONE_ADDRESSABLE = 0x05, /* Addressable LED header */
POLYCHROME_V2_ZONE_COUNT = 0x06, /* Total number of zones */
POLYCHROME_V2_ZONE_ADDRESSABLE_MAX = 0x64, /* Maxinum number of ARGB LEDs */
};
/*----------------------------------------------------------------------------------------------*\
| Definitions for Polychrome V2 |
\*----------------------------------------------------------------------------------------------*/
#define POLYCHROME_V2_NUM_MODES 14 /* Number of Polychrome V2 modes */
enum
{
POLYCHROME_V2_MODE_OFF = 0x10, /* OFF mode */
POLYCHROME_V2_MODE_STATIC = 0x11, /* Static color mode */
POLYCHROME_V2_MODE_BREATHING = 0x12, /* Breating effect mode */
POLYCHROME_V2_MODE_STROBE = 0x13, /* Strobe effect mode */
POLYCHROME_V2_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
POLYCHROME_V2_MODE_RANDOM = 0x15, /* Random effect mode */
POLYCHROME_V2_MODE_WAVE = 0x17, /* Wave effect mode */
POLYCHROME_V2_MODE_SPRING = 0x18, /* Spring effect mode */
POLYCHROME_V2_MODE_STACK = 0x19, /* Stack effect mode */
POLYCHROME_V2_MODE_CRAM = 0x1A, /* Cram effect mode */
POLYCHROME_V2_MODE_SCAN = 0x1B, /* Scan effect mode */
POLYCHROME_V2_MODE_NEON = 0x1C, /* Neon effect mode */
POLYCHROME_V2_MODE_WATER = 0x1D, /* Water effect mode */
POLYCHROME_V2_MODE_RAINBOW = 0x1E, /* Rainbow effect mode */
};
enum
{
POLYCHROME_V2_BREATHING_SPEED_MIN = 0x0A, /* Slowest speed */
POLYCHROME_V2_BREATHING_SPEED_DEFAULT = 0x06, /* Default speed */
POLYCHROME_V2_BREATHING_SPEED_MAX = 0x02, /* Fastest speed */
POLYCHROME_V2_STROBE_SPEED_MIN = 0xA0, /* Slowest speed */
POLYCHROME_V2_STROBE_SPEED_DEFAULT = 0x4D, /* Default speed */
POLYCHROME_V2_STROBE_SPEED_MAX = 0x05, /* Fastest speed */
POLYCHROME_V2_SPECTRUM_CYCLE_SPEED_MIN = 0xA0, /* Slowest speed */
POLYCHROME_V2_SPECTRUM_CYCLE_SPEED_DEFAULT = 0x50, /* Default speed */
POLYCHROME_V2_SPECTRUM_CYCLE_SPEED_MAX = 0x0A, /* Fastest speed */
POLYCHROME_V2_RANDOM_SPEED_MIN = 0xA0, /* Slowest speed */
POLYCHROME_V2_RANDOM_SPEED_DEFAULT = 0x4D, /* Default speed */
POLYCHROME_V2_RANDOM_SPEED_MAX = 0x05, /* Fastest speed */
POLYCHROME_V2_WAVE_SPEED_MIN = 0x06, /* Slowest speed */
POLYCHROME_V2_WAVE_SPEED_DEFAULT = 0x03, /* Default speed */
POLYCHROME_V2_WAVE_SPEED_MAX = 0x01, /* Fastest speed */
POLYCHROME_V2_SPRING_SPEED_MIN = 0x20, /* Slowest speed */
POLYCHROME_V2_SPRING_SPEED_DEFAULT = 0x11, /* Default speed */
POLYCHROME_V2_SPRING_SPEED_MAX = 0x02, /* Fastest speed */
POLYCHROME_V2_STACK_SPEED_MIN = 0x20, /* Slowest speed */
POLYCHROME_V2_STACK_SPEED_DEFAULT = 0x11, /* Default speed */
POLYCHROME_V2_STACK_SPEED_MAX = 0x02, /* Fastest speed */
POLYCHROME_V2_CRAM_SPEED_MIN = 0x20, /* Slowest speed */
POLYCHROME_V2_CRAM_SPEED_DEFAULT = 0x11, /* Default speed */
POLYCHROME_V2_CRAM_SPEED_MAX = 0x02, /* Fastest speed */
POLYCHROME_V2_SCAN_SPEED_MIN = 0x20, /* Slowest speed */
POLYCHROME_V2_SCAN_SPEED_DEFAULT = 0x11, /* Default speed */
POLYCHROME_V2_SCAN_SPEED_MAX = 0x02, /* Fastest speed */
POLYCHROME_V2_NEON_SPEED_MIN = 0x20, /* Slowest speed */
POLYCHROME_V2_NEON_SPEED_DEFAULT = 0x11, /* Default speed */
POLYCHROME_V2_NEON_SPEED_MAX = 0x02, /* Fastest speed */
POLYCHROME_V2_WATER_SPEED_MIN = 0x20, /* Slowest speed */
POLYCHROME_V2_WATER_SPEED_DEFAULT = 0x11, /* Default speed */
POLYCHROME_V2_WATER_SPEED_MAX = 0x02, /* Fastest speed */
POLYCHROME_V2_RAINBOW_SPEED_MIN = 0x12, /* Slowest speed */
POLYCHROME_V2_RAINBOW_SPEED_DEFAULT = 0x08, /* Default speed */
POLYCHROME_V2_RAINBOW_SPEED_MAX = 0x02, /* Fastest speed */
};
class ASRockPolychromeV2SMBusController
{
public:
ASRockPolychromeV2SMBusController(i2c_smbus_interface* bus, polychrome_dev_id dev);
~ASRockPolychromeV2SMBusController();
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetFirmwareVersion();
uint8_t GetMode();
void SetColorsAndSpeed(uint8_t led, uint8_t red, uint8_t green, uint8_t blue);
void SetMode(uint8_t zone, uint8_t mode, uint8_t speed);
uint8_t zone_led_count[6];
uint16_t fw_version;
private:
std::string device_name;
uint8_t active_zone;
uint8_t active_mode;
uint8_t active_speed;
i2c_smbus_interface* bus;
polychrome_dev_id dev;
void ReadLEDConfiguration();
};
@@ -0,0 +1,168 @@
#include "Detector.h"
#include "ASRockASRRGBSMBusController.h"
#include "ASRockPolychromeV1SMBusController.h"
#include "ASRockPolychromeV2SMBusController.h"
#include "LogManager.h"
#include "RGBController.h"
#include "RGBController_ASRockASRRGBSMBus.h"
#include "RGBController_ASRockPolychromeV1SMBus.h"
#include "RGBController_ASRockPolychromeV2SMBus.h"
#include "i2c_smbus.h"
#include "pci_ids.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
/*******************************************************************************************\
* *
* TestForPolychromeSMBusController *
* *
* Tests the given address to see if an ASRock RGB controller exists there. *
* First does a quick write to test for a response *
* *
\*******************************************************************************************/
#define ASROCK_DETECTOR_NAME "ASRock SMBus Detectector"
#define VENDOR_NAME "ASRock"
#define SMBUS_ADDRESS 0x6A
enum
{
ASROCK_TYPE_UNKNOWN = 0x00, /* Unknown Type or Not ASRock Device */
ASROCK_TYPE_ASRLED = 0x01, /* ASRock Firmware 1.x - ASR LED */
ASROCK_TYPE_POLYCHROME_V1 = 0x02, /* ASRock Firmware 2.x - Polychrome V1 */
ASROCK_TYPE_POLYCHROME_V2 = 0x03, /* ASRock Firmware 3.x - Polychrome V2 */
ASROCK_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
};
union u16_to_u8
{
uint16_t u16;
struct
{
uint8_t lsb;
uint8_t msb;
};
};
bool TestForPolychromeSMBusController(i2c_smbus_interface* bus, uint8_t address)
{
bool pass = false;
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
if (res >= 0)
{
pass = true;
}
return(pass);
} /* TestForPolychromeController() */
uint16_t GetFirmwareVersion(i2c_smbus_interface* bus, uint8_t address)
{
// The firmware register holds two bytes, so the first read should return 2
// If not, report invalid firmware revision
LOG_DEBUG("[%s] Reading back device firmware version", ASROCK_DETECTOR_NAME);
u16_to_u8 asrock_version_u16;
// Version response array needs to be 32 bytes to prevent non ASRock board from stack smashing
uint8_t asrock_version[I2C_SMBUS_BLOCK_MAX] = { 0x00, 0x00 };
if (bus->i2c_smbus_read_block_data(address, ASROCK_REG_FIRMWARE_VER, asrock_version) == 0x02)
{
asrock_version_u16.msb = asrock_version[0];
asrock_version_u16.lsb = asrock_version[1];
LOG_DEBUG("[%s] Device firmware version: v%02d.%02d", ASROCK_DETECTOR_NAME, asrock_version_u16.msb, asrock_version_u16.lsb);
return(asrock_version_u16.u16);
}
else
{
LOG_WARNING("[%s] Firmware readback failed; Returning Unknown Version", ASROCK_DETECTOR_NAME);
return(ASROCK_TYPE_UNKNOWN);
}
}
/******************************************************************************************\
* *
* DetectPolychromeControllers *
* *
* Detect ASRock Polychrome RGB SMBus controllers on the enumerated I2C busses at *
* address 0x6A. *
* *
* bus - pointer to i2c_smbus_interface where Polychrome device is connected *
* dev - I2C address of Polychrome device *
* *
\******************************************************************************************/
void DetectASRockSMBusControllers(std::vector<i2c_smbus_interface*>& busses)
{
for(unsigned int bus = 0; bus < busses.size(); bus++)
{
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
{
if(busses[bus]->pci_subsystem_vendor == ASROCK_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
// Check for Polychrome controller at 0x6A
if(TestForPolychromeSMBusController(busses[bus], SMBUS_ADDRESS))
{
LOG_DEBUG("[%s] Detected a device at address 0x%02X, testing for a known controller", ASROCK_DETECTOR_NAME, SMBUS_ADDRESS);
u16_to_u8 version;
version.u16 = GetFirmwareVersion(busses[bus], SMBUS_ADDRESS);
switch (version.msb)
{
case ASROCK_TYPE_ASRLED:
{
LOG_DEBUG("[%s] Found a ASR RGB LED Controller", ASROCK_DETECTOR_NAME);
ASRockASRRGBSMBusController* controller = new ASRockASRRGBSMBusController(busses[bus], SMBUS_ADDRESS);
controller-> fw_version = version.u16;
RGBController_ASRockASRRGBSMBus* rgb_controller = new RGBController_ASRockASRRGBSMBus(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
break;
case ASROCK_TYPE_POLYCHROME_V1:
{
LOG_DEBUG("[%s] Found a Polychrome v1 Controller", ASROCK_DETECTOR_NAME);
ASRockPolychromeV1SMBusController* controller = new ASRockPolychromeV1SMBusController(busses[bus], SMBUS_ADDRESS);
controller-> fw_version = version.u16;
RGBController_ASRockPolychromeV1SMBus* rgb_controller = new RGBController_ASRockPolychromeV1SMBus(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
break;
case ASROCK_TYPE_POLYCHROME_V2:
{
LOG_DEBUG("[%s] Found a Polychrome v2 Controller", ASROCK_DETECTOR_NAME);
ASRockPolychromeV2SMBusController* controller = new ASRockPolychromeV2SMBusController(busses[bus], SMBUS_ADDRESS);
controller-> fw_version = version.u16;
RGBController_ASRockPolychromeV2SMBus* rgb_controller = new RGBController_ASRockPolychromeV2SMBus(controller);
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
break;
default:
LOG_DEBUG("[%s] Not a Polychrome device or unknown type", ASROCK_DETECTOR_NAME);
break;
}
}
else
{
LOG_DEBUG("[%s] Bus %02d has no response at 0x%02X", ASROCK_DETECTOR_NAME, bus, SMBUS_ADDRESS);
}
}
else
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_FAILURE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME);
}
}
}
} /* DetectSMBusPolychromeControllers() */
REGISTER_I2C_DETECTOR("ASRock Motherboard SMBus Controllers", DetectASRockSMBusControllers);
@@ -0,0 +1,205 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromeSMBus.cpp |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#include "RGBController_ASRockASRRGBSMBus.h"
#define ASROCK_MAX_ZONES 4
#define ASROCK_MAX_LEDS 22
/**------------------------------------------------------------------*\
@name ASRock ASR RGB SMBus
@category Motherboard
@type SMBus
@save :robot:
@direct :x:
@effects :white_check_mark:
@detectors DetectASRockSMBusControllers
@comment ASRock ASR RGB LED controllers will save with each update.
Per ARGB LED support is not possible with these devices.
\*-------------------------------------------------------------------*/
RGBController_ASRockASRRGBSMBus::RGBController_ASRockASRRGBSMBus(ASRockASRRGBSMBusController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "ASRock";
version = controller->GetFirmwareVersion();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASRock ASR RGB LED Device";
location = controller->GetDeviceLocation();
mode Off;
Off.name = "Off";
Off.value = ASRLED_MODE_OFF;
Off.flags = MODE_FLAG_AUTOMATIC_SAVE;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = ASRLED_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = ASRLED_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Breathing.speed_min = ASRLED_SPEED_MIN;
Breathing.speed_max = ASRLED_SPEED_MAX;
Breathing.speed = ASRLED_SPEED_DEFAULT;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = ASRLED_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Strobe.speed_min = ASRLED_SPEED_MIN;
Strobe.speed_max = ASRLED_SPEED_MAX;
Strobe.speed = ASRLED_SPEED_DEFAULT;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = ASRLED_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
SpectrumCycle.speed_min = ASRLED_SPEED_MIN;
SpectrumCycle.speed_max = ASRLED_SPEED_MAX;
SpectrumCycle.speed = ASRLED_SPEED_DEFAULT;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = ASRLED_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Random.speed_min = ASRLED_SPEED_MIN;
Random.speed_max = ASRLED_SPEED_MAX;
Random.speed = ASRLED_SPEED_DEFAULT;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Music;
Music.name = "Music";
Music.value = ASRLED_MODE_MUSIC;
Music.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Music.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Music);
mode Wave;
Wave.name = "Wave";
Wave.value = ASRLED_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Wave.speed_min = ASRLED_SPEED_MIN;
Wave.speed_max = ASRLED_SPEED_MAX;
Wave.speed = ASRLED_SPEED_DEFAULT;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
SetupZones();
}
RGBController_ASRockASRRGBSMBus::~RGBController_ASRockASRRGBSMBus()
{
delete controller;
}
void RGBController_ASRockASRRGBSMBus::SetupZones()
{
/*---------------------------------------------------------*\
| ASR LED motherboards only have a single zone/LED |
\*---------------------------------------------------------*/
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
zone* new_zone = new zone();
/*---------------------------------------------------------*\
| Set single zone name to "Motherboard" |
\*---------------------------------------------------------*/
new_zone->name = "Motherboard";
new_zone->type = ZONE_TYPE_SINGLE;
new_zone->leds_min = 1;
new_zone->leds_max = 1;
new_zone->leds_count = 1;
new_zone->matrix_map = NULL;
/*---------------------------------------------------------*\
| Push new zone to zones vector |
\*---------------------------------------------------------*/
zones.push_back(*new_zone);
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
led* new_led = new led();
/*---------------------------------------------------------*\
| Set single LED name to "Motherboard" |
\*---------------------------------------------------------*/
new_led->name = "Motherboard";
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
\*---------------------------------------------------------*/
leds.push_back(*new_led);
SetupColors();
}
void RGBController_ASRockASRRGBSMBus::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_ASRockASRRGBSMBus::DeviceUpdateLEDs()
{
for (std::size_t led = 0; led < colors.size(); led++)
{
UpdateSingleLED(led);
}
}
void RGBController_ASRockASRRGBSMBus::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_ASRockASRRGBSMBus::UpdateSingleLED(int led)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
/*---------------------------------------------------------*\
| If the LED value is non-zero, this LED overrides the LED |
| index |
\*---------------------------------------------------------*/
if(leds[led].value != 0)
{
led = leds[led].value;
}
controller->SetColorsAndSpeed(led, red, grn, blu);
}
void RGBController_ASRockASRRGBSMBus::DeviceUpdateMode()
{
controller->SetMode(0, modes[active_mode].value, modes[active_mode].speed);
DeviceUpdateLEDs();
}
@@ -1,34 +1,33 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromeSMBus.h |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "ASRockPolychromeSMBusController.h"
class RGBController_Polychrome : public RGBController
{
public:
RGBController_Polychrome(PolychromeController* polychrome_ptr);
~RGBController_Polychrome();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
PolychromeController* polychrome;
};
/*-----------------------------------------*\
| RGBController_ASRockPolychromeSMBus.h |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "ASRockASRRGBSMBusController.h"
class RGBController_ASRockASRRGBSMBus : public RGBController
{
public:
RGBController_ASRockASRRGBSMBus(ASRockASRRGBSMBusController* controller_ptr);
~RGBController_ASRockASRRGBSMBus();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
ASRockASRRGBSMBusController* controller;
};
@@ -0,0 +1,348 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromeSMBus.cpp |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#include "LogManager.h"
#include "RGBController_ASRockPolychromeV1SMBus.h"
static const char* polychrome_v1_zone_names[] =
{
"RGB LED 1 Header",
"RGB LED 2 Header",
"PCH",
"IO Cover",
"Audio",
"Addressable Header"
};
/**------------------------------------------------------------------*\
@name ASRock Polychrome v1 SMBus
@category Motherboard
@type SMBus
@save :robot:
@direct :x:
@effects :white_check_mark:
@detectors DetectASRockSMBusControllers
@comment ASRock Polychrome v1 controllers will save with each update.
Per ARGB LED support is not possible with these devices.
ARGB size and color order is set using the `ARGB Header Config mode`
`Right` = GRB mode that is needed for WS2812B ARGB devices and `Left` = RGB used for WS2811 strips
The modes speed slider will set the size of the header
Spectrum Cycles uses the RGB values to set the individual color brightness.
\*-------------------------------------------------------------------*/
RGBController_ASRockPolychromeV1SMBus::RGBController_ASRockPolychromeV1SMBus(ASRockPolychromeV1SMBusController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "ASRock";
version = controller->GetFirmwareVersion();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASRock Polychrome v1 Device";
location = controller->GetDeviceLocation();
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_V1_MODE_OFF;
Off.flags = MODE_FLAG_AUTOMATIC_SAVE;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = POLYCHROME_V1_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = POLYCHROME_V1_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Breathing.speed_min = POLYCHROME_V1_SPEED_MIN_BREATHING;
Breathing.speed_max = POLYCHROME_V1_SPEED_MAX_BREATHING;
Breathing.speed = POLYCHROME_V1_SPEED_DEFAULT_BREATHING;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = POLYCHROME_V1_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Strobe.speed_min = POLYCHROME_V1_SPEED_MIN_STROBE;
Strobe.speed_max = POLYCHROME_V1_SPEED_MAX_STROBE;
Strobe.speed = POLYCHROME_V1_SPEED_DEFAULT_STROBE;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = POLYCHROME_V1_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
SpectrumCycle.speed_min = POLYCHROME_V1_SPEED_MIN_CYCLE;
SpectrumCycle.speed_max = POLYCHROME_V1_SPEED_MAX_CYCLE;
SpectrumCycle.speed = POLYCHROME_V1_SPEED_DEFAULT_CYCLE;
SpectrumCycle.color_mode = MODE_COLORS_PER_LED;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = POLYCHROME_V1_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Random.speed_min = POLYCHROME_V1_SPEED_MIN_RANDOM;
Random.speed_max = POLYCHROME_V1_SPEED_MAX_RANDOM;
Random.speed = POLYCHROME_V1_SPEED_DEFAULT_RANDOM;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Music;
Music.name = "Music";
Music.value = POLYCHROME_V1_MODE_MUSIC;
Music.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Music.color_mode = MODE_COLORS_NONE;
modes.push_back(Music);
mode Wave;
Wave.name = "Wave";
Wave.value = POLYCHROME_V1_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Wave.speed_min = POLYCHROME_V1_SPEED_MIN_WAVE;
Wave.speed_max = POLYCHROME_V1_SPEED_MAX_WAVE;
Wave.speed = POLYCHROME_V1_SPEED_DEFAULT_WAVE;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
/*---------------------------------------------------------------------*\
| Comment out until per zone modes are working. These are only for ARGB |
\*---------------------------------------------------------------------*/
/*
mode Spring;
Spring.name = "Spring";
Spring.value = POLYCHROME_V1_MODE_SPRING;
Spring.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Spring.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Spring.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Spring.speed = POLYCHROME_V1_SPEED_DEFAULT_SPRING;
Spring.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Spring);
mode Stack;
Stack.name = "Stack";
Stack.value = POLYCHROME_V1_MODE_STACK;
Stack.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Stack.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Stack.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Stack.speed = POLYCHROME_V1_SPEED_DEFAULT_STACK;
Stack.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Stack);
mode Cram;
Cram.name = "Cram";
Cram.value = POLYCHROME_V1_MODE_CRAM;
Cram.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Cram.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Cram.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Cram.speed = POLYCHROME_V1_SPEED_DEFAULT_CRAM;
Cram.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Cram);
mode Scan;
Scan.name = "Scan";
Scan.value = POLYCHROME_V1_MODE_SCAN;
Scan.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Scan.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Scan.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Scan.speed = POLYCHROME_V1_SPEED_DEFAULT_SCAN;
Scan.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Scan);
mode Neon;
Neon.name = "Neon";
Neon.value = POLYCHROME_V1_MODE_NEON;
Neon.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Neon.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Neon.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Neon.speed = POLYCHROME_V1_SPEED_DEFAULT_NEON;
Neon.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Neon);
mode Water;
Water.name = "Water";
Water.value = POLYCHROME_V1_MODE_WATER;
Water.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Water.speed_min = POLYCHROME_V1_SPEED_MIN_ARGB;
Water.speed_max = POLYCHROME_V1_SPEED_MAX_ARGB;
Water.speed = POLYCHROME_V1_SPEED_DEFAULT_WATER;
Water.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Water);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = POLYCHROME_V1_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Rainbow.speed_min = POLYCHROME_V1_SPEED_MIN_RAINBOW;
Rainbow.speed_max = POLYCHROME_V1_SPEED_MAX_RAINBOW;
Rainbow.speed = POLYCHROME_V1_SPEED_DEFAULT_RAINBOW;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
*/
/*---------------------------------------------------------------------*\
| This ARGB_Config section is a hack to allow users to configure the |
| RGB vs GRB mode using the direction of the mode as well as set the |
| size of the devices connected to the header using the brightness |
| value. |
| |
| The mode should be removed onece the device settings are avaiable. |
\*---------------------------------------------------------------------*/
mode ARGB_Config;
ARGB_Config.name = "ARGB Header Config";
ARGB_Config.value = POLYCHROME_V1_REG_ARGB_GRB;
ARGB_Config.flags = MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
ARGB_Config.speed = controller->zone_led_count[POLYCHROME_V1_ZONE_ADDRESSABLE];
ARGB_Config.speed_min = 1;
ARGB_Config.speed_max = POLYCHROME_V1_ZONE_ADDRESSABLE_MAX;
ARGB_Config.direction = controller -> GetARGBColorOrder();
ARGB_Config.color_mode = MODE_COLORS_NONE;
modes.push_back(ARGB_Config);
SetupZones();
controller->LoadZoneConfig();
active_mode = getModeIndex(controller->zone_config[0].mode); // Hard coding zone 0 until per zone modes are available.
if(active_mode != POLYCHROME_V1_MODE_OFF)
{
for( uint8_t zone_idx = 0; zone_idx < zoneIndexMap.size(); zone_idx++)
{
zones[zone_idx].colors[0] = controller->GetZoneColor(zoneIndexMap[zone_idx]);
}
}
}
RGBController_ASRockPolychromeV1SMBus::~RGBController_ASRockPolychromeV1SMBus()
{
delete controller;
}
uint8_t RGBController_ASRockPolychromeV1SMBus::getModeIndex(uint8_t mode_value)
{
for(uint8_t mode_index = 0; mode_index < modes.size(); mode_index++)
{
if (modes[mode_index].value == mode_value)
{
return mode_index;
}
}
return 0;
}
void RGBController_ASRockPolychromeV1SMBus::SetupZones()
{
/*---------------------------------------------------------*\
| Polychrome motherboards should set up zones based on LED |
| configuration register read from device |
\*---------------------------------------------------------*/
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
for(uint8_t zone_idx = 0; zone_idx < POLYCHROME_V1_ZONE_COUNT; zone_idx++)
{
if(controller->zone_led_count[zone_idx] > 0)
{
zone* new_zone = new zone();
/*---------------------------------------------------------*\
| Set zone name to channel name |
\*---------------------------------------------------------*/
new_zone->name = polychrome_v1_zone_names[zone_idx];
new_zone->type = ZONE_TYPE_SINGLE;
new_zone->leds_min = 1;
new_zone->leds_max = 1;
new_zone->leds_count = 1;
new_zone->matrix_map = NULL;
if(zone_idx == POLYCHROME_V1_ZONE_ADDRESSABLE)
{
new_zone->leds_max = POLYCHROME_V1_ZONE_ADDRESSABLE_MAX;
}
/*---------------------------------------------------------*\
| Push new zone to zones vector |
\*---------------------------------------------------------*/
zones.push_back(*new_zone);
/*---------------------------------------------------------*\
| Each zone only has one LED |
\*---------------------------------------------------------*/
led* new_led = new led();
new_led->name = polychrome_v1_zone_names[zone_idx];
new_led->value = zone_idx;
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
\*---------------------------------------------------------*/
leds.push_back(*new_led);
zoneIndexMap.push_back(zone_idx);
}
}
SetupColors();
}
void RGBController_ASRockPolychromeV1SMBus::ResizeZone(int zone, int new_size)
{
LOG_TRACE("[%s] ResizeZone(%02X, %02X)", name.c_str(), zone, new_size);
controller-> SetARGBSize(new_size & 0xFF);
zones[POLYCHROME_V1_ZONE_ADDRESSABLE].leds_count = 1;
}
void RGBController_ASRockPolychromeV1SMBus::DeviceUpdateLEDs()
{
LOG_TRACE("[%s] DeviceUpdateLEDs()", name.c_str());
for (uint8_t zone_idx = 0; zone_idx < zoneIndexMap.size(); zone_idx++)
{
UpdateSingleLED(zone_idx);
}
}
void RGBController_ASRockPolychromeV1SMBus::UpdateZoneLEDs(int /*zone*/)
{
LOG_TRACE("[%s] UpdateZoneLEDs()", name.c_str());
DeviceUpdateLEDs();
}
void RGBController_ASRockPolychromeV1SMBus::UpdateSingleLED(int zone)
{
LOG_TRACE("[%s] UpdateSingleLED(%02X)", name.c_str(), zone);
uint8_t red = RGBGetRValue(colors[zone]);
uint8_t grn = RGBGetGValue(colors[zone]);
uint8_t blu = RGBGetBValue(colors[zone]);
controller->SetColorsAndSpeed(zoneIndexMap[zone], red, grn, blu);
}
void RGBController_ASRockPolychromeV1SMBus::DeviceUpdateMode()
{
LOG_TRACE("[%s] DeviceUpdateMode()", name.c_str());
if(modes[active_mode].value != POLYCHROME_V1_REG_ARGB_GRB)
{
for(uint8_t zone_idx = 0; zone_idx < zoneIndexMap.size(); zone_idx++)
{
controller->SetMode(zoneIndexMap[zone_idx], modes[active_mode].value, modes[active_mode].speed);
UpdateSingleLED(zone_idx);
}
}
else
{
controller-> SetARGBColorOrder(modes[active_mode].direction);
controller-> SetARGBSize(modes[active_mode].speed);
}
}
@@ -0,0 +1,35 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromeV1SMBus.h |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "ASRockPolychromeV1SMBusController.h"
class RGBController_ASRockPolychromeV1SMBus : public RGBController
{
public:
RGBController_ASRockPolychromeV1SMBus(ASRockPolychromeV1SMBusController* controller_ptr);
~RGBController_ASRockPolychromeV1SMBus();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
ASRockPolychromeV1SMBusController* controller;
uint8_t getModeIndex(uint8_t mode_value);
std::vector<uint8_t> zoneIndexMap;
};
@@ -0,0 +1,325 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromeV2SMBus.cpp|
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#include "RGBController_ASRockPolychromeV2SMBus.h"
static const char* polychrome_v2_zone_names[] =
{
"RGB LED 1 Header",
"RGB LED 2 Header",
"Audio",
"PCH",
"IO Cover",
"Addressable Header"
};
/**------------------------------------------------------------------*\
@name ASRock Polychrome v2 SMBus
@category Motherboard
@type SMBus
@save :robot:
@direct :x:
@effects :white_check_mark:
@detectors DetectASRockSMBusControllers
@comment ASRock Polychrome v2 controllers will save with each update.
Per ARGB LED support is not possible with these devices.
\*-------------------------------------------------------------------*/
RGBController_ASRockPolychromeV2SMBus::RGBController_ASRockPolychromeV2SMBus(ASRockPolychromeV2SMBusController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "ASRock";
version = controller->GetFirmwareVersion();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASRock Polychrome v2 Device";
location = controller->GetDeviceLocation();
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_V2_MODE_OFF;
Off.flags = MODE_FLAG_AUTOMATIC_SAVE;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = POLYCHROME_V2_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = POLYCHROME_V2_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Breathing.speed_min = POLYCHROME_V2_BREATHING_SPEED_MIN;
Breathing.speed_max = POLYCHROME_V2_BREATHING_SPEED_MAX;
Breathing.speed = POLYCHROME_V2_BREATHING_SPEED_DEFAULT;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = POLYCHROME_V2_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Strobe.speed_min = POLYCHROME_V2_STROBE_SPEED_MIN;
Strobe.speed_max = POLYCHROME_V2_STROBE_SPEED_MAX;
Strobe.speed = POLYCHROME_V2_STROBE_SPEED_DEFAULT;
Strobe.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Strobe);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = POLYCHROME_V2_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
SpectrumCycle.speed_min = POLYCHROME_V2_SPECTRUM_CYCLE_SPEED_MIN;
SpectrumCycle.speed_max = POLYCHROME_V2_SPECTRUM_CYCLE_SPEED_MAX;
SpectrumCycle.speed = POLYCHROME_V2_SPECTRUM_CYCLE_SPEED_DEFAULT;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Random;
Random.name = "Random";
Random.value = POLYCHROME_V2_MODE_RANDOM;
Random.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Random.speed_min = POLYCHROME_V2_RANDOM_SPEED_MIN;
Random.speed_max = POLYCHROME_V2_RANDOM_SPEED_MAX;
Random.speed = POLYCHROME_V2_RANDOM_SPEED_DEFAULT;
Random.color_mode = MODE_COLORS_NONE;
modes.push_back(Random);
mode Wave;
Wave.name = "Wave";
Wave.value = POLYCHROME_V2_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Wave.speed_min = POLYCHROME_V2_WAVE_SPEED_MIN;
Wave.speed_max = POLYCHROME_V2_WAVE_SPEED_MAX;
Wave.speed = POLYCHROME_V2_WAVE_SPEED_DEFAULT;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
mode Spring;
Spring.name = "Spring";
Spring.value = POLYCHROME_V2_MODE_SPRING;
Spring.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Spring.speed_min = POLYCHROME_V2_SPRING_SPEED_MIN;
Spring.speed_max = POLYCHROME_V2_SPRING_SPEED_MAX;
Spring.speed = POLYCHROME_V2_SPRING_SPEED_DEFAULT;
Spring.color_mode = MODE_COLORS_NONE;
modes.push_back(Spring);
mode Stack;
Stack.name = "Stack";
Stack.value = POLYCHROME_V2_MODE_STACK;
Stack.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Stack.speed_min = POLYCHROME_V2_STACK_SPEED_MIN;
Stack.speed_max = POLYCHROME_V2_STACK_SPEED_MAX;
Stack.speed = POLYCHROME_V2_STACK_SPEED_DEFAULT;
Stack.color_mode = MODE_COLORS_NONE;
modes.push_back(Stack);
mode Cram;
Cram.name = "Cram";
Cram.value = POLYCHROME_V2_MODE_CRAM;
Cram.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Cram.speed_min = POLYCHROME_V2_CRAM_SPEED_MIN;
Cram.speed_max = POLYCHROME_V2_CRAM_SPEED_MAX;
Cram.speed = POLYCHROME_V2_CRAM_SPEED_DEFAULT;
Cram.color_mode = MODE_COLORS_NONE;
modes.push_back(Cram);
mode Scan;
Scan.name = "Scan";
Scan.value = POLYCHROME_V2_MODE_SCAN;
Scan.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Scan.speed_min = POLYCHROME_V2_SCAN_SPEED_MIN;
Scan.speed_max = POLYCHROME_V2_SCAN_SPEED_MAX;
Scan.speed = POLYCHROME_V2_SCAN_SPEED_DEFAULT;
Scan.color_mode = MODE_COLORS_NONE;
modes.push_back(Scan);
mode Neon;
Neon.name = "Neon";
Neon.value = POLYCHROME_V2_MODE_NEON;
Neon.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Neon.speed_min = POLYCHROME_V2_NEON_SPEED_MIN;
Neon.speed_max = POLYCHROME_V2_NEON_SPEED_MAX;
Neon.speed = POLYCHROME_V2_NEON_SPEED_DEFAULT;
Neon.color_mode = MODE_COLORS_NONE;
modes.push_back(Neon);
mode Water;
Water.name = "Water";
Water.value = POLYCHROME_V2_MODE_WATER;
Water.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Water.speed_min = POLYCHROME_V2_WATER_SPEED_MIN;
Water.speed_max = POLYCHROME_V2_WATER_SPEED_MAX;
Water.speed = POLYCHROME_V2_WATER_SPEED_DEFAULT;
Water.color_mode = MODE_COLORS_NONE;
modes.push_back(Water);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = POLYCHROME_V2_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Rainbow.speed_min = POLYCHROME_V2_RAINBOW_SPEED_MIN;
Rainbow.speed_max = POLYCHROME_V2_RAINBOW_SPEED_MAX;
Rainbow.speed = POLYCHROME_V2_RAINBOW_SPEED_DEFAULT;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
SetupZones();
}
RGBController_ASRockPolychromeV2SMBus::~RGBController_ASRockPolychromeV2SMBus()
{
delete controller;
}
void RGBController_ASRockPolychromeV2SMBus::SetupZones()
{
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_V2_ZONE_COUNT; zone_idx++)
{
if(controller->zone_led_count[zone_idx] > 0)
{
zone* new_zone = new zone();
/*---------------------------------------------------------*\
| Set zone name to channel name |
\*---------------------------------------------------------*/
new_zone->name = polychrome_v2_zone_names[zone_idx];
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
{
new_zone->leds_min = 1;
new_zone->leds_max = 1;
new_zone->leds_count = 1;
}
else
{
new_zone->leds_min = controller->zone_led_count[zone_idx];
new_zone->leds_max = controller->zone_led_count[zone_idx];
new_zone->leds_count = controller->zone_led_count[zone_idx];
}
if(new_zone->leds_count > 1)
{
new_zone->type = ZONE_TYPE_LINEAR;
}
else
{
new_zone->type = ZONE_TYPE_SINGLE;
}
new_zone->matrix_map = NULL;
/*---------------------------------------------------------*\
| Push new zone to zones vector |
\*---------------------------------------------------------*/
zones.push_back(*new_zone);
}
}
unsigned int led_count = 0;
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
for(unsigned int zone_idx = 0; zone_idx < POLYCHROME_V2_ZONE_COUNT; zone_idx++)
{
if(controller->zone_led_count[zone_idx] > 0)
{
for(unsigned int led_idx = 0; led_idx < controller->zone_led_count[zone_idx]; led_idx++)
{
/*---------------------------------------------------------*\
| Each zone only has one LED |
\*---------------------------------------------------------*/
led* new_led = new led();
new_led->name = polychrome_v2_zone_names[zone_idx];
new_led->name.append(" " + std::to_string(led_idx + 1));
new_led->value = 0;
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
{
new_led->value = 0x19;
}
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
\*---------------------------------------------------------*/
leds.push_back(*new_led);
led_count++;
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
{
break;
}
}
}
}
SetupColors();
}
void RGBController_ASRockPolychromeV2SMBus::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_ASRockPolychromeV2SMBus::DeviceUpdateLEDs()
{
for (std::size_t led = 0; led < colors.size(); led++)
{
UpdateSingleLED(led);
}
}
void RGBController_ASRockPolychromeV2SMBus::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_ASRockPolychromeV2SMBus::UpdateSingleLED(int led)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
/*---------------------------------------------------------*\
| If the LED value is non-zero, this LED overrides the LED |
| index |
\*---------------------------------------------------------*/
if(leds[led].value != 0)
{
led = leds[led].value;
}
controller->SetColorsAndSpeed(led, red, grn, blu);
}
void RGBController_ASRockPolychromeV2SMBus::DeviceUpdateMode()
{
controller->SetMode(0, modes[active_mode].value, modes[active_mode].speed);
DeviceUpdateLEDs();
}
@@ -0,0 +1,33 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromev2SMBus.h |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "ASRockPolychromeV2SMBusController.h"
class RGBController_ASRockPolychromeV2SMBus : public RGBController
{
public:
RGBController_ASRockPolychromeV2SMBus(ASRockPolychromeV2SMBusController* controller_ptr);
~RGBController_ASRockPolychromeV2SMBus();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
ASRockPolychromeV2SMBusController* controller;
};
@@ -592,13 +592,14 @@ void AlienwareController::SetColor(uint8_t zone, RGBColor color)
void AlienwareController::SetColor(uint8_t zone, RGBColor color1, RGBColor color2)
{
dirty = ((color1 != zones[zone].color[0]) || (color2 != zones[zone].color[1]));
if ((color1 == zones[zone].color[0]) && (color2 == zones[zone].color[1]))
{
return;
}
if(dirty)
{
zones[zone].color[0] = color1;
zones[zone].color[1] = color2;
}
zones[zone].color[0] = color1;
zones[zone].color[1] = color2;
dirty = true;
}
void AlienwareController::SetPeriod(uint8_t zone, uint16_t period)
@@ -12,17 +12,28 @@
#include <thread>
#include <chrono>
RGBController_Alienware::RGBController_Alienware(AlienwareController* alienware_ptr)
{
alienware = alienware_ptr;
/**------------------------------------------------------------------*\
@name Alienware
@category Keyboard
@type USB
@save :x:
@direct :x:
@effects :white_check_mark:
@detectors DetectAlienwareControllers
@comment
\*-------------------------------------------------------------------*/
name = alienware->GetDeviceName();
RGBController_Alienware::RGBController_Alienware(AlienwareController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "Alienware";
type = DEVICE_TYPE_KEYBOARD;
description = "Alienware USB Device";
location = alienware->GetDeviceLocation();
serial = alienware->GetSerialString();
version = alienware->GetFirmwareVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
version = controller->GetFirmwareVersion();
mode Color;
Color.name = "Static";
@@ -56,7 +67,7 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* alienware_
Morph.value = ALIENWARE_MODE_MORPH;
Morph.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
Morph.color_mode = MODE_COLORS_MODE_SPECIFIC;
Morph.colors_min = 2 * alienware->GetZoneCount();
Morph.colors_min = 2 * controller->GetZoneCount();
Morph.colors_max = Morph.colors_min;
Morph.colors.resize(Morph.colors_max);
Morph.speed_min = ALIENWARE_TEMPO_MIN;
@@ -110,7 +121,7 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* alienware_
SetupZones();
alienware->UpdateDim();
controller->UpdateDim();
}
void RGBController_Alienware::SetupZones()
@@ -118,9 +129,9 @@ void RGBController_Alienware::SetupZones()
/*-------------------------------------------------*\
| Set zones and leds |
\*-------------------------------------------------*/
std::vector<const char*> zone_names = alienware->GetZoneNames();
std::vector<const char*> zone_names = controller->GetZoneNames();
for(unsigned int zone_idx = 0; zone_idx < alienware->GetZoneCount(); zone_idx++)
for(unsigned int zone_idx = 0; zone_idx < controller->GetZoneCount(); zone_idx++)
{
zone new_zone;
@@ -137,7 +148,7 @@ void RGBController_Alienware::SetupZones()
for(unsigned int led_idx = 0; led_idx < zones.size(); led_idx++)
{
led new_led;
new_led.name = zones[led_idx].name + std::string(" LED");
leds.emplace_back(new_led);
@@ -168,11 +179,6 @@ void RGBController_Alienware::UpdateSingleLED(int led)
UpdateZoneLEDs(led);
}
void RGBController_Alienware::SetCustomMode()
{
active_mode = 0;
}
static bool modes_eq(const mode& mode1, const mode& mode2)
{
return( ( mode1.name == mode2.name )
@@ -217,43 +223,43 @@ void RGBController_Alienware::DeviceUpdateMode()
\*-------------------------------------------------*/
uint16_t period = 0x07d0;
alienware->SetMode(zone_idx, current_mode.value);
controller->SetMode(zone_idx, current_mode.value);
switch(current_mode_idx)
{
case ALIENWARE_MODE_COLOR:
alienware->SetPeriod(zone_idx, period);
alienware->SetColor( zone_idx, colors[current_zone.start_idx]);
alienware->SetTempo( zone_idx, ALIENWARE_TEMPO_MAX);
alienware->SetDim( zone_idx, modes[current_mode_idx].brightness);
controller->SetPeriod(zone_idx, period);
controller->SetColor( zone_idx, colors[current_zone.start_idx]);
controller->SetTempo( zone_idx, ALIENWARE_TEMPO_MAX);
controller->SetDim( zone_idx, modes[current_mode_idx].brightness);
break;
case ALIENWARE_MODE_PULSE:
alienware->SetPeriod(zone_idx, period);
alienware->SetColor( zone_idx, colors[current_zone.start_idx]);
alienware->SetTempo( zone_idx, current_mode.speed);
alienware->SetDim( zone_idx, modes[current_mode_idx].brightness);
controller->SetPeriod(zone_idx, period);
controller->SetColor( zone_idx, colors[current_zone.start_idx]);
controller->SetTempo( zone_idx, current_mode.speed);
controller->SetDim( zone_idx, modes[current_mode_idx].brightness);
break;
case ALIENWARE_MODE_MORPH:
alienware->SetPeriod(zone_idx, period);
alienware->SetColor( zone_idx, current_mode.colors[zone_idx * 2], current_mode.colors[(zone_idx * 2) + 1]);
alienware->SetTempo( zone_idx, current_mode.speed);
alienware->SetDim( zone_idx, modes[current_mode_idx].brightness);
controller->SetPeriod(zone_idx, period);
controller->SetColor( zone_idx, current_mode.colors[zone_idx * 2], current_mode.colors[(zone_idx * 2) + 1]);
controller->SetTempo( zone_idx, current_mode.speed);
controller->SetDim( zone_idx, modes[current_mode_idx].brightness);
break;
case ALIENWARE_MODE_SPECTRUM:
case ALIENWARE_MODE_RAINBOW:
alienware->SetPeriod(zone_idx, ALIENWARE_DURATION_SPECTRUM);
alienware->SetTempo( zone_idx, current_mode.speed);
alienware->SetDim( zone_idx, modes[current_mode_idx].brightness);
controller->SetPeriod(zone_idx, ALIENWARE_DURATION_SPECTRUM);
controller->SetTempo( zone_idx, current_mode.speed);
controller->SetDim( zone_idx, modes[current_mode_idx].brightness);
break;
case ALIENWARE_MODE_BREATHING:
alienware->SetPeriod(zone_idx, period);
alienware->SetColor( zone_idx, colors[current_zone.start_idx], 0x0);
alienware->SetTempo( zone_idx, current_mode.speed);
alienware->SetDim( zone_idx, modes[current_mode_idx].brightness);
controller->SetPeriod(zone_idx, period);
controller->SetColor( zone_idx, colors[current_zone.start_idx], 0x0);
controller->SetTempo( zone_idx, current_mode.speed);
controller->SetDim( zone_idx, modes[current_mode_idx].brightness);
break;
}
}
@@ -262,7 +268,7 @@ void RGBController_Alienware::DeviceUpdateMode()
| Due to rate-limiting, this can take more than one |
| second to execute |
\*-----------------------------------------------------*/
alienware->UpdateController();
controller->UpdateController();
/*-----------------------------------------------------*\
| Re-run update if there's anything that's changed from |
@@ -17,7 +17,7 @@
class RGBController_Alienware : public RGBController
{
public:
RGBController_Alienware(AlienwareController* alienware_ptr);
RGBController_Alienware(AlienwareController* controller_ptr);
void SetupZones();
@@ -29,9 +29,7 @@ public:
void DeviceUpdateMode();
void SetCustomMode();
private:
AlienwareController* alienware;
AlienwareController* controller;
std::chrono::steady_clock::time_point last_packet_ts;
};
@@ -172,7 +172,7 @@ void AlienwareAW510KController::SendInitialize()
void AlienwareAW510KController::SetDirect
(
unsigned char zone,
unsigned char /*zone*/,
unsigned char r,
unsigned char g,
unsigned char b
@@ -222,7 +222,7 @@ void AlienwareAW510KController::SendDirectOn
| To Guarantee the data are always %4 =0 append |
| zeros at end of last packet |
\*-----------------------------------------------*/
for(int i = 0; i < (frame_data.size() % 4); i++)
for(unsigned int i = 0; i < (frame_data.size() % 4); i++)
{
SelectedKeys key;
key.idx = 0x00;
@@ -358,7 +358,7 @@ void AlienwareAW510KController::UpdateSingleLED
}
void AlienwareAW510KController::SendMode
(
unsigned char zone,
unsigned char /*zone*/,
unsigned char mode,
unsigned short speed,
unsigned char direction,
@@ -7,6 +7,7 @@
| Mohamad Sallal - msallal 05/22/2021 |
\*-----------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_AlienwareAW510K.h"
#include <iterator>
@@ -49,131 +50,142 @@ typedef struct
static const led_type led_names[] =
{
/* Key Label Zone, Index */
{ "Key: Escape", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB0 },
{ "Key: F1", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x98 },
{ "Key: F2", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x90 },
{ "Key: F3", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x88 },
{ "Key: F4", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x80 },
{ "Key: F5", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x70 },
{ "Key: F6", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x68 },
{ "Key: F7", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x60 },
{ "Key: F8", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x58 },
{ "Key: F9", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x50 },
{ "Key: F10", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x48 },
{ "Key: F11", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x40 },
{ "Key: F12", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x38 },
{ "Key: Print Screen", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x30 },
{ "Key: Scroll Lock", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x28 },
{ "Key: Pause/Break", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x20 },
{ "Key: Media Mute", ALIENWARE_AW510K_ZONE_DIRECT_MEDIA, 0x18 },
{ "Key: `", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB1 },
{ "Key: 1", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA1 },
{ "Key: 2", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x99 },
{ "Key: 3", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x91 },
{ "Key: 4", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x89 },
{ "Key: 5", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x81 },
{ "Key: 6", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x79 },
{ "Key: 7", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x71 },
{ "Key: 8", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x69 },
{ "Key: 9", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x61 },
{ "Key: 0", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x59 },
{ "Key: -", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x51 },
{ "Key: =", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x49 },
{ "Key: Backspace", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x39 },
{ "Key: Insert", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x31 },
{ "Key: Home", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x29 },
{ "Key: Page Up", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x21 },
{ "Key: Num Lock", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x19 },
{ "Key: Number Pad /", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x11 },
{ "Key: Number Pad *", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x09 },
{ "Key: Number Pad -", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x01 },
{ "Key: Tab", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB2 },
{ "Key: Q", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA2 },
{ "Key: W", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x9A },
{ "Key: E", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x92 },
{ "Key: R", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x8A },
{ "Key: T", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x82 },
{ "Key: Y", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x7A },
{ "Key: U", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x72 },
{ "Key: I", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x6A },
{ "Key: O", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x62 },
{ "Key: P", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5A },
{ "Key: [", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x52 },
{ "Key: ]", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x4A },
{ "Key: \\ (ANSI)", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x42 },//ANSI only
{ "Key: Delete", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x32 },
{ "Key: End", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x2A },
{ "Key: Page Down", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x22 },
{ "Key: Number Pad 7", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1A },
{ "Key: Number Pad 8", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x12 },
{ "Key: Number Pad 9", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0A },
{ "Key: Caps Lock", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB3 },
{ "Key: A", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA3 },
{ "Key: S", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x9B },
{ "Key: D", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x93 },
{ "Key: F", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x8B },
{ "Key: G", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x83 },
{ "Key: H", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x7B },
{ "Key: J", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x73 },
{ "Key: K", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x6B },
{ "Key: L", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x63 },
{ "Key: ;", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5B },
{ "Key: '", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x53 },
{ "Key: Enter", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x43 },
{ "Key: Number Pad 4", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1B },
{ "Key: Number Pad 5", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x13 },
{ "Key: Number Pad 6", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0B },
{ "Key: Number Pad +", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x03 },
{ "Key: Left Shift", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB4 },
{ "Key: Z", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA4 },
{ "Key: X", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x9C },
{ "Key: C", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x94 },
{ "Key: V", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x8C },
{ "Key: B", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x84 },
{ "Key: N", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x7C },
{ "Key: M", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x74 },
{ "Key: ,", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x6C },
{ "Key: .", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x64 },
{ "Key: /", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5C },
{ "Key: Right Shift", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x4C },
{ "Key: Up Arrow", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x2C },
{ "Key: Number Pad 1", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1C },
{ "Key: Number Pad 2", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x14 },
{ "Key: Number Pad 3", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0C },
{ "Key: Left Control", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB5 },
{ "Key: Left Windows", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xAD },
{ "Key: Left Alt", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA5 },
{ "Key: Space", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x85 },
{ "Key: Right Alt", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x65 },
{ "Key: Right Fn", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5D },
{ "Key: Menu", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x55 },
{ "Key: Right Control", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x4D },
{ "Key: Left Arrow", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x35 },
{ "Key: Down Arrow", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x2D },
{ "Key: Right Arrow", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x25 },
{ "Key: Number Pad 0", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1D },
{ "Key: Number Pad .", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0D },
{ "Key: Number Pad Enter", ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x05 },
{ KEY_EN_ESCAPE, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB0 },
{ KEY_EN_F1, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x98 },
{ KEY_EN_F2, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x90 },
{ KEY_EN_F3, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x88 },
{ KEY_EN_F4, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x80 },
{ KEY_EN_F5, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x70 },
{ KEY_EN_F6, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x68 },
{ KEY_EN_F7, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x60 },
{ KEY_EN_F8, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x58 },
{ KEY_EN_F9, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x50 },
{ KEY_EN_F10, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x48 },
{ KEY_EN_F11, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x40 },
{ KEY_EN_F12, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x38 },
{ KEY_EN_PRINT_SCREEN, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x30 },
{ KEY_EN_SCROLL_LOCK, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x28 },
{ KEY_EN_PAUSE_BREAK, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x20 },
{ KEY_EN_MEDIA_MUTE, ALIENWARE_AW510K_ZONE_DIRECT_MEDIA, 0x18 },
{ KEY_EN_BACK_TICK, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB1 },
{ KEY_EN_1, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA1 },
{ KEY_EN_2, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x99 },
{ KEY_EN_3, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x91 },
{ KEY_EN_4, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x89 },
{ KEY_EN_5, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x81 },
{ KEY_EN_6, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x79 },
{ KEY_EN_7, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x71 },
{ KEY_EN_8, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x69 },
{ KEY_EN_9, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x61 },
{ KEY_EN_0, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x59 },
{ KEY_EN_MINUS, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x51 },
{ KEY_EN_EQUALS, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x49 },
{ KEY_EN_BACKSPACE, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x39 },
{ KEY_EN_INSERT, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x31 },
{ KEY_EN_HOME, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x29 },
{ KEY_EN_PAGE_UP, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x21 },
{ KEY_EN_NUMPAD_LOCK, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x19 },
{ KEY_EN_NUMPAD_DIVIDE, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x11 },
{ KEY_EN_NUMPAD_TIMES, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x09 },
{ KEY_EN_NUMPAD_MINUS, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x01 },
{ KEY_EN_TAB, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB2 },
{ KEY_EN_Q, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA2 },
{ KEY_EN_W, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x9A },
{ KEY_EN_E, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x92 },
{ KEY_EN_R, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x8A },
{ KEY_EN_T, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x82 },
{ KEY_EN_Y, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x7A },
{ KEY_EN_U, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x72 },
{ KEY_EN_I, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x6A },
{ KEY_EN_O, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x62 },
{ KEY_EN_P, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5A },
{ KEY_EN_LEFT_BRACKET, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x52 },
{ KEY_EN_RIGHT_BRACKET, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x4A },
{ KEY_EN_ANSI_BACK_SLASH, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x42 },//ANSI only
{ KEY_EN_DELETE, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x32 },
{ KEY_EN_END, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x2A },
{ KEY_EN_PAGE_DOWN, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x22 },
{ KEY_EN_NUMPAD_7, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1A },
{ KEY_EN_NUMPAD_8, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x12 },
{ KEY_EN_NUMPAD_9, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0A },
{ KEY_EN_CAPS_LOCK, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB3 },
{ KEY_EN_A, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA3 },
{ KEY_EN_S, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x9B },
{ KEY_EN_D, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x93 },
{ KEY_EN_F, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x8B },
{ KEY_EN_G, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x83 },
{ KEY_EN_H, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x7B },
{ KEY_EN_J, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x73 },
{ KEY_EN_K, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x6B },
{ KEY_EN_L, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x63 },
{ KEY_EN_SEMICOLON, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5B },
{ KEY_EN_QUOTE, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x53 },
{ KEY_EN_ANSI_ENTER, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x43 },
{ KEY_EN_NUMPAD_4, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1B },
{ KEY_EN_NUMPAD_5, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x13 },
{ KEY_EN_NUMPAD_6, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0B },
{ KEY_EN_NUMPAD_PLUS, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x03 },
{ KEY_EN_LEFT_SHIFT, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB4 },
{ KEY_EN_Z, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA4 },
{ KEY_EN_X, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x9C },
{ KEY_EN_C, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x94 },
{ KEY_EN_V, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x8C },
{ KEY_EN_B, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x84 },
{ KEY_EN_N, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x7C },
{ KEY_EN_M, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x74 },
{ KEY_EN_COMMA, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x6C },
{ KEY_EN_PERIOD, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x64 },
{ KEY_EN_FORWARD_SLASH, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5C },
{ KEY_EN_RIGHT_SHIFT, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x4C },
{ KEY_EN_UP_ARROW, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x2C },
{ KEY_EN_NUMPAD_1, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1C },
{ KEY_EN_NUMPAD_2, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x14 },
{ KEY_EN_NUMPAD_3, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0C },
{ KEY_EN_LEFT_CONTROL, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xB5 },
{ KEY_EN_LEFT_WINDOWS, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xAD },
{ KEY_EN_LEFT_ALT, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0xA5 },
{ KEY_EN_SPACE, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x85 },
{ KEY_EN_RIGHT_ALT, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x65 },
{ KEY_EN_RIGHT_FUNCTION, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x5D },
{ KEY_EN_MENU, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x55 },
{ KEY_EN_RIGHT_CONTROL, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x4D },
{ KEY_EN_LEFT_ARROW, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x35 },
{ KEY_EN_DOWN_ARROW, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x2D },
{ KEY_EN_RIGHT_ARROW, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x25 },
{ KEY_EN_NUMPAD_0, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x1D },
{ KEY_EN_NUMPAD_PERIOD, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x0D },
{ KEY_EN_NUMPAD_ENTER, ALIENWARE_AW510K_ZONE_DIRECT_KEYBOARD, 0x05 },
{ "Logo", ALIENWARE_AW510K_ZONE_DIRECT_LOGO, 0x07 }
};
RGBController_AlienwareAW510K::RGBController_AlienwareAW510K(AlienwareAW510KController* alienware_ptr)
/**------------------------------------------------------------------*\
@name Alienware AW510 Keyboard
@category Keyboard
@type USB
@save :x:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAlienwareAW510KControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_AlienwareAW510K::RGBController_AlienwareAW510K(AlienwareAW510KController* controller_ptr)
{
alienware = alienware_ptr;
controller = controller_ptr;
name = "Alienware AW510K Keyboard Device";
vendor = "Alienware";
type = DEVICE_TYPE_KEYBOARD;
description = "Alienware AW510K Keyboard Device";
location = alienware->GetDeviceLocation();
serial = alienware->GetSerialString();
name = "Alienware AW510K Keyboard Device";
vendor = "Alienware";
type = DEVICE_TYPE_KEYBOARD;
description = "Alienware AW510K Keyboard Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct_Per_LED;
Direct_Per_LED.name = "Direct";
Direct_Per_LED.value = ALIENWARE_AW510K_MODE_DIRECT_PER_LED;
Direct_Per_LED.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct_Per_LED.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct_Per_LED);
mode Direct;
Direct.name = "Direct";
Direct.value = ALIENWARE_AW510K_MODE_DIRECT_PER_LED;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
@@ -274,7 +286,7 @@ RGBController_AlienwareAW510K::~RGBController_AlienwareAW510K()
}
}
delete alienware;
delete controller;
}
void RGBController_AlienwareAW510K::SetupZones()
@@ -349,10 +361,10 @@ void RGBController_AlienwareAW510K::DeviceUpdateLEDs()
{
SelectedKeys key;
key.idx = (unsigned char)leds[led_idx].value;
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
key.idx = (unsigned char)leds[led_idx].value;
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
frame_buf_keys.push_back(key);
}
@@ -360,22 +372,22 @@ void RGBController_AlienwareAW510K::DeviceUpdateLEDs()
{
SelectedKeys key;
key.idx = (unsigned char)leds[led_idx].value;
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
key.idx = (unsigned char)leds[led_idx].value;
key.red = RGBGetRValue(colors[led_idx]);
key.green = RGBGetGValue(colors[led_idx]);
key.blue = RGBGetBValue(colors[led_idx]);
frame_buf_keys.push_back(key);
}
}
alienware->SendInitialize();
alienware->SendfeatureReport(0x05, 0x01, 0x51, 0x00);
alienware->SendCommit();
controller->SendInitialize();
controller->SendfeatureReport(0x05, 0x01, 0x51, 0x00);
controller->SendCommit();
if(frame_buf_keys.size() > 0)
{
alienware->SendDirectOn(frame_buf_keys);
controller->SendDirectOn(frame_buf_keys);
}
std::copy(new_colors.begin(), new_colors.end(),current_colors.begin());
@@ -383,17 +395,12 @@ void RGBController_AlienwareAW510K::DeviceUpdateLEDs()
void RGBController_AlienwareAW510K::UpdateZoneLEDs(int zone)
{
alienware->SetDirect((unsigned char) zone, RGBGetRValue(zones[zone].colors[0]), RGBGetGValue(zones[zone].colors[0]), RGBGetBValue(zones[zone].colors[0]));
controller->SetDirect((unsigned char) zone, RGBGetRValue(zones[zone].colors[0]), RGBGetGValue(zones[zone].colors[0]), RGBGetBValue(zones[zone].colors[0]));
}
void RGBController_AlienwareAW510K::UpdateSingleLED(int led)
{
alienware->UpdateSingleLED(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
}
void RGBController_AlienwareAW510K::SetCustomMode()
{
active_mode = 0;
controller->UpdateSingleLED(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
}
void RGBController_AlienwareAW510K::DeviceUpdateMode()
@@ -404,7 +411,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateMode()
return;
}
alienware->SendfeatureReport(0x05, 0x01, 0x51, 0x00);
controller->SendfeatureReport(0x05, 0x01, 0x51, 0x00);
unsigned char red = 0;
unsigned char grn = 0;
unsigned char blu = 0;
@@ -427,7 +434,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateMode()
unsigned char grn2 = RGBGetGValue(modes[active_mode].colors[1]);
unsigned char blu2 = RGBGetBValue(modes[active_mode].colors[1]);
alienware->SetMorphMode(modes[active_mode].value, modes[active_mode].speed, red, grn, blu, red2, grn2, blu2);
controller->SetMorphMode(modes[active_mode].value, modes[active_mode].speed, red, grn, blu, red2, grn2, blu2);
}
break;
@@ -435,7 +442,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateMode()
/*-------------------------------------------------------------*\
| Spectrum only set mode, speed and colorMode |
\*-------------------------------------------------------------*/
alienware->SetMode(modes[active_mode].value, modes[active_mode].speed, 0x00, ALIENWARE_AW510K_RANBOW_COLOR_MODE, 0x00, 0x00, 0x00);
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, 0x00, ALIENWARE_AW510K_RANBOW_COLOR_MODE, 0x00, 0x00, 0x00);
break;
case ALIENWARE_AW510K_MODE_SINGLE_WAVE:
@@ -444,7 +451,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateMode()
\*-------------------------------------------------------------*/
{
int waveDirection = GetAW520K_WaveDirection(modes[active_mode].direction);
alienware->SetMode(modes[active_mode].value, modes[active_mode].speed, waveDirection, ALIENWARE_AW510K_SINGLE_COLOR_MODE, red, grn, blu);
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, waveDirection, ALIENWARE_AW510K_SINGLE_COLOR_MODE, red, grn, blu);
}
break;
@@ -454,13 +461,13 @@ void RGBController_AlienwareAW510K::DeviceUpdateMode()
\*-------------------------------------------------------------*/
{
int waveDirection = GetAW520K_WaveDirection(modes[active_mode].direction);
alienware->SetMode(modes[active_mode].value, modes[active_mode].speed, waveDirection, ALIENWARE_AW510K_RANBOW_COLOR_MODE, 0x00, 0x00, 0x00);
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, waveDirection, ALIENWARE_AW510K_RANBOW_COLOR_MODE, 0x00, 0x00, 0x00);
}
break;
default:
alienware->SetMode(modes[active_mode].value, modes[active_mode].speed, 0x00, ALIENWARE_AW510K_SINGLE_COLOR_MODE, red, grn, blu);
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, 0x00, ALIENWARE_AW510K_SINGLE_COLOR_MODE, red, grn, blu);
break;
}
}
@@ -15,7 +15,7 @@
class RGBController_AlienwareAW510K : public RGBController
{
public:
RGBController_AlienwareAW510K(AlienwareAW510KController* alienware_ptr);
RGBController_AlienwareAW510K(AlienwareAW510KController* controller_ptr);
~RGBController_AlienwareAW510K();
void SetupZones();
@@ -26,10 +26,9 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AlienwareAW510KController* alienware;
AlienwareAW510KController* controller;
std::vector<RGBColor> current_colors;
};
@@ -7,6 +7,7 @@
| Sergey Gavrilov (DrZlo13) 06/06/2021 |
\*-----------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_AnnePro2.h"
#define NA 0xFFFFFFFF
@@ -17,12 +18,12 @@ static unsigned int matrix_map[5][14] =
{ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 },
{ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 },
{ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, NA },
{ 41, NA, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, NA },
{ 41, NA, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, NA },
{ 53, NA, 54, 55, NA, NA, 56, NA, NA, 57, 58, 59, 60, NA } };
static const char* zone_names[] =
{
"Keyboard",
ZONE_EN_KEYBOARD,
};
static zone_type zone_types[] =
@@ -44,79 +45,90 @@ typedef struct
static const led_type led_names[] =
{
/* Key Label Index */
{ "Key: Escape", 0 },
{ "Key: 1", 1 },
{ "Key: 2", 2 },
{ "Key: 3", 3 },
{ "Key: 4", 4 },
{ "Key: 5", 5 },
{ "Key: 6", 6 },
{ "Key: 7", 7 },
{ "Key: 8", 8 },
{ "Key: 9", 9 },
{ "Key: 0", 10 },
{ "Key: -", 11 },
{ "Key: =", 12 },
{ "Key: Backspace", 13 },
{ "Key: Tab", 14 },
{ "Key: Q", 15 },
{ "Key: W", 16 },
{ "Key: E", 17 },
{ "Key: R", 18 },
{ "Key: T", 19 },
{ "Key: Y", 20 },
{ "Key: U", 21 },
{ "Key: I", 22 },
{ "Key: O", 23 },
{ "Key: P", 24 },
{ "Key: [", 25 },
{ "Key: ]", 26 },
{ "Key: \\ (ANSI)", 27 },
{ "Key: Caps Lock", 28 },
{ "Key: A", 29 },
{ "Key: S", 30 },
{ "Key: D", 31 },
{ "Key: F", 32 },
{ "Key: G", 33 },
{ "Key: H", 34 },
{ "Key: J", 35 },
{ "Key: K", 36 },
{ "Key: L", 37 },
{ "Key: ;", 38 },
{ "Key: '", 39 },
{ "Key: Enter", 40 },
{ "Key: Left Shift", 41 },
{ "Key: Z", 42 },
{ "Key: X", 43 },
{ "Key: C", 44 },
{ "Key: V", 45 },
{ "Key: B", 46 },
{ "Key: N", 47 },
{ "Key: M", 48 },
{ "Key: ,", 49 },
{ "Key: .", 50 },
{ "Key: /", 51 },
{ "Key: Right Shift", 52 },
{ "Key: Left Control", 53 },
{ "Key: Left Windows", 54 },
{ "Key: Left Alt", 55 },
{ "Key: Space", 56 },
{ "Key: Right Alt", 57 },
{ "Key: Right Fn", 58 },
{ "Key: Menu", 59 },
{ "Key: Right Control", 60 },
{ KEY_EN_ESCAPE, 0 },
{ KEY_EN_1, 1 },
{ KEY_EN_2, 2 },
{ KEY_EN_3, 3 },
{ KEY_EN_4, 4 },
{ KEY_EN_5, 5 },
{ KEY_EN_6, 6 },
{ KEY_EN_7, 7 },
{ KEY_EN_8, 8 },
{ KEY_EN_9, 9 },
{ KEY_EN_0, 10 },
{ KEY_EN_MINUS, 11 },
{ KEY_EN_EQUALS, 12 },
{ KEY_EN_BACKSPACE, 13 },
{ KEY_EN_TAB, 14 },
{ KEY_EN_Q, 15 },
{ KEY_EN_W, 16 },
{ KEY_EN_E, 17 },
{ KEY_EN_R, 18 },
{ KEY_EN_T, 19 },
{ KEY_EN_Y, 20 },
{ KEY_EN_U, 21 },
{ KEY_EN_I, 22 },
{ KEY_EN_O, 23 },
{ KEY_EN_P, 24 },
{ KEY_EN_LEFT_BRACKET, 25 },
{ KEY_EN_RIGHT_BRACKET, 26 },
{ KEY_EN_ANSI_BACK_SLASH, 27 },
{ KEY_EN_CAPS_LOCK, 28 },
{ KEY_EN_A, 29 },
{ KEY_EN_S, 30 },
{ KEY_EN_D, 31 },
{ KEY_EN_F, 32 },
{ KEY_EN_G, 33 },
{ KEY_EN_H, 34 },
{ KEY_EN_J, 35 },
{ KEY_EN_K, 36 },
{ KEY_EN_L, 37 },
{ KEY_EN_SEMICOLON, 38 },
{ KEY_EN_QUOTE, 39 },
{ KEY_EN_ANSI_ENTER, 40 },
{ KEY_EN_LEFT_SHIFT, 41 },
{ KEY_EN_Z, 42 },
{ KEY_EN_X, 43 },
{ KEY_EN_C, 44 },
{ KEY_EN_V, 45 },
{ KEY_EN_B, 46 },
{ KEY_EN_N, 47 },
{ KEY_EN_M, 48 },
{ KEY_EN_COMMA, 49 },
{ KEY_EN_PERIOD, 50 },
{ KEY_EN_FORWARD_SLASH, 51 },
{ KEY_EN_RIGHT_SHIFT, 52 },
{ KEY_EN_LEFT_CONTROL, 53 },
{ KEY_EN_LEFT_WINDOWS, 54 },
{ KEY_EN_LEFT_ALT, 55 },
{ KEY_EN_SPACE, 56 },
{ KEY_EN_RIGHT_ALT, 57 },
{ KEY_EN_RIGHT_FUNCTION, 58 },
{ KEY_EN_MENU, 59 },
{ KEY_EN_RIGHT_CONTROL, 60 },
};
RGBController_AnnePro2::RGBController_AnnePro2(AnnePro2Controller* annepro2_ptr)
/**------------------------------------------------------------------*\
@name Anne Pro 2
@category Keyboard
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectAnnePro2Controllers
@comment
\*-------------------------------------------------------------------*/
RGBController_AnnePro2::RGBController_AnnePro2(AnnePro2Controller* controller_ptr)
{
annepro2 = annepro2_ptr;
controller = controller_ptr;
name = "Anne Pro 2";
vendor = "Obinslab";
type = DEVICE_TYPE_KEYBOARD;
description = "Obinslab Anne Pro 2 Device";
location = annepro2->GetDeviceLocation();
serial = annepro2->GetSerialString();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
@@ -128,12 +140,12 @@ RGBController_AnnePro2::RGBController_AnnePro2(AnnePro2Controller* annepro2_ptr)
SetupZones();
}
RGBController_AnnePro2::~RGBController_AnnePro2()
RGBController_AnnePro2::~RGBController_AnnePro2()
{
delete annepro2;
delete controller;
}
void RGBController_AnnePro2::SetupZones()
void RGBController_AnnePro2::SetupZones()
{
/*---------------------------------------------------------*\
| Set up zones |
@@ -176,14 +188,14 @@ void RGBController_AnnePro2::SetupZones()
SetupColors();
}
void RGBController_AnnePro2::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_AnnePro2::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AnnePro2::DeviceUpdateLEDs()
void RGBController_AnnePro2::DeviceUpdateLEDs()
{
const unsigned char frame_buf_length = LED_REAL_COUNT * 3;
unsigned char frame_buf[frame_buf_length];
@@ -211,25 +223,20 @@ void RGBController_AnnePro2::DeviceUpdateLEDs()
led_real_idx++;
}
annepro2->SendDirect(frame_buf_length, frame_buf);
controller->SendDirect(frame_buf_length, frame_buf);
}
void RGBController_AnnePro2::UpdateZoneLEDs(int /*zone*/)
void RGBController_AnnePro2::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_AnnePro2::UpdateSingleLED(int /*led*/)
void RGBController_AnnePro2::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_AnnePro2::SetCustomMode()
void RGBController_AnnePro2::DeviceUpdateMode()
{
active_mode = 0;
}
void RGBController_AnnePro2::DeviceUpdateMode()
{
}
@@ -14,7 +14,7 @@
class RGBController_AnnePro2 : public RGBController
{
public:
RGBController_AnnePro2(AnnePro2Controller* annepro2_ptr);
RGBController_AnnePro2(AnnePro2Controller* controller_ptr);
~RGBController_AnnePro2();
void SetupZones();
@@ -24,9 +24,8 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AnnePro2Controller* annepro2;
AnnePro2Controller* controller;
};
@@ -1,34 +1,57 @@
#include "Detector.h"
#include "AsusAuraCoreController.h"
#include "RGBController.h"
#include "RGBController_AsusAuraCore.h"
#include <hidapi/hidapi.h>
#define AURA_CORE_VID 0x0B05
/******************************************************************************************\
* *
* DetectAuraCoreControllers *
* *
* Tests the USB address to see if an Asus ROG Aura Core controller exists there *
* *
\******************************************************************************************/
void DetectAsusAuraCoreControllers(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if( dev )
{
AuraCoreController* controller = new AuraCoreController(dev, info->path);
RGBController_AuraCore* rgb_controller = new RGBController_AuraCore(controller);
// Constructor sets the name
if(rgb_controller->type != DEVICE_TYPE_UNKNOWN)
{
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
}
REGISTER_HID_DETECTOR("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1854);
REGISTER_HID_DETECTOR("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1866);
REGISTER_HID_DETECTOR("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1869);
#include "Detector.h"
#include "AsusAuraCoreController.h"
#include "RGBController.h"
#include "RGBController_AsusAuraCore.h"
#include "RGBController_AsusAuraCoreLaptop.h"
#include <hidapi/hidapi.h>
#define AURA_CORE_VID 0x0B05
#define AURA_STRIX_SCAR_15_PID 0x19B6
/******************************************************************************************\
* *
* DetectAuraCoreControllers *
* *
* Tests the USB address to see if an Asus ROG Aura Core controller exists there *
* *
\******************************************************************************************/
void DetectAsusAuraCoreControllers(hid_device_info* info, const std::string& /*name*/)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraCoreController* controller = new AuraCoreController(dev, info->path);
RGBController_AuraCore* rgb_controller = new RGBController_AuraCore(controller);
// Constructor sets the name
if(rgb_controller->type != DEVICE_TYPE_UNKNOWN)
{
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
else
{
delete rgb_controller;
}
}
}
void DetectAsusAuraCoreLaptopControllers(hid_device_info* info, const std::string& /*name*/)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AsusAuraCoreLaptopController* controller = new AsusAuraCoreLaptopController(dev, info->path);
RGBController_AsusAuraCoreLaptop* rgb_controller = new RGBController_AsusAuraCoreLaptop(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
REGISTER_HID_DETECTOR ("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1854);
REGISTER_HID_DETECTOR ("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1866);
REGISTER_HID_DETECTOR ("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1869);
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix SCAR 15", DetectAsusAuraCoreLaptopControllers, AURA_CORE_VID, AURA_STRIX_SCAR_15_PID, 0xFF31, 0x79);
@@ -0,0 +1,356 @@
/*---------------------------------------------------------------------*\
| AsusAuraCoreLaptopController.cpp |
| |
| Driver for Asus Aura Core Laptop USB Controller |
| |
| Chris M (Dr_No) 28 Jul 2022 |
| |
\*---------------------------------------------------------------------*/
#include "AsusAuraCoreLaptopController.h"
static uint8_t packet_map[ASUSAURACORELAPTOP_KEYCOUNT +
ASUSAURACORELAPTOP_LIGHTBARCOUNT +
ASUSAURACORELAPTOP_LIDCOUNT ] =
{
/*00 ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 */
21, 23, 24, 25, 26, 28, 29, 30, 31, 33,
/*10 F10 F11 F12 DEL ` 1 2 3 4 5 */
34, 35, 36, 37, 42, 43, 44, 45, 46, 47,
/*20 6 7 8 9 0 - = BSP BSP BSP */
48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
/*30 PLY TAB Q W E R T Y U I */
58, 63, 64, 65, 66, 67, 68, 69, 70, 71,
/*40 O P [ ] \ STP CAP A S D */
72, 73, 74, 75, 76, 79, 84, 85, 86, 87,
/*50 F G H J K L ; ' ENT PRV */
88, 89, 90, 91, 92, 93, 94, 95, 98, 100,
/*60 LSH Z X C V B N M , . */
105, 107, 108, 109, 110, 111, 112, 113, 114, 115,
/*70 / RSH UP NXT LCTL LFN LWIN LALT SPC RALT */
116, 119, 139, 121, 126, 127, 128, 129, 131, 135,
/*80 RCTL LFT DWN RGT PRT KSTN VDN VUP MICM HPFN */
137, 159, 160, 161, 142, 175, 2, 3, 4, 5,
/*90 ARMC LB1 LB2 LB3 LB4 LB5 LB6 LOGO LIDL LIDR */
6, 174, 173, 172, 171, 170, 169, 167, 176, 177,
};
static std::string power_zones[ASUSAURACORELAPTOP_POWER_ZONES] =
{
"Logo",
ZONE_EN_KEYBOARD,
"Lightbar",
"Lid Edges"
};
static std::string power_states[ASUSAURACORELAPTOP_POWER_STATES] =
{
" when booting",
" when awake",
" when sleeping",
" when off",
};
AsusAuraCoreLaptopController::AsusAuraCoreLaptopController(hid_device* dev_handle, const char* path)
{
const uint8_t sz = HID_MAX_STR;
wchar_t tmp[sz];
dev = dev_handle;
location = path;
hid_get_manufacturer_string(dev, tmp, sz);
std::wstring wName = std::wstring(tmp);
device_name = std::string(wName.begin(), wName.end());
hid_get_product_string(dev, tmp, sz);
wName = std::wstring(tmp);
device_name.append(" ").append(std::string(wName.begin(), wName.end()));
SetPowerConfigFromJSON();
}
AsusAuraCoreLaptopController::~AsusAuraCoreLaptopController()
{
hid_close(dev);
}
std::string AsusAuraCoreLaptopController::GetDeviceName()
{
return device_name;
}
std::string AsusAuraCoreLaptopController::GetSerial()
{
const uint8_t sz = HID_MAX_STR;
wchar_t tmp[sz];
int ret = hid_get_serial_number_string(dev, tmp, sz);
if (ret != 0)
{
LOG_DEBUG("[%s] Get HID Serial string failed", device_name.c_str());
return("");
}
std::wstring w_tmp = std::wstring(tmp);
std::string serial = std::string(w_tmp.begin(), w_tmp.end());
return serial;
}
std::string AsusAuraCoreLaptopController::GetLocation()
{
return("HID: " + location);
}
void AsusAuraCoreLaptopController::SetMode(uint8_t mode, uint8_t speed, uint8_t brightness, RGBColor color1, RGBColor color2, uint8_t random, uint8_t direction)
{
bool needs_update = !( (current_mode == mode ) &&
(current_speed == speed ) &&
(current_brightness == brightness ) &&
(current_c1 == color1 ) &&
(current_c2 == color2 ) &&
(current_random == random ) &&
(current_direction == direction ) );
if(needs_update)
{
current_mode = mode;
current_speed = speed;
current_brightness = brightness;
current_c1 = color1;
current_c2 = color2;
current_random = random;
current_direction = direction;
SendUpdate();
SendBrightness();
}
}
void AsusAuraCoreLaptopController::SetLedsDirect(std::vector<RGBColor> colors)
{
/*---------------------------------------------------------*\
| The keyboard zone is a set of 168 keys (indexed from 0) |
| sent in 11 packets of 16 triplets. The Lid and Lightbar |
| zones are sent in one final packet afterwards. |
\*---------------------------------------------------------*/
const uint8_t key_set = 167;
const uint8_t led_count = 178;
const uint16_t map_size = 3 * led_count;
const uint8_t leds_per_packet = 16;
uint8_t buffer[ASUSAURACORELAPTOP_WRITE_PACKET_SIZE] = { ASUSAURACORELAPTOP_REPORT_ID, ASUSAURACORELAPTOP_CMD_DIRECT,
0x00, 0x01, 0x01, 0x01, 0x00, leds_per_packet, 0x00 };
uint8_t key_buf[map_size];
memset(key_buf, 0, map_size);
for(size_t led_index = 0; led_index < colors.size(); led_index++)
{
uint16_t offset = 3 * packet_map[led_index];
key_buf[offset] = RGBGetRValue(colors[led_index]);
key_buf[offset + 1] = RGBGetGValue(colors[led_index]);
key_buf[offset + 2] = RGBGetBValue(colors[led_index]);
}
for(size_t i = 0; i < key_set; i+=leds_per_packet)
{
uint8_t leds_remaining = key_set - i;
if(leds_remaining < leds_per_packet)
{
buffer[07] = leds_remaining;
}
buffer[06] = i;
memcpy(&buffer[ASUSAURACORELAPTOP_DATA_BYTE], &key_buf[3 * i], (3 * buffer[07]));
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);
}
buffer[4] = 0x04;
buffer[5] = 0x00;
buffer[6] = 0x00;
buffer[7] = 0x00;
memcpy(&buffer[ASUSAURACORELAPTOP_DATA_BYTE], &key_buf[3 * key_set], (3 * (led_count - key_set)));
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);
}
void AsusAuraCoreLaptopController::SendBrightness()
{
const uint8_t index = 2;
uint8_t buffer[ASUSAURACORELAPTOP_WRITE_PACKET_SIZE] = { ASUSAURACORELAPTOP_REPORT_ID, ASUSAURACORELAPTOP_CMD_BRIGHTNESS };
memset(&buffer[index], 0, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE - index);
buffer[4] = current_brightness;
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);
}
void AsusAuraCoreLaptopController::SendUpdate()
{
uint8_t buffer[ASUSAURACORELAPTOP_WRITE_PACKET_SIZE] = { ASUSAURACORELAPTOP_REPORT_ID, ASUSAURACORELAPTOP_CMD_UPDATE };
buffer[ASUSAURACORELAPTOP_ZONE_BYTE] = 0;
buffer[ASUSAURACORELAPTOP_MODE_BYTE] = current_mode;
buffer[ASUSAURACORELAPTOP_R1_BYTE] = RGBGetRValue(current_c1);
buffer[ASUSAURACORELAPTOP_G1_BYTE] = RGBGetGValue(current_c1);
buffer[ASUSAURACORELAPTOP_B1_BYTE] = RGBGetBValue(current_c1);
buffer[ASUSAURACORELAPTOP_SPEED_BYTE] = current_speed;
buffer[ASUSAURACORELAPTOP_DIRECTION_BYTE] = current_direction;
buffer[ASUSAURACORELAPTOP_DATA_BYTE] = current_random;
buffer[ASUSAURACORELAPTOP_R2_BYTE] = RGBGetRValue(current_c2);
buffer[ASUSAURACORELAPTOP_G2_BYTE] = RGBGetGValue(current_c2);
buffer[ASUSAURACORELAPTOP_B2_BYTE] = RGBGetBValue(current_c2);
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);
SendApply();
}
void AsusAuraCoreLaptopController::SendApply()
{
const uint8_t index = 2;
uint8_t buffer[ASUSAURACORELAPTOP_WRITE_PACKET_SIZE] = { ASUSAURACORELAPTOP_REPORT_ID, ASUSAURACORELAPTOP_CMD_APPLY };
memset(&buffer[index], 0, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE - index);
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);
}
void AsusAuraCoreLaptopController::SendSet()
{
const uint8_t index = 2;
uint8_t buffer[ASUSAURACORELAPTOP_WRITE_PACKET_SIZE] = { ASUSAURACORELAPTOP_REPORT_ID, ASUSAURACORELAPTOP_CMD_SET };
memset(&buffer[index], 0, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE - index);
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);
}
std::vector<p_state> AsusAuraCoreLaptopController::PowerConfigArray()
{
std::vector<p_state> temp;
for(uint8_t zone_index = 0; zone_index < ASUSAURACORELAPTOP_POWER_ZONES; zone_index++)
{
for(uint8_t state_index = 0; state_index < ASUSAURACORELAPTOP_POWER_STATES; state_index++)
{
p_state new_state;
new_state.zone = power_zones[zone_index] + power_states[state_index];
new_state.state = true;
temp.push_back(new_state);
}
}
return temp;
}
void AsusAuraCoreLaptopController::SetPowerConfigFromJSON()
{
std::vector<p_state> power_config = PowerConfigArray();
const std::string section_power = "PowerConfig";
const std::string detector_name = "Asus Aura Core Laptop";
SettingsManager* settings_manager = ResourceManager::get()->GetSettingsManager();
json device_settings = settings_manager->GetSettings(detector_name);
/*---------------------------------------------------------*\
| Get Power state config from the settings manager |
| If PowerConfig is not found then write it to settings |
\*---------------------------------------------------------*/
if(!device_settings.contains(section_power))
{
json pcfg;
for(size_t i = 0; i < power_config.size(); i++)
{
pcfg[power_config[i].zone] = power_config[i].state;
}
device_settings[section_power] = pcfg;
settings_manager->SetSettings(detector_name, device_settings);
settings_manager->SaveSettings();
}
else
{
for(size_t i = 0; i < power_config.size(); i++)
{
std::string key_name = power_config[i].zone;
if(device_settings[section_power].contains(key_name))
{
power_config[i].state = device_settings[section_power][key_name];
LOG_DEBUG("[%s] Reading power config for %s: %s", device_name.c_str(), key_name.c_str(), ((power_config[i].state) ? "On" : "Off"));
}
}
}
/*-----------------------------------------------------------------------------*\
| Power state flags are packed in zones but the order is inconsistent. |
| With thanks to AsusCtl for helping to decipher the packet captures |
| https://gitlab.com/asus-linux/asusctl/-/blob/main/rog-aura/src/usb.rs#L150 |
\*-----------------------------------------------------------------------------*/
bool flag_array[] =
{
power_config[0].state, power_config[4].state,
power_config[1].state, power_config[5].state,
!power_config[2].state, !power_config[6].state,
!power_config[3].state, !power_config[7].state,
false, power_config[8].state,
power_config[9].state, !power_config[10].state,
!power_config[11].state, false,
false, false,
power_config[12].state, power_config[13].state,
!power_config[14].state, !power_config[15].state
};
uint32_t flags = PackPowerFlags(flag_array);
LOG_DEBUG("[%s] Sending power config Logo+KB: %02X Lightbar: %02X Lid Edges: %02X Raw: %08X", device_name.c_str(), (flags & 0xFF), ((flags >> 8) & 0xFF), ((flags >> 16) & 0xFF), flags);
SendPowerConfig(flags);
}
void AsusAuraCoreLaptopController::SendPowerConfig(uint32_t flags)
{
const uint8_t index = 6;
uint8_t buffer[ASUSAURACORELAPTOP_WRITE_PACKET_SIZE] = { ASUSAURACORELAPTOP_REPORT_ID, ASUSAURACORELAPTOP_CMD_POWER, 0x01, 0x00, 0x00, 0x0F };
memset(&buffer[index], 0, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE - index);
buffer[3] = flags & 0xFF;
buffer[4] = (flags >> 8) & 0xFF;
buffer[5] = (flags >> 16) & 0xFF;
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);
}
uint32_t AsusAuraCoreLaptopController::PackPowerFlags(bool flags[])
{
uint32_t temp = {};
const uint8_t length = 32;
for (size_t i = 0; i < length; ++i)
{
uint32_t flag = {flags[i]};
flag <<= i;
temp |= flag;
}
return temp;
}
@@ -0,0 +1,135 @@
/*---------------------------------------------------------------------*\
| AsusAuraCoreLaptopController.h |
| |
| Driver for AsusAuraCoreLaptop USB Controller |
| |
| Chris M (Dr_No) 28 Jul 2022 |
| |
\*---------------------------------------------------------------------*/
#include <string>
#include <vector>
#include <hidapi/hidapi.h>
#include "LogManager.h"
#include "RGBController.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
#include "RGBControllerKeyNames.h"
#pragma once
#define NA 0xFFFFFFFF
#define HID_MAX_STR 255
#define ASUSAURACORELAPTOP_TIMEOUT 250
#define ASUSAURACORELAPTOP_READ_PACKET_SIZE 64
#define ASUSAURACORELAPTOP_WRITE_PACKET_SIZE 64 //Buffer requires a prepended ReportID hence + 1
#define ASUSAURACORELAPTOP_KEYCOUNT 91
#define ASUSAURACORELAPTOP_KEY_WIDTH 18
#define ASUSAURACORELAPTOP_KEY_HEIGHT 7
#define ASUSAURACORELAPTOP_LIGHTBARCOUNT 6
#define ASUSAURACORELAPTOP_LIDCOUNT 3
#define ASUSAURACORELAPTOP_POWER_ZONES 4
#define ASUSAURACORELAPTOP_POWER_STATES 4
#define ASUSAURACORELAPTOP_BRIGHTNESS_MIN 0
#define ASUSAURACORELAPTOP_BRIGHTNESS_MAX 255
enum
{
ASUSAURACORELAPTOP_MODE_OFF = 0x00, //Turn off - All leds off
ASUSAURACORELAPTOP_MODE_DIRECT = 0xFF, //Direct Led Control - Independently set LEDs in zone
ASUSAURACORELAPTOP_MODE_STATIC = 0x00, //Static Mode - Set entire zone to a single color.
ASUSAURACORELAPTOP_MODE_BREATHING = 0x01, //Breathing Mode - Fades between fully off and fully on.
ASUSAURACORELAPTOP_MODE_SPECTRUM = 0x02, //Spectrum Cycle Mode - Cycles through the color spectrum on all lights on the device
ASUSAURACORELAPTOP_MODE_RAINBOW = 0x03, //Rainbow Wave Mode - Cycle thru the color spectrum as a wave across all LEDs
ASUSAURACORELAPTOP_MODE_FLASHING = 0x0A, //Flashing Mode - Abruptly changing between fully off and fully on.
/*-------------------------------------------------*\
| Modes not implemented in the Armoury Crate |
| OEM software that were discovered. |
\*-------------------------------------------------*/
ASUSAURACORELAPTOP_MODE_STARRY_NIGHT = 0x04, //Starry Night Mode
ASUSAURACORELAPTOP_MODE_RAIN = 0x05, //Rain Mode
ASUSAURACORELAPTOP_MODE_REACT_FADE = 0x06, //Reactive Fade Mode
ASUSAURACORELAPTOP_MODE_REACT_LASER = 0x07, //Reactive Laser Mode
ASUSAURACORELAPTOP_MODE_REACT_RIPPLE = 0x08, //Reactive Ripple Mode
ASUSAURACORELAPTOP_MODE_COMET = 0x0B, //Comet Mode
ASUSAURACORELAPTOP_MODE_FLASHNDASH = 0x0C, //Flash n Dash Mode
ASUSAURACORELAPTOP_MODE_KEYSTONE = 0x0D, //Keystone Mode
};
enum
{
ASUSAURACORELAPTOP_ZONE_BYTE = 2,
ASUSAURACORELAPTOP_MODE_BYTE = 3,
ASUSAURACORELAPTOP_R1_BYTE = 4,
ASUSAURACORELAPTOP_G1_BYTE = 5,
ASUSAURACORELAPTOP_B1_BYTE = 6,
ASUSAURACORELAPTOP_SPEED_BYTE = 7,
ASUSAURACORELAPTOP_DIRECTION_BYTE = 8,
ASUSAURACORELAPTOP_DATA_BYTE = 9,
ASUSAURACORELAPTOP_R2_BYTE = 10,
ASUSAURACORELAPTOP_G2_BYTE = 11,
ASUSAURACORELAPTOP_B2_BYTE = 12,
};
enum
{
ASUSAURACORELAPTOP_REPORT_ID = 0x5D,
ASUSAURACORELAPTOP_CMD_BRIGHTNESS = 0xBA,
ASUSAURACORELAPTOP_CMD_DIRECT = 0xBC,
ASUSAURACORELAPTOP_CMD_POWER = 0xBD,
ASUSAURACORELAPTOP_CMD_UPDATE = 0xB3,
ASUSAURACORELAPTOP_CMD_APPLY = 0xB4,
ASUSAURACORELAPTOP_CMD_SET = 0xB5,
};
enum
{
ASUSAURACORELAPTOP_SPEED_SLOWEST = 0xE1, // Slowest speed
ASUSAURACORELAPTOP_SPEED_NORMAL = 0xEB, // Normal speed
ASUSAURACORELAPTOP_SPEED_FASTEST = 0xF5, // Fastest speed
};
struct p_state
{
std::string zone;
bool state;
};
class AsusAuraCoreLaptopController
{
public:
AsusAuraCoreLaptopController(hid_device* dev_handle, const char* path);
~AsusAuraCoreLaptopController();
std::string GetDeviceName();
std::string GetSerial();
std::string GetLocation();
void SetMode(uint8_t mode, uint8_t speed, uint8_t brightness, RGBColor color1, RGBColor color2, uint8_t random, uint8_t direction);
void SetLedsDirect(std::vector<RGBColor> colors);
private:
std::string device_name;
std::string location;
hid_device* dev;
uint8_t current_mode;
uint8_t current_speed;
uint8_t current_direction;
RGBColor current_c1;
RGBColor current_c2;
uint8_t current_brightness;
uint8_t current_random;
void SendApply();
void SendBrightness();
void SendSet();
void SendUpdate();
void SetPowerConfigFromJSON();
void SendPowerConfig(uint32_t flags);
uint32_t PackPowerFlags(bool flags[]);
std::vector<p_state> PowerConfigArray();
};
@@ -1,319 +1,325 @@
/*-----------------------------------------*\
| RGBController_AsusAuraCore.cpp |
| |
| Generic RGB Interface for ROG Aura Core |
| |
| Adam Honse (CalcProgrammer1) 4/17/2020 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraCore.h"
RGBController_AuraCore::RGBController_AuraCore(AuraCoreController* aura_ptr)
{
aura = aura_ptr;
name = "ASUS Aura Core Device";
vendor = "ASUS";
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
description = "ASUS Aura Core Device";
type = DEVICE_TYPE_UNKNOWN;
if(aura->aura_device.aura_type == AURA_CORE_DEVICE_KEYBOARD)
{
SetupKeyboard();
}
else if(aura->aura_device.aura_type == AURA_CORE_DEVICE_GA15DH)
{
SetupGA15DH();
}
SetupZones();
}
void RGBController_AuraCore::SetupKeyboard()
{
name = "ASUS Aura Keyboard";
vendor = "ASUS";
type = DEVICE_TYPE_KEYBOARD;
description = "ASUS Aura Core Device";
mode Static;
Static.name = "Static";
Static.value = AURA_CORE_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_CORE_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.value = AURA_CORE_MODE_SPECTRUM_CYCLE;
ColorCycle.flags = 0;
ColorCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(ColorCycle);
}
void RGBController_AuraCore::SetupGA15DH()
{
name = "ASUS Aura GA15DH";
vendor = "ASUS";
type = DEVICE_TYPE_LEDSTRIP;
description = "ASUS Aura Core Device";
mode Static;
Static.name = "Static";
Static.value = AURA_CORE_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.colors.resize(1);
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_CORE_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
Breathing.speed_min = AURA_CORE_SPEED_SLOW;
Breathing.speed_max = AURA_CORE_SPEED_FAST;
Breathing.speed = AURA_CORE_SPEED_NORMAL;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.colors.resize(2);
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.value = AURA_CORE_MODE_SPECTRUM_CYCLE;
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
ColorCycle.speed_min = AURA_CORE_SPEED_SLOW;
ColorCycle.speed_max = AURA_CORE_SPEED_FAST;
ColorCycle.speed = AURA_CORE_SPEED_NORMAL;
ColorCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(ColorCycle);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = AURA_CORE_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
Rainbow.speed_min = AURA_CORE_SPEED_SLOW;
Rainbow.speed_max = AURA_CORE_SPEED_FAST;
Rainbow.speed = AURA_CORE_SPEED_NORMAL;
Rainbow.direction = MODE_DIRECTION_RIGHT;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = AURA_CORE_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Strobe.colors_min = 1;
Strobe.colors_max = 1;
Strobe.color_mode = MODE_COLORS_MODE_SPECIFIC;
Strobe.colors.resize(1);
modes.push_back(Strobe);
mode Comet;
Comet.name = "Comet";
Comet.value = AURA_CORE_MODE_COMET;
Comet.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Comet.colors_min = 1;
Comet.colors_max = 1;
Comet.color_mode = MODE_COLORS_MODE_SPECIFIC;
Comet.colors.resize(1);
modes.push_back(Comet);
mode Flash;
Flash.name = "Flash & Dash";
Flash.value = AURA_CORE_MODE_FLASHNDASH;
Flash.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flash.colors_min = 1;
Flash.colors_max = 1;
Flash.color_mode = MODE_COLORS_MODE_SPECIFIC;
Flash.colors.resize(1);
modes.push_back(Flash);
mode Irradiation;
Irradiation.name = "Irradiation";
Irradiation.value = AURA_CORE_MODE_IRRADIATION;
Irradiation.flags = 0;
Irradiation.color_mode = MODE_COLORS_NONE;
modes.push_back(Irradiation);
mode Direct;
Static.name = "Direct";
Static.value = AURA_CORE_MODE_DIRECT;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
}
RGBController_AuraCore::~RGBController_AuraCore()
{
delete aura;
}
void RGBController_AuraCore::SetupZones()
{
zone auraZone;
if(aura->aura_device.aura_type == AURA_CORE_DEVICE_KEYBOARD)
{
auraZone.name = "Keyboard";
auraZone.type = ZONE_TYPE_SINGLE;
auraZone.leds_min = 4;
auraZone.leds_max = 4;
auraZone.leds_count = 4;
auraZone.matrix_map = NULL;
}
else if(aura->aura_device.aura_type == AURA_CORE_DEVICE_GA15DH)
{
auraZone.name = "GA15DH";
auraZone.type = ZONE_TYPE_LINEAR;
auraZone.leds_min = 20;
auraZone.leds_max = 20;
auraZone.leds_count = 20;
auraZone.matrix_map = NULL;
}
else
{
auraZone.leds_count = 0;
}
zones.push_back(auraZone);
for(unsigned int led_idx = 0; led_idx < auraZone.leds_count; led_idx++)
{
led KeyLED;
KeyLED.name = auraZone.name + " ";
KeyLED.name.append(std::to_string(led_idx + 1));
leds.push_back(KeyLED);
}
SetupColors();
}
void RGBController_AuraCore::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AuraCore::DeviceUpdateLEDs()
{
UpdateZoneLEDs(0);
}
void RGBController_AuraCore::UpdateZoneLEDs(int /*zone*/)
{
if(modes[active_mode].value == AURA_CORE_MODE_DIRECT)
{
std::vector<AuraColor> aura_colors;
std::vector<RGBColor>& color_set = colors;
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
color_set = modes[active_mode].colors;
}
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
AuraColor new_color;
new_color.red = RGBGetRValue(color_set[led_idx]);
new_color.green = RGBGetGValue(color_set[led_idx]);
new_color.blue = RGBGetBValue(color_set[led_idx]);
aura_colors.push_back(new_color);
}
aura->UpdateDirect(aura_colors);
}
else if(modes[active_mode].color_mode == MODE_COLORS_PER_LED)
{
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
UpdateSingleLED(led_idx);
}
}
else
{
UpdateSingleLED(0);
}
}
void RGBController_AuraCore::UpdateSingleLED(int led)
{
unsigned char speed = 0xFF;
unsigned char red = 0;
unsigned char green = 0;
unsigned char blue = 0;
unsigned char dir = 0;
mode& curr_mode = modes[active_mode];
if(curr_mode.color_mode == MODE_COLORS_PER_LED)
{
red = RGBGetRValue(colors[led]);
green = RGBGetGValue(colors[led]);
blue = RGBGetBValue(colors[led]);
}
else if(curr_mode.color_mode == MODE_COLORS_MODE_SPECIFIC)
{
red = RGBGetRValue(curr_mode.colors[led]);
green = RGBGetGValue(curr_mode.colors[led]);
blue = RGBGetBValue(curr_mode.colors[led]);
}
if(curr_mode.flags & MODE_FLAG_HAS_SPEED)
{
speed = curr_mode.speed;
}
if(curr_mode.flags & MODE_FLAG_HAS_DIRECTION_LR)
{
if(curr_mode.direction == MODE_DIRECTION_RIGHT)
{
dir = 1;
}
}
aura->SendUpdate
(
led,
curr_mode.value,
speed,
dir,
red,
green,
blue
);
aura->SendSet();
aura->SendApply();
}
void RGBController_AuraCore::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AuraCore::DeviceUpdateMode()
{
if(modes[active_mode].value == AURA_CORE_MODE_DIRECT)
{
aura->InitDirectMode();
}
else
{
DeviceUpdateLEDs();
}
}
/*-----------------------------------------*\
| RGBController_AsusAuraCore.cpp |
| |
| Generic RGB Interface for ROG Aura Core |
| |
| Adam Honse (CalcProgrammer1) 4/17/2020 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraCore.h"
/**------------------------------------------------------------------*\
@name Asus AURA Core
@category Keyboard,LEDStrip
@type USB
@save :x:
@direct :rotating_light:
@effects :white_check_mark:
@detectors DetectAsusAuraCoreControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraCore::RGBController_AuraCore(AuraCoreController* controller_ptr)
{
controller = controller_ptr;
name = "ASUS Aura Core Device";
vendor = "ASUS";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
description = "ASUS Aura Core Device";
type = DEVICE_TYPE_UNKNOWN;
if(controller->aura_device.aura_type == AURA_CORE_DEVICE_KEYBOARD)
{
SetupKeyboard();
}
else if(controller->aura_device.aura_type == AURA_CORE_DEVICE_GA15DH)
{
SetupGA15DH();
}
SetupZones();
}
void RGBController_AuraCore::SetupKeyboard()
{
name = "ASUS Aura Keyboard";
vendor = "ASUS";
type = DEVICE_TYPE_KEYBOARD;
description = "ASUS Aura Core Device";
mode Static;
Static.name = "Static";
Static.value = AURA_CORE_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_CORE_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.value = AURA_CORE_MODE_SPECTRUM_CYCLE;
ColorCycle.flags = 0;
ColorCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(ColorCycle);
}
void RGBController_AuraCore::SetupGA15DH()
{
name = "ASUS Aura GA15DH";
vendor = "ASUS";
type = DEVICE_TYPE_LEDSTRIP;
description = "ASUS Aura Core Device";
mode Static;
Static.name = "Static";
Static.value = AURA_CORE_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.colors.resize(1);
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_CORE_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
Breathing.speed_min = AURA_CORE_SPEED_SLOW;
Breathing.speed_max = AURA_CORE_SPEED_FAST;
Breathing.speed = AURA_CORE_SPEED_NORMAL;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.colors.resize(2);
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.value = AURA_CORE_MODE_SPECTRUM_CYCLE;
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
ColorCycle.speed_min = AURA_CORE_SPEED_SLOW;
ColorCycle.speed_max = AURA_CORE_SPEED_FAST;
ColorCycle.speed = AURA_CORE_SPEED_NORMAL;
ColorCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(ColorCycle);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = AURA_CORE_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
Rainbow.speed_min = AURA_CORE_SPEED_SLOW;
Rainbow.speed_max = AURA_CORE_SPEED_FAST;
Rainbow.speed = AURA_CORE_SPEED_NORMAL;
Rainbow.direction = MODE_DIRECTION_RIGHT;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
mode Strobe;
Strobe.name = "Strobe";
Strobe.value = AURA_CORE_MODE_STROBE;
Strobe.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Strobe.colors_min = 1;
Strobe.colors_max = 1;
Strobe.color_mode = MODE_COLORS_MODE_SPECIFIC;
Strobe.colors.resize(1);
modes.push_back(Strobe);
mode Comet;
Comet.name = "Comet";
Comet.value = AURA_CORE_MODE_COMET;
Comet.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Comet.colors_min = 1;
Comet.colors_max = 1;
Comet.color_mode = MODE_COLORS_MODE_SPECIFIC;
Comet.colors.resize(1);
modes.push_back(Comet);
mode Flash;
Flash.name = "Flash & Dash";
Flash.value = AURA_CORE_MODE_FLASHNDASH;
Flash.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flash.colors_min = 1;
Flash.colors_max = 1;
Flash.color_mode = MODE_COLORS_MODE_SPECIFIC;
Flash.colors.resize(1);
modes.push_back(Flash);
mode Irradiation;
Irradiation.name = "Irradiation";
Irradiation.value = AURA_CORE_MODE_IRRADIATION;
Irradiation.flags = 0;
Irradiation.color_mode = MODE_COLORS_NONE;
modes.push_back(Irradiation);
mode Direct;
Static.name = "Direct";
Static.value = AURA_CORE_MODE_DIRECT;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
}
RGBController_AuraCore::~RGBController_AuraCore()
{
delete controller;
}
void RGBController_AuraCore::SetupZones()
{
zone auraZone;
if(controller->aura_device.aura_type == AURA_CORE_DEVICE_KEYBOARD)
{
auraZone.name = "Keyboard";
auraZone.type = ZONE_TYPE_SINGLE;
auraZone.leds_min = 4;
auraZone.leds_max = 4;
auraZone.leds_count = 4;
auraZone.matrix_map = NULL;
}
else if(controller->aura_device.aura_type == AURA_CORE_DEVICE_GA15DH)
{
auraZone.name = "GA15DH";
auraZone.type = ZONE_TYPE_LINEAR;
auraZone.leds_min = 20;
auraZone.leds_max = 20;
auraZone.leds_count = 20;
auraZone.matrix_map = NULL;
}
else
{
auraZone.leds_count = 0;
}
zones.push_back(auraZone);
for(unsigned int led_idx = 0; led_idx < auraZone.leds_count; led_idx++)
{
led KeyLED;
KeyLED.name = auraZone.name + " ";
KeyLED.name.append(std::to_string(led_idx + 1));
leds.push_back(KeyLED);
}
SetupColors();
}
void RGBController_AuraCore::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AuraCore::DeviceUpdateLEDs()
{
UpdateZoneLEDs(0);
}
void RGBController_AuraCore::UpdateZoneLEDs(int /*zone*/)
{
if(modes[active_mode].value == AURA_CORE_MODE_DIRECT)
{
std::vector<AuraColor> aura_colors;
std::vector<RGBColor>& color_set = colors;
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
color_set = modes[active_mode].colors;
}
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
AuraColor new_color;
new_color.red = RGBGetRValue(color_set[led_idx]);
new_color.green = RGBGetGValue(color_set[led_idx]);
new_color.blue = RGBGetBValue(color_set[led_idx]);
aura_colors.push_back(new_color);
}
controller->UpdateDirect(aura_colors);
}
else if(modes[active_mode].color_mode == MODE_COLORS_PER_LED)
{
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
UpdateSingleLED(led_idx);
}
}
else
{
UpdateSingleLED(0);
}
}
void RGBController_AuraCore::UpdateSingleLED(int led)
{
unsigned char speed = 0xFF;
unsigned char red = 0;
unsigned char green = 0;
unsigned char blue = 0;
unsigned char dir = 0;
mode& curr_mode = modes[active_mode];
if(curr_mode.color_mode == MODE_COLORS_PER_LED)
{
red = RGBGetRValue(colors[led]);
green = RGBGetGValue(colors[led]);
blue = RGBGetBValue(colors[led]);
}
else if(curr_mode.color_mode == MODE_COLORS_MODE_SPECIFIC)
{
red = RGBGetRValue(curr_mode.colors[led]);
green = RGBGetGValue(curr_mode.colors[led]);
blue = RGBGetBValue(curr_mode.colors[led]);
}
if(curr_mode.flags & MODE_FLAG_HAS_SPEED)
{
speed = curr_mode.speed;
}
if(curr_mode.flags & MODE_FLAG_HAS_DIRECTION_LR)
{
if(curr_mode.direction == MODE_DIRECTION_RIGHT)
{
dir = 1;
}
}
controller->SendUpdate
(
led,
curr_mode.value,
speed,
dir,
red,
green,
blue
);
controller->SendSet();
controller->SendApply();
}
void RGBController_AuraCore::DeviceUpdateMode()
{
if(modes[active_mode].value == AURA_CORE_MODE_DIRECT)
{
controller->InitDirectMode();
}
else
{
DeviceUpdateLEDs();
}
}
@@ -1,35 +1,34 @@
/*-----------------------------------------*\
| RGBController_AsusAuraCore.h |
| |
| Generic RGB Interface for ROG Aura Core |
| |
| Adam Honse (CalcProgrammer1) 4/17/2020 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraCoreController.h"
class RGBController_AuraCore : public RGBController
{
public:
RGBController_AuraCore(AuraCoreController* aura_ptr);
~RGBController_AuraCore();
void SetupKeyboard();
void SetupGA15DH();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AuraCoreController* aura;
};
/*-----------------------------------------*\
| RGBController_AsusAuraCore.h |
| |
| Generic RGB Interface for ROG Aura Core |
| |
| Adam Honse (CalcProgrammer1) 4/17/2020 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraCoreController.h"
class RGBController_AuraCore : public RGBController
{
public:
RGBController_AuraCore(AuraCoreController* controller_ptr);
~RGBController_AuraCore();
void SetupKeyboard();
void SetupGA15DH();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
AuraCoreController* controller;
};
@@ -0,0 +1,491 @@
/*---------------------------------------------------------------------*\
| RGBController_AsusAuraCoreLaptop.cpp |
| |
| Driver for AsusAuraCoreLaptop USB Controller |
| |
| Chris M (Dr_No) 28 Jul 2022 |
| |
\*---------------------------------------------------------------------*/
#include "RGBController_AsusAuraCoreLaptop.h"
static unsigned int matrix_map[ASUSAURACORELAPTOP_KEY_HEIGHT][ASUSAURACORELAPTOP_KEY_WIDTH] =
{
{ NA, NA, 86, 87, 88, 89, 90, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA },
{ 0, NA, 1, 2, 3, 4, NA, 5, 6, 7, 8, NA, 9, 10, 11, 12, 13, NA },
{ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, NA },
{ 31, NA, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, NA, 45, NA },
{ 46, NA, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, NA, 58, NA, 59, NA },
{ 60, NA, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, NA, 72, NA, 73, NA },
{ 74, 75, 76, 77, NA, NA, NA, 78, NA, NA, NA, 79, 80, 81, 82, 83, 84, 85 }
};
static const char *led_names[] =
{
KEY_EN_ESCAPE, //00
KEY_EN_F1,
KEY_EN_F2,
KEY_EN_F3,
KEY_EN_F4,
KEY_EN_F5,
KEY_EN_F6,
KEY_EN_F7,
KEY_EN_F8,
KEY_EN_F9,
KEY_EN_F10, //10
KEY_EN_F11,
KEY_EN_F12,
KEY_EN_DELETE,
KEY_EN_BACK_TICK,
KEY_EN_1,
KEY_EN_2,
KEY_EN_3,
KEY_EN_4,
KEY_EN_5,
KEY_EN_6, //20
KEY_EN_7,
KEY_EN_8,
KEY_EN_9,
KEY_EN_0,
KEY_EN_MINUS,
KEY_EN_EQUALS,
KEY_EN_BACKSPACE,
KEY_EN_BACKSPACE,
KEY_EN_BACKSPACE,
KEY_EN_MEDIA_PLAY_PAUSE, //30
KEY_EN_TAB,
KEY_EN_Q,
KEY_EN_W,
KEY_EN_E,
KEY_EN_R,
KEY_EN_T,
KEY_EN_Y,
KEY_EN_U,
KEY_EN_I,
KEY_EN_O, //40
KEY_EN_P,
KEY_EN_LEFT_BRACKET,
KEY_EN_RIGHT_BRACKET,
KEY_EN_ANSI_BACK_SLASH,
KEY_EN_MEDIA_STOP,
KEY_EN_CAPS_LOCK,
KEY_EN_A,
KEY_EN_S,
KEY_EN_D,
KEY_EN_F, //50
KEY_EN_G,
KEY_EN_H,
KEY_EN_J,
KEY_EN_K,
KEY_EN_L,
KEY_EN_SEMICOLON,
KEY_EN_QUOTE,
KEY_EN_ANSI_ENTER,
KEY_EN_MEDIA_PREVIOUS,
KEY_EN_LEFT_SHIFT, //60
KEY_EN_Z,
KEY_EN_X,
KEY_EN_C,
KEY_EN_V,
KEY_EN_B,
KEY_EN_N,
KEY_EN_M,
KEY_EN_COMMA,
KEY_EN_PERIOD,
KEY_EN_FORWARD_SLASH, //70
KEY_EN_RIGHT_SHIFT,
KEY_EN_UP_ARROW,
KEY_EN_MEDIA_NEXT,
KEY_EN_LEFT_CONTROL,
KEY_EN_LEFT_FUNCTION,
KEY_EN_LEFT_WINDOWS,
KEY_EN_LEFT_ALT,
KEY_EN_SPACE,
KEY_EN_RIGHT_ALT,
KEY_EN_RIGHT_CONTROL, //80
KEY_EN_LEFT_ARROW,
KEY_EN_DOWN_ARROW,
KEY_EN_RIGHT_ARROW,
KEY_EN_PRINT_SCREEN,
"Asus Keystone",
KEY_EN_MEDIA_VOLUME_DOWN,
KEY_EN_MEDIA_VOLUME_UP,
"Key: Mic On/Off",
"Key: HyperFan",
"Key: Armoury Crate", //90
"Lightbar LED 1",
"Lightbar LED 2",
"Lightbar LED 3",
"Lightbar LED 4",
"Lightbar LED 5",
"Lightbar LED 6",
"Logo",
"Lid Left",
"Lid Right", //99
};
/**------------------------------------------------------------------*\
@name AsusAuraCoreLaptop
@category DEVICE_TYPE_KEYBOARD
@type USB
@save :x:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraCoreLaptopControllers
@comment Power profiles for this controller are set to `On` for all power
state and scan be adjusted in the JSON config file.
For each zone available LEDs can be set as `On = true` or `Off = false` when
* Booting
* Awake (Normal Usage)
* Sleeping
* Shutdown / Power Off
\*-------------------------------------------------------------------*/
RGBController_AsusAuraCoreLaptop::RGBController_AsusAuraCoreLaptop(AsusAuraCoreLaptopController *controller_ptr)
{
controller = controller_ptr;
name = "Asus Aura Core Laptop";
vendor = "Asus";
type = DEVICE_TYPE_KEYBOARD;
description = controller->GetDeviceName();
serial = controller->GetSerial();
location = controller->GetLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = ASUSAURACORELAPTOP_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
Static.value = ASUSAURACORELAPTOP_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Static.colors_min = 1;
Static.colors_max = 1;
Static.colors.resize(Static.colors_max);
Static.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Static.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Static.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Static.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Static.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = ASUSAURACORELAPTOP_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
Breathing.colors.resize(Breathing.colors_min);
Breathing.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Breathing.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Breathing.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Breathing.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Breathing.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Breathing);
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = ASUSAURACORELAPTOP_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
Flashing.colors.resize(Flashing.colors_max);
Flashing.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Flashing.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Flashing.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Flashing.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Flashing.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Flashing.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Flashing);
mode Spectrum;
Spectrum.name = "Spectrum Cycle";
Spectrum.value = ASUSAURACORELAPTOP_MODE_SPECTRUM;
Spectrum.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
Spectrum.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Spectrum.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Spectrum.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Spectrum.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Spectrum.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Spectrum.color_mode = MODE_COLORS_NONE;
Spectrum.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Spectrum);
mode Rainbow;
Rainbow.name = "Rainbow Wave";
Rainbow.value = ASUSAURACORELAPTOP_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD;
Rainbow.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Rainbow.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Rainbow.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Rainbow.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Rainbow.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Rainbow.color_mode = MODE_COLORS_NONE;
Rainbow.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Rainbow);
mode Starry;
Starry.name = "Starry Night";
Starry.value = ASUSAURACORELAPTOP_MODE_STARRY_NIGHT;
Starry.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Starry.colors_min = 1;
Starry.colors_max = 2;
Starry.colors.resize(Starry.colors_min);
Starry.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Starry.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Starry.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Starry.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Starry.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Starry.color_mode = MODE_COLORS_MODE_SPECIFIC;
Starry.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Starry);
mode Rain;
Rain.name = "Rain";
Rain.value = ASUSAURACORELAPTOP_MODE_RAIN;
Rain.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
Rain.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Rain.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Rain.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Rain.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Rain.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Rain.color_mode = MODE_COLORS_NONE;
Rain.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Rain);
mode ReactFade;
ReactFade.name = "Reactive - Fade";
ReactFade.value = ASUSAURACORELAPTOP_MODE_REACT_FADE;
ReactFade.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
ReactFade.colors_min = 1;
ReactFade.colors_max = 1;
ReactFade.colors.resize(ReactFade.colors_max);
ReactFade.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
ReactFade.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
ReactFade.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
ReactFade.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
ReactFade.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
ReactFade.color_mode = MODE_COLORS_MODE_SPECIFIC;
ReactFade.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(ReactFade);
mode ReactLaser;
ReactLaser.name = "Reactive - Laser";
ReactLaser.value = ASUSAURACORELAPTOP_MODE_REACT_LASER;
ReactLaser.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
ReactLaser.colors_min = 1;
ReactLaser.colors_max = 1;
ReactLaser.colors.resize(ReactLaser.colors_max);
ReactLaser.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
ReactLaser.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
ReactLaser.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
ReactLaser.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
ReactLaser.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
ReactLaser.color_mode = MODE_COLORS_MODE_SPECIFIC;
ReactLaser.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(ReactLaser);
mode ReactRipple;
ReactRipple.name = "Reactive - Ripple";
ReactRipple.value = ASUSAURACORELAPTOP_MODE_REACT_RIPPLE;
ReactRipple.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
ReactRipple.colors_min = 1;
ReactRipple.colors_max = 1;
ReactRipple.colors.resize(ReactRipple.colors_max);
ReactRipple.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
ReactRipple.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
ReactRipple.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
ReactRipple.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
ReactRipple.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
ReactRipple.color_mode = MODE_COLORS_MODE_SPECIFIC;
ReactRipple.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(ReactRipple);
mode Comet;
Comet.name = "Comet";
Comet.value = ASUSAURACORELAPTOP_MODE_COMET;
Comet.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR;
Comet.colors_min = 1;
Comet.colors_max = 1;
Comet.colors.resize(Comet.colors_max);
Comet.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Comet.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Comet.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Comet.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Comet.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Comet.color_mode = MODE_COLORS_MODE_SPECIFIC;
Comet.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Comet);
mode FlashNDash;
FlashNDash.name = "Flash N Dash";
FlashNDash.value = ASUSAURACORELAPTOP_MODE_FLASHNDASH;
FlashNDash.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR;
FlashNDash.colors_min = 1;
FlashNDash.colors_max = 1;
FlashNDash.colors.resize(FlashNDash.colors_max);
FlashNDash.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
FlashNDash.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
FlashNDash.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
FlashNDash.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
FlashNDash.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
FlashNDash.color_mode = MODE_COLORS_MODE_SPECIFIC;
FlashNDash.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(FlashNDash);
mode Keystone;
Keystone.name = "Keystone";
Keystone.value = ASUSAURACORELAPTOP_MODE_KEYSTONE;
Keystone.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
Keystone.colors_min = 1;
Keystone.colors_max = 1;
Keystone.colors.resize(Keystone.colors_max);
Keystone.brightness_min = ASUSAURACORELAPTOP_BRIGHTNESS_MIN;
Keystone.brightness_max = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Keystone.brightness = ASUSAURACORELAPTOP_BRIGHTNESS_MAX;
Keystone.speed_min = ASUSAURACORELAPTOP_SPEED_SLOWEST;
Keystone.speed_max = ASUSAURACORELAPTOP_SPEED_FASTEST;
Keystone.color_mode = MODE_COLORS_MODE_SPECIFIC;
Keystone.speed = ASUSAURACORELAPTOP_SPEED_NORMAL;
modes.push_back(Keystone);
mode Off;
Off.name = "Off";
Off.value = ASUSAURACORELAPTOP_MODE_OFF;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
Init_Controller();
SetupZones();
}
RGBController_AsusAuraCoreLaptop::~RGBController_AsusAuraCoreLaptop()
{
delete controller;
}
void RGBController_AsusAuraCoreLaptop::Init_Controller()
{
/*-------------------------------------------------*\
| Create the keyboard zone and add the matix map |
\*-------------------------------------------------*/
zone KB_zone;
KB_zone.name = "Keyboard Zone";
KB_zone.type = ZONE_TYPE_MATRIX;
KB_zone.leds_min = ASUSAURACORELAPTOP_KEYCOUNT;
KB_zone.leds_max = ASUSAURACORELAPTOP_KEYCOUNT;
KB_zone.leds_count = ASUSAURACORELAPTOP_KEYCOUNT;
KB_zone.matrix_map = new matrix_map_type;
KB_zone.matrix_map->height = ASUSAURACORELAPTOP_KEY_HEIGHT;
KB_zone.matrix_map->width = ASUSAURACORELAPTOP_KEY_WIDTH;
KB_zone.matrix_map->map = (unsigned int *)&matrix_map;
zones.push_back(KB_zone);
zone lightbar;
lightbar.name = "Lightbar Zone";
lightbar.type = ZONE_TYPE_LINEAR;
lightbar.leds_min = ASUSAURACORELAPTOP_LIGHTBARCOUNT;
lightbar.leds_max = ASUSAURACORELAPTOP_LIGHTBARCOUNT;
lightbar.leds_count = ASUSAURACORELAPTOP_LIGHTBARCOUNT;
zones.push_back(lightbar);
zone lid;
lid.name = "Lid Zone";
lid.type = ZONE_TYPE_LINEAR;
lid.leds_min = ASUSAURACORELAPTOP_LIDCOUNT;
lid.leds_max = ASUSAURACORELAPTOP_LIDCOUNT;
lid.leds_count = ASUSAURACORELAPTOP_LIDCOUNT;
zones.push_back(lid);
}
void RGBController_AsusAuraCoreLaptop::SetupZones()
{
/*-------------------------------------------------*\
| Clear any existing color/LED configuration |
\*-------------------------------------------------*/
leds.clear();
colors.clear();
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
for(std::size_t zone_index = 0; zone_index < zones.size(); zone_index++)
{
int zone_offset = leds.size();
for(unsigned int led_index = 0; led_index < zones[zone_index].leds_count; led_index++)
{
led new_led;
new_led.value = led_index + zone_offset;
new_led.name = led_names[new_led.value];
leds.push_back(new_led);
}
}
SetupColors();
}
void RGBController_AsusAuraCoreLaptop::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AsusAuraCoreLaptop::DeviceUpdateLEDs()
{
controller->SetLedsDirect(colors);
}
void RGBController_AsusAuraCoreLaptop::UpdateZoneLEDs(int zone)
{
std::vector<RGBColor> colour;
for(size_t i = 0; i < zones[zone].leds_count; i++)
{
colour.push_back(zones[zone].colors[i]);
}
controller->SetLedsDirect(colour);
}
void RGBController_AsusAuraCoreLaptop::UpdateSingleLED(int led)
{
std::vector<RGBColor> colour;
colour.push_back(colors[led]);
controller->SetLedsDirect(colour);
}
void RGBController_AsusAuraCoreLaptop::DeviceUpdateMode()
{
mode set_mode = modes[active_mode];
if(set_mode.value == ASUSAURACORELAPTOP_MODE_DIRECT)
{
return;
}
uint8_t random = (set_mode.color_mode == MODE_COLORS_RANDOM) ? 0xFF : 0;
RGBColor color1 = (set_mode.colors.size() > 0) ? set_mode.colors[0] : 0;
RGBColor color2 = (set_mode.colors.size() > 1) ? set_mode.colors[1] : 0;
controller->SetMode(set_mode.value, set_mode.speed, set_mode.brightness, color1, color2, random, set_mode.direction );
}
@@ -0,0 +1,35 @@
/*---------------------------------------------------------------------*\
| RGBController_AsusAuraCoreLaptop.h |
| |
| Driver for AsusAuraCoreLaptop USB Controller |
| |
| Chris M (Dr_No) 28 Jul 2022 |
| |
\*---------------------------------------------------------------------*/
#pragma once
#include <vector>
#include "RGBController.h"
#include "AsusAuraCoreLaptopController.h"
class RGBController_AsusAuraCoreLaptop : public RGBController
{
public:
RGBController_AsusAuraCoreLaptop(AsusAuraCoreLaptopController* controller_ptr);
~RGBController_AsusAuraCoreLaptop();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
void Init_Controller();
AsusAuraCoreLaptopController* controller;
};
@@ -17,63 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
using namespace std::chrono_literals;
typedef struct
{
int pci_vendor;
int pci_device;
int pci_subsystem_vendor;
int pci_subsystem_device;
unsigned char controller_address;
const char * name;
} gpu_pci_device;
#define ASUSGPU_CONTROLLER_NAME "ASUS Aura GPU"
#define GPU_NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ]))
static const gpu_pci_device device_list[] =
{
{ NVIDIA_VEN, NVIDIA_GTX1050_DEV, ASUS_SUB_VEN, ASUS_GTX1050_STRIX_O2G_GAMING, 0x29, "ASUS ROG Strix GTX 1050 O2G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1050TI_O4G_GAMING, 0x29, "ASUS ROG Strix GTX 1050 TI O4G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1060_DEV, ASUS_SUB_VEN, ASUS_GTX1060_STRIX_6G_GAMING, 0x29, "ASUS GTX 1060 Strix 6G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1060_DEV, ASUS_SUB_VEN, ASUS_GTX1060_STRIX, 0x29, "ASUS GTX 1060 Strix" },
{ NVIDIA_VEN, NVIDIA_GTX1070_DEV, ASUS_SUB_VEN, ASUS_GTX1070_STRIX_GAMING, 0x29, "ASUS GTX 1070 Strix Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1070_DEV, ASUS_SUB_VEN, ASUS_GTX1070_STRIX_OC, 0x29, "ASUS GTX 1070 Strix OC" },
{ NVIDIA_VEN, NVIDIA_GTX1070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1070TI_A8G_GAMING, 0x29, "ASUS ROG Strix GTX1070 Ti A8G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1080_DEV, ASUS_SUB_VEN, ASUS_GTX1080_STRIX, 0x29, "ASUS GTX 1080 Strix OC" },
{ NVIDIA_VEN, NVIDIA_GTX1080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080_A8G_GAMING, 0x29, "ASUS ROG Strix GTX1080 A8G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080_O8G_GAMING, 0x29, "ASUS ROG Strix GTX1080 O8G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_GAMING, 0x29, "ASUS ROG Strix GTX1080 Ti Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_11G_GAMING, 0x29, "ASUS ROG Strix GTX1080 Ti 11G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_O11G_GAMING, 0x29, "ASUS ROG Strix GTX1080 Ti O11G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_O11G_GAMING_A02, 0x29, "ASUS ROG Strix GTX1080 Ti O11G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1650S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1650S_OC, 0x2A, "ASUS ROG Strix GTX 1650S OC 4G" },
{ NVIDIA_VEN, NVIDIA_GTX1660S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1660S_O6G_GAMING, 0x2A, "ASUS ROG Strix GTX 1660S O6G Gaming" },
{ NVIDIA_VEN, NVIDIA_GTX1660TI_DEV, ASUS_SUB_VEN, ASUS_ROG_GTX1660TI_OC, 0x2A, "ASUS ROG GTX 1660 Ti OC 6G" },
{ NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_EVO_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060 EVO Gaming 6G" },
{ NVIDIA_VEN, NVIDIA_RTX2060_TU104_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_O6G_EVO_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060 O6G EVO Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2060S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_A8G_EVO_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060S A8G EVO Gaming 8G"},
{ NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060S 8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2060S O8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070_A8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2070 A8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2070 O8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_A8G_GAMING_86FF, 0x2A, "ASUS ROG STRIX RTX 2070S A8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_A8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2070S A8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_A8G_GAMING_8706, 0x2A, "ASUS ROG STRIX RTX 2070S A8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2070S O8G Gaming 8G" },
{ NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080 O8G Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080S_O8G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080S O8G Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_11G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080 Ti 11G Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_O11G_GAMING, 0x2A, "ASUS ROG STRIX RTX 2080 Ti O11G Gaming" },
{ AMD_GPU_VEN, AMD_VEGA10_DEV, ASUS_SUB_VEN, ASUS_VEGA64_STRIX, 0x29, "ASUS Vega 64 Strix" },
{ AMD_GPU_VEN, AMD_NAVI10_DEV, ASUS_SUB_VEN, ASUS_RX5600XT_STRIX_O6G_GAMING, 0x2A, "ASUS RX 5600XT Strix O6G Gaming" },
{ AMD_GPU_VEN, AMD_NAVI10_DEV, ASUS_SUB_VEN, ASUS_RX5700XT_STRIX_GAMING_OC, 0x2A, "ASUS RX 5700XT Strix Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX480_STRIX_GAMING_OC, 0x29, "ASUS ROG STRIX RX480 Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX570_STRIX_O4G_GAMING_OC, 0x29, "ASUS RX 570 Strix O4G Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX580_STRIX_GAMING_OC, 0x29, "ASUS RX 580 Strix Gaming OC" },
{ AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX580_STRIX_GAMING_TOP, 0x29, "ASUS RX 580 Strix Gaming TOP" },
};
/******************************************************************************************\
* *
@@ -87,8 +31,8 @@ bool TestForAsusAuraGPUController(i2c_smbus_interface* bus, unsigned char addres
{
bool pass = false;
unsigned char aura_gpu_magic_high = bus->i2c_smbus_read_byte_data(address, 0x20); // High Byte of magic (0x15)
unsigned char aura_gpu_magic_low = bus->i2c_smbus_read_byte_data(address, 0x21); // Low Byte of magic (0x89)
unsigned char aura_gpu_magic_high = bus->i2c_smbus_read_byte_data(address, 0x20); // High Byte of magic (0x15)
unsigned char aura_gpu_magic_low = bus->i2c_smbus_read_byte_data(address, 0x21); // Low Byte of magic (0x89)
LOG_DEBUG("[%s] Test GPU expect: 0x1589 received: 0x%02X%02X", ASUSGPU_CONTROLLER_NAME, aura_gpu_magic_high, aura_gpu_magic_low);
@@ -109,31 +53,83 @@ bool TestForAsusAuraGPUController(i2c_smbus_interface* bus, unsigned char addres
* *
\******************************************************************************************/
void DetectAsusAuraGPUControllers(std::vector<i2c_smbus_interface*> &busses)
void DetectAsusAuraGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
{
AuraGPUController* new_aura_gpu;
RGBController_AuraGPU* new_controller;
for (unsigned int bus = 0; bus < busses.size(); bus++)
if(TestForAsusAuraGPUController(bus, i2c_addr))
{
for(unsigned int dev_idx = 0; dev_idx < GPU_NUM_DEVICES; dev_idx++)
{
if(busses[bus]->pci_vendor == device_list[dev_idx].pci_vendor &&
busses[bus]->pci_device == device_list[dev_idx].pci_device &&
busses[bus]->pci_subsystem_vendor == device_list[dev_idx].pci_subsystem_vendor &&
busses[bus]->pci_subsystem_device == device_list[dev_idx].pci_subsystem_device)
{
LOG_DEBUG(GPU_DETECT_MESSAGE, ASUSGPU_CONTROLLER_NAME, bus, device_list[dev_idx].pci_device, device_list[dev_idx].pci_subsystem_device, device_list[dev_idx].name );
if (TestForAsusAuraGPUController(busses[bus], device_list[dev_idx].controller_address))
{
new_aura_gpu = new AuraGPUController(busses[bus], device_list[dev_idx].controller_address);
new_controller = new RGBController_AuraGPU(new_aura_gpu);
new_controller->name = device_list[dev_idx].name;
ResourceManager::get()->RegisterRGBController(new_controller);
}
}
}
AuraGPUController* controller = new AuraGPUController(bus, i2c_addr);
RGBController_AuraGPU* rgb_controller = new RGBController_AuraGPU(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
} /* DetectAsusAuraGPUControllers() */
REGISTER_I2C_DETECTOR(ASUSGPU_CONTROLLER_NAME, DetectAsusAuraGPUControllers);
/*-----------------------------------------*\
| NVidia GPUs |
\*-----------------------------------------*/
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX 1050 O2G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050_DEV, ASUS_SUB_VEN, ASUS_GTX1050_STRIX_O2G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX 1050 TI 4G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1050TI_4G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX 1050 TI O4G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1050TI_O4G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX 1050 TI O4G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1050TI_O4G_GAMING_2, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS GTX 1060 Strix 6G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, ASUS_SUB_VEN, ASUS_GTX1060_STRIX_6G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS GTX 1060 Strix" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, ASUS_SUB_VEN, ASUS_GTX1060_STRIX, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS GTX 1070 Strix Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070_DEV, ASUS_SUB_VEN, ASUS_GTX1070_STRIX_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS GTX 1070 Strix OC" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070_DEV, ASUS_SUB_VEN, ASUS_GTX1070_STRIX_OC, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1070 Ti 8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1070TI_8G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1070 Ti A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1070TI_A8G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS GTX 1080 Strix OC" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, ASUS_SUB_VEN, ASUS_GTX1080_STRIX, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1080 A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080_A8G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1080 O8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080_O8G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1080 O8G 11Gbps" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080_O8G_11GBPS, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1080 Ti Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1080 Ti 11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_11G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1080 Ti O11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_O11G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX1080 Ti O11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1080TI_O11G_GAMING_A02, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX 1650S OC 4G" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1650S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1650S_OC, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG Strix GTX 1660S O6G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1660S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1660S_O6G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG GTX 1660 Ti OC 6G" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1660TI_DEV, ASUS_SUB_VEN, ASUS_ROG_GTX1660TI_OC, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060 EVO Gaming 6G" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_EVO_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060 O6G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_O6G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060 O6G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_O6G_GAMING_86D2, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060 O6G EVO Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060_TU104_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060_O6G_EVO_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060S 8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060S A8G EVO Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_A8G_EVO_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060S O8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_O8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2060S A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2060S_A8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070 A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070_A8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070 O8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070_O8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070S A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_A8G_GAMING_86FF, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070S A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_A8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070S A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_A8G_GAMING_8706, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070S O8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_O8G_GAMING_8729, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070S 8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_8G_GAMING_8707, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2070S O8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2070S_O8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080 8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080_8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080 O8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080_O8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080 O8G V2 Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080_O8G_V2_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080S A8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080S_A8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080S O8G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080S_O8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080S O8G White" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080S_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080S_O8G_WHITE, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080 Ti 11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_11G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080 Ti 11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080TI_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_11G_GAMING_866C, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080 Ti A11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080TI_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_A11G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RTX 2080 Ti O11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080TI_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_O11G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF RTX 3060 Ti 8G Gaming OC" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3060_TI_O8G_OC, 0x2A);
/*-----------------------------------------*\
| AMD GPUs |
\*-----------------------------------------*/
REGISTER_I2C_PCI_DETECTOR("ASUS AREZ Strix RX Vega 56 O8G" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_VEGA10_DEV, ASUS_SUB_VEN, ASUS_AREZ_STRIX_VEGA56_08G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS Vega 64 Strix" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_VEGA10_DEV, ASUS_SUB_VEN, ASUS_VEGA64_STRIX, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS RX 5600XT Strix O6G Gaming" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_NAVI10_DEV, ASUS_SUB_VEN, ASUS_RX5600XT_STRIX_O6G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS RX 5700XT Strix Gaming OC" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_NAVI10_DEV, ASUS_SUB_VEN, ASUS_RX5700XT_STRIX_GAMING_OC, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS RX 5700XT Strix 08G Gaming" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_NAVI10_DEV, ASUS_SUB_VEN, ASUS_RX5700XT_STRIX_O8G_GAMING, 0x2A);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RX470 O4G Gaming" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX470_STRIX_O4G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RX480 Gaming OC" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX480_STRIX_GAMING_OC, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX RX560 Gaming" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_POLARIS11, ASUS_SUB_VEN, ASUS_RX560_STRIX_4G_GAMING, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS RX 570 Strix O4G Gaming OC" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX570_STRIX_O4G_GAMING_OC, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS RX 580 Strix Gaming OC" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX580_STRIX_GAMING_OC, 0x29);
REGISTER_I2C_PCI_DETECTOR("ASUS RX 580 Strix Gaming TOP" , DetectAsusAuraGPUControllers, AMD_GPU_VEN, AMD_POLARIS_DEV, ASUS_SUB_VEN, ASUS_RX580_STRIX_GAMING_TOP, 0x29);
@@ -1,204 +1,207 @@
/*-----------------------------------------*\
| RGBController_AsusAuraGPU.h |
| |
| Generic RGB Interface for Asus Aura GPU |
| |
| Jan Rettig (Klapstuhl) 14.02.2020 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraGPU.h"
int RGBController_AuraGPU::GetDeviceMode()
{
int dev_mode = aura_gpu->AuraGPURegisterRead(AURA_GPU_REG_MODE);
int color_mode = MODE_COLORS_PER_LED;
if(dev_mode == AURA_GPU_MODE_STATIC)
{
if (aura_gpu->direct)
{
dev_mode = AURA_GPU_MODE_DIRECT;
}
}
switch(dev_mode)
{
case AURA_GPU_MODE_OFF:
case AURA_GPU_MODE_SPECTRUM_CYCLE:
color_mode = MODE_COLORS_NONE;
break;
}
for(std::size_t mode = 0; mode < modes.size(); mode++)
{
if(modes[mode].value == dev_mode)
{
active_mode = mode;
modes[mode].color_mode = color_mode;
}
}
return(active_mode);
}
RGBController_AuraGPU::RGBController_AuraGPU(AuraGPUController * aura_gpu_ptr)
{
aura_gpu = aura_gpu_ptr;
name = aura_gpu->GetDeviceName();
vendor = "ASUS";
type = DEVICE_TYPE_GPU;
description = "ASUS Aura GPU Device";
version = "0.00.1";
location = aura_gpu->GetDeviceLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_GPU_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Off;
Off.name = "Off";
Off.value = AURA_GPU_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = AURA_GPU_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_GPU_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = AURA_GPU_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Flashing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Flashing);
mode Spectrum_Cycle;
Spectrum_Cycle.name = "Spectrum Cycle";
Spectrum_Cycle.value = AURA_GPU_MODE_SPECTRUM_CYCLE;
Spectrum_Cycle.flags = 0;
Spectrum_Cycle.color_mode = MODE_COLORS_NONE;
modes.push_back(Spectrum_Cycle);
SetupZones();
active_mode = GetDeviceMode();
}
RGBController_AuraGPU::~RGBController_AuraGPU()
{
delete aura_gpu;
}
void RGBController_AuraGPU::SetupZones()
{
/*---------------------------------------------------------*\
| Set up zone |
\*---------------------------------------------------------*/
zone aura_gpu_zone;
aura_gpu_zone.name = "GPU";
aura_gpu_zone.type = ZONE_TYPE_SINGLE;
aura_gpu_zone.leds_min = 1;
aura_gpu_zone.leds_max = 1;
aura_gpu_zone.leds_count = 1;
aura_gpu_zone.matrix_map = NULL;
zones.push_back(aura_gpu_zone);
/*---------------------------------------------------------*\
| Set up LED |
\*---------------------------------------------------------*/
led aura_gpu_led;
aura_gpu_led.name = "GPU";
leds.push_back(aura_gpu_led);
SetupColors();
/*---------------------------------------------------------*\
| Initialize color |
\*---------------------------------------------------------*/
unsigned char red = aura_gpu->GetLEDRed();
unsigned char grn = aura_gpu->GetLEDGreen();
unsigned char blu = aura_gpu->GetLEDBlue();
colors[0] = ToRGBColor(red, grn, blu);
}
void RGBController_AuraGPU::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AuraGPU::DeviceUpdateLEDs()
{
for(std::size_t led = 0; led < colors.size(); led++)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
if (GetMode() == 0)
{
aura_gpu->SetLEDColorsDirect(red, grn, blu);
}
else
{
aura_gpu->SetLEDColorsEffect(red, grn, blu);
}
}
}
void RGBController_AuraGPU::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraGPU::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraGPU::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AuraGPU::DeviceUpdateMode()
{
int new_mode = modes[active_mode].value;
aura_gpu->direct = false;
switch(new_mode)
{
// Set all LEDs to 0 and Mode to static as a workaround for the non existing Off Mode
case AURA_GPU_MODE_OFF:
aura_gpu->SetLEDColorsEffect(0, 0, 0);
new_mode = AURA_GPU_MODE_STATIC;
break;
// Direct mode is done by switching to Static and not applying color changes
case AURA_GPU_MODE_DIRECT:
aura_gpu->direct = true;
new_mode = AURA_GPU_MODE_STATIC;
break;
}
aura_gpu->SetMode(new_mode);
}
/*-----------------------------------------*\
| RGBController_AsusAuraGPU.h |
| |
| Generic RGB Interface for Asus Aura GPU |
| |
| Jan Rettig (Klapstuhl) 14.02.2020 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraGPU.h"
int RGBController_AuraGPU::GetDeviceMode()
{
int dev_mode = controller->AuraGPURegisterRead(AURA_GPU_REG_MODE);
int color_mode = MODE_COLORS_PER_LED;
if(dev_mode == AURA_GPU_MODE_STATIC)
{
if (controller->direct)
{
dev_mode = AURA_GPU_MODE_DIRECT;
}
}
switch(dev_mode)
{
case AURA_GPU_MODE_OFF:
case AURA_GPU_MODE_SPECTRUM_CYCLE:
color_mode = MODE_COLORS_NONE;
break;
}
for(std::size_t mode = 0; mode < modes.size(); mode++)
{
if(modes[mode].value == dev_mode)
{
active_mode = mode;
modes[mode].color_mode = color_mode;
}
}
return(active_mode);
}
/**------------------------------------------------------------------*\
@name Asus Aura GPU
@category GPU
@type SMBus
@save :x:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraGPUControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraGPU::RGBController_AuraGPU(AuraGPUController * controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "ASUS";
type = DEVICE_TYPE_GPU;
description = "ASUS Aura GPU Device";
location = controller->GetDeviceLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_GPU_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Off;
Off.name = "Off";
Off.value = AURA_GPU_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = AURA_GPU_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_GPU_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = AURA_GPU_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Flashing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Flashing);
mode Spectrum_Cycle;
Spectrum_Cycle.name = "Spectrum Cycle";
Spectrum_Cycle.value = AURA_GPU_MODE_SPECTRUM_CYCLE;
Spectrum_Cycle.flags = 0;
Spectrum_Cycle.color_mode = MODE_COLORS_NONE;
modes.push_back(Spectrum_Cycle);
SetupZones();
active_mode = GetDeviceMode();
}
RGBController_AuraGPU::~RGBController_AuraGPU()
{
delete controller;
}
void RGBController_AuraGPU::SetupZones()
{
/*---------------------------------------------------------*\
| Set up zone |
\*---------------------------------------------------------*/
zone aura_gpu_zone;
aura_gpu_zone.name = "GPU";
aura_gpu_zone.type = ZONE_TYPE_SINGLE;
aura_gpu_zone.leds_min = 1;
aura_gpu_zone.leds_max = 1;
aura_gpu_zone.leds_count = 1;
aura_gpu_zone.matrix_map = NULL;
zones.push_back(aura_gpu_zone);
/*---------------------------------------------------------*\
| Set up LED |
\*---------------------------------------------------------*/
led aura_gpu_led;
aura_gpu_led.name = "GPU";
leds.push_back(aura_gpu_led);
SetupColors();
/*---------------------------------------------------------*\
| Initialize color |
\*---------------------------------------------------------*/
unsigned char red = controller->GetLEDRed();
unsigned char grn = controller->GetLEDGreen();
unsigned char blu = controller->GetLEDBlue();
colors[0] = ToRGBColor(red, grn, blu);
}
void RGBController_AuraGPU::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AuraGPU::DeviceUpdateLEDs()
{
for(std::size_t led = 0; led < colors.size(); led++)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
if (GetMode() == 0)
{
controller->SetLEDColorsDirect(red, grn, blu);
}
else
{
controller->SetLEDColorsEffect(red, grn, blu);
}
}
}
void RGBController_AuraGPU::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraGPU::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraGPU::DeviceUpdateMode()
{
int new_mode = modes[active_mode].value;
controller->direct = false;
switch(new_mode)
{
// Set all LEDs to 0 and Mode to static as a workaround for the non existing Off Mode
case AURA_GPU_MODE_OFF:
controller->SetLEDColorsEffect(0, 0, 0);
new_mode = AURA_GPU_MODE_STATIC;
break;
// Direct mode is done by switching to Static and not applying color changes
case AURA_GPU_MODE_DIRECT:
controller->direct = true;
new_mode = AURA_GPU_MODE_STATIC;
break;
}
controller->SetMode(new_mode);
}
@@ -1,35 +1,34 @@
/*-----------------------------------------*\
| RGBController_AsusAuraGPU.h |
| |
| Generic RGB Interface for Asus Aura GPU |
| |
| Jan Rettig (Klapstuhl) 14.02.2020 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraGPUController.h"
class RGBController_AuraGPU : public RGBController
{
public:
RGBController_AuraGPU(AuraGPUController* aura_gpu_ptr);
~RGBController_AuraGPU();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AuraGPUController* aura_gpu;
int GetDeviceMode();
};
/*-----------------------------------------*\
| RGBController_AsusAuraGPU.h |
| |
| Generic RGB Interface for Asus Aura GPU |
| |
| Jan Rettig (Klapstuhl) 14.02.2020 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraGPUController.h"
class RGBController_AuraGPU : public RGBController
{
public:
RGBController_AuraGPU(AuraGPUController* controller_ptr);
~RGBController_AuraGPU();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
AuraGPUController* controller;
int GetDeviceMode();
};
@@ -19,7 +19,7 @@ AuraHeadsetStandController::AuraHeadsetStandController(hid_device* dev_handle, c
AuraHeadsetStandController::~AuraHeadsetStandController()
{
hid_close(dev);
hid_close(dev);
}
std::string AuraHeadsetStandController::GetDeviceLocation()
@@ -0,0 +1,116 @@
/*-----------------------------------------*\
| AsusAuraMonitorController.cpp |
| |
| Driver for ASUS Aura RGB USB |
| lighting controller |
| |
| Mola19 08/03/2021 |
\*-----------------------------------------*/
#include "AsusAuraMonitorController.h"
#include <cstring>
#include "LogManager.h"
AuraMonitorController::AuraMonitorController(hid_device* dev_handle, const char* path, uint16_t pid)
{
dev = dev_handle;
location = path;
device_pid = pid;
}
AuraMonitorController::~AuraMonitorController()
{
hid_close(dev);
}
std::string AuraMonitorController::GetDeviceLocation()
{
return("HID: " + location);
}
std::string AuraMonitorController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return("");
}
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
void AuraMonitorController::BeginUpdate()
{
unsigned char usb_buf[8];
if (device_pid == AURA_ROG_PG32UQ_PID)
{
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x03;
usb_buf[0x01] = 0x02;
usb_buf[0x02] = 0xA1;
usb_buf[0x03] = 0x80;
usb_buf[0x04] = 0x20;
hid_send_feature_report(dev, usb_buf, 8);
usb_buf[0x04] = 0x30;
hid_send_feature_report(dev, usb_buf, 8);
}
}
void AuraMonitorController::UpdateLed
(
int led,
unsigned char red,
unsigned char green,
unsigned char blue
)
{
unsigned char usb_buf[8];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x03;
usb_buf[0x01] = 0x02;
usb_buf[0x02] = 0xA1;
usb_buf[0x03] = 0x80;
usb_buf[0x04] = 16 + led * 3;
usb_buf[0x05] = red;
hid_send_feature_report(dev, usb_buf, 8);
usb_buf[0x04] = 16 + led * 3 + 1;
usb_buf[0x05] = blue;
hid_send_feature_report(dev, usb_buf, 8);
usb_buf[0x04] = 16 + led * 3 + 2;
usb_buf[0x05] = green;
hid_send_feature_report(dev, usb_buf, 8);
}
void AuraMonitorController::ApplyChanges()
{
unsigned char usb_buf[8];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x03;
usb_buf[0x01] = 0x02;
usb_buf[0x02] = 0xA1;
usb_buf[0x03] = 0x80;
usb_buf[0x04] = 0xA0;
usb_buf[0x05] = 0x01;
hid_send_feature_report(dev, usb_buf, 8);
}
@@ -0,0 +1,42 @@
/*-----------------------------------------*\
| AsusAuraMonitorController.h |
| |
| Definitions and types for ASUS Aura |
| USB RGB lighting controller |
| |
| Mola19 08/03/2023 |
\*-----------------------------------------*/
#include "RGBController.h"
#include <hidapi/hidapi.h>
#pragma once
enum
{
AURA_ROG_STRIX_XG27AQ_PID = 0x198C,
AURA_ROG_STRIX_XG27W_PID = 0x1933,
AURA_ROG_PG32UQ_PID = 0x19B9,
};
class AuraMonitorController
{
public:
AuraMonitorController(hid_device* dev_handle, const char* path, uint16_t pid);
virtual ~AuraMonitorController();
std::string GetDeviceLocation();
std::string GetSerialString();
void BeginUpdate();
void UpdateLed(int led, unsigned char red, unsigned char green, unsigned char blue);
void ApplyChanges();
uint16_t device_pid;
private:
hid_device* dev;
std::string location;
};
@@ -67,21 +67,32 @@ std::string AuraMouseController::GetVersion(bool wireless, int protocol)
break;
case 1:
case 2:
{
char version[9];
int offset = (wireless ? 13 : 4);
int wireless_offset = (protocol == 2 ? 14 : 13);
int offset = (wireless ? wireless_offset : 4);
snprintf(version, 9, "%2X.%02X.%02X", usb_buf_out[offset + 2], usb_buf_out[offset + 1], usb_buf_out[offset]);
str = std::string(version);
}
break;
case 2:
case 3:
{
unsigned char* offset = usb_buf_out + (wireless ? 13 : 4);
str = std::string(offset, offset + 4);
str = "0." + str.substr(0, 2) + "." + str.substr(2, 2);
}
break;
case 4:
{
char version[16];
int offset = (wireless ? 13 : 4);
snprintf(version, 16, "%2d.%02d.%02d", usb_buf_out[offset + 1], usb_buf_out[offset + 2], usb_buf_out[offset + 3]);
str = std::string(version);
}
break;
}
return str;
@@ -125,28 +136,41 @@ void AuraMouseController::SendUpdate
/*-----------------------------------------------------*\
| Set up message packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x28;
usb_buf[0x03] = zone;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = mode;
usb_buf[0x06] = brightness;
usb_buf[0x07] = red;
usb_buf[0x08] = grn;
usb_buf[0x09] = blu;
if (device_pid == AURA_ROG_GLADIUS_II_ORIGIN_PNK_LTD_PID)
{
usb_buf[0x0A] = 0;
usb_buf[0x0B] = 0;
usb_buf[0x0C] = 0;
usb_buf[0x0D] = dir;
usb_buf[0x0E] = random;
usb_buf[0x0F] = speed;
// this device supports 2 color for breathing,
// but since this mode is per led and openrgb doesn't support 2 colors per led this feature is not implemented
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x28;
usb_buf[0x03] = zone;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = mode;
usb_buf[0x06] = brightness;
usb_buf[0x07] = 0x00; // boolean signaling if the 2nd set of colors is in use
usb_buf[0x08] = red;
usb_buf[0x09] = grn;
usb_buf[0x0A] = blu;
usb_buf[0x0B] = 0; // 2nd red
usb_buf[0x0C] = 0; // 2nd green
usb_buf[0x0D] = 0; // 2nd blue
usb_buf[0x0E] = dir;
usb_buf[0x0F] = random;
usb_buf[0x10] = speed;
}
else
{
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x28;
usb_buf[0x03] = zone;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = mode;
usb_buf[0x06] = brightness;
usb_buf[0x07] = red;
usb_buf[0x08] = grn;
usb_buf[0x09] = blu;
usb_buf[0x0A] = dir;
usb_buf[0x0B] = random;
usb_buf[0x0C] = speed;
@@ -158,5 +182,5 @@ void AuraMouseController::SendUpdate
hid_write(dev, usb_buf, ASUS_AURA_MOUSE_PACKET_SIZE);
unsigned char usb_buf_out[ASUS_AURA_MOUSE_PACKET_SIZE];
hid_read(dev, usb_buf_out, ASUS_AURA_MOUSE_PACKET_SIZE);
hid_read_timeout(dev, usb_buf_out, ASUS_AURA_MOUSE_PACKET_SIZE, 10);
}
@@ -40,7 +40,7 @@ public:
bool random,
unsigned char speed,
unsigned char brightness
);
);
uint16_t device_pid;
@@ -11,22 +11,38 @@
#pragma once
#define AURA_ROG_GLADIUS_II_CORE_PID 0x18DD
#define AURA_ROG_GLADIUS_II_PID 0x1845
#define AURA_ROG_GLADIUS_II_ORIGIN_PID 0x1877
#define AURA_ROG_GLADIUS_II_ORIGIN_PNK_LTD_PID 0x18CD
#define AURA_ROG_GLADIUS_II_ORIGIN_COD_PID 0x18B1
#define AURA_ROG_GLADIUS_II_WIRELESS_1_PID 0x189E
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
#define AURA_ROG_CHAKRAM_WIRELESS_PID 0x18E5
#define AURA_ROG_CHAKRAM_WIRED_1_PID 0x18E3
#define AURA_ROG_CHAKRAM_CORE_PID 0x1958
#define AURA_ROG_PUGIO_PID 0x1846
#define AURA_ROG_PUGIO_II_WIRED_PID 0x1906
#define AURA_ROG_PUGIO_II_WIRELESS_PID 0x1908
#define AURA_ROG_STRIX_IMPACT_II_PID 0x18E1
#define AURA_TUF_M3_PID 0x1910
#define AURA_TUF_M5_PID 0x1898
#define AURA_ROG_GLADIUS_II_CORE_PID 0x18DD
#define AURA_ROG_GLADIUS_II_PID 0x1845
#define AURA_ROG_GLADIUS_II_ORIGIN_PID 0x1877
#define AURA_ROG_GLADIUS_II_ORIGIN_PNK_LTD_PID 0x18CD
#define AURA_ROG_GLADIUS_II_ORIGIN_COD_PID 0x18B1
#define AURA_ROG_GLADIUS_II_WIRELESS_1_PID 0x189E
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
#define AURA_ROG_GLADIUS_III_PID 0x197B
#define AURA_ROG_GLADIUS_III_WIRELESS_USB_PID 0x197D
#define AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID 0x197F
#define AURA_ROG_GLADIUS_III_WIRELESS_BT_PID 0x1981
#define AURA_ROG_CHAKRAM_WIRELESS_PID 0x18E5
#define AURA_ROG_CHAKRAM_WIRED_1_PID 0x18E3
#define AURA_ROG_CHAKRAM_CORE_PID 0x1958
#define AURA_ROG_CHAKRAM_X_USB_PID 0x1A18
#define AURA_ROG_CHAKRAM_X_2_4_PID 0x1A1A
#define AURA_ROG_PUGIO_PID 0x1846
#define AURA_ROG_PUGIO_II_WIRED_PID 0x1906
#define AURA_ROG_PUGIO_II_WIRELESS_PID 0x1908
#define AURA_ROG_STRIX_IMPACT_PID 0x1847
#define AURA_ROG_STRIX_IMPACT_II_PID 0x18E1
#define AURA_ROG_STRIX_IMPACT_II_GUNDAM_PID 0x189E
#define AURA_ROG_STRIX_IMPACT_II_PUNK_PID 0x1956
#define AURA_ROG_STRIX_IMPACT_II_WHITE_PID 0x19D2
#define AURA_ROG_STRIX_IMPACT_II_WIRELESS_USB_PID 0x1947
#define AURA_ROG_STRIX_IMPACT_II_WIRELESS_2_4_PID 0x1949
#define AURA_ROG_KERIS 0x195C
#define AURA_ROG_KERIS_WIRELESS_USB_PID 0x195E
#define AURA_ROG_KERIS_WIRELESS_2_4_PID 0x1960
#define AURA_ROG_KERIS_WIRELESS_BT_PID 0x1962
#define AURA_TUF_M3_PID 0x1910
#define AURA_TUF_M5_PID 0x1898
enum
{
@@ -52,6 +68,8 @@ typedef struct
{
uint8_t speed_min;
uint8_t speed_max;
uint8_t brightness_min;
uint8_t brightness_max;
bool wireless;
int version_protocol;
std::vector<uint8_t> mouse_zones;
@@ -71,10 +89,12 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
AURA_ROG_GLADIUS_II_CORE_PID, // ROG Gladius II Core
{
0, //Speed Min - The Asus Mouse protocol defines larger numbers as slow
0, //Speed Max
false,
1,
0, // Speed Min - The Asus Mouse protocol defines larger numbers as slow
0, // Speed Max
0, // Brightness Min
4, // Brightness Max
false, // is wireless? (important for fetching the version)
1, // version protocol
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
@@ -84,6 +104,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
255,
1,
0,
4,
false,
0,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -95,6 +117,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
255,
1,
0,
4,
false,
0,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -106,6 +130,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
255,
1,
0,
4,
false,
0,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -117,6 +143,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
255,
1,
0,
4,
false,
0,
{ AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -128,6 +156,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
0,
0,
0,
4,
true,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
@@ -139,17 +169,73 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
0,
0,
0,
4,
true,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_GLADIUS_III_PID, // ROG Gladius III
{
255,
1,
0,
64,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, // ROG Gladius III Wireless USB
{
255,
1,
0,
64,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID, // ROG Gladius III Wireless 2.4 GHz Dongle
{
255,
1,
0,
64,
true,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_GLADIUS_III_WIRELESS_BT_PID, // ROG Gladius III Wireless Bluetooth
{
255,
1,
0,
64,
true,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_CHAKRAM_WIRELESS_PID, // ROG Chakram Wireless
{
15,
1,
0,
4,
true,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -161,6 +247,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
15,
1,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -172,17 +260,47 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
},
{
AURA_ROG_CHAKRAM_X_USB_PID, // ROG Chakram X USB
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_CHAKRAM_X_2_4_PID, // ROG Chakram X 2.4GHz Dongle
{
255,
1,
0,
64,
true,
2,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_PUGIO_PID, // ROG Pugio
{
255,
1,
0,
4,
false,
0,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -194,6 +312,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
15,
1,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
@@ -205,28 +325,164 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
15,
1,
0,
4,
true,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_STRIX_IMPACT_PID, // ROG Strix Impact
{
0,
0,
0,
4,
false,
4,
{ AURA_MOUSE_ZONE_LOGO },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM }
}
},
{
AURA_ROG_STRIX_IMPACT_II_PID, // ROG Strix Impact II
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
},
{
AURA_ROG_STRIX_IMPACT_II_GUNDAM_PID, // ROG Strix Impact II Gundam
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
},
{
AURA_ROG_STRIX_IMPACT_II_PUNK_PID, // ROG Strix Impact II Electro Punk
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
},
{
AURA_ROG_STRIX_IMPACT_II_WHITE_PID, // ROG Strix Impact II Moonlight White
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL, AURA_MOUSE_ZONE_UNDERGLOW },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
},
{
AURA_ROG_STRIX_IMPACT_II_WIRELESS_USB_PID, // ROG Strix Impact II Wireless USB
{
0,
0,
0,
4,
false,
1, // not tested, but likely same as ROG Strix Impact II non wireless
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_STRIX_IMPACT_II_WIRELESS_2_4_PID, // ROG Strix Impact II Wireless 2.4 GHz Dongle
{
0,
0,
0,
4,
true,
1, // not tested, but likely same as ROG Strix Impact II non wireless
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_KERIS, // ROG Keris
{
0,
0,
0,
4,
false,
1, // might be the wrong protocol for version
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
},
{
AURA_ROG_KERIS_WIRELESS_USB_PID, // ROG Keris
{
0,
0,
0,
4,
true,
1, // might be the wrong protocol for version
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_KERIS_WIRELESS_2_4_PID, // ROG Keris
{
0,
0,
0,
4,
true,
1, // might be the wrong protocol for version
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_ROG_KERIS_WIRELESS_BT_PID, // ROG Keris
{
0,
0,
0,
4,
true,
1, // might be the wrong protocol for version
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_BATTERY }
}
},
{
AURA_TUF_M3_PID, // TUF M3
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO },
@@ -238,8 +494,10 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
0,
0,
0,
4,
false,
2,
3,
{ AURA_MOUSE_ZONE_LOGO },
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_REACTIVE }
}
@@ -0,0 +1,134 @@
/*-----------------------------------------*\
| AsusAuraMousematController.cpp |
| |
| Driver for ASUS Aura RGB USB |
| lighting controller |
| |
| Adam Honse (CalcProgrammer1) 1/10/2022 |
\*-----------------------------------------*/
#include "AsusAuraMousematController.h"
#include <cstring>
AuraMousematController::AuraMousematController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
location = path;
}
AuraMousematController::~AuraMousematController()
{
hid_close(dev);
}
std::string AuraMousematController::GetDeviceLocation()
{
return("HID: " + location);
}
std::string AuraMousematController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return("");
}
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
std::string AuraMousematController::GetVersion()
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0xEE;
usb_buf[0x01] = 0x12;
usb_buf[0x02] = 0x00;
hid_write(dev, usb_buf, 65);
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
char version[5];
snprintf(version, 5, "%04X", (usb_buf_out[6] << 8) | usb_buf_out[7]);
return std::string(version);
}
void AuraMousematController::UpdateLeds
(
std::vector<RGBColor> colors
)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0xEE;
usb_buf[0x01] = 0xC0;
usb_buf[0x02] = 0x81;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x00;
for(unsigned int i = 0; i < 60; i += 4)
{
usb_buf[5 + i] = 0x00;
usb_buf[6 + i] = RGBGetRValue(colors[i / 4]);
usb_buf[7 + i] = RGBGetGValue(colors[i / 4]);
usb_buf[8 + i] = RGBGetBValue(colors[i / 4]);
}
hid_write(dev, usb_buf, 65);
}
void AuraMousematController::UpdateDevice
(
unsigned char mode,
std::vector<RGBColor> colors,
unsigned char speed,
unsigned char brightness,
unsigned char pattern
)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0xEE;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x28;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = mode;
usb_buf[0x06] = speed;
usb_buf[0x07] = brightness;
usb_buf[0x08] = pattern;
usb_buf[0x09] = 0x00;
for(unsigned int i = 0; i < colors.size(); i++)
{
usb_buf[0x0a + i * 3] = RGBGetRValue(colors[i]);
usb_buf[0x0b + i * 3] = RGBGetGValue(colors[i]);
usb_buf[0x0c + i * 3] = RGBGetBValue(colors[i]);
}
hid_write(dev, usb_buf, 65);
}
void AuraMousematController::SaveMode()
{
unsigned char usb_save_buf[65];
memset(usb_save_buf, 0x00, sizeof(usb_save_buf));
usb_save_buf[0x00] = 0xEE;
usb_save_buf[0x01] = 0x50;
usb_save_buf[0x02] = 0x55;
hid_write(dev, usb_save_buf, 65);
}
@@ -0,0 +1,59 @@
/*-----------------------------------------*\
| AsusAuraMousematController.h |
| |
| Definitions and types for ASUS Aura |
| USB RGB lighting controller |
| |
| Adam Honse (CalcProgrammer1) 1/10/2022 |
\*-----------------------------------------*/
#include "RGBController.h"
#include <hidapi/hidapi.h>
#pragma once
enum
{
AURA_MOUSEMAT_MODE_STATIC = 0,
AURA_MOUSEMAT_MODE_BREATHING = 1,
AURA_MOUSEMAT_MODE_COLOR_CYCLE = 2,
AURA_MOUSEMAT_MODE_WAVE = 3,
AURA_MOUSEMAT_MODE_WAVE_PLANE = 4,
AURA_MOUSEMAT_MODE_COMET = 5,
AURA_MOUSEMAT_MODE_GLOWING_YOYO = 6,
AURA_MOUSEMAT_MODE_CROSS = 7,
AURA_MOUSEMAT_MODE_STARRY_NIGHT = 8,
AURA_MOUSEMAT_MODE_DIRECT = 0xFF,
};
class AuraMousematController
{
public:
AuraMousematController(hid_device* dev_handle, const char* path);
virtual ~AuraMousematController();
std::string GetDeviceLocation();
std::string GetSerialString();
std::string GetVersion();
void UpdateLeds
(
std::vector<RGBColor> colors
);
void UpdateDevice
(
unsigned char mode,
std::vector<RGBColor> colors,
unsigned char speed,
unsigned char brightness,
unsigned char pattern
);
void SaveMode();
private:
hid_device* dev;
std::string location;
};
@@ -0,0 +1,118 @@
/*-------------------------------------------------------------------*\
| AsusAuraRyuoAIOController.cpp |
| |
| Driver for the ASUS Aura Ryuo AIO |
| lighting controller |
| |
| Cooper Hall (geobot19 / Geo_bot) 08 Apr 2022 |
| using snipets from Chris M (Dr.No) |
\*-------------------------------------------------------------------*/
#include "AsusAuraRyuoAIOController.h"
AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, const char* path) : AuraUSBController(dev_handle, path)
{
/*-----------------------------------------------------*\
| Add addressable devices |
| Manually adding device info for now |
| TODO: Implement config table accurately |
\*-----------------------------------------------------*/
device_info.push_back({0x00, 0x00, 12, 0, AuraDeviceType::FIXED});
}
AsusAuraRyuoAIOController::~AsusAuraRyuoAIOController()
{
hid_close(dev);
}
std::string AsusAuraRyuoAIOController::GetLocation()
{
return("HID: " + location);
}
void AsusAuraRyuoAIOController::SetMode(unsigned char /*channel*/, unsigned char /*mode*/, unsigned char /*red*/, unsigned char /*grn*/, unsigned char /*blu*/)
{
/*---------------------------------------------------------*\
| This interface is not used in this controller however is |
| required by the abstract class |
\*---------------------------------------------------------*/
}
void AsusAuraRyuoAIOController::SetMode(unsigned char mode, unsigned char speed, unsigned char direction, RGBColor colour)
{
//check if update is needed
if(!((current_mode == mode) && (ToRGBColor(current_red, current_green, current_blue) == colour) && (current_speed == speed) && (current_direction == direction)))
{
current_mode = mode;
current_speed = speed;
current_direction = direction;
current_red = RGBGetRValue(colour);
current_green = RGBGetGValue(colour);
current_blue = RGBGetBValue(colour);
SendUpdate();
}
}
void AsusAuraRyuoAIOController::SetChannelLEDs(unsigned char /*channel*/, RGBColor* /*colors*/, unsigned int /*num_colors*/)
{
/*---------------------------------------------------------*\
| This interface is not used in this controller however is |
| required by the abstract class |
\*---------------------------------------------------------*/
}
void AsusAuraRyuoAIOController::SetLedsDirect(RGBColor * led_colours, uint8_t led_count)
{
uint8_t buffer[write_packet_size] = { 0xEC, 0x40, 0x80, 0x00, led_count };
/*---------------------------------------------------------*\
| Set the colour bytes in the packet |
\*---------------------------------------------------------*/
for(uint8_t index = 0; index < led_count; index++)
{
uint8_t offset = (index * 3) + RED_BYTE;
buffer[offset + 0] = RGBGetRValue(led_colours[index]);
buffer[offset + 1] = RGBGetGValue(led_colours[index]);
buffer[offset + 2] = RGBGetBValue(led_colours[index]);
}
hid_write(dev, buffer, write_packet_size);
}
void AsusAuraRyuoAIOController::GetStatus()
{
uint8_t buffer[write_packet_size] = { 0xEC, 0x01, 0x02 };
hid_write(dev, buffer, write_packet_size);
hid_read_timeout(dev, buffer, read_packet_size, ASUSAURARYUOAIOCONTROLLER_TIMEOUT);
current_red = buffer[RED_BYTE - 1];
current_green = buffer[GREEN_BYTE - 1];
current_blue = buffer[BLUE_BYTE - 1];
}
void AsusAuraRyuoAIOController::SendUpdate()
{
uint8_t buffer[write_packet_size];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(buffer, 0x00, write_packet_size);
buffer[REPORTID_BYTE] = reportid;
buffer[COMMAND_BYTE] = modefx;
buffer[ZONE_BYTE] = 0;
buffer[PROGRAM_ID_BYTE] = program_id;
buffer[MODE_BYTE] = current_mode;
buffer[RED_BYTE] = current_red;
buffer[GREEN_BYTE] = current_green;
buffer[BLUE_BYTE] = current_blue;
buffer[DIRECTION_BYTE]= current_direction;
buffer[SPEED_BYTE] = current_speed;
hid_write(dev, buffer, write_packet_size);
}
@@ -0,0 +1,94 @@
/*-------------------------------------------------------------------*\
| AsusAuraRyuoAIOController.h |
| |
| Driver for the ASUS Aura Ryuo AIO |
| lighting controller |
| |
| Cooper Hall (geobot19 / Geo_bot) 08 Apr 2022 |
| using snipets from Chris M (Dr.No) |
\*-------------------------------------------------------------------*/
#include <string>
#include <hidapi/hidapi.h>
#include "RGBController.h"
#include "AsusAuraUSBController.h"
#pragma once
#define ASUSAURARYUOAIOCONTROLLER_TIMEOUT 250
#define ASUSAURARYUOAIOCONTROLLER_HID_MAX_STR 255
#define ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MIN 0
#define ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX 255
class AsusAuraRyuoAIOController : public AuraUSBController
{
public:
enum
{
MODE_DIRECT = 0xFF, //Direct Led Control - Independently set LEDs in zone
MODE_STATIC = 0x01, //Static Mode - Set entire zone to a single color.
MODE_BREATHING = 0x02, //Breathing Mode - Fades between fully off and fully on.
MODE_FLASHING = 0x03, //Flashing Mode - Abruptly changing between fully off and fully on.
MODE_SPECTRUM = 0x04, //Spectrum Cycle Mode - Cycles through the color spectrum on all lights on the device
MODE_RAINBOW = 0x05, //Rainbow Wave Mode - Cycle thru the color spectrum as a wave across all LEDs
MODE_FLASHANDDASH = 0x0A, //Flash n Dash - Flash twice and then flash in direction
};
enum PacketMap
{
REPORTID_BYTE = 0,
COMMAND_BYTE = 1,
ZONE_BYTE = 2,
PROGRAM_ID_BYTE= 3,
MODE_BYTE = 4,
RED_BYTE = 5,
GREEN_BYTE = 6,
BLUE_BYTE = 7,
DIRECTION_BYTE = 8,
SPEED_BYTE = 9,
};
enum
{
SPEED_SLOWEST = 0x04, // Slowest speed
SPEED_SLOW = 0x03, // Slower speed
SPEED_NORMAL = 0x02, // Normal speed
SPEED_FAST = 0x01, // Fast speed
SPEED_FASTEST = 0x00, // Fastest speed
};
AsusAuraRyuoAIOController(hid_device* dev_handle, const char* path);
~AsusAuraRyuoAIOController();
std::string GetLocation();
void SetChannelLEDs(unsigned char channel, RGBColor *colors, unsigned int num_colors);
void SetLedsDirect(RGBColor * led_colours, uint8_t led_count);
void SetMode(unsigned char channel, unsigned char mode, unsigned char red, unsigned char grn, unsigned char blu);
void SetMode(unsigned char mode, unsigned char speed, unsigned char direction, RGBColor colour);
private:
static const uint8_t read_packet_size = 65;
static const uint8_t write_packet_size = 65;
static const uint8_t modefx = 0x3B;
static const uint8_t direct = 0x40;
static const uint8_t reportid = 0xEC;
static const uint8_t program_id = 0x22;
std::string location;
uint8_t zone_index;
uint8_t current_mode;
uint8_t current_speed;
uint8_t current_red;
uint8_t current_green;
uint8_t current_blue;
uint8_t current_direction;
void GetStatus();
void SendUpdate();
void SendEffect(unsigned char channel, unsigned char mode, unsigned char red, unsigned char grn, unsigned char blu);
void SendDirectApply(unsigned char channel);
};
@@ -31,7 +31,7 @@ public:
(
unsigned char key,
unsigned char value
);
);
void UpdateProfile
(
@@ -17,10 +17,12 @@
#include <string.h>
#include <cmath>
AuraTUFKeyboardController::AuraTUFKeyboardController(hid_device* dev_handle, const char* path)
AuraTUFKeyboardController::AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid, unsigned short rev_version)
{
dev = dev_handle;
location = path;
device_pid = pid;
version = rev_version;
}
AuraTUFKeyboardController::~AuraTUFKeyboardController()
@@ -51,49 +53,161 @@ std::string AuraTUFKeyboardController::GetSerialString()
std::string AuraTUFKeyboardController::GetVersion()
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x12;
usb_buf[0x02] = 0x00;
if(device_pid != AURA_ROG_CLAYMORE_PID)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
hid_write(dev, usb_buf, 65);
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x12;
usb_buf[0x02] = 0x00;
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
ClearResponses();
char version[9];
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[5], usb_buf_out[6], usb_buf_out[7]);
return std::string(version);
hid_write(dev, usb_buf, 65);
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
char version[9];
if(device_pid == AURA_TUF_K3_GAMING_PID)
{
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[6], usb_buf_out[5], usb_buf_out[4]);
}
else
{
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[5], usb_buf_out[6], usb_buf_out[7]);
}
return std::string(version);
}
else
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x10;
usb_buf[0x02] = 0x01;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = 0x00; // set to 1 to get firmware version of numpad
ClearResponses();
hid_write(dev, usb_buf, 65);
AwaitResponse(20);
unsigned char usb_buf1[65];
memset(usb_buf1, 0x00, sizeof(usb_buf1));
usb_buf1[0x00] = 0x00;
usb_buf1[0x01] = 0x12;
usb_buf1[0x02] = 0x22;
ClearResponses();
hid_write(dev, usb_buf1, 65);
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
char version[9];
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[8], usb_buf_out[9], usb_buf_out[10]);
return std::string(version);
}
}
int AuraTUFKeyboardController::GetLayout()
{
if(device_pid != AURA_ROG_CLAYMORE_PID)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x12;
usb_buf[0x02] = 0x12;
ClearResponses();
hid_write(dev, usb_buf, 65);
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
return(usb_buf_out[4] * 100 + usb_buf_out[5]);
}
else
{
char layout[4];
snprintf(layout, 4, "%X", version);
int layoutnum = std::stoi(std::string(layout, 1));
switch(layoutnum)
{
case 1:
return 117;
case 2:
return 204;
case 3:
return 221;
case 4:
return 117;
default:
return 117;
}
}
}
/*---------------------------------------------------------*\
| only needed for Claymore |
\*---------------------------------------------------------*/
int AuraTUFKeyboardController::GetNumpadLocation()
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x12;
usb_buf[0x02] = 0x12;
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x40;
usb_buf[0x02] = 0x60;
ClearResponses();
hid_write(dev, usb_buf, 65);
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
return(usb_buf_out[4] * 100 + usb_buf_out[5]);
return(usb_buf_out[5] * 2 + usb_buf_out[4]);
}
void AuraTUFKeyboardController::SaveMode()
{
unsigned char usb_save_buf[65];
memset(usb_save_buf, 0x00, sizeof(usb_save_buf));
usb_save_buf[0x00] = 0x00;
usb_save_buf[0x01] = 0x50;
usb_save_buf[0x02] = 0x55;
ClearResponses();
hid_write(dev, usb_save_buf, 65);
AwaitResponse(60);
}
/*---------------------------------------------------------*\
| only needed for Claymore |
\*---------------------------------------------------------*/
void AuraTUFKeyboardController::AllowRemoteControl(unsigned char type)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x41;
usb_buf[0x02] = type;
ClearResponses();
hid_write(dev, usb_buf, 65);
AwaitResponse(20);
}
void AuraTUFKeyboardController::UpdateSingleLed
@@ -108,11 +222,10 @@ void AuraTUFKeyboardController::UpdateSingleLed
| Set up message packet for single LED |
\*-----------------------------------------------------*/
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0] = 0x00;
usb_buf[1] = 0xc0;
usb_buf[1] = 0xC0;
usb_buf[2] = 0x81;
usb_buf[3] = 0x01;
usb_buf[4] = 0x00;
@@ -120,70 +233,48 @@ void AuraTUFKeyboardController::UpdateSingleLed
/*-----------------------------------------------------*\
| Convert LED index |
\*-----------------------------------------------------*/
usb_buf[5] = floor(led/6)*8 + led%6;
usb_buf[5] = led;
usb_buf[6] = red;
usb_buf[7] = green;
usb_buf[8] = blue;
ClearResponses();
hid_write(dev, usb_buf, 65);
AwaitResponse(20);
}
void AuraTUFKeyboardController::UpdateLeds
(
std::vector<RGBColor> colors
std::vector<led_color> colors
)
{
/*-----------------------------------------------------*\
| Loop over every column (optimisation needed) |
\*-----------------------------------------------------*/
for(unsigned int i = 0; i < 192; i += 16)
{
unsigned char usb_buf[69];
int packets = ceil((float) colors.size() / 15);
for(int i = 0; i < packets; i++)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
int remaining = colors.size() - i * 15;
int leds = (remaining > 0x0F) ? 0x0F : remaining;
usb_buf[0] = 0x00;
usb_buf[1] = 0xc0;
usb_buf[1] = 0xC0;
usb_buf[2] = 0x81;
usb_buf[3] = (138 - i / 16 * 12);
usb_buf[3] = leds;
usb_buf[4] = 0x00;
for(unsigned int n = 0; n < 6; n++)
for(int j = 0; j < leds; j++)
{
usb_buf[n * 4 + 5] = i + n;
usb_buf[n * 4 + 6] = RGBGetRValue(colors[i/16*12+n]);
usb_buf[n * 4 + 7] = RGBGetGValue(colors[i/16*12+n]);
usb_buf[n * 4 + 8] = RGBGetBValue(colors[i/16*12+n]);
usb_buf[j * 4 + 5] = colors[i * 15 + j].value;
usb_buf[j * 4 + 6] = RGBGetRValue(colors[i * 15 + j].color);
usb_buf[j * 4 + 7] = RGBGetGValue(colors[i * 15 + j].color);
usb_buf[j * 4 + 8] = RGBGetBValue(colors[i * 15 + j].color);
}
for(unsigned int n = 6; n < 8; n++)
{
usb_buf[n * 4 + 5] = i + n;
usb_buf[n * 4 + 6] = 0;
usb_buf[n * 4 + 7] = 0;
usb_buf[n * 4 + 8] = 0;
}
if(i != 176)
{
for(unsigned int n = 8; n < 14; n++)
{
usb_buf[n * 4 + 5] = i + n;
usb_buf[n * 4 + 6] = RGBGetRValue(colors[i/16*12+n-2]);
usb_buf[n * 4 + 7] = RGBGetGValue(colors[i/16*12+n-2]);
usb_buf[n * 4 + 8] = RGBGetBValue(colors[i/16*12+n-2]);
}
for(unsigned int n = 14; n < 16; n++)
{
usb_buf[n * 4 + 5] = i + n;
usb_buf[n * 4 + 6] = 0;
usb_buf[n * 4 + 7] = 0;
usb_buf[n * 4 + 8] = 0;
}
}
hid_write(dev, usb_buf, 69);
ClearResponses();
hid_write(dev, usb_buf, 65);
AwaitResponse(20);
}
}
@@ -191,75 +282,168 @@ void AuraTUFKeyboardController::UpdateDevice
(
unsigned char mode,
std::vector<RGBColor> colors,
unsigned char dir,
unsigned char direction,
unsigned char color_mode,
unsigned char speed,
unsigned char brightness
)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x2C;
usb_buf[0x03] = mode;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = speed;
usb_buf[0x06] = brightness;
usb_buf[0x07] = color_mode;
usb_buf[0x08] = dir;
usb_buf[0x09] = 0x02;
if(mode == 4 || mode == 5)
if(device_pid != AURA_ROG_CLAYMORE_PID)
{
/*-----------------------------------------------------*\
| If mode is Rainbow or Ripple |
\*-----------------------------------------------------*/
usb_buf[0x0A] = colors.size();
usb_buf[0x03] = mode;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = speed;
usb_buf[0x06] = brightness;
usb_buf[0x07] = color_mode;
usb_buf[0x08] = direction;
usb_buf[0x09] = 0x02;
/*-----------------------------------------------------*\
| Loop over every color given |
\*-----------------------------------------------------*/
for(unsigned int i = 0; i / 4 < colors.size(); i += 4)
if(mode == AURA_KEYBOARD_MODE_WAVE || mode == AURA_KEYBOARD_MODE_RIPPLE)
{
if(colors[i / 4])
usb_buf[0x0A] = colors.size();
/*-----------------------------------------------------*\
| Loop over every color given |
\*-----------------------------------------------------*/
for(unsigned int i = 0; i < colors.size(); i ++)
{
usb_buf[11 + i] = 100/(double)colors.size()*(i/4+1);
usb_buf[12 + i] = RGBGetRValue(colors[i/4]);
usb_buf[13 + i] = RGBGetGValue(colors[i/4]);
usb_buf[14 + i] = RGBGetBValue(colors[i/4]);
if(colors[i])
{
usb_buf[11 + i * 4] = 100/(double)colors.size()*(i+1);
usb_buf[12 + i * 4] = RGBGetRValue(colors[i]);
usb_buf[13 + i * 4] = RGBGetGValue(colors[i]);
usb_buf[14 + i * 4] = RGBGetBValue(colors[i]);
}
}
}
else
{
/*-----------------------------------------------------*\
| Loop over Color1, Color2 and Background if there |
\*-----------------------------------------------------*/
for(unsigned int i = 0; i != colors.size(); i++)
{
if(colors[i])
{
usb_buf[10 + i * 3] = RGBGetRValue(colors[i]);
usb_buf[11 + i * 3] = RGBGetGValue(colors[i]);
usb_buf[12 + i * 3] = RGBGetBValue(colors[i]);
}
}
}
}
else
{
/*-----------------------------------------------------*\
| Loop over Color1, Color2 and Background if there |
\*-----------------------------------------------------*/
for(unsigned int i = 0; i / 3 != colors.size(); i += 3)
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = mode;
usb_buf[0x06] = speed;
bool random = (color_mode == 1);
bool pattern = (color_mode == 2);
usb_buf[0x07] = random * 128 + pattern * 32 + direction;
usb_buf[0x08] = 0xFF; // "byteExt1" unknown usage
usb_buf[0x09] = 0xFF; // "byteExt2" unknown usage
usb_buf[0x0A] = (mode == 2) ? 0x80 : 0xFF; // "Lightness" (not Brightness)
if(mode == 7)
{
if(colors[i / 3])
UpdateQuicksandColors(colors);
}
else
{
if(mode == 4 && color_mode == 0)
{
usb_buf[10 + i] = RGBGetRValue(colors[i/3]);
usb_buf[11 + i] = RGBGetGValue(colors[i/3]);
usb_buf[12 + i] = RGBGetBValue(colors[i/3]);
usb_buf[11] = 0xFF;
usb_buf[12] = 0xFF;
usb_buf[13] = 0xFF;
}
for(unsigned int i = 0; i < colors.size(); i ++)
{
if(colors[i])
{
usb_buf[11 + i * 3] = RGBGetRValue(colors[i]);
usb_buf[12 + i * 3] = RGBGetGValue(colors[i]);
usb_buf[13 + i * 3] = RGBGetBValue(colors[i]);
}
}
}
for(int i = 1; i < 5; i++)
{
usb_buf[5 + i * 12] = 0xFF;
}
}
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
ClearResponses();
hid_write(dev, usb_buf, 65);
AwaitResponse(20);
}
void AuraTUFKeyboardController::AwaitResponse()
/*---------------------------------------------------------*\
| only needed for Claymore |
\*---------------------------------------------------------*/
void AuraTUFKeyboardController::UpdateQuicksandColors
(
std::vector<RGBColor> colors
)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x91;
for(unsigned int i = 0; i < 6; i++)
{
if(colors[i])
{
usb_buf[5 + i * 3] = RGBGetRValue(colors[i]);
usb_buf[6 + i * 3] = RGBGetGValue(colors[i]);
usb_buf[7 + i * 3] = RGBGetBValue(colors[i]);
}
}
ClearResponses();
hid_write(dev, usb_buf, 65);
AwaitResponse(20);
}
/*---------------------------------------------------------*\
| only needed for Claymore |
\*---------------------------------------------------------*/
void AuraTUFKeyboardController::UpdateMode(unsigned char mode)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x51;
usb_buf[0x02] = 0x28;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = mode;
ClearResponses();
hid_write(dev, usb_buf, 65);
AwaitResponse(20);
}
void AuraTUFKeyboardController::AwaitResponse(int ms)
{
unsigned char usb_buf_out[65];
hid_read(dev, usb_buf_out, 65);
hid_read_timeout(dev, usb_buf_out, 65, ms);
}
void AuraTUFKeyboardController::ClearResponses()
@@ -268,7 +452,7 @@ void AuraTUFKeyboardController::ClearResponses()
unsigned char usb_buf_flush[65];
while(result > 0)
{
result = hid_read_timeout(dev, usb_buf_flush, 65, 0);
result = hid_read_timeout(dev, usb_buf_flush, 65, 0);
}
}
@@ -16,14 +16,6 @@
#pragma once
enum
{
AURA_KEYBOARD_ZONE_LOGO = 0,
AURA_KEYBOARD_ZONE_SCROLL = 1,
AURA_KEYBOARD_ZONE_UNDERGLOW = 2,
AURA_KEYBOARD_ZONE_ALL = 3,
};
enum
{
AURA_KEYBOARD_MODE_STATIC = 0,
@@ -39,17 +31,34 @@ enum
AURA_KEYBOARD_MODE_DIRECT = 15,
};
enum
{
AURA_ROG_FALCHION_WIRED_PID = 0x193C,
AURA_ROG_FALCHION_WIRELESS_PID = 0x193E,
AURA_TUF_K7_GAMING_PID = 0x18AA,
AURA_TUF_K3_GAMING_PID = 0x194B,
AURA_ROG_CLAYMORE_PID = 0x184D,
};
struct led_color
{
unsigned int value;
RGBColor color;
};
class AuraTUFKeyboardController
{
public:
AuraTUFKeyboardController(hid_device* dev_handle, const char* path);
AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid, unsigned short rev_version);
~AuraTUFKeyboardController();
std::string GetDeviceLocation();
std::string GetSerialString();
std::string GetVersion();
int GetLayout();
int GetNumpadLocation();
void SaveMode();
void AllowRemoteControl(unsigned char type);
void UpdateSingleLed
(
@@ -61,7 +70,7 @@ public:
void UpdateLeds
(
std::vector<RGBColor> colors
std::vector<led_color> colors
);
void UpdateDevice
@@ -73,11 +82,16 @@ public:
unsigned char speed,
unsigned char brightness
);
void AwaitResponse();
void UpdateQuicksandColors(std::vector<RGBColor> colors);
void UpdateMode(unsigned char mode);
void AwaitResponse(int ms);
void ClearResponses();
uint16_t device_pid;
private:
hid_device* dev;
std::string location;
unsigned short version;
};
File diff suppressed because it is too large Load Diff
@@ -8,6 +8,8 @@
\*-----------------------------------------*/
#include "AsusAuraUSBController.h"
#include "LogManager.h"
#include <cstring>
#include <stdexcept>
@@ -24,6 +26,7 @@ AuraUSBController::~AuraUSBController()
{
hid_close(dev);
}
unsigned int AuraUSBController::GetChannelCount()
{
return(device_info.size());
@@ -88,18 +91,21 @@ void AuraUSBController::GetConfigTable()
{
memcpy(config_table, &usb_buf[4], 60);
LOG_DEBUG("[%s] ASUS Aura USB config table:", device_name);
for(int i = 0; i < 60; i+=6)
{
printf("%02X %02X %02X %02X %02X %02X\r\n", config_table[i + 0],
config_table[i + 1],
config_table[i + 2],
config_table[i + 3],
config_table[i + 4],
config_table[i + 5]);
LOG_DEBUG("[%s] %02X %02X %02X %02X %02X %02X", device_name,
config_table[i + 0],
config_table[i + 1],
config_table[i + 2],
config_table[i + 3],
config_table[i + 4],
config_table[i + 5]);
}
}
else
{
{
LOG_INFO("[%s] Could not read config table, can not add device", device_name);
delete this;
}
@@ -5,14 +5,21 @@
#include "AsusAuraTUFKeyboardController.h"
#include "AsusAuraMainboardController.h"
#include "AsusAuraMouseController.h"
#include "AsusAuraMousematController.h"
#include "AsusAuraStrixEvolveController.h"
#include "AsusAuraMonitorController.h"
#include "AsusAuraRyuoAIOController.h"
#include "RGBController.h"
#include "RGBController_AsusAuraUSB.h"
#include "RGBController_AsusAuraHeadsetStand.h"
#include "RGBController_AsusAuraKeyboard.h"
#include "RGBController_AsusAuraTUFKeyboard.h"
#include "RGBController_AsusAuraMouse.h"
#include "RGBController_AsusAuraMousemat.h"
#include "RGBController_ROGStrixLC_Controller.h"
#include "RGBController_AsusAuraStrixEvolve.h"
#include "RGBController_AsusAuraMonitor.h"
#include "RGBController_AsusAuraRyuoAIO.h"
#include <stdexcept>
#include <hidapi/hidapi.h>
#include "dependencies/dmiinfo.h"
@@ -37,10 +44,14 @@
#define AURA_ROG_FALCHION_WIRELESS_PID 0x193E
#define AURA_ROG_STRIX_FLARE_PID 0x1875
#define AURA_ROG_STRIX_FLARE_PNK_LTD_PID 0x18CF
#define AURA_ROG_STRIX_FLARE_COD_BO4_PID 0x18AF
#define AURA_ROG_STRIX_SCOPE_PID 0x18F8
#define AURA_ROG_STRIX_SCOPE_RX_PID 0x1951
#define AURA_ROG_STRIX_SCOPE_TKL_PID 0x190C
#define AURA_ROG_STRIX_SCOPE_TKL_PNK_LTD_PID 0x1954
#define AURA_ROG_CLAYMORE_PID 0x184D
#define AURA_TUF_K7_GAMING_PID 0x18AA
#define AURA_TUF_K3_GAMING_PID 0x194B
/*-----------------------------------------------------------------*\
| MICE - defined in AsusAuraMouseDevices.h |
@@ -48,13 +59,35 @@
#define AURA_ROG_STRIX_EVOLVE_PID 0x185B
/*-----------------------------------------------------------------*\
| MOUSEMATS |
\*-----------------------------------------------------------------*/
#define AURA_ROG_BALTEUS_PID 0x1891
#define AURA_ROG_BALTEUS_QI_PID 0x1890
/*-----------------------------------------------------------------*\
| MONITORS |
\*-----------------------------------------------------------------*/
#define AURA_ROG_STRIX_XG27AQ_PID 0x198C
#define AURA_ROG_STRIX_XG27AQM_PID 0x19BB
#define AURA_ROG_STRIX_XG27W_PID 0x1933
#define AURA_ROG_PG32UQ_PID 0x19B9
/*-----------------------------------------------------------------*\
| HEADSETSTANDS |
\*-----------------------------------------------------------------*/
#define AURA_ROG_THRONE_PID 0x18D9
#define AURA_ROG_THRONE_QI_PID 0x18C5
#define AURA_ROG_THRONE_QI_GUNDAM_PID 0x1994
/*-----------------------------------------------------------------*\
| OTHER |
\*-----------------------------------------------------------------*/
#define AURA_TERMINAL_PID 0x1889
#define AURA_ROG_THRONE_PID 0x18D9
#define AURA_ROG_THRONE_QI_PID 0x18C5
#define ROG_STRIX_LC120_PID 0x879E
#define AURA_RYUO_AIO_PID 0x1887
AuraKeyboardMappingLayoutType GetKeyboardMappingLayoutType(int pid)
{
@@ -62,6 +95,7 @@ AuraKeyboardMappingLayoutType GetKeyboardMappingLayoutType(int pid)
{
case AURA_ROG_STRIX_FLARE_PID:
case AURA_ROG_STRIX_FLARE_PNK_LTD_PID:
case AURA_ROG_STRIX_FLARE_COD_BO4_PID:
return FLARE_LAYOUT;
case AURA_ROG_STRIX_SCOPE_PID:
@@ -71,12 +105,9 @@ AuraKeyboardMappingLayoutType GetKeyboardMappingLayoutType(int pid)
return SCOPE_RX_LAYOUT;
case AURA_ROG_STRIX_SCOPE_TKL_PID:
case AURA_ROG_STRIX_SCOPE_TKL_PNK_LTD_PID:
return SCOPE_TKL_LAYOUT;
case AURA_ROG_FALCHION_WIRED_PID:
case AURA_ROG_FALCHION_WIRELESS_PID:
return FALCHION_LAYOUT;
default:
return FLARE_LAYOUT;
}
@@ -88,9 +119,9 @@ void DetectAsusAuraUSBTerminal(hid_device_info* info, const std::string& name)
if(dev)
{
AuraAddressableController* controller = new AuraAddressableController(dev, info->path);
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
rgb_controller->name = name;
AuraAddressableController* controller = new AuraAddressableController(dev, info->path);
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
@@ -102,9 +133,9 @@ void DetectAsusAuraUSBAddressable(hid_device_info* info, const std::string& /*na
if(dev)
{
DMIInfo dmi;
AuraAddressableController* controller = new AuraAddressableController(dev, info->path);
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
rgb_controller->name = "ASUS " + dmi.getMainboard() + " Addressable";
AuraAddressableController* controller = new AuraAddressableController(dev, info->path);
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
rgb_controller->name = "ASUS " + dmi.getMainboard() + " Addressable";
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
@@ -112,19 +143,21 @@ void DetectAsusAuraUSBAddressable(hid_device_info* info, const std::string& /*na
void DetectAsusAuraUSBMotherboards(hid_device_info* info, const std::string& /*name*/)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
try
{
DMIInfo dmi;
AuraMainboardController* controller = new AuraMainboardController(dev, info->path);
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
rgb_controller->name = "ASUS " + dmi.getMainboard();
AuraMainboardController* controller = new AuraMainboardController(dev, info->path);
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
rgb_controller->name = "ASUS " + dmi.getMainboard();
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
catch(std::runtime_error&)
catch(const std::runtime_error& ex)
{
// reading the config table failed
LOG_ERROR("[AsusAuraUSB] An error occured while reading the config table: %s", ex.what());
}
}
}
@@ -132,12 +165,13 @@ void DetectAsusAuraUSBMotherboards(hid_device_info* info, const std::string& /*n
void DetectAsusAuraUSBKeyboards(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraKeyboardController* controller = new AuraKeyboardController(dev, info->path);
AuraKeyboardMappingLayoutType layout = GetKeyboardMappingLayoutType(info->product_id);
RGBController_AuraKeyboard* rgb_controller = new RGBController_AuraKeyboard(controller, layout);
rgb_controller->name = name;
AuraKeyboardController* controller = new AuraKeyboardController(dev, info->path);
AuraKeyboardMappingLayoutType layout = GetKeyboardMappingLayoutType(info->product_id);
RGBController_AuraKeyboard* rgb_controller = new RGBController_AuraKeyboard(controller, layout);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
@@ -145,11 +179,51 @@ void DetectAsusAuraUSBKeyboards(hid_device_info* info, const std::string& name)
void DetectAsusAuraUSBMice(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraMouseController* controller = new AuraMouseController(dev, info->path, info->product_id);
RGBController_AuraMouse* rgb_controller = new RGBController_AuraMouse(controller);
rgb_controller->name = name;
AuraMouseController* controller = new AuraMouseController(dev, info->path, info->product_id);
RGBController_AuraMouse* rgb_controller = new RGBController_AuraMouse(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
void DetectAsusAuraUSBMousemats(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraMousematController* controller = new AuraMousematController(dev, info->path);
RGBController_AuraMousemat* rgb_controller = new RGBController_AuraMousemat(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
void DetectAsusAuraUSBROGStrixLC(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
ROGStrixLC_Controller* controller = new ROGStrixLC_Controller(dev, info->path);
RGBController_ROGStrixLC_Controller* rgb_controller = new RGBController_ROGStrixLC_Controller(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
void DetectAsusAuraUSBRyuoAIO(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AsusAuraRyuoAIOController* controller = new AsusAuraRyuoAIOController(dev, info->path);
RGBController_AsusAuraRyuoAIO* rgb_controller = new RGBController_AsusAuraRyuoAIO(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
@@ -157,11 +231,12 @@ void DetectAsusAuraUSBMice(hid_device_info* info, const std::string& name)
void DetectAsusAuraUSBStrixEvolve(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraStrixEvolveController* controller = new AuraStrixEvolveController(dev, info->path, info->product_id);
RGBController_AuraStrixEvolve* rgb_controller = new RGBController_AuraStrixEvolve(controller);
rgb_controller->name = name;
AuraStrixEvolveController* controller = new AuraStrixEvolveController(dev, info->path, info->product_id);
RGBController_AuraStrixEvolve* rgb_controller = new RGBController_AuraStrixEvolve(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
@@ -169,11 +244,12 @@ void DetectAsusAuraUSBStrixEvolve(hid_device_info* info, const std::string& name
void DetectAsusAuraUSBHeadsetStand(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraHeadsetStandController* controller = new AuraHeadsetStandController(dev, info->path);
RGBController_AuraHeadsetStand* rgb_controller = new RGBController_AuraHeadsetStand(controller);
rgb_controller->name = name;
AuraHeadsetStandController* controller = new AuraHeadsetStandController(dev, info->path);
RGBController_AuraHeadsetStand* rgb_controller = new RGBController_AuraHeadsetStand(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
@@ -181,11 +257,25 @@ void DetectAsusAuraUSBHeadsetStand(hid_device_info* info, const std::string& nam
void DetectAsusAuraTUFUSBKeyboard(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraTUFKeyboardController* controller = new AuraTUFKeyboardController(dev, info->path);
RGBController_AuraTUFKeyboard* rgb_controller = new RGBController_AuraTUFKeyboard(controller);
rgb_controller->name = name;
AuraTUFKeyboardController* controller = new AuraTUFKeyboardController(dev, info->path, info->product_id, info->release_number);
RGBController_AuraTUFKeyboard* rgb_controller = new RGBController_AuraTUFKeyboard(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
void DetectAsusAuraUSBMonitor(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
AuraMonitorController* controller = new AuraMonitorController(dev, info->path, info->product_id);
RGBController_AuraMonitor* rgb_controller = new RGBController_AuraMonitor(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
@@ -193,51 +283,88 @@ void DetectAsusAuraTUFUSBKeyboard(hid_device_info* info, const std::string& name
/*-----------------------------------------------------------------*\
| MOTHERBOARDS |
\*-----------------------------------------------------------------*/
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_1_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_2_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_3_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_4_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_1_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_2_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_3_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_1_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_2_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_3_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_4_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_1_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_2_PID);
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_3_PID);
/*-----------------------------------------------------------------*\
| KEYBOARDS |
\*-----------------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("ASUS ROG Falchion (Wired)", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_FALCHION_WIRED_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Falchion (Wireless)", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_FALCHION_WIRELESS_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Flare", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_FLARE_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Flare PNK LTD", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_FLARE_PNK_LTD_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_SCOPE_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope RX", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_SCOPE_RX_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope TKL", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_SCOPE_TKL_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_I ("ASUS TUF Gaming K7", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_TUF_K7_GAMING_PID, 1);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Flare", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_FLARE_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Flare PNK LTD", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_FLARE_PNK_LTD_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Flare CoD Black Ops 4 Edition",DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_FLARE_COD_BO4_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_SCOPE_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope RX", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_SCOPE_RX_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope TKL", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_SCOPE_TKL_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Scope TKL PNK LTD", DetectAsusAuraUSBKeyboards, AURA_USB_VID, AURA_ROG_STRIX_SCOPE_TKL_PNK_LTD_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Claymore", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_ROG_CLAYMORE_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Falchion (Wired)", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_ROG_FALCHION_WIRED_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS ROG Falchion (Wireless)", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_ROG_FALCHION_WIRELESS_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming K7", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_TUF_K7_GAMING_PID, 1, 0xFF00);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming K3", DetectAsusAuraTUFUSBKeyboard, AURA_USB_VID, AURA_TUF_K3_GAMING_PID, 1, 0xFF00);
/*-----------------------------------------------------------------*\
| MICE |
\*-----------------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_CORE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_ORIGIN_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin PNK LTD", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_ORIGIN_PNK_LTD_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin COD", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_ORIGIN_COD_PID, 1, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_1_PID, 1, 0xFF13);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Chakram (Wireless)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_WIRELESS_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram (Wired)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_WIRED_1_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_CORE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio II (Wired)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_II_WIRED_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio II (Wireless)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_II_WIRELESS_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact II", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_II_PID, 1, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming M3", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_TUF_M3_PID, 1, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming M5", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_TUF_M5_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_CORE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_ORIGIN_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin PNK LTD", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_ORIGIN_PNK_LTD_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin COD", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_ORIGIN_COD_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_1_PID, 1, 0xFF13);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless 2.4Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless Bluetooth", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_BT_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Chakram (Wireless)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_WIRELESS_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram (Wired)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_WIRED_1_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_CORE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram X USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_X_USB_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("Asus ROG Chakram X 2.4GHz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_CHAKRAM_X_2_4_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio II (Wired)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_II_WIRED_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Pugio II (Wireless)", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_PUGIO_II_WIRELESS_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact II", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_II_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact II Gundam", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_II_GUNDAM_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact II Electro Punk", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_II_PUNK_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact II Moonlight White", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_II_WHITE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact II Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_II_WIRELESS_USB_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Impact II Wireless 2.4 Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_STRIX_IMPACT_II_WIRELESS_2_4_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Keris", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_KERIS, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Keris Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_KERIS_WIRELESS_USB_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Keris Wireless 2.4Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_KERIS_WIRELESS_2_4_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Keris Wireless Bluetooth", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_KERIS_WIRELESS_BT_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming M3", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_TUF_M3_PID, 1, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS TUF Gaming M5", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_TUF_M5_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Evolve", DetectAsusAuraUSBStrixEvolve, AURA_USB_VID, AURA_ROG_STRIX_EVOLVE_PID, 1, 0x0008);
REGISTER_HID_DETECTOR_IP("ASUS ROG Strix Evolve", DetectAsusAuraUSBStrixEvolve, AURA_USB_VID, AURA_ROG_STRIX_EVOLVE_PID, 1, 0x0008);
/*-----------------------------------------------------------------*\
| MOUSEMATS |
\*-----------------------------------------------------------------*/
REGISTER_HID_DETECTOR_PU("ASUS ROG Balteus", DetectAsusAuraUSBMousemats, AURA_USB_VID, AURA_ROG_BALTEUS_PID, 0xFF06, 1);
REGISTER_HID_DETECTOR_PU("ASUS ROG Balteus Qi", DetectAsusAuraUSBMousemats, AURA_USB_VID, AURA_ROG_BALTEUS_QI_PID, 0xFF06, 1);
/*-----------------------------------------------------------------*\
| MONITORS |
\*-----------------------------------------------------------------*/
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix XG27AQ", DetectAsusAuraUSBMonitor, AURA_USB_VID, AURA_ROG_STRIX_XG27AQ_PID, 0xFFA0, 1);
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix XG27AQM", DetectAsusAuraUSBMonitor, AURA_USB_VID, AURA_ROG_STRIX_XG27AQM_PID, 0xFFA0, 1);
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix XG27W", DetectAsusAuraUSBMonitor, AURA_USB_VID, AURA_ROG_STRIX_XG27W_PID, 0xFFA0, 1);
REGISTER_HID_DETECTOR_PU("ASUS ROG PG32UQ", DetectAsusAuraUSBMonitor, AURA_USB_VID, AURA_ROG_PG32UQ_PID, 0xFFA0, 1);
/*-----------------------------------------------------------------*\
| OTHER |
\*-----------------------------------------------------------------*/
REGISTER_HID_DETECTOR ("ASUS ROG AURA Terminal", DetectAsusAuraUSBTerminal, AURA_USB_VID, AURA_TERMINAL_PID);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_PID, 0);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_PID, 0);
REGISTER_HID_DETECTOR ("ASUS ROG AURA Terminal", DetectAsusAuraUSBTerminal, AURA_USB_VID, AURA_TERMINAL_PID);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Strix LC", DetectAsusAuraUSBROGStrixLC, AURA_USB_VID, ROG_STRIX_LC120_PID, 0x00FF, 1);
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryuo AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUO_AIO_PID, 0xFF72, 0x00A1);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_PID, 0);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_PID, 0);
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI GUNDAM", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_GUNDAM_PID, 0);
@@ -9,17 +9,28 @@
#include "RGBController_AsusAuraHeadsetStand.h"
RGBController_AuraHeadsetStand::RGBController_AuraHeadsetStand(AuraHeadsetStandController* aura_ptr)
/**------------------------------------------------------------------*\
@name Asus Aura Headset Stand
@category HeadsetStand
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBHeadsetStand
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraHeadsetStand::RGBController_AuraHeadsetStand(AuraHeadsetStandController* controller_ptr)
{
aura = aura_ptr;
controller = controller_ptr;
name = "ASUS Aura Headset Stand";
vendor = "ASUS";
type = DEVICE_TYPE_HEADSET_STAND;
description = "ASUS Aura Headset Stand Device";
version = aura->GetVersion();
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
@@ -99,7 +110,7 @@ RGBController_AuraHeadsetStand::RGBController_AuraHeadsetStand(AuraHeadsetStandC
RGBController_AuraHeadsetStand::~RGBController_AuraHeadsetStand()
{
delete aura;
delete controller;
}
void RGBController_AuraHeadsetStand::SetupZones()
@@ -153,7 +164,7 @@ void RGBController_AuraHeadsetStand::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_AuraHeadsetStand::DeviceUpdateLEDs()
{
aura->UpdateLeds(std::vector<RGBColor>(colors));
controller->UpdateLeds(std::vector<RGBColor>(colors));
}
void RGBController_AuraHeadsetStand::UpdateZoneLEDs(int /*zone*/)
@@ -166,12 +177,6 @@ void RGBController_AuraHeadsetStand::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_AuraHeadsetStand::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AuraHeadsetStand::DeviceUpdateMode()
{
unsigned char red = 0;
@@ -180,7 +185,7 @@ void RGBController_AuraHeadsetStand::DeviceUpdateMode()
switch(modes[active_mode].value)
{
case 0:
aura->UpdateLeds(std::vector<RGBColor>(colors));
controller->UpdateLeds(std::vector<RGBColor>(colors));
break;
case 1:
case 2:
@@ -188,11 +193,11 @@ void RGBController_AuraHeadsetStand::DeviceUpdateMode()
red = RGBGetRValue(modes[active_mode].colors[0]);
grn = RGBGetGValue(modes[active_mode].colors[0]);
blu = RGBGetBValue(modes[active_mode].colors[0]);
aura->UpdateDevice(modes[active_mode].value, red, grn, blu, modes[active_mode].speed, modes[active_mode].brightness);
controller->UpdateDevice(modes[active_mode].value, red, grn, blu, modes[active_mode].speed, modes[active_mode].brightness);
break;
case 4:
case 5:
aura->UpdateDevice(modes[active_mode].value, red, grn, blu, modes[active_mode].speed, modes[active_mode].brightness);
controller->UpdateDevice(modes[active_mode].value, red, grn, blu, modes[active_mode].speed, modes[active_mode].brightness);
break;
}
}
@@ -200,5 +205,5 @@ void RGBController_AuraHeadsetStand::DeviceUpdateMode()
void RGBController_AuraHeadsetStand::DeviceSaveMode()
{
DeviceUpdateMode();
aura->SaveMode();
controller->SaveMode();
}
@@ -24,7 +24,7 @@ enum
class RGBController_AuraHeadsetStand : public RGBController
{
public:
RGBController_AuraHeadsetStand(AuraHeadsetStandController* aura_ptr);
RGBController_AuraHeadsetStand(AuraHeadsetStandController* controller_ptr);
~RGBController_AuraHeadsetStand();
void SetupZones();
@@ -35,10 +35,9 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AuraHeadsetStandController* aura;
AuraHeadsetStandController* controller;
};
@@ -7,6 +7,7 @@
| Adam Honse (CalcProgrammer1) 3/19/2020 |
\*-----------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_AsusAuraKeyboard.h"
//0xFFFFFFFF indicates an unused entry in matrix
@@ -39,206 +40,206 @@ static unsigned int scope_tkl_matrix_map[6][18] =
static unsigned int falchion_matrix_map[5][16] =
{ { 0, 5, 9, 14, 18, 22, 26, 31, 35, 39, 44, 49, 54, 58, NA, 63 },
{ 1, NA, 6, 10, 15, 19, 23, 27, 32, 36, 40, 45, 50, 55, 59, 64 },
{ 2, NA, 7, 11, 16, 20, 24, 28, 33, 37, 41, 46, 51, 60, NA, 65 },
{ 2, NA, 7, 11, 16, 20, 24, 28, 33, 37, 41, 46, 51, 60, NA, 65 },
{ 3, NA, 12, 17, 21, 25, 29, 34, 38, 42, 47, 52, 56, NA, 61, 66 },
{ 4, 8, 13, NA, NA, NA, 30, NA, NA, NA, 43, 48, 53, 57, 62, 67 } };
static const std::vector<led_type> default_led_names =
{
/* Key Label Index */
{ "Key: Escape", 0x00 },
{ "Key: `", 0x01 },
{ "Key: Tab", 0x02 },
{ "Key: Caps Lock", 0x03 },
{ "Key: Left Shift", 0x04 },
{ "Key: Left Control", 0x05 },
{ "Key: \\ (ISO)", 0x0C },
{ "Key: 1", 0x11 },
{ "Key: Q", 0x12 },
{ "Key: A", 0x13 },
{ "Key: Z", 0x14 },
{ "Key: F1", 0x18 },
{ "Key: 2", 0x19 },
{ "Key: W", 0x1A },
{ "Key: S", 0x1B },
{ "Key: X", 0x1C },
{ "Key: F2", 0x20 },
{ "Key: 3", 0x21 },
{ "Key: E", 0x22 },
{ "Key: D", 0x23 },
{ "Key: C", 0x24 },
{ "Key: F3", 0x28 },
{ "Key: 4", 0x29 },
{ "Key: R", 0x2A },
{ "Key: F", 0x2B },
{ "Key: V", 0x2C },
{ "Key: F4", 0x30 },
{ "Key: 5", 0x31 },
{ "Key: T", 0x32 },
{ "Key: G", 0x33 },
{ "Key: B", 0x34 },
{ "Key: Space", 0x35 },
{ "Key: 6", 0x39 },
{ "Key: Y", 0x3A },
{ "Key: H", 0x3B },
{ "Key: N", 0x3C },
{ "Key: F5", 0x40 },
{ "Key: 7", 0x41 },
{ "Key: U", 0x42 },
{ "Key: J", 0x43 },
{ "Key: M", 0x44 },
{ "Key: F6", 0x48 },
{ "Key: 8", 0x49 },
{ "Key: I", 0x4A },
{ "Key: K", 0x4B },
{ "Key: ,", 0x4C },
{ "Key: Right Alt", 0x4D },
{ "Key: F7", 0x50 },
{ "Key: 9", 0x51 },
{ "Key: O", 0x52 },
{ "Key: L", 0x53 },
{ "Key: .", 0x54 },
{ "Key: F8", 0x58 },
{ "Key: 0", 0x59 },
{ "Key: P", 0x5A },
{ "Key: ;", 0x5B },
{ "Key: /", 0x5C },
{ "Key: Right Fn", 0x5D },
{ "Key: F9", 0x60 },
{ "Key: -", 0x61 },
{ "Key: [", 0x62 },
{ "Key: '", 0x63 },
{ "Key: Menu", 0x65 },
{ "Key: F10", 0x68 },
{ "Key: =", 0x69 },
{ "Key: ]", 0x6A },
{ "Key: #", 0x6B },
{ "Key: F11", 0x70 },
{ "Key: F12", 0x78 },
{ "Key: Backspace", 0x79 },
{ "Key: \\ (ANSI)", 0x7A },
{ "Key: Enter", 0x7B },
{ "Key: Right Shift", 0x7C },
{ "Key: Right Control", 0x7D },
{ "Key: Print Screen", 0x80 },
{ "Key: Insert", 0x81 },
{ "Key: Delete", 0x82 },
{ "Key: Left Arrow", 0x85 },
{ "Key: Scroll Lock", 0x88 },
{ "Key: Home", 0x89 },
{ "Key: End", 0x8A },
{ "Key: Up Arrow", 0x8C },
{ "Key: Down Arrow", 0x8D },
{ "Key: Pause/Break", 0x90 },
{ "Key: Page Up", 0x91 },
{ "Key: Page Down", 0x92 },
{ "Key: Right Arrow", 0x95 },
{ "Key: Num Lock", 0x99 },
{ "Key: Number Pad 7", 0x9A },
{ "Key: Number Pad 4", 0x9B },
{ "Key: Number Pad 1", 0x9C },
{ "Key: Number Pad 0", 0x9D },
{ "Key: Number Pad /", 0xA1 },
{ "Key: Number Pad 8", 0xA2 },
{ "Key: Number Pad 5", 0xA3 },
{ "Key: Number Pad 2", 0xA4 },
{ "Key: Number Pad *", 0xA9 },
{ "Key: Number Pad 9", 0xAA },
{ "Key: Number Pad 6", 0xAB },
{ "Key: Number Pad 3", 0xAC },
{ "Key: Number Pad .", 0xAD },
{ "Key: Number Pad -", 0xB1 },
{ "Key: Number Pad +", 0xB2 },
{ "Key: Number Pad Enter", 0xB4 },
{ KEY_EN_ESCAPE, 0x00 },
{ KEY_EN_BACK_TICK, 0x01 },
{ KEY_EN_TAB, 0x02 },
{ KEY_EN_CAPS_LOCK, 0x03 },
{ KEY_EN_LEFT_SHIFT, 0x04 },
{ KEY_EN_LEFT_CONTROL, 0x05 },
{ KEY_EN_ISO_BACK_SLASH, 0x0C },
{ KEY_EN_1, 0x11 },
{ KEY_EN_Q, 0x12 },
{ KEY_EN_A, 0x13 },
{ KEY_EN_Z, 0x14 },
{ KEY_EN_F1, 0x18 },
{ KEY_EN_2, 0x19 },
{ KEY_EN_W, 0x1A },
{ KEY_EN_S, 0x1B },
{ KEY_EN_X, 0x1C },
{ KEY_EN_F2, 0x20 },
{ KEY_EN_3, 0x21 },
{ KEY_EN_E, 0x22 },
{ KEY_EN_D, 0x23 },
{ KEY_EN_C, 0x24 },
{ KEY_EN_F3, 0x28 },
{ KEY_EN_4, 0x29 },
{ KEY_EN_R, 0x2A },
{ KEY_EN_F, 0x2B },
{ KEY_EN_V, 0x2C },
{ KEY_EN_F4, 0x30 },
{ KEY_EN_5, 0x31 },
{ KEY_EN_T, 0x32 },
{ KEY_EN_G, 0x33 },
{ KEY_EN_B, 0x34 },
{ KEY_EN_SPACE, 0x35 },
{ KEY_EN_6, 0x39 },
{ KEY_EN_Y, 0x3A },
{ KEY_EN_H, 0x3B },
{ KEY_EN_N, 0x3C },
{ KEY_EN_F5, 0x40 },
{ KEY_EN_7, 0x41 },
{ KEY_EN_U, 0x42 },
{ KEY_EN_J, 0x43 },
{ KEY_EN_M, 0x44 },
{ KEY_EN_F6, 0x48 },
{ KEY_EN_8, 0x49 },
{ KEY_EN_I, 0x4A },
{ KEY_EN_K, 0x4B },
{ KEY_EN_COMMA, 0x4C },
{ KEY_EN_RIGHT_ALT, 0x4D },
{ KEY_EN_F7, 0x50 },
{ KEY_EN_9, 0x51 },
{ KEY_EN_O, 0x52 },
{ KEY_EN_L, 0x53 },
{ KEY_EN_PERIOD, 0x54 },
{ KEY_EN_F8, 0x58 },
{ KEY_EN_0, 0x59 },
{ KEY_EN_P, 0x5A },
{ KEY_EN_SEMICOLON, 0x5B },
{ KEY_EN_FORWARD_SLASH, 0x5C },
{ KEY_EN_RIGHT_FUNCTION, 0x5D },
{ KEY_EN_F9, 0x60 },
{ KEY_EN_MINUS, 0x61 },
{ KEY_EN_LEFT_BRACKET, 0x62 },
{ KEY_EN_QUOTE, 0x63 },
{ KEY_EN_MENU, 0x65 },
{ KEY_EN_F10, 0x68 },
{ KEY_EN_EQUALS, 0x69 },
{ KEY_EN_RIGHT_BRACKET, 0x6A },
{ KEY_EN_POUND, 0x6B },
{ KEY_EN_F11, 0x70 },
{ KEY_EN_F12, 0x78 },
{ KEY_EN_BACKSPACE, 0x79 },
{ KEY_EN_ANSI_BACK_SLASH, 0x7A },
{ KEY_EN_ANSI_ENTER, 0x7B },
{ KEY_EN_RIGHT_SHIFT, 0x7C },
{ KEY_EN_RIGHT_CONTROL, 0x7D },
{ KEY_EN_PRINT_SCREEN, 0x80 },
{ KEY_EN_INSERT, 0x81 },
{ KEY_EN_DELETE, 0x82 },
{ KEY_EN_LEFT_ARROW, 0x85 },
{ KEY_EN_SCROLL_LOCK, 0x88 },
{ KEY_EN_HOME, 0x89 },
{ KEY_EN_END, 0x8A },
{ KEY_EN_UP_ARROW, 0x8C },
{ KEY_EN_DOWN_ARROW, 0x8D },
{ KEY_EN_PAUSE_BREAK, 0x90 },
{ KEY_EN_PAGE_UP, 0x91 },
{ KEY_EN_PAGE_DOWN, 0x92 },
{ KEY_EN_RIGHT_ARROW, 0x95 },
{ KEY_EN_NUMPAD_LOCK, 0x99 },
{ KEY_EN_NUMPAD_7, 0x9A },
{ KEY_EN_NUMPAD_4, 0x9B },
{ KEY_EN_NUMPAD_1, 0x9C },
{ KEY_EN_NUMPAD_0, 0x9D },
{ KEY_EN_NUMPAD_DIVIDE, 0xA1 },
{ KEY_EN_NUMPAD_8, 0xA2 },
{ KEY_EN_NUMPAD_5, 0xA3 },
{ KEY_EN_NUMPAD_2, 0xA4 },
{ KEY_EN_NUMPAD_TIMES, 0xA9 },
{ KEY_EN_NUMPAD_9, 0xAA },
{ KEY_EN_NUMPAD_6, 0xAB },
{ KEY_EN_NUMPAD_3, 0xAC },
{ KEY_EN_NUMPAD_PERIOD, 0xAD },
{ KEY_EN_NUMPAD_MINUS, 0xB1 },
{ KEY_EN_NUMPAD_PLUS, 0xB2 },
{ KEY_EN_NUMPAD_ENTER, 0xB4 },
};
static const std::vector<led_type> default_tkl_led_names =
{
/* Key Label Index */
{ "Key: Escape", 0x00 },
{ "Key: `", 0x01 },
{ "Key: Tab", 0x02 },
{ "Key: Caps Lock", 0x03 },
{ "Key: Left Shift", 0x04 },
{ "Key: Left Control", 0x05 },
{ "Key: \\ (ISO)", 0x0C },
{ "Key: 1", 0x11 },
{ "Key: Q", 0x12 },
{ "Key: A", 0x13 },
{ "Key: Z", 0x14 },
{ "Key: F1", 0x18 },
{ "Key: 2", 0x19 },
{ "Key: W", 0x1A },
{ "Key: S", 0x1B },
{ "Key: X", 0x1C },
{ "Key: F2", 0x20 },
{ "Key: 3", 0x21 },
{ "Key: E", 0x22 },
{ "Key: D", 0x23 },
{ "Key: C", 0x24 },
{ "Key: F3", 0x28 },
{ "Key: 4", 0x29 },
{ "Key: R", 0x2A },
{ "Key: F", 0x2B },
{ "Key: V", 0x2C },
{ "Key: F4", 0x30 },
{ "Key: 5", 0x31 },
{ "Key: T", 0x32 },
{ "Key: G", 0x33 },
{ "Key: B", 0x34 },
{ "Key: Space", 0x35 },
{ "Key: 6", 0x39 },
{ "Key: Y", 0x3A },
{ "Key: H", 0x3B },
{ "Key: N", 0x3C },
{ "Key: F5", 0x40 },
{ "Key: 7", 0x41 },
{ "Key: U", 0x42 },
{ "Key: J", 0x43 },
{ "Key: M", 0x44 },
{ "Key: F6", 0x48 },
{ "Key: 8", 0x49 },
{ "Key: I", 0x4A },
{ "Key: K", 0x4B },
{ "Key: ,", 0x4C },
{ "Key: Right Alt", 0x4D },
{ "Key: F7", 0x50 },
{ "Key: 9", 0x51 },
{ "Key: O", 0x52 },
{ "Key: L", 0x53 },
{ "Key: .", 0x54 },
{ "Key: F8", 0x58 },
{ "Key: 0", 0x59 },
{ "Key: P", 0x5A },
{ "Key: ;", 0x5B },
{ "Key: /", 0x5C },
{ "Key: Right Fn", 0x5D },
{ "Key: F9", 0x60 },
{ "Key: -", 0x61 },
{ "Key: [", 0x62 },
{ "Key: '", 0x63 },
{ "Key: Menu", 0x65 },
{ "Key: F10", 0x68 },
{ "Key: =", 0x69 },
{ "Key: ]", 0x6A },
{ "Key: #", 0x6B },
{ "Key: F11", 0x70 },
{ "Key: F12", 0x78 },
{ "Key: Backspace", 0x79 },
{ "Key: \\ (ANSI)", 0x7A },
{ "Key: Enter", 0x7B },
{ "Key: Right Shift", 0x7C },
{ "Key: Right Control", 0x7D },
{ "Key: Insert", 0x81 },
{ "Key: Delete", 0x82 },
{ "Key: Left Arrow", 0x85 },
{ "Key: Home", 0x89 },
{ "Key: End", 0x8A },
{ "Key: Up Arrow", 0x8C },
{ "Key: Down Arrow", 0x8D },
{ "Key: Page Up", 0x91 },
{ "Key: Page Down", 0x92 },
{ "Key: Right Arrow", 0x95 },
{ KEY_EN_ESCAPE, 0x00 },
{ KEY_EN_BACK_TICK, 0x01 },
{ KEY_EN_TAB, 0x02 },
{ KEY_EN_CAPS_LOCK, 0x03 },
{ KEY_EN_LEFT_SHIFT, 0x04 },
{ KEY_EN_LEFT_CONTROL, 0x05 },
{ KEY_EN_ISO_BACK_SLASH, 0x0C },
{ KEY_EN_1, 0x11 },
{ KEY_EN_Q, 0x12 },
{ KEY_EN_A, 0x13 },
{ KEY_EN_Z, 0x14 },
{ KEY_EN_F1, 0x18 },
{ KEY_EN_2, 0x19 },
{ KEY_EN_W, 0x1A },
{ KEY_EN_S, 0x1B },
{ KEY_EN_X, 0x1C },
{ KEY_EN_F2, 0x20 },
{ KEY_EN_3, 0x21 },
{ KEY_EN_E, 0x22 },
{ KEY_EN_D, 0x23 },
{ KEY_EN_C, 0x24 },
{ KEY_EN_F3, 0x28 },
{ KEY_EN_4, 0x29 },
{ KEY_EN_R, 0x2A },
{ KEY_EN_F, 0x2B },
{ KEY_EN_V, 0x2C },
{ KEY_EN_F4, 0x30 },
{ KEY_EN_5, 0x31 },
{ KEY_EN_T, 0x32 },
{ KEY_EN_G, 0x33 },
{ KEY_EN_B, 0x34 },
{ KEY_EN_SPACE, 0x35 },
{ KEY_EN_6, 0x39 },
{ KEY_EN_Y, 0x3A },
{ KEY_EN_H, 0x3B },
{ KEY_EN_N, 0x3C },
{ KEY_EN_F5, 0x40 },
{ KEY_EN_7, 0x41 },
{ KEY_EN_U, 0x42 },
{ KEY_EN_J, 0x43 },
{ KEY_EN_M, 0x44 },
{ KEY_EN_F6, 0x48 },
{ KEY_EN_8, 0x49 },
{ KEY_EN_I, 0x4A },
{ KEY_EN_K, 0x4B },
{ KEY_EN_COMMA, 0x4C },
{ KEY_EN_RIGHT_ALT, 0x4D },
{ KEY_EN_F7, 0x50 },
{ KEY_EN_9, 0x51 },
{ KEY_EN_O, 0x52 },
{ KEY_EN_L, 0x53 },
{ KEY_EN_PERIOD, 0x54 },
{ KEY_EN_F8, 0x58 },
{ KEY_EN_0, 0x59 },
{ KEY_EN_P, 0x5A },
{ KEY_EN_SEMICOLON, 0x5B },
{ KEY_EN_FORWARD_SLASH, 0x5C },
{ KEY_EN_RIGHT_FUNCTION, 0x5D },
{ KEY_EN_F9, 0x60 },
{ KEY_EN_MINUS, 0x61 },
{ KEY_EN_LEFT_BRACKET, 0x62 },
{ KEY_EN_QUOTE, 0x63 },
{ KEY_EN_MENU, 0x65 },
{ KEY_EN_F10, 0x68 },
{ KEY_EN_EQUALS, 0x69 },
{ KEY_EN_RIGHT_BRACKET, 0x6A },
{ KEY_EN_POUND, 0x6B },
{ KEY_EN_F11, 0x70 },
{ KEY_EN_F12, 0x78 },
{ KEY_EN_BACKSPACE, 0x79 },
{ KEY_EN_ANSI_BACK_SLASH, 0x7A },
{ KEY_EN_ANSI_ENTER, 0x7B },
{ KEY_EN_RIGHT_SHIFT, 0x7C },
{ KEY_EN_RIGHT_CONTROL, 0x7D },
{ KEY_EN_INSERT, 0x81 },
{ KEY_EN_DELETE, 0x82 },
{ KEY_EN_LEFT_ARROW, 0x85 },
{ KEY_EN_HOME, 0x89 },
{ KEY_EN_END, 0x8A },
{ KEY_EN_UP_ARROW, 0x8C },
{ KEY_EN_DOWN_ARROW, 0x8D },
{ KEY_EN_PAGE_UP, 0x91 },
{ KEY_EN_PAGE_DOWN, 0x92 },
{ KEY_EN_RIGHT_ARROW, 0x95 },
{ "Logo 1", 0x80 },
{ "Logo 2", 0x90 },
{ "Underglow 1", 0x06 },
@@ -272,87 +273,98 @@ static const std::vector<led_type> default_tkl_led_names =
static const std::vector<led_type> default_65pct_led_names =
{
/* Key Label Index */
{ "Key: Escape", 0x00 },
{ "Key: Tab", 0x01 },
{ "Key: Caps Lock", 0x02 },
{ "Key: Left Shift", 0x03 },
{ "Key: Left Control", 0x04 },
{ "Key: 1", 0x08 },
{ "Key: Q", 0x09 },
{ "Key: A", 0x0A },
{ "Key: Left Windows", 0x0C },
{ "Key: 2", 0x10 },
{ "Key: W", 0x11 },
{ "Key: S", 0x12 },
{ "Key: Z", 0x13 },
{ "Key: Left Alt", 0x14 },
{ "Key: 3", 0x18 },
{ "Key: E", 0x19 },
{ "Key: D", 0x1A },
{ "Key: X", 0x1B },
{ "Key: 4", 0x20 },
{ "Key: R", 0x21 },
{ "Key: F", 0x22 },
{ "Key: C", 0x23 },
{ "Key: 5", 0x28 },
{ "Key: T", 0x29 },
{ "Key: G", 0x2A },
{ "Key: V", 0x2B },
{ "Key: 6", 0x30 },
{ "Key: Y", 0x31 },
{ "Key: H", 0x32 },
{ "Key: B", 0x33 },
{ "Key: Space", 0x34 },
{ "Key: 7", 0x38 },
{ "Key: U", 0x39 },
{ "Key: J", 0x3A },
{ "Key: N", 0x3B },
{ "Key: 8", 0x40 },
{ "Key: I", 0x41 },
{ "Key: K", 0x42 },
{ "Key: M", 0x43 },
{ "Key: 9", 0x48 },
{ "Key: O", 0x49 },
{ "Key: L", 0x4A },
{ "Key: ,", 0x4B },
{ "Key: Right Alt", 0x4C },
{ "Key: 0", 0x50 },
{ "Key: P", 0x51 },
{ "Key: ;", 0x52 },
{ "Key: .", 0x53 },
{ "Key: Right Fn", 0x54 },
{ "Key: -", 0x58 },
{ "Key: [", 0x59 },
{ "Key: '", 0x5A },
{ "Key: /", 0x5B },
{ "Key: Right Control", 0x5C },
{ "Key: =", 0x60 },
{ "Key: ]", 0x61 },
{ "Key: Right Shift", 0x63 },
{ "Key: Left Arrow", 0x64 },
{ "Key: Backspace", 0x68 },
{ "Key: \\ (ANSI)", 0x69 },
{ "Key: Enter", 0x6A },
{ "Key: Up Arrow", 0x6B },
{ "Key: Down Arrow", 0x6C },
{ "Key: Insert", 0x70 },
{ "Key: Delete", 0x71 },
{ "Key: Page Up", 0x72 },
{ "Key: Page Down", 0x73 },
{ "Key: Right Arrow", 0x74 },
{ KEY_EN_ESCAPE, 0x00 },
{ KEY_EN_TAB, 0x01 },
{ KEY_EN_CAPS_LOCK, 0x02 },
{ KEY_EN_LEFT_SHIFT, 0x03 },
{ KEY_EN_LEFT_CONTROL, 0x04 },
{ KEY_EN_1, 0x08 },
{ KEY_EN_Q, 0x09 },
{ KEY_EN_A, 0x0A },
{ KEY_EN_LEFT_WINDOWS, 0x0C },
{ KEY_EN_2, 0x10 },
{ KEY_EN_W, 0x11 },
{ KEY_EN_S, 0x12 },
{ KEY_EN_Z, 0x13 },
{ KEY_EN_LEFT_ALT, 0x14 },
{ KEY_EN_3, 0x18 },
{ KEY_EN_E, 0x19 },
{ KEY_EN_D, 0x1A },
{ KEY_EN_X, 0x1B },
{ KEY_EN_4, 0x20 },
{ KEY_EN_R, 0x21 },
{ KEY_EN_F, 0x22 },
{ KEY_EN_C, 0x23 },
{ KEY_EN_5, 0x28 },
{ KEY_EN_T, 0x29 },
{ KEY_EN_G, 0x2A },
{ KEY_EN_V, 0x2B },
{ KEY_EN_6, 0x30 },
{ KEY_EN_Y, 0x31 },
{ KEY_EN_H, 0x32 },
{ KEY_EN_B, 0x33 },
{ KEY_EN_SPACE, 0x34 },
{ KEY_EN_7, 0x38 },
{ KEY_EN_U, 0x39 },
{ KEY_EN_J, 0x3A },
{ KEY_EN_N, 0x3B },
{ KEY_EN_8, 0x40 },
{ KEY_EN_I, 0x41 },
{ KEY_EN_K, 0x42 },
{ KEY_EN_M, 0x43 },
{ KEY_EN_9, 0x48 },
{ KEY_EN_O, 0x49 },
{ KEY_EN_L, 0x4A },
{ KEY_EN_COMMA, 0x4B },
{ KEY_EN_RIGHT_ALT, 0x4C },
{ KEY_EN_0, 0x50 },
{ KEY_EN_P, 0x51 },
{ KEY_EN_SEMICOLON, 0x52 },
{ KEY_EN_PERIOD, 0x53 },
{ KEY_EN_RIGHT_FUNCTION, 0x54 },
{ KEY_EN_MINUS, 0x58 },
{ KEY_EN_LEFT_BRACKET, 0x59 },
{ KEY_EN_QUOTE, 0x5A },
{ KEY_EN_FORWARD_SLASH, 0x5B },
{ KEY_EN_RIGHT_CONTROL, 0x5C },
{ KEY_EN_EQUALS, 0x60 },
{ KEY_EN_RIGHT_BRACKET, 0x61 },
{ KEY_EN_RIGHT_SHIFT, 0x63 },
{ KEY_EN_LEFT_ARROW, 0x64 },
{ KEY_EN_BACKSPACE, 0x68 },
{ KEY_EN_ANSI_BACK_SLASH, 0x69 },
{ KEY_EN_ANSI_ENTER, 0x6A },
{ KEY_EN_UP_ARROW, 0x6B },
{ KEY_EN_DOWN_ARROW, 0x6C },
{ KEY_EN_INSERT, 0x70 },
{ KEY_EN_DELETE, 0x71 },
{ KEY_EN_PAGE_UP, 0x72 },
{ KEY_EN_PAGE_DOWN, 0x73 },
{ KEY_EN_RIGHT_ARROW, 0x74 },
};
RGBController_AuraKeyboard::RGBController_AuraKeyboard(AuraKeyboardController* aura_ptr, AuraKeyboardMappingLayoutType keyboard_layout)
/**------------------------------------------------------------------*\
@name Asus Aura Keyboard
@category Keyboard
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectAsusAuraUSBKeyboards
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraKeyboard::RGBController_AuraKeyboard(AuraKeyboardController* controller_ptr, AuraKeyboardMappingLayoutType keyboard_layout)
{
aura = aura_ptr;
controller = controller_ptr;
layout = keyboard_layout;
name = "ASUS Aura Keyboard";
vendor = "ASUS";
type = DEVICE_TYPE_KEYBOARD;
description = "ASUS Aura Keyboard Device";
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
@@ -373,7 +385,8 @@ RGBController_AuraKeyboard::~RGBController_AuraKeyboard()
delete zones[zone_idx].matrix_map;
}
}
delete aura;
delete controller;
}
void RGBController_AuraKeyboard::SetupZones()
@@ -392,40 +405,40 @@ void RGBController_AuraKeyboard::SetupZones()
\*-----------------------------------------------------*/
case SCOPE_LAYOUT:
led_names = default_led_names;
led_zones.push_back({"Keyboard", ZONE_TYPE_MATRIX, 106, new matrix_map_type{6, 22, (unsigned int *)&scope_matrix_map}});
led_zones.push_back({ZONE_EN_KEYBOARD, ZONE_TYPE_MATRIX, 106, new matrix_map_type{6, 22, (unsigned int *)&scope_matrix_map}});
led_names.insert(led_names.begin() + 7, {"Key: Left Windows", 0x15});
led_names.insert(led_names.begin() + 12, {"Key: Left Alt", 0x1D});
led_names.insert(led_names.begin() + 7, {KEY_EN_LEFT_WINDOWS, 0x15});
led_names.insert(led_names.begin() + 12, {KEY_EN_LEFT_ALT, 0x1D});
break;
case SCOPE_RX_LAYOUT:
led_names = default_led_names;
led_zones.push_back({"Keyboard", ZONE_TYPE_MATRIX, 106, new matrix_map_type{6, 22, (unsigned int *)&scope_matrix_map}});
led_zones.push_back({"Logo", ZONE_TYPE_SINGLE, 1});
led_zones.push_back({ZONE_EN_KEYBOARD, ZONE_TYPE_MATRIX, 106, new matrix_map_type{6, 22, (unsigned int *)&scope_matrix_map}});
led_zones.push_back({"Logo", ZONE_TYPE_SINGLE, 1, NULL});
led_names.insert(led_names.begin() + 7, {"Key: Left Windows", 0x15});
led_names.insert(led_names.begin() + 12, {"Key: Left Alt", 0x1D});
led_names.insert(led_names.begin() + 7, {KEY_EN_LEFT_WINDOWS, 0x15});
led_names.insert(led_names.begin() + 12, {KEY_EN_LEFT_ALT, 0x1D});
led_names.push_back({ "Logo", 0xB0});
break;
case SCOPE_TKL_LAYOUT:
led_names = default_tkl_led_names;
led_zones.push_back({"Keyboard", ZONE_TYPE_MATRIX, 86, new matrix_map_type{6, 18, (unsigned int *)&scope_tkl_matrix_map}});
led_zones.push_back({"Logo", ZONE_TYPE_LINEAR, 2});
led_zones.push_back({"Underglow", ZONE_TYPE_LINEAR, 26});
led_zones.push_back({ZONE_EN_KEYBOARD, ZONE_TYPE_MATRIX, 86, new matrix_map_type{6, 18, (unsigned int *)&scope_tkl_matrix_map}});
led_zones.push_back({"Logo", ZONE_TYPE_LINEAR, 2, NULL});
led_zones.push_back({"Underglow", ZONE_TYPE_LINEAR, 26, NULL});
led_names.insert(led_names.begin() + 7, {"Key: Left Windows", 0x15});
led_names.insert(led_names.begin() + 12, {"Key: Left Alt", 0x1D});
led_names.insert(led_names.begin() + 7, {KEY_EN_LEFT_WINDOWS, 0x15});
led_names.insert(led_names.begin() + 12, {KEY_EN_LEFT_ALT, 0x1D});
break;
case FLARE_LAYOUT:
led_names = default_led_names;
led_zones.push_back({"Keyboard", ZONE_TYPE_MATRIX, 106, new matrix_map_type{6, 22, (unsigned int *)&flare_matrix_map}});
led_zones.push_back({"Logo", ZONE_TYPE_SINGLE, 1});
led_zones.push_back({"Underglow", ZONE_TYPE_SINGLE, 2});
led_zones.push_back({ZONE_EN_KEYBOARD, ZONE_TYPE_MATRIX, 106, new matrix_map_type{6, 22, (unsigned int *)&flare_matrix_map}});
led_zones.push_back({"Logo", ZONE_TYPE_SINGLE, 1, NULL});
led_zones.push_back({"Underglow", ZONE_TYPE_SINGLE, 2, NULL});
led_names.insert(led_names.begin() + 7, {"Key: Left Windows", 0x0D});
led_names.insert(led_names.begin() + 12, {"Key: Left Alt", 0x15});
led_names.insert(led_names.begin() + 7, {KEY_EN_LEFT_WINDOWS, 0x0D});
led_names.insert(led_names.begin() + 12, {KEY_EN_LEFT_ALT, 0x15});
led_names.push_back({ "Logo", 0xB8});
led_names.push_back({ "Left Underglow", 0xB9});
@@ -434,7 +447,7 @@ void RGBController_AuraKeyboard::SetupZones()
case FALCHION_LAYOUT:
led_names = default_65pct_led_names;
led_zones.push_back({"Keyboard", ZONE_TYPE_MATRIX, 68, new matrix_map_type{5, 16, (unsigned int *)&falchion_matrix_map}});
led_zones.push_back({ZONE_EN_KEYBOARD, ZONE_TYPE_MATRIX, 68, new matrix_map_type{5, 16, (unsigned int *)&falchion_matrix_map}});
break;
}
@@ -501,7 +514,7 @@ void RGBController_AuraKeyboard::DeviceUpdateLEDs()
frame_buf[(led_idx * 4) + 3] = RGBGetBValue(colors[led_idx]);
}
aura->SendDirect(leds.size(), frame_buf.data());
controller->SendDirect(leds.size(), frame_buf.data());
}
void RGBController_AuraKeyboard::UpdateZoneLEDs(int /*zone*/)
@@ -514,11 +527,6 @@ void RGBController_AuraKeyboard::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_AuraKeyboard::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AuraKeyboard::DeviceUpdateMode()
{
@@ -37,7 +37,7 @@ typedef struct
class RGBController_AuraKeyboard : public RGBController
{
public:
RGBController_AuraKeyboard(AuraKeyboardController* aura_ptr, AuraKeyboardMappingLayoutType keyboard_layout);
RGBController_AuraKeyboard(AuraKeyboardController* controller_ptr, AuraKeyboardMappingLayoutType keyboard_layout);
~RGBController_AuraKeyboard();
void SetupZones();
@@ -48,10 +48,9 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AuraKeyboardController* aura;
AuraKeyboardController* controller;
AuraKeyboardMappingLayoutType layout;
};
@@ -0,0 +1,127 @@
/*-----------------------------------------*\
| RGBController_AsusAuraMonitor.cpp |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Mola19 08/03/2022 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraMonitor.h"
/**------------------------------------------------------------------*\
@name Asus Aura Monitor
@category LEDStrip
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectAsusAuraUSBMonitor
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraMonitor::RGBController_AuraMonitor(AuraMonitorController* controller_ptr)
{
controller = controller_ptr;
name = "ASUS Aura Monitor";
vendor = "ASUS";
type = DEVICE_TYPE_LEDSTRIP;
description = "ASUS Aura Monitor Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
}
RGBController_AuraMonitor::~RGBController_AuraMonitor()
{
delete controller;
}
void RGBController_AuraMonitor::SetupZones()
{
zone underglow_zone;
underglow_zone.name = "Backlight";
underglow_zone.type = ZONE_TYPE_LINEAR;
underglow_zone.leds_min = 3;
underglow_zone.leds_max = 3;
underglow_zone.leds_count = 3;
underglow_zone.matrix_map = NULL;
zones.push_back(underglow_zone);
for(unsigned int i = 0; i < 3; i++)
{
led underglow_led;
underglow_led.name = "Backlight LED " + std::to_string(i + 1);
leds.push_back(underglow_led);
}
SetupColors();
}
void RGBController_AuraMonitor::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AuraMonitor::DeviceUpdateLEDs()
{
controller->BeginUpdate();
for (int i = 0; i < 3; i++)
{
unsigned char red = RGBGetRValue(colors[i]);
unsigned char green = RGBGetGValue(colors[i]);
unsigned char blue = RGBGetBValue(colors[i]);
controller->UpdateLed(i, red, green, blue);
}
controller->ApplyChanges();
}
void RGBController_AuraMonitor::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraMonitor::UpdateSingleLED(int led)
{
controller->BeginUpdate();
unsigned char red = RGBGetRValue(colors[led]);
unsigned char green = RGBGetGValue(colors[led]);
unsigned char blue = RGBGetBValue(colors[led]);
controller->UpdateLed(led, red, green, blue);
controller->ApplyChanges();
}
void RGBController_AuraMonitor::DeviceUpdateMode()
{
/*---------------------------------------------------------*\
| This device does not support Mode changing |
\*---------------------------------------------------------*/
}
void RGBController_AuraMonitor::DeviceSaveMode()
{
/*---------------------------------------------------------*\
| This device does not support Mode saving |
\*---------------------------------------------------------*/
}
@@ -0,0 +1,33 @@
/*-----------------------------------------*\
| RGBController_AsusAuraMonitor.h |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Mola19 08/03/2022 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraMonitorController.h"
class RGBController_AuraMonitor : public RGBController
{
public:
RGBController_AuraMonitor(AuraMonitorController* controller_ptr);
~RGBController_AuraMonitor();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AuraMonitorController* controller;
};
@@ -16,19 +16,30 @@ static std::string aura_mouse_zone_names[3]
"Underglow"
};
RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
{
aura = aura_ptr;
/**------------------------------------------------------------------*\
@name Asus Aura Mouse
@category Mouse
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBMice
@comment
\*-------------------------------------------------------------------*/
uint16_t pid = aura->device_pid;
RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* controller_ptr)
{
controller = controller_ptr;
pid = controller->device_pid;
name = "ASUS Aura Mouse";
vendor = "ASUS";
type = DEVICE_TYPE_MOUSE;
description = "ASUS Aura Mouse Device";
version = aura->GetVersion(aura_mouse_devices[pid].wireless, aura_mouse_devices[pid].version_protocol);
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
version = controller->GetVersion(aura_mouse_devices[pid].wireless, aura_mouse_devices[pid].version_protocol);
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
std::vector<uint8_t> mm = aura_mouse_devices[pid].mouse_modes;
@@ -44,9 +55,9 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
Direct.name = "Direct";
Direct.value = mode_value;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Direct.brightness_min = AURA_MOUSE_BRIGHTNESS_MIN;
Direct.brightness_max = AURA_MOUSE_BRIGHTNESS_MAX;
Direct.brightness = AURA_MOUSE_BRIGHTNESS_DEFAULT;
Direct.brightness_min = aura_mouse_devices[pid].brightness_min;
Direct.brightness_max = aura_mouse_devices[pid].brightness_max;
Direct.brightness = aura_mouse_devices[pid].brightness_max;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
}
@@ -58,9 +69,9 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
Breathing.name = "Breathing";
Breathing.value = mode_value;
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.brightness_min = AURA_MOUSE_BRIGHTNESS_MIN;
Breathing.brightness_max = AURA_MOUSE_BRIGHTNESS_MAX;
Breathing.brightness = AURA_MOUSE_BRIGHTNESS_DEFAULT;
Breathing.brightness_min = aura_mouse_devices[pid].brightness_min;
Breathing.brightness_max = aura_mouse_devices[pid].brightness_max;
Breathing.brightness = aura_mouse_devices[pid].brightness_max;
Breathing.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Breathing);
}
@@ -72,9 +83,9 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
ColorCycle.name = "Spectrum Cycle";
ColorCycle.value = mode_value;
ColorCycle.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE ;
ColorCycle.brightness_min = AURA_MOUSE_BRIGHTNESS_MIN;
ColorCycle.brightness_max = AURA_MOUSE_BRIGHTNESS_MAX;
ColorCycle.brightness = AURA_MOUSE_BRIGHTNESS_DEFAULT;
ColorCycle.brightness_min = aura_mouse_devices[pid].brightness_min;
ColorCycle.brightness_max = aura_mouse_devices[pid].brightness_max;
ColorCycle.brightness = aura_mouse_devices[pid].brightness_max;
ColorCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(ColorCycle);
}
@@ -90,9 +101,9 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
Wave.speed_min = aura_mouse_devices[pid].speed_min;
Wave.speed_max = aura_mouse_devices[pid].speed_max;
Wave.speed = (aura_mouse_devices[pid].speed_min + aura_mouse_devices[pid].speed_max) / 2;
Wave.brightness_min = AURA_MOUSE_BRIGHTNESS_MIN;
Wave.brightness_max = AURA_MOUSE_BRIGHTNESS_MAX;
Wave.brightness = AURA_MOUSE_BRIGHTNESS_DEFAULT;
Wave.brightness_min = aura_mouse_devices[pid].brightness_min;
Wave.brightness_max = aura_mouse_devices[pid].brightness_max;
Wave.brightness = aura_mouse_devices[pid].brightness_max;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
}
@@ -104,9 +115,9 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
Reactive.name = "Reactive";
Reactive.value = mode_value;
Reactive.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Reactive.brightness_min = AURA_MOUSE_BRIGHTNESS_MIN;
Reactive.brightness_max = AURA_MOUSE_BRIGHTNESS_MAX;
Reactive.brightness = AURA_MOUSE_BRIGHTNESS_DEFAULT;
Reactive.brightness_min = aura_mouse_devices[pid].brightness_min;
Reactive.brightness_max = aura_mouse_devices[pid].brightness_max;
Reactive.brightness = aura_mouse_devices[pid].brightness_max;
Reactive.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Reactive);
}
@@ -118,9 +129,9 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
Comet.name = "Comet";
Comet.value = mode_value;
Comet.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Comet.brightness_min = AURA_MOUSE_BRIGHTNESS_MIN;
Comet.brightness_max = AURA_MOUSE_BRIGHTNESS_MAX;
Comet.brightness = AURA_MOUSE_BRIGHTNESS_DEFAULT;
Comet.brightness_min = aura_mouse_devices[pid].brightness_min;
Comet.brightness_max = aura_mouse_devices[pid].brightness_max;
Comet.brightness = aura_mouse_devices[pid].brightness_max;
Comet.color_mode = MODE_COLORS_MODE_SPECIFIC;
Comet.direction = 0;
Comet.colors_min = 1;
@@ -136,9 +147,9 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
BatteryMode.name = "Battery";
BatteryMode.value = mode_value;
BatteryMode.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
BatteryMode.brightness_min = AURA_MOUSE_BRIGHTNESS_MIN;
BatteryMode.brightness_max = AURA_MOUSE_BRIGHTNESS_MAX;
BatteryMode.brightness = AURA_MOUSE_BRIGHTNESS_DEFAULT;
BatteryMode.brightness_min = aura_mouse_devices[pid].brightness_min;
BatteryMode.brightness_max = aura_mouse_devices[pid].brightness_max;
BatteryMode.brightness = aura_mouse_devices[pid].brightness_max;
BatteryMode.color_mode = MODE_COLORS_NONE;
modes.push_back(BatteryMode);
}
@@ -152,14 +163,11 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* aura_ptr)
RGBController_AuraMouse::~RGBController_AuraMouse()
{
delete aura;
delete controller;
}
void RGBController_AuraMouse::SetupZones()
{
uint16_t pid = aura->device_pid;
for(std::vector<uint8_t>::iterator zone_it = aura_mouse_devices[pid].mouse_zones.begin(); zone_it != aura_mouse_devices[pid].mouse_zones.end(); zone_it++)
{
zone mouse_zone;
@@ -199,7 +207,7 @@ void RGBController_AuraMouse::DeviceUpdateLEDs()
void RGBController_AuraMouse::UpdateZoneLEDs(int zone)
{
UpdateSingleLED(zone);
DeviceUpdateLEDs();
}
void RGBController_AuraMouse::UpdateSingleLED(int led)
@@ -208,12 +216,7 @@ void RGBController_AuraMouse::UpdateSingleLED(int led)
uint8_t grn = RGBGetGValue(colors[led]);
uint8_t blu = RGBGetBValue(colors[led]);
aura->SendUpdate(leds[led].value, modes[active_mode].value, red, grn, blu, 0, false, 0, modes[active_mode].brightness);
}
void RGBController_AuraMouse::SetCustomMode()
{
active_mode = 0;
controller->SendUpdate(leds[led].value, modes[active_mode].value, red, grn, blu, 0, false, 0, modes[active_mode].brightness);
}
void RGBController_AuraMouse::DeviceUpdateMode()
@@ -235,12 +238,12 @@ void RGBController_AuraMouse::DeviceUpdateMode()
blu = RGBGetBValue(modes[active_mode].colors[0]);
}
aura->SendUpdate(AURA_MOUSE_ZONE_ALL, modes[active_mode].value, red, grn, blu, modes[active_mode].direction, modes[active_mode].color_mode == MODE_COLORS_RANDOM, modes[active_mode].speed, modes[active_mode].brightness);
controller->SendUpdate(AURA_MOUSE_ZONE_ALL, modes[active_mode].value, red, grn, blu, modes[active_mode].direction, modes[active_mode].color_mode == MODE_COLORS_RANDOM, modes[active_mode].speed, modes[active_mode].brightness);
}
}
void RGBController_AuraMouse::DeviceSaveMode()
{
DeviceUpdateMode();
aura->SaveMode();
controller->SaveMode();
}
@@ -11,16 +11,10 @@
#include "RGBController.h"
#include "AsusAuraMouseController.h"
enum {
AURA_MOUSE_BRIGHTNESS_MIN = 0,
AURA_MOUSE_BRIGHTNESS_MAX = 4,
AURA_MOUSE_BRIGHTNESS_DEFAULT = 4
};
class RGBController_AuraMouse : public RGBController
{
public:
RGBController_AuraMouse(AuraMouseController* aura_ptr);
RGBController_AuraMouse(AuraMouseController* controller_ptr);
~RGBController_AuraMouse();
void SetupZones();
@@ -31,10 +25,10 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AuraMouseController* aura;
AuraMouseController* controller;
uint16_t pid;
};
@@ -0,0 +1,298 @@
/*-----------------------------------------*\
| RGBController_AsusAuraMousemat.cpp |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Adam Honse (CalcProgrammer1) 1/10/2022 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraMousemat.h"
/**------------------------------------------------------------------*\
@name Asus Aura Mousemat
@category Mousemat
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBMousemats
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraMousemat::RGBController_AuraMousemat(AuraMousematController* controller_ptr)
{
controller = controller_ptr;
name = "ASUS Aura Mousemat";
vendor = "ASUS";
type = DEVICE_TYPE_MOUSEMAT;
description = "ASUS Aura Mousemat Device";
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_MOUSEMAT_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
Static.value = AURA_MOUSEMAT_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
Static.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
Static.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
Static.colors_min = 1;
Static.colors_max = 1;
Static.colors.resize(1);
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_MOUSEMAT_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC | MODE_COLORS_RANDOM;
Breathing.speed_min = AURA_MOUSEMAT_SPEED_MIN;
Breathing.speed_max = AURA_MOUSEMAT_SPEED_MAX;
Breathing.speed = AURA_MOUSEMAT_SPEED_DEFAULT_BREATHING;
Breathing.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
Breathing.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
Breathing.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
Breathing.colors.resize(1);
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.value = AURA_MOUSEMAT_MODE_COLOR_CYCLE;
ColorCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
ColorCycle.color_mode = MODE_COLORS_NONE;
ColorCycle.speed_min = AURA_MOUSEMAT_SPEED_MIN;
ColorCycle.speed_max = AURA_MOUSEMAT_SPEED_MAX;
ColorCycle.speed = AURA_MOUSEMAT_SPEED_DEFAULT_COLOR_CYCLE;
ColorCycle.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
ColorCycle.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
ColorCycle.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
modes.push_back(ColorCycle);
mode Wave;
Wave.name = "Wave";
Wave.value = AURA_MOUSEMAT_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_MANUAL_SAVE;
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
Wave.speed_min = AURA_MOUSEMAT_SPEED_MIN;
Wave.speed_max = AURA_MOUSEMAT_SPEED_MAX;
Wave.speed = AURA_MOUSEMAT_SPEED_DEFAULT_WAVE;
Wave.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
Wave.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
Wave.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
Wave.direction = MODE_DIRECTION_LEFT;
Wave.colors_min = 7;
Wave.colors_max = 7;
Wave.colors.resize(7);
modes.push_back(Wave);
mode WavePlane;
WavePlane.name = "Wave Plane";
WavePlane.value = AURA_MOUSEMAT_MODE_WAVE_PLANE;
WavePlane.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_MANUAL_SAVE;
WavePlane.color_mode = MODE_COLORS_NONE;
WavePlane.speed_min = AURA_MOUSEMAT_SPEED_MIN;
WavePlane.speed_max = AURA_MOUSEMAT_SPEED_MAX;
WavePlane.speed = AURA_MOUSEMAT_SPEED_DEFAULT_WAVE_PLANE;
WavePlane.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
WavePlane.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
WavePlane.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
WavePlane.direction = MODE_DIRECTION_LEFT;
modes.push_back(WavePlane);
mode Comet;
Comet.name = "Comet";
Comet.value = AURA_MOUSEMAT_MODE_COMET;
Comet.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_MANUAL_SAVE;
Comet.color_mode = MODE_COLORS_MODE_SPECIFIC;
Comet.speed_min = AURA_MOUSEMAT_SPEED_MIN;
Comet.speed_max = AURA_MOUSEMAT_SPEED_MAX;
Comet.speed = AURA_MOUSEMAT_SPEED_DEFAULT_COMET;
Comet.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
Comet.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
Comet.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
Comet.direction = MODE_DIRECTION_LEFT;
Comet.colors_min = 1;
Comet.colors_max = 1;
Comet.colors.resize(1);
modes.push_back(Comet);
mode GlowingYoyo;
GlowingYoyo.name = "Glowing Yoyo";
GlowingYoyo.value = AURA_MOUSEMAT_MODE_GLOWING_YOYO;
GlowingYoyo.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_MANUAL_SAVE;
GlowingYoyo.color_mode = MODE_COLORS_NONE;
GlowingYoyo.speed_min = AURA_MOUSEMAT_SPEED_MIN;
GlowingYoyo.speed_max = AURA_MOUSEMAT_SPEED_MAX;
GlowingYoyo.speed = AURA_MOUSEMAT_SPEED_DEFAULT_GLOWING_YOYO;
GlowingYoyo.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
GlowingYoyo.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
GlowingYoyo.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
GlowingYoyo.direction = MODE_DIRECTION_LEFT;
modes.push_back(GlowingYoyo);
mode Cross;
Cross.name = "Cross";
Cross.value = AURA_MOUSEMAT_MODE_CROSS;
Cross.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
Cross.color_mode = MODE_COLORS_MODE_SPECIFIC;
Cross.speed_min = AURA_MOUSEMAT_SPEED_MIN;
Cross.speed_max = AURA_MOUSEMAT_SPEED_MAX;
Cross.speed = AURA_MOUSEMAT_SPEED_DEFAULT_CROSS;
Cross.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
Cross.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
Cross.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
Cross.colors_min = 2;
Cross.colors_max = 2;
Cross.colors.resize(2);
modes.push_back(Cross);
mode StarryNight;
StarryNight.name = "Starry Night";
StarryNight.value = AURA_MOUSEMAT_MODE_STARRY_NIGHT;
StarryNight.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
StarryNight.color_mode = MODE_COLORS_MODE_SPECIFIC | MODE_COLORS_RANDOM;
StarryNight.speed_min = AURA_MOUSEMAT_SPEED_MIN;
StarryNight.speed_max = AURA_MOUSEMAT_SPEED_MAX;
StarryNight.speed = AURA_MOUSEMAT_SPEED_DEFAULT_STARRY_NIGHT;
StarryNight.brightness_min = AURA_MOUSEMAT_BRIGHTNESS_MIN;
StarryNight.brightness_max = AURA_MOUSEMAT_BRIGHTNESS_MAX;
StarryNight.brightness = AURA_MOUSEMAT_BRIGHTNESS_DEFAULT;
StarryNight.colors_min = 2;
StarryNight.colors_max = 2;
StarryNight.colors.resize(2);
modes.push_back(StarryNight);
SetupZones();
}
RGBController_AuraMousemat::~RGBController_AuraMousemat()
{
delete controller;
}
void RGBController_AuraMousemat::SetupZones()
{
zone mousemat_zone;
mousemat_zone.name = "Mousemat";
mousemat_zone.type = ZONE_TYPE_LINEAR;
mousemat_zone.leds_min = 15;
mousemat_zone.leds_max = 15;
mousemat_zone.leds_count = 15;
mousemat_zone.matrix_map = NULL;
zones.push_back(mousemat_zone);
for(unsigned int i = 0; i < 15; i++)
{
led mousemat_led;
mousemat_led.name = "Mousemat LED " + std::to_string(i);
leds.push_back(mousemat_led);
}
SetupColors();
}
void RGBController_AuraMousemat::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AuraMousemat::DeviceUpdateLEDs()
{
controller->UpdateLeds(std::vector<RGBColor>(colors));
}
void RGBController_AuraMousemat::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraMousemat::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_AuraMousemat::DeviceUpdateMode()
{
if(modes[active_mode].value == AURA_MOUSEMAT_MODE_DIRECT)
{
DeviceUpdateLEDs();
}
else
{
int pattern = 0;
switch(modes[active_mode].value)
{
case AURA_MOUSEMAT_MODE_BREATHING:
if(modes[active_mode].color_mode == MODE_COLORS_RANDOM)
{
pattern = 2;
}
else
{
pattern = modes[active_mode].colors.size() - 1;
}
break;
case AURA_MOUSEMAT_MODE_WAVE:
pattern = modes[active_mode].colors.size() * 16 + modes[active_mode].direction;
break;
case AURA_MOUSEMAT_MODE_WAVE_PLANE:
switch(modes[active_mode].direction)
{
case MODE_DIRECTION_LEFT:
pattern = 2;
break;
case MODE_DIRECTION_RIGHT:
pattern = 3;
break;
case MODE_DIRECTION_UP:
pattern = 0;
break;
case MODE_DIRECTION_DOWN:
pattern = 1;
break;
}
break;
case AURA_MOUSEMAT_MODE_COMET:
pattern = modes[active_mode].direction;
if(pattern == MODE_DIRECTION_HORIZONTAL || pattern == MODE_DIRECTION_VERTICAL) pattern = 2;
break;
case AURA_MOUSEMAT_MODE_GLOWING_YOYO:
pattern = modes[active_mode].direction;
break;
case AURA_MOUSEMAT_MODE_STARRY_NIGHT:
pattern = 16 + (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
break;
default:
pattern = 255;
break;
}
controller->UpdateDevice(modes[active_mode].value, std::vector<RGBColor>(modes[active_mode].colors), modes[active_mode].speed, modes[active_mode].brightness, pattern);
}
}
void RGBController_AuraMousemat::DeviceSaveMode()
{
DeviceUpdateMode();
controller->SaveMode();
}
@@ -0,0 +1,51 @@
/*-----------------------------------------*\
| RGBController_AsusAuraMousemat.h |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Mola19 06/04/2021 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraMousematController.h"
enum
{
AURA_MOUSEMAT_BRIGHTNESS_MIN = 0,
AURA_MOUSEMAT_BRIGHTNESS_MAX = 4,
AURA_MOUSEMAT_BRIGHTNESS_DEFAULT = 4,
AURA_MOUSEMAT_SPEED_MIN = 127,
AURA_MOUSEMAT_SPEED_MAX = 0,
AURA_MOUSEMAT_SPEED_DEFAULT_STATIC = 0,
AURA_MOUSEMAT_SPEED_DEFAULT_BREATHING = 1,
AURA_MOUSEMAT_SPEED_DEFAULT_COLOR_CYCLE = 1,
AURA_MOUSEMAT_SPEED_DEFAULT_WAVE = 14,
AURA_MOUSEMAT_SPEED_DEFAULT_WAVE_PLANE = 2,
AURA_MOUSEMAT_SPEED_DEFAULT_COMET = 2,
AURA_MOUSEMAT_SPEED_DEFAULT_GLOWING_YOYO = 4,
AURA_MOUSEMAT_SPEED_DEFAULT_CROSS = 12,
AURA_MOUSEMAT_SPEED_DEFAULT_STARRY_NIGHT = 2,
};
class RGBController_AuraMousemat : public RGBController
{
public:
RGBController_AuraMousemat(AuraMousematController* controller_ptr);
~RGBController_AuraMousemat();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AuraMousematController* controller;
};
@@ -0,0 +1,218 @@
/*-------------------------------------------------------------------*\
| RGBController_AsusAuraRyuoAIO.cpp |
| |
| Driver for the ASUS Aura Ryuo AIO |
| lighting controller |
| |
| Cooper Hall (geobot19 / Geo_bot) 08 Apr 2022 |
| using snipets from Chris M (Dr.No) |
\*-------------------------------------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_AsusAuraRyuoAIO.h"
/**------------------------------------------------------------------*\
@name Asus Aura Ryuo AIO
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBMousemats
@category Cooler
@comment
\*-------------------------------------------------------------------*/
RGBController_AsusAuraRyuoAIO::RGBController_AsusAuraRyuoAIO(AsusAuraRyuoAIOController *controller_ptr)
{
controller = controller_ptr;
uint8_t speed = controller->SPEED_NORMAL;
name = "ROG Ryuo AIO";
vendor = "ASUS";
type = DEVICE_TYPE_COOLER;
description = "ASUS Liquid Cooler with 120mm and 240mm radiators.";
location = controller->GetLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = controller->MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
Static.value = controller->MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
Static.colors.resize(Static.colors_max);
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = controller->MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 1;
Breathing.colors.resize(Breathing.colors_max);
Breathing.brightness_min = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MIN;
Breathing.brightness_max = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Breathing.brightness = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Breathing.speed_min = controller->SPEED_SLOWEST;
Breathing.speed_max = controller->SPEED_FASTEST;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.speed = speed;
modes.push_back(Breathing);
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = controller->MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
Flashing.colors.resize(Flashing.colors_max);
Flashing.brightness_min = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MIN;
Flashing.brightness_max = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Flashing.brightness = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Flashing.speed_min = controller->SPEED_SLOWEST;
Flashing.speed_max = controller->SPEED_FASTEST;
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Flashing.speed = speed;
modes.push_back(Flashing);
mode Spectrum;
Spectrum.name = "Spectrum";
Spectrum.value = controller->MODE_SPECTRUM;
Spectrum.flags = MODE_FLAG_HAS_SPEED;
Spectrum.brightness_min = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MIN;
Spectrum.brightness_max = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Spectrum.brightness = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Spectrum.speed_min = controller->SPEED_SLOWEST;
Spectrum.speed_max = controller->SPEED_FASTEST;
Spectrum.color_mode = MODE_COLORS_NONE;
Spectrum.speed = speed;
modes.push_back(Spectrum);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = controller->MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
Rainbow.brightness_min = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MIN;
Rainbow.brightness_max = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Rainbow.brightness = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
Rainbow.speed_min = controller->SPEED_SLOWEST;
Rainbow.speed_max = controller->SPEED_FASTEST;
Rainbow.color_mode = MODE_COLORS_NONE;
Rainbow.speed = speed;
modes.push_back(Rainbow);
mode FlashAndDash;
FlashAndDash.name = "Flash and Dash";
FlashAndDash.value = controller->MODE_FLASHANDDASH;
FlashAndDash.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
FlashAndDash.brightness_min = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MIN;
FlashAndDash.brightness_max = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
FlashAndDash.brightness = ASUSAURARYUOAIOCONTROLLER_BRIGHTNESS_MAX;
FlashAndDash.speed_min = controller->SPEED_SLOWEST;
FlashAndDash.speed_max = controller->SPEED_FASTEST;
FlashAndDash.color_mode = MODE_COLORS_NONE;
FlashAndDash.speed = speed;
modes.push_back(FlashAndDash);
SetupZones();
}
RGBController_AsusAuraRyuoAIO::~RGBController_AsusAuraRyuoAIO()
{
delete controller;
}
void RGBController_AsusAuraRyuoAIO::SetupZones()
{
/*-------------------------------------------------*\
| Set up zones |
\*-------------------------------------------------*/
LOG_DEBUG("[%s] - Get channel count: %i", name.c_str(), controller->GetChannelCount());
zones.resize(controller->GetChannelCount());
LOG_DEBUG("[%s] - Creating Zones and LEDs", name.c_str());
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
AuraDeviceInfo device_info = controller->GetAuraDevices()[zone_idx];
LOG_INFO("[%s] %s Zone %i - Header Count %i LED Count %i FX %02X Direct %02X", name.c_str(),
((device_info.device_type == AuraDeviceType::FIXED) ? "Fixed" : "Addressable"),
zone_idx, device_info.num_headers, device_info.num_leds, device_info.effect_channel, device_info.direct_channel);
zones[zone_idx].name = name + " Zone ";
zones[zone_idx].name.append(std::to_string(zone_idx));
zones[zone_idx].type = ZONE_TYPE_LINEAR;
zones[zone_idx].leds_min = device_info.num_leds;
zones[zone_idx].leds_max = device_info.num_leds;
zones[zone_idx].leds_count = device_info.num_leds;
for(unsigned int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
{
led new_led;
new_led.name = zones[zone_idx].name;
new_led.name.append(" LED " + std::to_string(lp_idx));
new_led.value = lp_idx;
leds.push_back(new_led);
}
}
LOG_DEBUG("[%s] - Device zones and LEDs set", name.c_str());
SetupColors();
}
void RGBController_AsusAuraRyuoAIO::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_AsusAuraRyuoAIO::DeviceUpdateLEDs()
{
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
UpdateZoneLEDs(zone_idx);
}
}
void RGBController_AsusAuraRyuoAIO::UpdateZoneLEDs(int zone)
{
controller->SetLedsDirect(zones[zone].colors, zones[zone].leds_count);
}
void RGBController_AsusAuraRyuoAIO::UpdateSingleLED(int led)
{
UpdateZoneLEDs(GetLED_Zone(led));
}
void RGBController_AsusAuraRyuoAIO::DeviceUpdateMode()
{
RGBColor colour = (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC) ? modes[active_mode].colors[0] : 0;
controller->SetMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].direction, colour);
}
int RGBController_AsusAuraRyuoAIO::GetLED_Zone(int led_idx)
{
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
int zone_start = zones[zone_idx].start_idx;
int zone_end = zone_start + zones[zone_idx].leds_count - 1;
if( zone_start <= led_idx && zone_end >= led_idx)
{
return(zone_idx);
}
}
return -1;
}
@@ -0,0 +1,38 @@
/*-------------------------------------------------------------------*\
| RGBController_AsusAuraRyuoAIO.h |
| |
| Driver for the ASUS Aura Ryuo AIO |
| lighting controller |
| |
| Cooper Hall (geobot19 / Geo_bot) 08 Apr 2022 |
| using snipets from Chris M (Dr.No) |
\*-------------------------------------------------------------------*/
#pragma once
#include "LogManager.h"
#include "RGBController.h"
#include "AsusAuraRyuoAIOController.h"
#include <vector>
class RGBController_AsusAuraRyuoAIO : public RGBController
{
public:
RGBController_AsusAuraRyuoAIO(AsusAuraRyuoAIOController* controller_ptr);
~RGBController_AsusAuraRyuoAIO();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
int GetDeviceMode();
int GetLED_Zone(int led_idx);
AsusAuraRyuoAIOController* controller;
};
@@ -9,6 +9,17 @@
#include "RGBController_AsusAuraStrixEvolve.h"
/**------------------------------------------------------------------*\
@name Asus Aura Strix Evolve
@category Mouse
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBStrixEvolve
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraStrixEvolve::RGBController_AuraStrixEvolve(AuraStrixEvolveController* controller_ptr)
{
controller = controller_ptr;
@@ -118,11 +129,6 @@ void RGBController_AuraStrixEvolve::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_AuraStrixEvolve::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AuraStrixEvolve::DeviceUpdateMode()
{
unsigned char red = RGBGetRValue(colors[0]);
@@ -32,7 +32,6 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
@@ -11,195 +11,380 @@
#include <vector>
#include <cmath>
RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardController* aura_ptr)
/**------------------------------------------------------------------*\
@name Asus Aura TUF Keyboard
@category Keyboard
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraTUFUSBKeyboard
@comment
\*-------------------------------------------------------------------*/
RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardController* controller_ptr)
{
aura = aura_ptr;
controller = controller_ptr;
name = "ASUS Aura Keyboard";
vendor = "ASUS";
type = DEVICE_TYPE_KEYBOARD;
description = "ASUS Aura Keyboard Device";
version = aura->GetVersion();
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
pid = controller->device_pid;
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_KEYBOARD_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
const unsigned char AURA_KEYBOARD_SPEED_MIN = (pid == AURA_ROG_FALCHION_WIRED_PID || pid == AURA_ROG_FALCHION_WIRELESS_PID) ? 255 : 15;
mode Static;
Static.name = "Static";
Static.value = AURA_KEYBOARD_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Static.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Static.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Static.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.colors_min = 1;
Static.colors_max = 1;
Static.colors.resize(1);
modes.push_back(Static);
if(pid != AURA_ROG_CLAYMORE_PID)
{
name = "ASUS Aura Keyboard";
vendor = "ASUS";
type = DEVICE_TYPE_KEYBOARD;
description = "ASUS Aura Keyboard Device";
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_KEYBOARD_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.speed_min = AURA_KEYBOARD_SPEED_MIN;
Breathing.speed_max = AURA_KEYBOARD_SPEED_MAX;
Breathing.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Breathing.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Breathing.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Breathing.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
Breathing.colors.resize(1);
modes.push_back(Breathing);
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_KEYBOARD_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Color_Cycle;
Color_Cycle.name = "Spectrum Cycle";
Color_Cycle.value = AURA_KEYBOARD_MODE_COLOR_CYCLE;
Color_Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Color_Cycle.speed_min = AURA_KEYBOARD_SPEED_MIN;
Color_Cycle.speed_max = AURA_KEYBOARD_SPEED_MAX;
Color_Cycle.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Color_Cycle.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Color_Cycle.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Color_Cycle.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Color_Cycle.color_mode = MODE_COLORS_NONE;
modes.push_back(Color_Cycle);
mode Static;
Static.name = "Static";
Static.value = AURA_KEYBOARD_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Static.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Static.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Static.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.colors_min = 1;
Static.colors_max = 1;
Static.colors.resize(1);
modes.push_back(Static);
mode Wave;
Wave.name = "Rainbow Wave";
Wave.value = AURA_KEYBOARD_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Wave.speed_min = AURA_KEYBOARD_SPEED_MIN;
Wave.speed_max = AURA_KEYBOARD_SPEED_MAX;
Wave.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Wave.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Wave.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Wave.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Wave.direction = MODE_DIRECTION_LEFT;
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
Wave.colors_min = 1;
Wave.colors_max = 7;
Wave.colors.resize(7);
modes.push_back(Wave);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_KEYBOARD_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Breathing.speed_min = AURA_KEYBOARD_SPEED_MIN;
Breathing.speed_max = AURA_KEYBOARD_SPEED_MAX;
Breathing.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Breathing.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Breathing.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Breathing.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
Breathing.colors.resize(1);
modes.push_back(Breathing);
mode Ripple;
Ripple.name = "Ripple";
Ripple.value = AURA_KEYBOARD_MODE_RIPPLE;
Ripple.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Ripple.speed_min = AURA_KEYBOARD_SPEED_MIN;
Ripple.speed_max = AURA_KEYBOARD_SPEED_MAX;
Ripple.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Ripple.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Ripple.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Ripple.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
Ripple.colors_min = 1;
Ripple.colors_max = 8;
Ripple.colors.resize(7);
modes.push_back(Ripple);
mode Color_Cycle;
Color_Cycle.name = "Spectrum Cycle";
Color_Cycle.value = AURA_KEYBOARD_MODE_COLOR_CYCLE;
Color_Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Color_Cycle.speed_min = AURA_KEYBOARD_SPEED_MIN;
Color_Cycle.speed_max = AURA_KEYBOARD_SPEED_MAX;
Color_Cycle.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Color_Cycle.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Color_Cycle.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Color_Cycle.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Color_Cycle.color_mode = MODE_COLORS_NONE;
modes.push_back(Color_Cycle);
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = AURA_KEYBOARD_MODE_REACTIVE;
Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Reactive.speed_min = AURA_KEYBOARD_SPEED_MIN;
Reactive.speed_max = AURA_KEYBOARD_SPEED_MAX;
Reactive.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Reactive.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Reactive.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Reactive.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
Reactive.colors_min = 1;
Reactive.colors_max = 2;
Reactive.colors.resize(1);
modes.push_back(Reactive);
mode Wave;
Wave.name = "Rainbow Wave";
Wave.value = AURA_KEYBOARD_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Wave.speed_min = AURA_KEYBOARD_SPEED_MIN;
Wave.speed_max = AURA_KEYBOARD_SPEED_MAX;
Wave.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Wave.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Wave.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Wave.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Wave.direction = MODE_DIRECTION_LEFT;
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
Wave.colors_min = 1;
Wave.colors_max = 7;
Wave.colors.resize(7);
modes.push_back(Wave);
mode Starry_Night;
Starry_Night.name = "Starry Night";
Starry_Night.value = AURA_KEYBOARD_MODE_STARRY_NIGHT;
Starry_Night.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Starry_Night.speed_min = AURA_KEYBOARD_SPEED_MIN;
Starry_Night.speed_max = AURA_KEYBOARD_SPEED_MAX;
Starry_Night.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Starry_Night.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Starry_Night.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Starry_Night.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Starry_Night.color_mode = MODE_COLORS_MODE_SPECIFIC;
Starry_Night.colors_min = 1;
Starry_Night.colors_max = 3;
Starry_Night.colors.resize(1);
modes.push_back(Starry_Night);
mode Ripple;
Ripple.name = "Ripple";
Ripple.value = AURA_KEYBOARD_MODE_RIPPLE;
Ripple.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Ripple.speed_min = AURA_KEYBOARD_SPEED_MIN;
Ripple.speed_max = AURA_KEYBOARD_SPEED_MAX;
Ripple.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Ripple.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Ripple.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Ripple.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
Ripple.colors_min = 1;
Ripple.colors_max = 8;
Ripple.colors.resize(7);
modes.push_back(Ripple);
mode Quicksand;
Quicksand.name = "Quicksand";
Quicksand.value = AURA_KEYBOARD_MODE_QUICKSAND;
Quicksand.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Quicksand.direction = MODE_DIRECTION_DOWN;
Quicksand.speed_min = AURA_KEYBOARD_SPEED_MIN;
Quicksand.speed_max = AURA_KEYBOARD_SPEED_MAX;
Quicksand.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Quicksand.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Quicksand.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Quicksand.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Quicksand.color_mode = MODE_COLORS_MODE_SPECIFIC;
Quicksand.colors_min = 6;
Quicksand.colors_max = 6;
Quicksand.colors.resize(6);
modes.push_back(Quicksand);
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = AURA_KEYBOARD_MODE_REACTIVE;
Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Reactive.speed_min = AURA_KEYBOARD_SPEED_MIN;
Reactive.speed_max = AURA_KEYBOARD_SPEED_MAX;
Reactive.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Reactive.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Reactive.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Reactive.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
Reactive.colors_min = 1;
Reactive.colors_max = 2;
Reactive.colors.resize(1);
modes.push_back(Reactive);
mode Current;
Current.name = "Current";
Current.value = AURA_KEYBOARD_MODE_CURRENT;
Current.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Current.speed_min = AURA_KEYBOARD_SPEED_MIN;
Current.speed_max = AURA_KEYBOARD_SPEED_MAX;
Current.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Current.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Current.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Current.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Current.color_mode = MODE_COLORS_MODE_SPECIFIC;
Current.colors_min = 1;
Current.colors_max = 3;
Current.colors.resize(1);
modes.push_back(Current);
mode Starry_Night;
Starry_Night.name = "Starry Night";
Starry_Night.value = AURA_KEYBOARD_MODE_STARRY_NIGHT;
Starry_Night.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Starry_Night.speed_min = AURA_KEYBOARD_SPEED_MIN;
Starry_Night.speed_max = AURA_KEYBOARD_SPEED_MAX;
Starry_Night.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Starry_Night.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Starry_Night.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Starry_Night.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Starry_Night.color_mode = MODE_COLORS_MODE_SPECIFIC;
Starry_Night.colors_min = 1;
Starry_Night.colors_max = 3;
Starry_Night.colors.resize(1);
modes.push_back(Starry_Night);
mode Rain_Drop;
Rain_Drop.name = "Rain Drop";
Rain_Drop.value = AURA_KEYBOARD_MODE_RAIN_DROP;
Rain_Drop.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Rain_Drop.speed_min = AURA_KEYBOARD_SPEED_MIN;
Rain_Drop.speed_max = AURA_KEYBOARD_SPEED_MAX;
Rain_Drop.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Rain_Drop.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Rain_Drop.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Rain_Drop.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Rain_Drop.color_mode = MODE_COLORS_MODE_SPECIFIC;
Rain_Drop.colors_min = 1;
Rain_Drop.colors_max = 3;
Rain_Drop.colors.resize(1);
modes.push_back(Rain_Drop);
mode Quicksand;
Quicksand.name = "Quicksand";
Quicksand.value = AURA_KEYBOARD_MODE_QUICKSAND;
Quicksand.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Quicksand.direction = MODE_DIRECTION_DOWN;
Quicksand.speed_min = AURA_KEYBOARD_SPEED_MIN;
Quicksand.speed_max = AURA_KEYBOARD_SPEED_MAX;
Quicksand.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Quicksand.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Quicksand.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Quicksand.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Quicksand.color_mode = MODE_COLORS_MODE_SPECIFIC;
Quicksand.colors_min = 6;
Quicksand.colors_max = 6;
Quicksand.colors.resize(6);
modes.push_back(Quicksand);
mode Current;
Current.name = "Current";
Current.value = AURA_KEYBOARD_MODE_CURRENT;
Current.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Current.speed_min = AURA_KEYBOARD_SPEED_MIN;
Current.speed_max = AURA_KEYBOARD_SPEED_MAX;
Current.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Current.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Current.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Current.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Current.color_mode = MODE_COLORS_MODE_SPECIFIC;
Current.colors_min = 1;
Current.colors_max = 3;
Current.colors.resize(1);
modes.push_back(Current);
mode Rain_Drop;
Rain_Drop.name = "Rain Drop";
Rain_Drop.value = AURA_KEYBOARD_MODE_RAIN_DROP;
Rain_Drop.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
Rain_Drop.speed_min = AURA_KEYBOARD_SPEED_MIN;
Rain_Drop.speed_max = AURA_KEYBOARD_SPEED_MAX;
Rain_Drop.speed = AURA_KEYBOARD_SPEED_DEFAULT;
Rain_Drop.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
Rain_Drop.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
Rain_Drop.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
Rain_Drop.color_mode = MODE_COLORS_MODE_SPECIFIC;
Rain_Drop.colors_min = 1;
Rain_Drop.colors_max = 3;
Rain_Drop.colors.resize(1);
modes.push_back(Rain_Drop);
}
else
{
name = "ASUS ROG Claymore";
vendor = "ASUS";
type = DEVICE_TYPE_KEYBOARD;
description = "ASUS Aura Keyboard Device";
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_KEYBOARD_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
Static.value = AURA_KEYBOARD_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.colors_min = 1;
Static.colors_max = 1;
Static.colors.resize(1);
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_KEYBOARD_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Breathing.speed_min = AURA_CLAYMORE_SPEED_MIN;
Breathing.speed_max = AURA_CLAYMORE_SPEED_MAX;
Breathing.speed = AURA_CLAYMORE_SPEED_DEFAULT_BREATHING;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
Breathing.colors.resize(2);
modes.push_back(Breathing);
mode Color_Cycle;
Color_Cycle.name = "Spectrum Cycle";
Color_Cycle.value = AURA_KEYBOARD_MODE_COLOR_CYCLE;
Color_Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Color_Cycle.speed_min = AURA_CLAYMORE_SPEED_MIN;
Color_Cycle.speed_max = AURA_CLAYMORE_SPEED_MAX;
Color_Cycle.speed = AURA_CLAYMORE_SPEED_DEFAULT_COLOR_CYCLE;
Color_Cycle.color_mode = MODE_COLORS_NONE;
modes.push_back(Color_Cycle);
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = AURA_KEYBOARD_MODE_REACTIVE;
Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Reactive.speed_min = AURA_CLAYMORE_SPEED_MIN;
Reactive.speed_max = AURA_CLAYMORE_SPEED_MAX;
Reactive.speed = AURA_CLAYMORE_SPEED_DEFAULT_REACTIVE;
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
Reactive.colors_min = 1;
Reactive.colors_max = 2;
Reactive.colors.resize(2);
modes.push_back(Reactive);
mode Wave;
Wave.name = "Rainbow Wave";
Wave.value = AURA_KEYBOARD_MODE_WAVE;
Wave.flags = MODE_COLORS_NONE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
Wave.speed_min = AURA_CLAYMORE_SPEED_MIN;
Wave.speed_max = AURA_CLAYMORE_SPEED_MAX;
Wave.speed = AURA_CLAYMORE_SPEED_DEFAULT_WAVE;
Wave.direction = MODE_DIRECTION_LEFT;
Wave.color_mode = MODE_COLORS_NONE;
modes.push_back(Wave);
mode Color_Wave;
Color_Wave.name = "Color Wave";
Color_Wave.value = AURA_KEYBOARD_MODE_WAVE;
Color_Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
Color_Wave.speed_min = AURA_CLAYMORE_SPEED_MIN;
Color_Wave.speed_max = AURA_CLAYMORE_SPEED_MAX;
Color_Wave.speed = AURA_CLAYMORE_SPEED_DEFAULT_WAVE;
Color_Wave.direction = MODE_DIRECTION_LEFT;
Color_Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
Color_Wave.colors_min = 1;
Color_Wave.colors_max = 2;
Color_Wave.colors.resize(2);
modes.push_back(Color_Wave);
mode Ripple;
Ripple.name = "Ripple";
Ripple.value = AURA_KEYBOARD_MODE_RIPPLE;
Ripple.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Ripple.speed_min = AURA_CLAYMORE_SPEED_MIN;
Ripple.speed_max = AURA_CLAYMORE_SPEED_MAX;
Ripple.speed = AURA_CLAYMORE_SPEED_DEFAULT_RIPPLE;
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
Ripple.colors_min = 1;
Ripple.colors_max = 2;
Ripple.colors.resize(2);
modes.push_back(Ripple);
mode Starry_Night;
Starry_Night.name = "Starry Night";
Starry_Night.value = AURA_KEYBOARD_MODE_STARRY_NIGHT;
Starry_Night.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Starry_Night.speed_min = AURA_CLAYMORE_SPEED_MIN;
Starry_Night.speed_max = AURA_CLAYMORE_SPEED_MAX;
Starry_Night.speed = AURA_CLAYMORE_SPEED_DEFAULT_STARRY_NIGHT;
Starry_Night.color_mode = MODE_COLORS_MODE_SPECIFIC;
Starry_Night.colors_min = 1;
Starry_Night.colors_max = 2;
Starry_Night.colors.resize(2);
modes.push_back(Starry_Night);
mode Quicksand;
Quicksand.name = "Quicksand";
Quicksand.value = AURA_KEYBOARD_MODE_QUICKSAND;
Quicksand.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Quicksand.direction = MODE_DIRECTION_DOWN;
Quicksand.speed_min = AURA_CLAYMORE_SPEED_MIN;
Quicksand.speed_max = AURA_CLAYMORE_SPEED_MAX;
Quicksand.speed = AURA_CLAYMORE_SPEED_DEFAULT_QUICKSAND;
Quicksand.color_mode = MODE_COLORS_MODE_SPECIFIC;
Quicksand.colors_min = 6;
Quicksand.colors_max = 6;
Quicksand.colors.resize(6);
modes.push_back(Quicksand);
}
SetupZones();
}
RGBController_AuraTUFKeyboard::~RGBController_AuraTUFKeyboard()
{
delete aura;
delete controller;
}
void RGBController_AuraTUFKeyboard::SetupZones()
{
int layout = aura->GetLayout();
unsigned char layout = controller->GetLayout();
if(AsusTUFK7Layouts.find(layout % 100) == AsusTUFK7Layouts.end())
std::map<int,layout_info> * keyboard_ptr;
switch(pid)
{
case AURA_TUF_K7_GAMING_PID:
keyboard_ptr = &AsusTUFK7Layouts;
break;
case AURA_ROG_FALCHION_WIRED_PID:
case AURA_ROG_FALCHION_WIRELESS_PID:
keyboard_ptr = &AsusFalchionLayouts;
break;
case AURA_ROG_CLAYMORE_PID:
unsigned char numpad;
numpad = controller->GetNumpadLocation();
switch(numpad)
{
case 0:
keyboard_ptr = &AsusClaymoreNoNumpadLayouts;
break;
case 2:
keyboard_ptr = &AsusClaymoreNumpadRightLayouts;
break;
case 3:
keyboard_ptr = &AsusClaymoreNumpadLeftLayouts;
break;
default:
keyboard_ptr = &AsusClaymoreNoNumpadLayouts;
}
break;
default:
keyboard_ptr = &AsusTUFK7Layouts;
}
std::map<int,layout_info> & keyboard = *keyboard_ptr;
if(keyboard.find(layout % 100) == keyboard.end())
{
/*---------------------------------------------------------*\
| If Layout not found, take uk or us |
\*---------------------------------------------------------*/
layout = std::floor(layout/100) == 2 ? ASUS_TUF_K7_LAYOUT_UK : ASUS_TUF_K7_LAYOUT_US;
}
else
@@ -207,33 +392,32 @@ void RGBController_AuraTUFKeyboard::SetupZones()
layout = layout % 100;
}
unsigned int total_led_count = 0;
zone keyboard_zone;
keyboard_zone.name = "Keyboard";
keyboard_zone.type = ZONE_TYPE_MATRIX;
keyboard_zone.leds_min = keyboard[layout].size;
keyboard_zone.leds_max = keyboard[layout].size;
keyboard_zone.leds_count = keyboard[layout].size;
keyboard_zone.matrix_map = new matrix_map_type;
keyboard_zone.matrix_map->height = keyboard[layout].rows;
keyboard_zone.matrix_map->width = keyboard[layout].cols;
keyboard_zone.matrix_map->map = keyboard[layout].matrix_map;
zones.push_back(keyboard_zone);
int zone_size = 138;
zone keyboard;
keyboard.name = "Keyboard";
keyboard.type = ZONE_TYPE_MATRIX;
keyboard.leds_min = zone_size;
keyboard.leds_max = zone_size;
keyboard.leds_count = zone_size;
keyboard.matrix_map = new matrix_map_type;
keyboard.matrix_map->height = 6;
keyboard.matrix_map->width = 23;
keyboard.matrix_map->map = AsusTUFK7Layouts[layout].matrix_map;
zones.push_back(keyboard);
total_led_count += zone_size;
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
for(int led_id = 0; led_id < keyboard[layout].size; led_id++)
{
led new_led;
new_led.name = AsusTUFK7Layouts[layout].led_names[led_idx];
new_led.name = keyboard[layout].led_names[led_id].name;
new_led.value = keyboard[layout].led_names[led_id].id;
leds.push_back(new_led);
}
SetupColors();
/*---------------------------------------------------------*\
| sends the init packet for the default mode (direct) |
\*---------------------------------------------------------*/
DeviceUpdateMode();
}
void RGBController_AuraTUFKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
@@ -243,12 +427,19 @@ void RGBController_AuraTUFKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_AuraTUFKeyboard::DeviceUpdateLEDs()
{
DeviceUpdateMode();
std::vector<led_color> led_color_list = {};
for(int i = 0; i < colors.size(); i++)
{
led_color_list.push_back({ leds[i].value, colors[i] });
}
controller->UpdateLeds(led_color_list);
}
void RGBController_AuraTUFKeyboard::UpdateZoneLEDs(int /*zone*/)
{
aura->UpdateLeds(colors);
DeviceUpdateLEDs();
}
void RGBController_AuraTUFKeyboard::UpdateSingleLED(int led)
@@ -256,77 +447,101 @@ void RGBController_AuraTUFKeyboard::UpdateSingleLED(int led)
unsigned char red = RGBGetRValue(colors[led]);
unsigned char green = RGBGetGValue(colors[led]);
unsigned char blue = RGBGetBValue(colors[led]);
aura->UpdateSingleLed(led, red, green, blue);
controller->UpdateSingleLed(leds[led].value, red, green, blue);
}
void RGBController_AuraTUFKeyboard::SetCustomMode()
static const uint8_t direction_map[2][6] =
{
active_mode = 0;
}
{ 4, 0, 6, 2, 8, 1 }, // Default directions Left, Right, Up, Down, Horizontal, Vertical
{ 0, 4, 6, 2, 0xFF, 0xFF }, // AURA_ROG_CLAYMORE directions Left, Right, Up, Down
};
void RGBController_AuraTUFKeyboard::DeviceUpdateMode()
{
unsigned char color_mode;
std::vector<RGBColor> mode_colors;
{
if(pid == AURA_ROG_CLAYMORE_PID)
{
controller->AllowRemoteControl(1);
}
unsigned char color_mode = 0;
unsigned char direction = 0;
unsigned char brightness = 0;
if(modes[active_mode].value == AURA_KEYBOARD_MODE_DIRECT)
{
aura->UpdateLeds(colors);
if(pid == AURA_ROG_CLAYMORE_PID) controller->AllowRemoteControl(3);
return;
};
if(pid != AURA_ROG_CLAYMORE_PID)
{
brightness = modes[active_mode].brightness * 25;
switch(modes[active_mode].value)
{
case AURA_KEYBOARD_MODE_BREATHING:
case AURA_KEYBOARD_MODE_REACTIVE:
case AURA_KEYBOARD_MODE_STARRY_NIGHT:
case AURA_KEYBOARD_MODE_CURRENT:
case AURA_KEYBOARD_MODE_RAIN_DROP:
bool color_is_black = (modes[active_mode].colors.size() > 1 && modes[active_mode].colors[1] == 000);
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC && !color_is_black)
{
color_mode = 16;
}
break;
}
if(modes[active_mode].color_mode == MODE_COLORS_RANDOM)
{
color_mode = 1;
}
if(modes[active_mode].value == AURA_KEYBOARD_MODE_WAVE)
{
/*----------------------------------------------------------*\
| converting openrgb direction value to keyboard directions |
\*----------------------------------------------------------*/
direction = direction_map[0][modes[active_mode].direction];
}
}
else
{
bool mode_with_double = (modes[active_mode].value == 1 || modes[active_mode].value == 3 || modes[active_mode].value == 6 || modes[active_mode].value == 8 || modes[active_mode].value == 9);
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC && mode_with_double && modes[active_mode].colors.size() > 1)
if(modes[active_mode].color_mode == MODE_COLORS_RANDOM)
{
if(modes[active_mode].colors[1] == 000)
{
color_mode = 0;
}
else
{
color_mode = 16;
}
}
else
{
color_mode = modes[active_mode].color_mode == MODE_COLORS_RANDOM ? 1 : 0;
color_mode = 1;
}
int direction = 0;
if(modes[active_mode].value == AURA_KEYBOARD_MODE_WAVE) {
if (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC) color_mode = 2;
switch (modes[active_mode].direction)
{
case MODE_DIRECTION_LEFT:
direction = 0;
break;
case MODE_DIRECTION_RIGHT:
direction = 4;
break;
case MODE_DIRECTION_UP:
direction = 6;
break;
case MODE_DIRECTION_DOWN:
direction = 2;
break;
case MODE_DIRECTION_HORIZONTAL:
direction = 8;
break;
case MODE_DIRECTION_VERTICAL:
direction = 1;
break;
/*----------------------------------------------------------*\
| converting openrgb direction value to keyboard directions |
\*----------------------------------------------------------*/
direction = direction_map[1][modes[active_mode].direction];
}
}
mode_colors = modes[active_mode].color_mode == MODE_COLORS_PER_LED ? std::vector<RGBColor>(colors) : std::vector<RGBColor>(modes[active_mode].colors);
controller->UpdateDevice(modes[active_mode].value, std::vector<RGBColor>(modes[active_mode].colors), direction, color_mode, modes[active_mode].speed, brightness);
aura->UpdateDevice(modes[active_mode].value, mode_colors, direction, color_mode, (15 - modes[active_mode].speed), modes[active_mode].brightness * 25);
if(pid == AURA_ROG_CLAYMORE_PID)
{
controller->UpdateMode(modes[active_mode].value);
controller->SaveMode();
controller->AllowRemoteControl(0);
}
}
void RGBController_AuraTUFKeyboard::DeviceSaveMode()
{
aura->ClearResponses();
DeviceUpdateMode();
aura->AwaitResponse();
aura->SaveMode();
/*----------------------------------------------------------*\
| not available for Claymore |
\*----------------------------------------------------------*/
if(pid != AURA_ROG_CLAYMORE_PID)
{
DeviceUpdateMode();
controller->SaveMode();
}
}
@@ -13,18 +13,32 @@
enum
{
AURA_KEYBOARD_SPEED_MIN = 0,
AURA_KEYBOARD_SPEED_MAX = 15,
AURA_KEYBOARD_SPEED_DEFAULT = 8,
AURA_KEYBOARD_BRIGHTNESS_MIN = 0,
AURA_KEYBOARD_BRIGHTNESS_MAX = 4,
AURA_KEYBOARD_BRIGHTNESS_DEFAULT = 4
AURA_KEYBOARD_SPEED_MAX = 0,
AURA_KEYBOARD_SPEED_DEFAULT = 8,
AURA_KEYBOARD_BRIGHTNESS_MIN = 0,
AURA_KEYBOARD_BRIGHTNESS_MAX = 4,
AURA_KEYBOARD_BRIGHTNESS_DEFAULT = 4,
};
enum
{
AURA_CLAYMORE_SPEED_MIN = 254,
AURA_CLAYMORE_SPEED_MAX = 0,
AURA_CLAYMORE_SPEED_DEFAULT_STATIC = 0,
AURA_CLAYMORE_SPEED_DEFAULT_BREATHING = 107,
AURA_CLAYMORE_SPEED_DEFAULT_COLOR_CYCLE = 121,
AURA_CLAYMORE_SPEED_DEFAULT_REACTIVE = 56,
AURA_CLAYMORE_SPEED_DEFAULT_WAVE = 50,
AURA_CLAYMORE_SPEED_DEFAULT_RIPPLE = 108,
AURA_CLAYMORE_SPEED_DEFAULT_STARRY_NIGHT = 54,
AURA_CLAYMORE_SPEED_DEFAULT_QUICKSAND = 103,
};
class RGBController_AuraTUFKeyboard : public RGBController
{
public:
RGBController_AuraTUFKeyboard(AuraTUFKeyboardController* aura_ptr);
RGBController_AuraTUFKeyboard(AuraTUFKeyboardController* controller_ptr);
~RGBController_AuraTUFKeyboard();
void SetupZones();
@@ -35,10 +49,10 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AuraTUFKeyboardController* aura;
AuraTUFKeyboardController* controller;
uint16_t pid;
};
@@ -1,264 +1,273 @@
/*-----------------------------------------*\
| RGBController_AsusAuraUSB.cpp |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Adam Honse (CalcProgrammer1) 1/18/2020 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraUSB.h"
RGBController_AuraUSB::RGBController_AuraUSB(AuraUSBController* aura_ptr) :
initializedMode(false)
{
aura = aura_ptr;
name = "ASUS Aura USB";
vendor = "ASUS";
version = aura->GetDeviceName();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASUS Aura USB Device";
location = aura->GetDeviceLocation();
serial = aura->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Off;
Off.name = "Off";
Off.value = AURA_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = AURA_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.colors.resize(1);
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 1;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.colors.resize(1);
modes.push_back(Breathing);
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = AURA_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Flashing.colors.resize(1);
modes.push_back(Flashing);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = AURA_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = 0;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = AURA_MODE_RAINBOW;
Rainbow.flags = 0;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
mode ChaseFade;
ChaseFade.name = "Chase Fade";
ChaseFade.value = AURA_MODE_CHASE_FADE;
ChaseFade.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
ChaseFade.colors_min = 1;
ChaseFade.colors_max = 1;
ChaseFade.color_mode = MODE_COLORS_MODE_SPECIFIC;
ChaseFade.colors.resize(1);
modes.push_back(ChaseFade);
mode Chase;
Chase.name = "Chase";
Chase.value = AURA_MODE_CHASE;
Chase.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Chase.colors_min = 1;
Chase.colors_max = 1;
Chase.color_mode = MODE_COLORS_MODE_SPECIFIC;
Chase.colors.resize(1);
modes.push_back(Chase);
SetupZones();
}
RGBController_AuraUSB::~RGBController_AuraUSB()
{
delete aura;
}
void RGBController_AuraUSB::SetupZones()
{
/*-------------------------------------------------*\
| Only set LED count on the first run |
\*-------------------------------------------------*/
bool first_run = false;
if(zones.size() == 0)
{
first_run = true;
}
/*-------------------------------------------------*\
| Clear any existing color/LED configuration |
\*-------------------------------------------------*/
leds.clear();
colors.clear();
zones.resize(aura->GetChannelCount());
/*-------------------------------------------------*\
| Set zones and leds |
\*-------------------------------------------------*/
int addressableCounter = 1;
for (unsigned int channel_idx = 0; channel_idx < zones.size(); channel_idx++)
{
AuraDeviceInfo device_info = aura->GetAuraDevices()[channel_idx];
zones[channel_idx].type = ZONE_TYPE_LINEAR;
if(device_info.device_type == AuraDeviceType::FIXED)
{
zones[channel_idx].name = "Aura Mainboard";
zones[channel_idx].leds_min = device_info.num_leds;
zones[channel_idx].leds_max = device_info.num_leds;
zones[channel_idx].leds_count = device_info.num_leds;
}
else
{
zones[channel_idx].name = "Aura Addressable ";
zones[channel_idx].name.append(std::to_string(addressableCounter));
zones[channel_idx].leds_min = 0;
zones[channel_idx].leds_max = AURA_ADDRESSABLE_MAX_LEDS;
addressableCounter++;
if(first_run)
{
zones[channel_idx].leds_count = 0;
}
}
unsigned int num_mainboard_leds = device_info.num_leds - device_info.num_headers;
for (unsigned int led_ch_idx = 0; led_ch_idx < zones[channel_idx].leds_count; led_ch_idx++)
{
unsigned led_idx = led_ch_idx + 1;
led new_led;
new_led.name = zones[channel_idx].name;
if(device_info.device_type == AuraDeviceType::FIXED && led_ch_idx >= num_mainboard_leds)
{
new_led.name.append(", RGB Header ");
led_idx -= num_mainboard_leds;
}
else
{
new_led.name.append(", LED ");
}
new_led.name.append(std::to_string(led_idx));
new_led.value = channel_idx;
leds.push_back(new_led);
}
zones[channel_idx].matrix_map = NULL;
}
SetupColors();
}
void RGBController_AuraUSB::ResizeZone(int zone, int new_size)
{
if((size_t) zone >= zones.size())
{
return;
}
if(((unsigned int)new_size >= zones[zone].leds_min) && ((unsigned int)new_size <= zones[zone].leds_max))
{
zones[zone].leds_count = new_size;
SetupZones();
}
}
void RGBController_AuraUSB::DeviceUpdateLEDs()
{
if(!initializedMode)
{
DeviceUpdateMode();
}
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
aura->SetChannelLEDs(zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count);
}
}
void RGBController_AuraUSB::UpdateZoneLEDs(int zone)
{
if(!initializedMode)
{
DeviceUpdateMode();
}
aura->SetChannelLEDs(zone, zones[zone].colors, zones[zone].leds_count);
}
void RGBController_AuraUSB::UpdateSingleLED(int led)
{
if(!initializedMode)
{
DeviceUpdateMode();
}
unsigned int channel = leds[led].value;
aura->SetChannelLEDs(channel, zones[channel].colors, zones[channel].leds_count);
}
void RGBController_AuraUSB::SetCustomMode()
{
}
void RGBController_AuraUSB::DeviceUpdateMode()
{
initializedMode = true;
unsigned char red = 0;
unsigned char grn = 0;
unsigned char blu = 0;
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
red = RGBGetRValue(modes[active_mode].colors[0]);
grn = RGBGetGValue(modes[active_mode].colors[0]);
blu = RGBGetBValue(modes[active_mode].colors[0]);
}
for(unsigned int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
if(zones[zone_idx].leds_count > 0)
{
aura->SetMode(zone_idx, modes[active_mode].value, red, grn, blu);
}
}
}
/*-----------------------------------------*\
| RGBController_AsusAuraUSB.cpp |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Adam Honse (CalcProgrammer1) 1/18/2020 |
\*-----------------------------------------*/
#include "RGBController_AsusAuraUSB.h"
/**------------------------------------------------------------------*\
@name Asus Aura USB
@category Motherboard
@type USB
@save :x:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBTerminal,DetectAsusAuraUSBAddressable,DetectAsusAuraUSBMotherboards
@comment The Asus Aura USB controller applies to most AMD and
Intel mainboards from the x470 and z390 chipsets onwards.
\*-------------------------------------------------------------------*/
RGBController_AuraUSB::RGBController_AuraUSB(AuraUSBController* controller_ptr) :
initializedMode(false)
{
controller = controller_ptr;
name = "ASUS Aura USB";
vendor = "ASUS";
version = controller->GetDeviceName();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASUS Aura USB Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = AURA_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Off;
Off.name = "Off";
Off.value = AURA_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
mode Static;
Static.name = "Static";
Static.value = AURA_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
Static.colors.resize(1);
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = AURA_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 1;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.colors.resize(1);
modes.push_back(Breathing);
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = AURA_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Flashing.colors.resize(1);
modes.push_back(Flashing);
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = AURA_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = 0;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = AURA_MODE_RAINBOW;
Rainbow.flags = 0;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
mode ChaseFade;
ChaseFade.name = "Chase Fade";
ChaseFade.value = AURA_MODE_CHASE_FADE;
ChaseFade.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
ChaseFade.colors_min = 1;
ChaseFade.colors_max = 1;
ChaseFade.color_mode = MODE_COLORS_MODE_SPECIFIC;
ChaseFade.colors.resize(1);
modes.push_back(ChaseFade);
mode Chase;
Chase.name = "Chase";
Chase.value = AURA_MODE_CHASE;
Chase.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Chase.colors_min = 1;
Chase.colors_max = 1;
Chase.color_mode = MODE_COLORS_MODE_SPECIFIC;
Chase.colors.resize(1);
modes.push_back(Chase);
SetupZones();
}
RGBController_AuraUSB::~RGBController_AuraUSB()
{
delete controller;
}
void RGBController_AuraUSB::SetupZones()
{
/*-------------------------------------------------*\
| Only set LED count on the first run |
\*-------------------------------------------------*/
bool first_run = false;
if(zones.size() == 0)
{
first_run = true;
}
/*-------------------------------------------------*\
| Clear any existing color/LED configuration |
\*-------------------------------------------------*/
leds.clear();
colors.clear();
zones.resize(controller->GetChannelCount());
/*-------------------------------------------------*\
| Set zones and leds |
\*-------------------------------------------------*/
int addressableCounter = 1;
for (unsigned int channel_idx = 0; channel_idx < zones.size(); channel_idx++)
{
AuraDeviceInfo device_info = controller->GetAuraDevices()[channel_idx];
zones[channel_idx].type = ZONE_TYPE_LINEAR;
if(device_info.device_type == AuraDeviceType::FIXED)
{
zones[channel_idx].name = "Aura Mainboard";
zones[channel_idx].leds_min = device_info.num_leds;
zones[channel_idx].leds_max = device_info.num_leds;
zones[channel_idx].leds_count = device_info.num_leds;
}
else
{
zones[channel_idx].name = "Aura Addressable ";
zones[channel_idx].name.append(std::to_string(addressableCounter));
zones[channel_idx].leds_min = 0;
zones[channel_idx].leds_max = AURA_ADDRESSABLE_MAX_LEDS;
addressableCounter++;
if(first_run)
{
zones[channel_idx].leds_count = 0;
}
}
unsigned int num_mainboard_leds = device_info.num_leds - device_info.num_headers;
for (unsigned int led_ch_idx = 0; led_ch_idx < zones[channel_idx].leds_count; led_ch_idx++)
{
unsigned led_idx = led_ch_idx + 1;
led new_led;
new_led.name = zones[channel_idx].name;
if(device_info.device_type == AuraDeviceType::FIXED && led_ch_idx >= num_mainboard_leds)
{
new_led.name.append(", RGB Header ");
led_idx -= num_mainboard_leds;
}
else
{
new_led.name.append(", LED ");
}
new_led.name.append(std::to_string(led_idx));
new_led.value = channel_idx;
leds.push_back(new_led);
}
zones[channel_idx].matrix_map = NULL;
}
SetupColors();
}
void RGBController_AuraUSB::ResizeZone(int zone, int new_size)
{
if((size_t) zone >= zones.size())
{
return;
}
if(((unsigned int)new_size >= zones[zone].leds_min) && ((unsigned int)new_size <= zones[zone].leds_max))
{
zones[zone].leds_count = new_size;
SetupZones();
}
}
void RGBController_AuraUSB::DeviceUpdateLEDs()
{
if(!initializedMode)
{
DeviceUpdateMode();
}
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
controller->SetChannelLEDs(zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count);
}
}
void RGBController_AuraUSB::UpdateZoneLEDs(int zone)
{
if(!initializedMode)
{
DeviceUpdateMode();
}
controller->SetChannelLEDs(zone, zones[zone].colors, zones[zone].leds_count);
}
void RGBController_AuraUSB::UpdateSingleLED(int led)
{
if(!initializedMode)
{
DeviceUpdateMode();
}
unsigned int channel = leds[led].value;
controller->SetChannelLEDs(channel, zones[channel].colors, zones[channel].leds_count);
}
void RGBController_AuraUSB::DeviceUpdateMode()
{
initializedMode = true;
unsigned char red = 0;
unsigned char grn = 0;
unsigned char blu = 0;
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
red = RGBGetRValue(modes[active_mode].colors[0]);
grn = RGBGetGValue(modes[active_mode].colors[0]);
blu = RGBGetBValue(modes[active_mode].colors[0]);
}
for(unsigned int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
if(zones[zone_idx].leds_count > 0)
{
controller->SetMode(zone_idx, modes[active_mode].value, red, grn, blu);
}
}
}
@@ -1,38 +1,37 @@
/*-----------------------------------------*\
| RGBController_AsusAuraUSB.h |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Adam Honse (CalcProgrammer1) 1/18/2020 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraUSBController.h"
#define AURA_ADDRESSABLE_MAX_LEDS 120
class RGBController_AuraUSB : public RGBController
{
public:
RGBController_AuraUSB(AuraUSBController* aura_ptr);
~RGBController_AuraUSB();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
AuraUSBController* aura;
std::vector<unsigned int> leds_channel;
std::vector<unsigned int> zones_channel;
bool initializedMode;
};
/*-----------------------------------------*\
| RGBController_AsusAuraUSB.h |
| |
| Generic RGB Interface for Asus Aura |
| USB controller driver |
| |
| Adam Honse (CalcProgrammer1) 1/18/2020 |
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "AsusAuraUSBController.h"
#define AURA_ADDRESSABLE_MAX_LEDS 120
class RGBController_AuraUSB : public RGBController
{
public:
RGBController_AuraUSB(AuraUSBController* controller_ptr);
~RGBController_AuraUSB();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
AuraUSBController* controller;
std::vector<unsigned int> leds_channel;
std::vector<unsigned int> zones_channel;
bool initializedMode;
};
@@ -0,0 +1,220 @@
/*-------------------------------------------------------------------*\
| RGBController_ROGStrixLC_Controller.cpp |
| |
| Driver for the ASUS Aura Liquid Cooler (LC) series |
| of lighting controllers |
| |
| Chris M (Dr_No) 17 Jan 2022 |
| |
\*-------------------------------------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_ROGStrixLC_Controller.h"
/**------------------------------------------------------------------*\
@name Asus ROG Strix Liquid Cooler
@category Cooler
@type USB
@save :x:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusAuraUSBROGStrixLC
@comment
\*-------------------------------------------------------------------*/
RGBController_ROGStrixLC_Controller::RGBController_ROGStrixLC_Controller(ROGStrixLC_Controller *controller_ptr)
{
controller = controller_ptr;
uint8_t speed = ROGSTRIXLC_CONTROLLER_SPEED_NORMAL;
name = "ROG Strix LC";
vendor = "ASUS";
type = DEVICE_TYPE_COOLER;
description = "ASUS Liquid Cooler including 120mm, 140mm, 240mm, 280mm and 360mm radiators.";
version = KEY_EN_UNUSED;
serial = KEY_EN_UNUSED;
location = controller->GetLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = ROGSTRIXLC_CONTROLLER_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
Static.value = ROGSTRIXLC_CONTROLLER_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
Static.colors.resize(Static.colors_max);
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = ROGSTRIXLC_CONTROLLER_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 1;
Breathing.colors.resize(Breathing.colors_max);
Breathing.brightness_min = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MIN;
Breathing.brightness_max = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Breathing.brightness = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Breathing.speed_min = ROGSTRIXLC_CONTROLLER_SPEED_SLOWEST;
Breathing.speed_max = ROGSTRIXLC_CONTROLLER_SPEED_FASTEST;
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Breathing.speed = speed;
modes.push_back(Breathing);
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = ROGSTRIXLC_CONTROLLER_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
Flashing.colors.resize(Flashing.colors_max);
Flashing.brightness_min = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MIN;
Flashing.brightness_max = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Flashing.brightness = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Flashing.speed_min = ROGSTRIXLC_CONTROLLER_SPEED_SLOWEST;
Flashing.speed_max = ROGSTRIXLC_CONTROLLER_SPEED_FASTEST;
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
Flashing.speed = speed;
modes.push_back(Flashing);
mode Spectrum;
Spectrum.name = "Spectrum";
Spectrum.value = ROGSTRIXLC_CONTROLLER_MODE_SPECTRUM;
Spectrum.flags = MODE_FLAG_HAS_SPEED;
Spectrum.brightness_min = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MIN;
Spectrum.brightness_max = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Spectrum.brightness = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Spectrum.speed_min = ROGSTRIXLC_CONTROLLER_SPEED_SLOWEST;
Spectrum.speed_max = ROGSTRIXLC_CONTROLLER_SPEED_FASTEST;
Spectrum.color_mode = MODE_COLORS_NONE;
Spectrum.speed = speed;
modes.push_back(Spectrum);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = ROGSTRIXLC_CONTROLLER_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
Rainbow.brightness_min = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MIN;
Rainbow.brightness_max = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Rainbow.brightness = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
Rainbow.speed_min = ROGSTRIXLC_CONTROLLER_SPEED_SLOWEST;
Rainbow.speed_max = ROGSTRIXLC_CONTROLLER_SPEED_FASTEST;
Rainbow.color_mode = MODE_COLORS_NONE;
Rainbow.speed = speed;
modes.push_back(Rainbow);
mode FlashAndDash;
FlashAndDash.name = "Flash and Dash";
FlashAndDash.value = ROGSTRIXLC_CONTROLLER_MODE_FLASHANDDASH;
FlashAndDash.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
FlashAndDash.brightness_min = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MIN;
FlashAndDash.brightness_max = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
FlashAndDash.brightness = ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX;
FlashAndDash.speed_min = ROGSTRIXLC_CONTROLLER_SPEED_SLOWEST;
FlashAndDash.speed_max = ROGSTRIXLC_CONTROLLER_SPEED_FASTEST;
FlashAndDash.color_mode = MODE_COLORS_NONE;
FlashAndDash.speed = speed;
modes.push_back(FlashAndDash);
SetupZones();
}
RGBController_ROGStrixLC_Controller::~RGBController_ROGStrixLC_Controller()
{
delete controller;
}
void RGBController_ROGStrixLC_Controller::SetupZones()
{
/*-------------------------------------------------*\
| Set up zones |
\*-------------------------------------------------*/
LOG_DEBUG("[%s] - Get channel count: %i", name.c_str(), controller->GetChannelCount());
zones.resize(controller->GetChannelCount());
LOG_DEBUG("[%s] - Creating Zones and LEDs", name.c_str());
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
AuraDeviceInfo device_info = controller->GetAuraDevices()[zone_idx];
LOG_INFO("[%s] %s Zone %i - Header Count %i LED Count %i FX %02X Direct %02X", name.c_str(),
((device_info.device_type == AuraDeviceType::FIXED) ? "Fixed" : "Addressable"),
zone_idx, device_info.num_headers, device_info.num_leds, device_info.effect_channel, device_info.direct_channel);
zones[zone_idx].name = name + " Zone ";
zones[zone_idx].name.append(std::to_string(zone_idx));
zones[zone_idx].type = ZONE_TYPE_LINEAR;
zones[zone_idx].leds_min = device_info.num_leds;
zones[zone_idx].leds_max = device_info.num_leds;
zones[zone_idx].leds_count = device_info.num_leds;
for(unsigned int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
{
led new_led;
new_led.name = zones[zone_idx].name;
new_led.name.append(" LED " + std::to_string(lp_idx));
new_led.value = lp_idx;
leds.push_back(new_led);
}
}
LOG_DEBUG("[%s] - Device zones and LEDs set", name.c_str());
SetupColors();
}
void RGBController_ROGStrixLC_Controller::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_ROGStrixLC_Controller::DeviceUpdateLEDs()
{
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
UpdateZoneLEDs(zone_idx);
}
}
void RGBController_ROGStrixLC_Controller::UpdateZoneLEDs(int zone)
{
controller->SetLedsDirect( zones[zone].colors, zones[zone].leds_count );
}
void RGBController_ROGStrixLC_Controller::UpdateSingleLED(int led)
{
UpdateZoneLEDs(GetLED_Zone(led));
}
void RGBController_ROGStrixLC_Controller::DeviceUpdateMode()
{
RGBColor colour = (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC) ? modes[active_mode].colors[0] : 0;
controller->SetMode( modes[active_mode].value, modes[active_mode].speed, modes[active_mode].direction, colour );
}
int RGBController_ROGStrixLC_Controller::GetLED_Zone(int led_idx)
{
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
int zone_start = zones[zone_idx].start_idx;
int zone_end = zone_start + zones[zone_idx].leds_count - 1;
if( zone_start <= led_idx && zone_end >= led_idx)
{
return(zone_idx);
}
}
return -1;
}
@@ -0,0 +1,36 @@
/*-------------------------------------------------------------------*\
| RGBController_ROGStrixLC_Controller.h |
| |
| Driver for the ASUS Aura Liquid Cooler (LC) series |
| of lighting controllers |
| |
| Chris M (Dr_No) 17 Jan 2022 |
| |
\*-------------------------------------------------------------------*/
#pragma once
#include "LogManager.h"
#include "RGBController.h"
#include "ROGStrixLC_Controller.h"
#include <vector>
class RGBController_ROGStrixLC_Controller : public RGBController
{
public:
RGBController_ROGStrixLC_Controller(ROGStrixLC_Controller* controller_ptr);
~RGBController_ROGStrixLC_Controller();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
int GetDeviceMode();
int GetLED_Zone(int led_idx);
ROGStrixLC_Controller* controller;
};
@@ -0,0 +1,127 @@
/*-------------------------------------------------------------------*\
| ROGStrixLC_Controller.cpp |
| |
| Driver for the ASUS Aura Liquid Cooler (LC) series |
| of lighting controllers |
| |
| Chris M (Dr_No) 17 Jan 2022 |
| |
\*-------------------------------------------------------------------*/
#include "ROGStrixLC_Controller.h"
ROGStrixLC_Controller::ROGStrixLC_Controller(hid_device* dev_handle, const char* path) : AuraUSBController(dev_handle, path)
{
/*-----------------------------------------------------*\
| Add addressable devices |
| Manually adding device info for now |
| TODO: Implement config table accurately |
| LC120 - 1F FF 05 05 04 00 00 00 |
\*-----------------------------------------------------*/
device_info.push_back({0x00, 0x00, 4, 0, AuraDeviceType::FIXED});
}
ROGStrixLC_Controller::~ROGStrixLC_Controller()
{
hid_close(dev);
}
std::string ROGStrixLC_Controller::GetLocation()
{
return("HID: " + location);
}
void ROGStrixLC_Controller::SetMode(unsigned char /*channel*/, unsigned char /*mode*/, unsigned char /*red*/, unsigned char /*grn*/, unsigned char /*blu*/)
{
/*---------------------------------------------------------*\
| This interface is not used in this controller however is |
| required by the abstract class |
\*---------------------------------------------------------*/
}
void ROGStrixLC_Controller::SetMode(unsigned char mode, unsigned char speed, unsigned char direction, RGBColor colour)
{
bool needs_update = !( (current_mode == mode) && (ToRGBColor(current_red, current_green, current_blue) == colour) && (current_speed == speed) && (current_direction == direction));
if (needs_update)
{
current_mode = mode;
current_speed = speed;
current_direction = direction;
current_red = RGBGetRValue(colour);
current_green = RGBGetGValue(colour);
current_blue = RGBGetBValue(colour);
SendUpdate();
}
}
void ROGStrixLC_Controller::SetChannelLEDs(unsigned char /*channel*/, RGBColor* /*colors*/, unsigned int /*num_colors*/)
{
/*---------------------------------------------------------*\
| This interface is not used in this controller however is |
| required by the abstract class |
\*---------------------------------------------------------*/
}
void ROGStrixLC_Controller::SetLedsDirect(RGBColor * led_colours, uint8_t led_count)
{
uint8_t buffer[write_packet_size] = { 0xEC, 0x40, 0x00, 0xFF, led_count };
/*---------------------------------------------------------*\
| Set the colour bytes in the packet |
\*---------------------------------------------------------*/
for(uint8_t index = 0; index < led_count; index++)
{
uint8_t offset = (index * 3) + ROGSTRIXLC_GREEN_BYTE;
buffer[offset + 0] = RGBGetRValue(led_colours[index]);
buffer[offset + 1] = RGBGetGValue(led_colours[index]);
buffer[offset + 2] = RGBGetBValue(led_colours[index]);
}
/*---------------------------------------------------------*\
| These 3 bytes might be timing bytes |
\*---------------------------------------------------------*/
uint8_t offset = led_count * 3 + ROGSTRIXLC_GREEN_BYTE;
buffer[offset + 0] = 0x77;
buffer[offset + 1] = 0x10;
buffer[offset + 2] = 0xF3;
hid_write(dev, buffer, write_packet_size);
}
void ROGStrixLC_Controller::GetStatus()
{
uint8_t buffer[write_packet_size] = { 0xEC, 0x01, 0x02 };
hid_write(dev, buffer, write_packet_size);
hid_read_timeout(dev, buffer, read_packet_size, ROGSTRIXLC_CONTROLLER_TIMEOUT);
current_red = buffer[ROGSTRIXLC_RED_BYTE - 1];
current_green = buffer[ROGSTRIXLC_GREEN_BYTE - 1];
current_blue = buffer[ROGSTRIXLC_BLUE_BYTE - 1];
}
void ROGStrixLC_Controller::SendUpdate()
{
uint8_t buffer[write_packet_size];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(buffer, 0x00, write_packet_size);
buffer[ROGSTRIXLC_REPORTID_BYTE] = rogstrixlc_reportid;
buffer[ROGSTRIXLC_COMMAND_BYTE] = rogstrixlc_modefx;
buffer[ROGSTRIXLC_ZONE_BYTE] = 0;
buffer[ROGSTRIXLC_MODE_BYTE] = current_mode;
buffer[ROGSTRIXLC_RED_BYTE] = current_red;
buffer[ROGSTRIXLC_GREEN_BYTE] = current_green;
buffer[ROGSTRIXLC_BLUE_BYTE] = current_blue;
buffer[ROGSTRIXLC_DIRECTION_BYTE] = current_direction;
buffer[ROGSTRIXLC_SPEED_BYTE] = current_speed;
hid_write(dev, buffer, write_packet_size);
}
@@ -0,0 +1,92 @@
/*-------------------------------------------------------------------*\
| ROGStrixLC_Controller.h |
| |
| Driver for the ASUS Aura Liquid Cooler (LC) series |
| of lighting controllers |
| |
| Chris M (Dr_No) 17 Jan 2022 |
| |
\*-------------------------------------------------------------------*/
#include <string>
#include <hidapi/hidapi.h>
#include "RGBController.h"
#include "AsusAuraUSBController.h"
#pragma once
#define ROGSTRIXLC_CONTROLLER_TIMEOUT 250
#define HID_MAX_STR 255
#define ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MIN 0
#define ROGSTRIXLC_CONTROLLER_BRIGHTNESS_MAX 255
enum
{
ROGSTRIXLC_CONTROLLER_MODE_DIRECT = 0xFF, //Direct Led Control - Independently set LEDs in zone
ROGSTRIXLC_CONTROLLER_MODE_STATIC = 0x01, //Static Mode - Set entire zone to a single color.
ROGSTRIXLC_CONTROLLER_MODE_BREATHING = 0x02, //Breathing Mode - Fades between fully off and fully on.
ROGSTRIXLC_CONTROLLER_MODE_FLASHING = 0x03, //Flashing Mode - Abruptly changing between fully off and fully on.
ROGSTRIXLC_CONTROLLER_MODE_SPECTRUM = 0x04, //Spectrum Cycle Mode - Cycles through the color spectrum on all lights on the device
ROGSTRIXLC_CONTROLLER_MODE_RAINBOW = 0x05, //Rainbow Wave Mode - Cycle thru the color spectrum as a wave across all LEDs
ROGSTRIXLC_CONTROLLER_MODE_FLASHANDDASH = 0x0A, //Flash n Dash - Flash twice and then flash in direction
};
enum AsusAuraStrixLC_PacketMap
{
ROGSTRIXLC_REPORTID_BYTE = 0,
ROGSTRIXLC_COMMAND_BYTE = 1,
ROGSTRIXLC_ZONE_BYTE = 2,
ROGSTRIXLC_MODE_BYTE = 3,
ROGSTRIXLC_RED_BYTE = 4,
ROGSTRIXLC_GREEN_BYTE = 5,
ROGSTRIXLC_BLUE_BYTE = 6,
ROGSTRIXLC_DIRECTION_BYTE = 7,
ROGSTRIXLC_SPEED_BYTE = 8,
};
enum
{
ROGSTRIXLC_CONTROLLER_SPEED_SLOWEST = 0x04, // Slowest speed
ROGSTRIXLC_CONTROLLER_SPEED_SLOW = 0x03, // Slower speed
ROGSTRIXLC_CONTROLLER_SPEED_NORMAL = 0x02, // Normal speed
ROGSTRIXLC_CONTROLLER_SPEED_FAST = 0x01, // Fast speed
ROGSTRIXLC_CONTROLLER_SPEED_FASTEST = 0x00, // Fastest speed
};
class ROGStrixLC_Controller : public AuraUSBController
{
public:
ROGStrixLC_Controller(hid_device* dev_handle, const char* path);
~ROGStrixLC_Controller();
std::string GetLocation();
void SetChannelLEDs(unsigned char channel, RGBColor *colors, unsigned int num_colors);
void SetLedsDirect(RGBColor * led_colours, uint8_t led_count);
void SetMode(unsigned char channel, unsigned char mode, unsigned char red, unsigned char grn, unsigned char blu);
void SetMode(unsigned char mode, unsigned char speed, unsigned char direction, RGBColor colour);
private:
static const uint8_t read_packet_size = 64;
static const uint8_t write_packet_size = read_packet_size + 1;
static const uint8_t rogstrixlc_modefx = 0x3B;
static const uint8_t rogstrixlc_direct = 0x40;
static const uint8_t rogstrixlc_reportid = 0xEC;
std::string location;
uint8_t zone_index;
uint8_t current_mode;
uint8_t current_speed;
uint8_t current_red;
uint8_t current_green;
uint8_t current_blue;
uint8_t current_direction;
void GetStatus();
void SendUpdate();
void SendEffect(unsigned char channel, unsigned char mode, unsigned char red, unsigned char grn, unsigned char blu);
void SendDirectApply(unsigned char channel);
};
@@ -0,0 +1,198 @@
/*-----------------------------------------*\
| AsusCerberusKeyboardController.cpp |
| |
| Driver for ASUS Cerberus USB lighting |
| controller |
| |
| Mola19 05/28/2022 |
\*-----------------------------------------*/
#include "AsusCerberusKeyboardController.h"
#include <cstring>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#define ASUS_CERBERUS_KB_PACKET_SIZE 8
AsusCerberusKeyboardController::AsusCerberusKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version)
{
dev = dev_handle;
location = path;
version = rev_version;
}
AsusCerberusKeyboardController::~AsusCerberusKeyboardController()
{
hid_close(dev);
}
std::string AsusCerberusKeyboardController::GetDeviceLocation()
{
return("HID: " + location);
}
std::string AsusCerberusKeyboardController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return("");
}
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
return(return_string);
}
std::string AsusCerberusKeyboardController::GetVersion()
{
char versionstr[5];
snprintf(versionstr, 3, "%X", version);
return(std::string(versionstr, 3));
}
void AsusCerberusKeyboardController::SetProfile
(
uint8_t profile
)
{
uint8_t usb_buf[ASUS_CERBERUS_KB_PACKET_SIZE];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x07;
usb_buf[0x01] = 0x03;
usb_buf[0x02] = profile;
hid_send_feature_report(dev, usb_buf, ASUS_CERBERUS_KB_PACKET_SIZE);
}
void AsusCerberusKeyboardController::SetPerLEDColor
(
uint8_t key,
uint8_t red,
uint8_t green,
uint8_t blue
)
{
uint8_t profile = 1;
uint8_t usb_buf[ASUS_CERBERUS_KB_PACKET_SIZE];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x07;
usb_buf[0x01] = 0x0D;
usb_buf[0x02] = profile;
usb_buf[0x03] = key;
usb_buf[0x04] = red;
usb_buf[0x05] = green;
usb_buf[0x06] = blue;
hid_send_feature_report(dev, usb_buf, ASUS_CERBERUS_KB_PACKET_SIZE);
}
void AsusCerberusKeyboardController::SendPerLEDColorEnd()
{
SetPerLEDColor(255, 0, 0, 0);
}
void AsusCerberusKeyboardController::SetPerLEDMode
(
uint8_t mode
)
{
/*------------------------------------------------------------------------------------------------------*\
| this device has 6 different profiles, but there is no way to fetch them from the device, |
| hence this device always sends to the first profile until a better solution is implemented in OpenRGB |
\*------------------------------------------------------------------------------------------------------*/
uint8_t profile = 1;
/*--------------------------------------------------------------------------------*\
| 8 booleans per byte, each boolean controls one key |
| 0 = static, 1 = breathing |
| since openrgb doesn't support per led modes, either all static or all breathing |
\*--------------------------------------------------------------------------------*/
uint8_t modebyte = (mode == 1) ? 0xFF : 0x00;
for(int i = 0; i < 4; i++)
{
uint8_t usb_buf[ASUS_CERBERUS_KB_PACKET_SIZE];
memset(usb_buf, 0x00, sizeof(usb_buf));
usb_buf[0x00] = 0x07;
usb_buf[0x01] = 0x0E;
usb_buf[0x02] = profile;
usb_buf[0x03] = i;
usb_buf[0x04] = modebyte;
usb_buf[0x05] = modebyte;
usb_buf[0x06] = modebyte;
usb_buf[0x07] = modebyte;
hid_send_feature_report(dev, usb_buf, ASUS_CERBERUS_KB_PACKET_SIZE);
}
}
void AsusCerberusKeyboardController::SetMode
(
uint8_t mode,
uint8_t red,
uint8_t green,
uint8_t blue,
uint8_t direction,
uint8_t brightness
)
{
/*------------------------------------------------------------------------------------------------------*\
| this device has 6 different profiles, but there is no way to fetch them from the device, |
| hence this device always sends to the first profile until a better solution is implemented in OpenRGB |
\*------------------------------------------------------------------------------------------------------*/
uint8_t profile = 1;
uint8_t usb_buf_1[ASUS_CERBERUS_KB_PACKET_SIZE];
memset(usb_buf_1, 0x00, sizeof(usb_buf_1));
usb_buf_1[0x00] = 0x07;
usb_buf_1[0x01] = 0x0A;
usb_buf_1[0x02] = profile;
usb_buf_1[0x03] = mode;
usb_buf_1[0x04] = direction;
hid_send_feature_report(dev, usb_buf_1, ASUS_CERBERUS_KB_PACKET_SIZE);
uint8_t usb_buf_2[ASUS_CERBERUS_KB_PACKET_SIZE];
memset(usb_buf_2, 0x00, sizeof(usb_buf_2));
usb_buf_2[0x00] = 0x07;
usb_buf_2[0x01] = 0x0B;
usb_buf_2[0x02] = profile;
usb_buf_2[0x03] = mode;
usb_buf_2[0x04] = red;
usb_buf_2[0x05] = green;
usb_buf_2[0x06] = blue;
hid_send_feature_report(dev, usb_buf_2, ASUS_CERBERUS_KB_PACKET_SIZE);
uint8_t usb_buf_3[ASUS_CERBERUS_KB_PACKET_SIZE];
memset(usb_buf_3, 0x00, sizeof(usb_buf_3));
usb_buf_3[0x00] = 0x07;
usb_buf_3[0x01] = 0x0C;
usb_buf_3[0x02] = profile;
usb_buf_3[0x03] = brightness;
hid_send_feature_report(dev, usb_buf_3, ASUS_CERBERUS_KB_PACKET_SIZE);
}

Some files were not shown because too many files have changed in this diff Show More