Compare commits

..
Author SHA1 Message Date
Adam Honse d274d3276c Test Razer Blade Stealth Late 2020 2022-07-11 22:23:14 -05: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
697 changed files with 75854 additions and 27407 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
+101 -37
View File
@@ -13,7 +13,7 @@
- shared-windows
- windows
- windows-1809
stages:
- build
- test
@@ -27,6 +27,31 @@ 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
exclude:
- README.md
- CONTRIBUTING.md
expire_in: 30 days
rules:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
#-----------------------------------------------------------------------#
# Linux (AppImage) 32-bit Build Target #
#-----------------------------------------------------------------------#
@@ -37,7 +62,7 @@ before_script:
script:
- export $(dpkg-architecture)
- ./scripts/build-appimage.sh
artifacts:
name: "${CI_PROJECT_NAME}_Linux_32_${CI_COMMIT_SHORT_SHA}"
paths:
@@ -56,7 +81,7 @@ before_script:
script:
- export $(dpkg-architecture)
- ./scripts/build-appimage.sh
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_${CI_COMMIT_SHORT_SHA}"
paths:
@@ -127,7 +152,7 @@ before_script:
exclude:
- openrgb-dbgsym*.deb
expire_in: 30 days
#-----------------------------------------------------------------------#
# Linux (.deb) Debian Bullseye 64-bit Build Target #
#-----------------------------------------------------------------------#
@@ -150,14 +175,14 @@ before_script:
expire_in: 30 days
#-----------------------------------------------------------------------#
# 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
@@ -177,16 +202,31 @@ before_script:
expire_in: 30 days
#-----------------------------------------------------------------------#
# Alpine Linux 64-bit Build Target #
# Linux (.rpm, f36) 64-bit Build Target #
#-----------------------------------------------------------------------#
"Alpine Linux 64":
image: alpinelinux/alpine-gitlab-ci:latest
"Linux 64 f36 rpm":
image: fedora:36
stage: build
script:
- doas apk update
- doas apk add hidapi-dev libusb-dev mbedtls-dev qt5-qtbase-dev
- qmake .
- make
- 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
#-----------------------------------------------------------------------#
# Debian 32 Buster test #
@@ -291,10 +331,10 @@ before_script:
- "Linux 64 .deb (Debian Bullseye)"
#-----------------------------------------------------------------------#
# 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
@@ -302,9 +342,25 @@ before_script:
- 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
- openrgb -l
- yum -y remove openrgb
dependencies:
- "Linux 64 f36 rpm"
needs:
- "Linux 64 f36 rpm"
#-----------------------------------------------------------------------#
# Windows (32-bit) Build Target #
@@ -326,42 +382,46 @@ 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-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'
- _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_ 'Generate qm files'
- .\_qt\5.15.0\msvc2019\bin\lrelease OpenRGB.pro
- _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_
@@ -395,42 +455,46 @@ 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-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'
- _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_ 'Generate qm files'
- .\_qt\5.15.0\msvc2019_64\bin\lrelease OpenRGB.pro
- _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_
+106
View File
@@ -0,0 +1,106 @@
# OpenRGB CODEOWNERS
# Default Code Owner
* @Calcprogrammer1
CODEOWNERS @Calcprogrammer1
#-----------------------------------------------------------------------------#
# Controllers - Directories #
#-----------------------------------------------------------------------------#
[Controllers]
/Controllers/AMDWraithPrismController/
/Controllers/ASRockPolychromeSMBusController/
/Controllers/ASRockPolychromeUSBController/
/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/ASRockPolychromeSMBusController/ASRockPolychromeSMBusController.cpp @TheRogueZeta
/Controllers/ASRockPolychromeSMBusController/ASRockPolychromeSMBusController.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 -->
-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"
-42
View File
@@ -1,42 +0,0 @@
# Contributor: Bart Ribbers <[email protected]>
# Maintainer: Bart Ribbers <[email protected]>
pkgname=openrgb
pkgver=0.7
pkgrel=0
pkgdesc="Open source RGB lighting control that doesn't depend on manufacturer software"
url="https://gitlab.com/CalcProgrammer1/OpenRGB"
arch="all !ppc64le" # Build fails and not supported on ppc64le
license="GPL-2.0-only"
makedepends="
hidapi-dev
libusb-dev
mbedtls-dev
qt5-qtbase-dev
"
source="https://gitlab.com/CalcProgrammer1/OpenRGB/-/archive/release_$pkgver/OpenRGB-release_$pkgver.tar.gz
0001-fix-build.patch
modules-load.conf
"
install="$pkgname.post-install"
builddir="$srcdir/OpenRGB-release_$pkgver"
build() {
qmake-qt5 PREFIX=/usr
make
}
check() {
make check
}
package() {
INSTALL_ROOT="$pkgdir" make install
install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/openrgb.conf
}
sha512sums="
d08ef4f1b1d890858b37a0b76145da13031b35fca0b09bc243121323f4f7fc2760319981da6071acfe0ad020fdacf8663038f7fa0f4e596283a278905f1a010b OpenRGB-release_0.7.tar.gz
9070b8520b7ead8796c45ff90c9775ce235ae4fd818092998600cfe31c7c0b4393e10731fc727f0f29bee1aa093be5236779c38a164bf10bc1f218f53243c0a4 0001-fix-build.patch
6fc01a649fcdecd2168292ae383a5af61be8c3d3fb8b98026a779f09dc9c9e1643e3c55290abd3b262bfea55e9a6cacab902f0fae5c9396dc20028a37f566555 modules-load.conf
"
+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
+58
View File
@@ -0,0 +1,58 @@
# 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.
## 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,181 @@
/*---------------------------------------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 0;
}
void RGBController_BloodyMouse::DeviceUpdateMode()
{
/*---------------------------------------------------------*\
| This device only supports Direct mode |
\*---------------------------------------------------------*/
}
@@ -0,0 +1,42 @@
/*---------------------------------------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
private:
BloodyMouseController* controller;
};
@@ -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,21 +9,35 @@
#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();
version = controller->GetFirmwareVersionString();
location = controller->GetLocationString();
/*-----------------------------------------------------*\
| Don't use HID serial string, it is inconsistent on my |
| Wraith Prism |
\*-----------------------------------------------------*/
serial = "";//wraith->GetSerialString();
serial = "";//controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
@@ -49,7 +63,7 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
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 +76,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;
@@ -118,7 +132,7 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
RGBController_AMDWraithPrism::~RGBController_AMDWraithPrism()
{
delete wraith;
delete controller;
}
void RGBController_AMDWraithPrism::SetupZones()
@@ -183,17 +197,17 @@ 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);
controller->SetLogoColor(red, grn, blu);
red = RGBGetRValue(colors[1]);
grn = RGBGetGValue(colors[1]);
blu = RGBGetBValue(colors[1]);
wraith->SetFanColor(red, grn, blu);
controller->SetFanColor(red, grn, blu);
red = RGBGetRValue(colors[2]);
grn = RGBGetGValue(colors[2]);
blu = RGBGetBValue(colors[2]);
wraith->SetRingColor(red, grn, blu);
controller->SetRingColor(red, grn, blu);
}
void RGBController_AMDWraithPrism::UpdateZoneLEDs(int zone)
@@ -205,15 +219,15 @@ void RGBController_AMDWraithPrism::UpdateZoneLEDs(int zone)
if(zone == 0)
{
wraith->SetLogoColor(red, grn, blu);
controller->SetLogoColor(red, grn, blu);
}
else if(zone == 1)
{
wraith->SetFanColor(red, grn, blu);
controller->SetFanColor(red, grn, blu);
}
else if(zone == 2)
{
wraith->SetRingColor(red, grn, blu);
controller->SetRingColor(red, grn, blu);
}
}
@@ -231,36 +245,36 @@ 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);
controller->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_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->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->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->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->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->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,33 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
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();
}
@@ -76,11 +76,19 @@ void PolychromeUSBController::SetDeviceInfo()
{
if(configtable[zonecnt] == 0x1E)
{
break;
/*-----------------------------------------------------------------------*\
| If we don't have this device type (0x1E) we will skip it and continue. |
\*-----------------------------------------------------------------------*/
continue;
}
newdev_info.num_leds = configtable[zonecnt];
/*--------------------------------------------------------------------------------------------------*\
| 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)
{
/*-----------------------------------------*\
@@ -124,6 +132,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,7 +149,7 @@ 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);
@@ -211,9 +225,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 +245,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 |
@@ -248,7 +266,6 @@ PolychromeZoneInfo PolychromeUSBController::GetZoneConfig(unsigned char zone)
zoneinfo.color = ToRGBColor(r,g,b);
zoneinfo.speed = usb_buf[0x08];
zoneinfo.zone = usb_buf[0x03];
//all = usb_buf[0x10];
return(zoneinfo);
}
@@ -99,6 +99,7 @@ struct PolychromeDeviceInfo
{
unsigned char effect_channel;
unsigned char num_leds;
unsigned char zone_type;
PolychromeDeviceType device_type;
};
@@ -13,15 +13,27 @@
#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.
Per ARGB LED support is not possible with these devices.
\*-------------------------------------------------------------------*/
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";
@@ -176,31 +188,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++)
@@ -226,7 +238,7 @@ void RGBController_PolychromeUSB::SetupZones()
{
unsigned char led = (unsigned char)leds[led_idx].value;
colors[led_idx] = polychrome->GetZoneConfig(led).color; // TODO Get addressable instead of zone idx
colors[led_idx] = controller->GetZoneConfig(led).color; // TODO Get addressable instead of zone idx
}
/*---------------------------------------------------------*\
@@ -236,7 +248,7 @@ 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);
}
@@ -273,7 +285,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 +298,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,17 +311,17 @@ 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);
return(active_mode);
}
void RGBController_PolychromeUSB::SetCustomMode()
@@ -326,13 +338,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);
}
}
}
@@ -15,7 +15,7 @@
class RGBController_PolychromeUSB : public RGBController
{
public:
RGBController_PolychromeUSB(PolychromeUSBController* polychrome_ptr);
RGBController_PolychromeUSB(PolychromeUSBController* controller_ptr);
void SetupZones();
@@ -30,7 +30,7 @@ public:
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,180 @@
/*-----------------------------------------*\
| 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 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_V1_REG_LED_CONFIG, 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::GetMode()
{
return(active_mode);
}
void ASRockPolychromeV1SMBusController::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 != POLYCHROME_V1_MODE_OFF)
{
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_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);
}
void ASRockPolychromeV1SMBusController::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;
/*-----------------------------------------------------*\
| 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_LED_SELECT, 1, &active_zone);
std::this_thread::sleep_for(1ms);
/*-----------------------------------------------------*\
| Write the mode |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_MODE, 1, &active_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 |
@@ -13,80 +13,33 @@
#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_LED_SELECT = 0x31, /* LED selection register */
POLYCHROME_V1_REG_SET_ALL = 0x32, /* Set All register 0x1 = set all */
POLYCHROME_V1_REG_LED_CONFIG = 0x33, /* LED configuration register */
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 */
};
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, /* Audio/PCH Zone LEDs */
POLYCHROME_V1_ZONE_4 = 0x03, /* Audio/PCH Zone LEDs */
POLYCHROME_V1_ZONE_5 = 0x04, /* IO Cover 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, /* Maxinum number of ARGB LEDs */
};
/*----------------------------------------------------------------------------------------------*\
@@ -166,62 +119,29 @@ 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
{
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_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 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);
unsigned char zone_led_count[6];
uint8_t zone_led_count[6];
uint16_t fw_version;
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;
uint8_t active_zone;
uint8_t active_mode;
uint8_t 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,210 @@
/*-----------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 1;
}
void RGBController_ASRockASRRGBSMBus::DeviceUpdateMode()
{
controller->SetMode(0, modes[active_mode].value, modes[active_mode].speed);
DeviceUpdateLEDs();
}
@@ -1,34 +1,34 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
private:
ASRockASRRGBSMBusController* controller;
};
@@ -0,0 +1,327 @@
/*-----------------------------------------*\
| RGBController_ASRockPolychromeSMBus.cpp |
| |
| Generic RGB Interface for OpenRGB |
| ASRock ASR LED and Polychrome RGB Driver |
| |
| Adam Honse (CalcProgrammer1) 12/15/2019 |
\*-----------------------------------------*/
#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.
\*-------------------------------------------------------------------*/
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 = 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);
*/
SetupZones();
}
RGBController_ASRockPolychromeV1SMBus::~RGBController_ASRockPolychromeV1SMBus()
{
delete controller;
}
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->leds_min = 1;
new_zone->leds_max = 1;
//new_zone->leds_count = zone_led_count[zone_idx];
new_zone->leds_count = 1;
new_zone->type = ZONE_TYPE_SINGLE;
new_zone->matrix_map = NULL;
/*---------------------------------------------------------*\
| Push new zone to zones vector |
\*---------------------------------------------------------*/
zones.push_back(*new_zone);
}
}
uint8_t led_count = 0;
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
for(uint8_t zone_idx = 0; zone_idx < POLYCHROME_V1_ZONE_COUNT; zone_idx++)
{
if(controller->zone_led_count[zone_idx] > 0)
{
for(uint8_t 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_v1_zone_names[zone_idx];
new_led->name.append(" " + std::to_string(led_idx + 1));
new_led->value = 0;
new_led->value = zone_idx;
/*---------------------------------------------------------*\
| Push new LED to LEDs vector |
\*---------------------------------------------------------*/
leds.push_back(*new_led);
led_count++;
if(zone_idx == POLYCHROME_V1_ZONE_ADDRESSABLE)
{
break;
}
}
}
}
SetupColors();
}
void RGBController_ASRockPolychromeV1SMBus::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_ASRockPolychromeV1SMBus::DeviceUpdateLEDs()
{
for (std::size_t led = 0; led < colors.size(); led++)
{
UpdateSingleLED(led);
}
}
void RGBController_ASRockPolychromeV1SMBus::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_ASRockPolychromeV1SMBus::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_ASRockPolychromeV1SMBus::SetCustomMode()
{
active_mode = 1;
}
void RGBController_ASRockPolychromeV1SMBus::DeviceUpdateMode()
{
for(uint8_t led_idx = 0; led_idx < leds.size(); led_idx++)
{
controller->SetMode(led_idx, modes[active_mode].value, modes[active_mode].speed);
}
DeviceUpdateLEDs();
}
@@ -0,0 +1,34 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
private:
ASRockPolychromeV1SMBusController* controller;
};
@@ -0,0 +1,330 @@
/*-----------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 1;
}
void RGBController_ASRockPolychromeV2SMBus::DeviceUpdateMode()
{
controller->SetMode(0, modes[active_mode].value, modes[active_mode].speed);
DeviceUpdateLEDs();
}
@@ -0,0 +1,34 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
private:
ASRockPolychromeV2SMBusController* controller;
};
@@ -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);
@@ -217,43 +228,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 +273,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();
@@ -32,6 +32,6 @@ public:
void SetCustomMode();
private:
AlienwareController* alienware;
AlienwareController* controller;
std::chrono::steady_clock::time_point last_packet_ts;
};
@@ -7,6 +7,7 @@
| Mohamad Sallal - msallal 05/22/2021 |
\*-----------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_AlienwareAW510K.h"
#include <iterator>
@@ -49,124 +50,135 @@ 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();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct_Per_LED;
Direct_Per_LED.name = "Direct";
@@ -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,12 +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]));
controller->UpdateSingleLED(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
}
void RGBController_AlienwareAW510K::SetCustomMode()
@@ -404,7 +416,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 +439,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 +447,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 +456,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 +466,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();
@@ -30,6 +30,6 @@ public:
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,7 +18,7 @@ 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[] =
@@ -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,25 @@ 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::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AnnePro2::DeviceUpdateMode()
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();
@@ -28,5 +28,5 @@ public:
void DeviceUpdateMode();
private:
AnnePro2Controller* annepro2;
AnnePro2Controller* controller;
};
@@ -1,34 +1,38 @@
#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 <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);
}
else
{
delete 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);
@@ -1,319 +1,330 @@
/*-----------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 0;
}
void RGBController_AuraCore::DeviceUpdateMode()
{
if(modes[active_mode].value == AURA_CORE_MODE_DIRECT)
{
controller->InitDirectMode();
}
else
{
DeviceUpdateLEDs();
}
}
@@ -1,35 +1,35 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
private:
AuraCoreController* 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,69 @@ 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);
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 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 6G" , 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 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 8G" , 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 8G", 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 8G" , 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 8G" , 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 8G" , 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 8G" , 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 8G" , 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 8G" , 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 8G" , 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 8G" , 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 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 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 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 O11G Gaming" , DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080TI_A_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX2080TI_O11G_GAMING, 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 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);
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 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,212 @@
/*-----------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 0;
}
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,35 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
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,41 @@
/*-----------------------------------------*\
| 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_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;
};
@@ -82,6 +82,15 @@ std::string AuraMouseController::GetVersion(bool wireless, int protocol)
str = "0." + str.substr(0, 2) + "." + str.substr(2, 2);
}
break;
case 3:
{
char version[9];
int offset = (wireless ? 13 : 4);
snprintf(version, 9, "%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 +134,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 +180,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,35 @@
#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_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_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 +65,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 +86,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 +101,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 +114,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 +127,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 +140,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 +153,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 +166,60 @@ 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_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 +231,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,6 +244,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
0,
0,
0,
4,
false,
1,
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
@@ -183,6 +257,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 },
@@ -194,6 +270,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 +283,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,
3,
{ 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,6 +452,8 @@ static std::map<int,mouse_type> aura_mouse_devices =
{
0,
0,
0,
4,
false,
2,
{ AURA_MOUSE_ZONE_LOGO },
@@ -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(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,121 @@
/*-------------------------------------------------------------------*\
| 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)
{
const int szTemp = ASUSAURARYUOAIOCONTROLLER_HID_MAX_STR;
wchar_t tmpName[szTemp];
/*-----------------------------------------------------*\
| 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,11 @@
#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)
{
dev = dev_handle;
location = path;
device_pid = pid;
}
AuraTUFKeyboardController::~AuraTUFKeyboardController()
@@ -63,7 +64,15 @@ std::string AuraTUFKeyboardController::GetVersion()
hid_read(dev, usb_buf_out, 65);
char version[9];
snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[5], usb_buf_out[6], usb_buf_out[7]);
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);
}
@@ -39,10 +39,17 @@ enum
AURA_KEYBOARD_MODE_DIRECT = 15,
};
enum
{
AURA_TUF_K7_GAMING_PID = 0x18AA,
AURA_TUF_K3_GAMING_PID = 0x194B,
};
class AuraTUFKeyboardController
{
public:
AuraTUFKeyboardController(hid_device* dev_handle, const char* path);
AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid);
~AuraTUFKeyboardController();
std::string GetDeviceLocation();
@@ -76,6 +83,8 @@ public:
void AwaitResponse();
void ClearResponses();
uint16_t device_pid;
private:
hid_device* dev;
std::string location;
@@ -7,6 +7,7 @@
| Mola19 10/02/2021 |
\*-----------------------------------------*/
#include "RGBControllerKeyNames.h"
#include <vector>
#include <map>
#include "RGBController.h"
@@ -77,166 +78,166 @@ static std::map<int,layout_type> AsusTUFK7Layouts =
{
(unsigned int *) ASUS_TUF_K7_LAYOUT_KEYS_105,
{
"Key: Escape",
"Key: `",
"Key: Tab",
"Key: Caps Lock",
"Key: Left Shift",
"Key: Left Control",
KEY_EN_ESCAPE,
KEY_EN_BACK_TICK,
KEY_EN_TAB,
KEY_EN_CAPS_LOCK,
KEY_EN_LEFT_SHIFT,
KEY_EN_LEFT_CONTROL,
"Unused",
"Unused",
"Unused",
"Unused",
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
"Key: \\",
"Key: Left Windows",
KEY_EN_LEFT_WINDOWS,
"Unused",
"Key: 1",
"Key: Q",
"Key: A",
"Key: Z",
"Key: Left Alt",
KEY_EN_UNUSED,
KEY_EN_1,
KEY_EN_Q,
KEY_EN_A,
KEY_EN_Z,
KEY_EN_LEFT_ALT,
"Key: F1",
"Key: 2",
"Key: W",
"Key: S",
"Key: X",
"Unused",
KEY_EN_F1,
KEY_EN_2,
KEY_EN_W,
KEY_EN_S,
KEY_EN_X,
KEY_EN_UNUSED,
"Key: F2",
"Key: 3",
"Key: E",
"Key: D",
"Key: C",
"Unused",
KEY_EN_F2,
KEY_EN_3,
KEY_EN_E,
KEY_EN_D,
KEY_EN_C,
KEY_EN_UNUSED,
"Key: F3",
"Key: 4",
"Key: R",
"Key: F",
"Key: V",
"Unused",
KEY_EN_F3,
KEY_EN_4,
KEY_EN_R,
KEY_EN_F,
KEY_EN_V,
KEY_EN_UNUSED,
"Key: F4",
"Key: 5",
"Key: T",
"Key: G",
"Key: B",
"Key: Space",
KEY_EN_F4,
KEY_EN_5,
KEY_EN_T,
KEY_EN_G,
KEY_EN_B,
KEY_EN_SPACE,
"Unused",
"Key: 6",
"Key: Y",
"Key: H",
"Key: N",
"Unused",
KEY_EN_UNUSED,
KEY_EN_6,
KEY_EN_Y,
KEY_EN_H,
KEY_EN_N,
KEY_EN_UNUSED,
"Key: F5",
"Key: 7",
"Key: U",
"Key: J",
"Key: M",
"Unused",
KEY_EN_F5,
KEY_EN_7,
KEY_EN_U,
KEY_EN_J,
KEY_EN_M,
KEY_EN_UNUSED,
"Key: F6",
"Key: 8",
"Key: I",
"Key: K",
"Key: ,",
"Key: Right Alt",
KEY_EN_F6,
KEY_EN_8,
KEY_EN_I,
KEY_EN_K,
KEY_EN_COMMA,
KEY_EN_RIGHT_ALT,
"Key: F7",
"Key: 9",
"Key: O",
"Key: L",
"Key: .",
"Unused",
KEY_EN_F7,
KEY_EN_9,
KEY_EN_O,
KEY_EN_L,
KEY_EN_PERIOD,
KEY_EN_UNUSED,
"Key: F8",
"Key: 0",
"Key: P",
"Key: ;",
"Key: /",
"Key: Right Fn",
KEY_EN_F8,
KEY_EN_0,
KEY_EN_P,
KEY_EN_SEMICOLON,
KEY_EN_FORWARD_SLASH,
KEY_EN_RIGHT_FUNCTION,
"Key: F9",
"Key: -",
"Key: [",
"Key: '",
"Unused",
"Key: Menu",
KEY_EN_F9,
KEY_EN_MINUS,
KEY_EN_LEFT_BRACKET,
KEY_EN_QUOTE,
KEY_EN_UNUSED,
KEY_EN_MENU,
"Key: F10",
"Key: =",
"Key: ]",
"Key: #",
"Unused",
"Unused",
KEY_EN_F10,
KEY_EN_EQUALS,
KEY_EN_RIGHT_BRACKET,
KEY_EN_POUND,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
"Key: F11",
"Unused",
"Unused",
"Unused",
"Unused",
"Unused",
KEY_EN_F11,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
"Key: F12",
"Key: Backspace",
"Unused",
"Key: Enter",
"Key: Right Shift",
"Key: Right Control",
KEY_EN_F12,
KEY_EN_BACKSPACE,
KEY_EN_UNUSED,
KEY_EN_ANSI_ENTER,
KEY_EN_RIGHT_SHIFT,
KEY_EN_RIGHT_CONTROL,
"Key: Print Screen",
"Key: Insert",
"Key: Delete",
"Unused",
"Unused",
"Key: Left Arrow",
KEY_EN_PRINT_SCREEN,
KEY_EN_INSERT,
KEY_EN_DELETE,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_LEFT_ARROW,
"Key: Scroll Lock",
"Key: Home",
"Key: End",
"Unused",
"Key: Up Arrow",
"Key: Down Arrow",
KEY_EN_SCROLL_LOCK,
KEY_EN_HOME,
KEY_EN_END,
KEY_EN_UNUSED,
KEY_EN_UP_ARROW,
KEY_EN_DOWN_ARROW,
"Key: Pause/Break",
"Key: Page Up",
"Key: Page Down",
"Unused",
"Unused",
"Key: Right Arrow",
KEY_EN_PAUSE_BREAK,
KEY_EN_PAGE_UP,
KEY_EN_PAGE_DOWN,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_RIGHT_ARROW,
"Unused",
"Key: Num Lock",
"Key: Number Pad 7",
"Key: Number Pad 4",
"Key: Number Pad 1",
"Key: Number Pad 0",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_LOCK,
KEY_EN_NUMPAD_7,
KEY_EN_NUMPAD_4,
KEY_EN_NUMPAD_1,
KEY_EN_NUMPAD_0,
"Unused",
"Key: Number Pad /",
"Key: Number Pad 8",
"Key: Number Pad 5",
"Key: Number Pad 2",
"Unused",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_DIVIDE,
KEY_EN_NUMPAD_8,
KEY_EN_NUMPAD_5,
KEY_EN_NUMPAD_2,
KEY_EN_UNUSED,
"Unused",
"Key: Number Pad *",
"Key: Number Pad 9",
"Key: Number Pad 6",
"Key: Number Pad 3",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_TIMES,
KEY_EN_NUMPAD_9,
KEY_EN_NUMPAD_6,
KEY_EN_NUMPAD_3,
"Key: Number Pad ,",
"Unused",
"Key: Number Pad -",
"Key: Number Pad +",
"Unused",
"Key: Number Pad Enter",
"Unused",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_MINUS,
KEY_EN_NUMPAD_PLUS,
KEY_EN_UNUSED,
KEY_EN_NUMPAD_ENTER,
KEY_EN_UNUSED,
}
}
},
@@ -245,166 +246,166 @@ static std::map<int,layout_type> AsusTUFK7Layouts =
{
(unsigned int *) ASUS_TUF_K7_LAYOUT_KEYS_104,
{
"Key: Escape",
"Key: `",
"Key: Tab",
"Key: Caps Lock",
"Key: Left Shift",
"Key: Left Control",
KEY_EN_ESCAPE,
KEY_EN_BACK_TICK,
KEY_EN_TAB,
KEY_EN_CAPS_LOCK,
KEY_EN_LEFT_SHIFT,
KEY_EN_LEFT_CONTROL,
"Unused",
"Unused",
"Unused",
"Unused",
"Unused",
"Key: Left Windows",
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_LEFT_WINDOWS,
"Unused",
"Key: 1",
"Key: Q",
"Key: A",
"Key: Z",
"Key: Left Alt",
KEY_EN_UNUSED,
KEY_EN_1,
KEY_EN_Q,
KEY_EN_A,
KEY_EN_Z,
KEY_EN_LEFT_ALT,
"Key: F1",
"Key: 2",
"Key: W",
"Key: S",
"Key: X",
"Unused",
KEY_EN_F1,
KEY_EN_2,
KEY_EN_W,
KEY_EN_S,
KEY_EN_X,
KEY_EN_UNUSED,
"Key: F2",
"Key: 3",
"Key: E",
"Key: D",
"Key: C",
"Unused",
KEY_EN_F2,
KEY_EN_3,
KEY_EN_E,
KEY_EN_D,
KEY_EN_C,
KEY_EN_UNUSED,
"Key: F3",
"Key: 4",
"Key: R",
"Key: F",
"Key: V",
"Unused",
KEY_EN_F3,
KEY_EN_4,
KEY_EN_R,
KEY_EN_F,
KEY_EN_V,
KEY_EN_UNUSED,
"Key: F4",
"Key: 5",
"Key: T",
"Key: G",
"Key: B",
"Key: Space",
KEY_EN_F4,
KEY_EN_5,
KEY_EN_T,
KEY_EN_G,
KEY_EN_B,
KEY_EN_SPACE,
"Unused",
"Key: 6",
"Key: Y",
"Key: H",
"Key: N",
"Unused",
KEY_EN_UNUSED,
KEY_EN_6,
KEY_EN_Y,
KEY_EN_H,
KEY_EN_N,
KEY_EN_UNUSED,
"Key: F5",
"Key: 7",
"Key: U",
"Key: J",
"Key: M",
"Unused",
KEY_EN_F5,
KEY_EN_7,
KEY_EN_U,
KEY_EN_J,
KEY_EN_M,
KEY_EN_UNUSED,
"Key: F6",
"Key: 8",
"Key: I",
"Key: K",
"Key: ,",
"Key: Right Alt",
KEY_EN_F6,
KEY_EN_8,
KEY_EN_I,
KEY_EN_K,
KEY_EN_COMMA,
KEY_EN_RIGHT_ALT,
"Key: F7",
"Key: 9",
"Key: O",
"Key: L",
"Key: .",
"Unused",
KEY_EN_F7,
KEY_EN_9,
KEY_EN_O,
KEY_EN_L,
KEY_EN_PERIOD,
KEY_EN_UNUSED,
"Key: F8",
"Key: 0",
"Key: P",
"Key: ;",
"Key: /",
"Key: Right Fn",
KEY_EN_F8,
KEY_EN_0,
KEY_EN_P,
KEY_EN_SEMICOLON,
KEY_EN_FORWARD_SLASH,
KEY_EN_RIGHT_FUNCTION,
"Key: F9",
"Key: -",
"Key: [",
"Key: '",
"Unused",
"Key: Menu",
KEY_EN_F9,
KEY_EN_MINUS,
KEY_EN_LEFT_BRACKET,
KEY_EN_QUOTE,
KEY_EN_UNUSED,
KEY_EN_MENU,
"Key: F10",
"Key: =",
"Key: ]",
"Unused",
"Unused",
"Unused",
KEY_EN_F10,
KEY_EN_EQUALS,
KEY_EN_RIGHT_BRACKET,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
"Key: F11",
"Unused",
"Unused",
"Unused",
"Unused",
"Unused",
KEY_EN_F11,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
"Key: F12",
"Key: Backspace",
KEY_EN_F12,
KEY_EN_BACKSPACE,
"Key: \\",
"Key: Enter",
"Key: Right Shift",
"Key: Right Control",
KEY_EN_ANSI_ENTER,
KEY_EN_RIGHT_SHIFT,
KEY_EN_RIGHT_CONTROL,
"Key: Print Screen",
"Key: Insert",
"Key: Delete",
"Unused",
"Unused",
"Key: Left Arrow",
KEY_EN_PRINT_SCREEN,
KEY_EN_INSERT,
KEY_EN_DELETE,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_LEFT_ARROW,
"Key: Scroll Lock",
"Key: Home",
"Key: End",
"Unused",
"Key: Up Arrow",
"Key: Down Arrow",
KEY_EN_SCROLL_LOCK,
KEY_EN_HOME,
KEY_EN_END,
KEY_EN_UNUSED,
KEY_EN_UP_ARROW,
KEY_EN_DOWN_ARROW,
"Key: Pause/Break",
"Key: Page Up",
"Key: Page Down",
"Unused",
"Unused",
"Key: Right Arrow",
KEY_EN_PAUSE_BREAK,
KEY_EN_PAGE_UP,
KEY_EN_PAGE_DOWN,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_RIGHT_ARROW,
"Unused",
"Key: Num Lock",
"Key: Number Pad 7",
"Key: Number Pad 4",
"Key: Number Pad 1",
"Key: Number Pad 0",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_LOCK,
KEY_EN_NUMPAD_7,
KEY_EN_NUMPAD_4,
KEY_EN_NUMPAD_1,
KEY_EN_NUMPAD_0,
"Unused",
"Key: Number Pad /",
"Key: Number Pad 8",
"Key: Number Pad 5",
"Key: Number Pad 2",
"Unused",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_DIVIDE,
KEY_EN_NUMPAD_8,
KEY_EN_NUMPAD_5,
KEY_EN_NUMPAD_2,
KEY_EN_UNUSED,
"Unused",
"Key: Number Pad *",
"Key: Number Pad 9",
"Key: Number Pad 6",
"Key: Number Pad 3",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_TIMES,
KEY_EN_NUMPAD_9,
KEY_EN_NUMPAD_6,
KEY_EN_NUMPAD_3,
"Key: Number Pad ,",
"Unused",
"Key: Number Pad -",
"Key: Number Pad +",
"Unused",
"Key: Number Pad Enter",
"Unused",
KEY_EN_UNUSED,
KEY_EN_NUMPAD_MINUS,
KEY_EN_NUMPAD_PLUS,
KEY_EN_UNUSED,
KEY_EN_NUMPAD_ENTER,
KEY_EN_UNUSED,
}
}
},
@@ -8,6 +8,8 @@
\*-----------------------------------------*/
#include "AsusAuraUSBController.h"
#include "LogManager.h"
#include <cstring>
#include <stdexcept>
@@ -88,14 +90,17 @@ 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
@@ -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"
@@ -41,6 +48,7 @@
#define AURA_ROG_STRIX_SCOPE_RX_PID 0x1951
#define AURA_ROG_STRIX_SCOPE_TKL_PID 0x190C
#define AURA_TUF_K7_GAMING_PID 0x18AA
#define AURA_TUF_K3_GAMING_PID 0x194B
/*-----------------------------------------------------------------*\
| MICE - defined in AsusAuraMouseDevices.h |
@@ -48,13 +56,33 @@
#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_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)
{
@@ -88,9 +116,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 +130,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 +140,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 +162,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 +176,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 +228,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 +241,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 +254,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);
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 +280,80 @@ 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 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_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 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 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 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*/)
@@ -180,7 +191,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 +199,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 +211,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();
@@ -40,5 +40,5 @@ public:
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()
@@ -394,8 +407,8 @@ void RGBController_AuraKeyboard::SetupZones()
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_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:
@@ -403,8 +416,8 @@ void RGBController_AuraKeyboard::SetupZones()
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_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;
@@ -414,8 +427,8 @@ void RGBController_AuraKeyboard::SetupZones()
led_zones.push_back({"Logo", ZONE_TYPE_LINEAR, 2});
led_zones.push_back({"Underglow", ZONE_TYPE_LINEAR, 26});
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:
@@ -424,8 +437,8 @@ void RGBController_AuraKeyboard::SetupZones()
led_zones.push_back({"Logo", ZONE_TYPE_SINGLE, 1});
led_zones.push_back({"Underglow", ZONE_TYPE_SINGLE, 2});
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});
@@ -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*/)
@@ -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();
@@ -52,6 +52,6 @@ public:
void DeviceUpdateMode();
private:
AuraKeyboardController* aura;
AuraKeyboardController* controller;
AuraKeyboardMappingLayoutType layout;
};
@@ -0,0 +1,133 @@
/*-----------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 0;
}
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,34 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
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;
uint16_t 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,13 +163,12 @@ 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;
uint16_t pid = controller->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++)
{
@@ -208,7 +218,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);
controller->SendUpdate(leds[led].value, modes[active_mode].value, red, grn, blu, 0, false, 0, modes[active_mode].brightness);
}
void RGBController_AuraMouse::SetCustomMode()
@@ -235,12 +245,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();
@@ -36,5 +30,5 @@ public:
void DeviceSaveMode();
private:
AuraMouseController* aura;
AuraMouseController* controller;
};
@@ -0,0 +1,303 @@
/*-----------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 0;
}
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,52 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
private:
AuraMousematController* controller;
};
@@ -0,0 +1,223 @@
/*-------------------------------------------------------------------*\
| 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::SetCustomMode()
{
active_mode = 0;
}
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 SetCustomMode();
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;
@@ -11,17 +11,28 @@
#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();
version = controller->GetVersion();
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
@@ -191,12 +202,12 @@ RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardCont
RGBController_AuraTUFKeyboard::~RGBController_AuraTUFKeyboard()
{
delete aura;
delete controller;
}
void RGBController_AuraTUFKeyboard::SetupZones()
{
int layout = aura->GetLayout();
int layout = controller->GetLayout();
if(AsusTUFK7Layouts.find(layout % 100) == AsusTUFK7Layouts.end())
{
@@ -248,7 +259,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateLEDs()
void RGBController_AuraTUFKeyboard::UpdateZoneLEDs(int /*zone*/)
{
aura->UpdateLeds(colors);
controller->UpdateLeds(colors);
}
void RGBController_AuraTUFKeyboard::UpdateSingleLED(int led)
@@ -256,7 +267,8 @@ 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(led, red, green, blue);
}
void RGBController_AuraTUFKeyboard::SetCustomMode()
@@ -265,13 +277,13 @@ void RGBController_AuraTUFKeyboard::SetCustomMode()
}
void RGBController_AuraTUFKeyboard::DeviceUpdateMode()
{
{
unsigned char color_mode;
std::vector<RGBColor> mode_colors;
if(modes[active_mode].value == AURA_KEYBOARD_MODE_DIRECT)
{
aura->UpdateLeds(colors);
controller->UpdateLeds(colors);
}
else
{
@@ -319,14 +331,14 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateMode()
mode_colors = modes[active_mode].color_mode == MODE_COLORS_PER_LED ? std::vector<RGBColor>(colors) : std::vector<RGBColor>(modes[active_mode].colors);
aura->UpdateDevice(modes[active_mode].value, mode_colors, direction, color_mode, (15 - modes[active_mode].speed), modes[active_mode].brightness * 25);
controller->UpdateDevice(modes[active_mode].value, mode_colors, direction, color_mode, (15 - modes[active_mode].speed), modes[active_mode].brightness * 25);
}
}
void RGBController_AuraTUFKeyboard::DeviceSaveMode()
{
aura->ClearResponses();
controller->ClearResponses();
DeviceUpdateMode();
aura->AwaitResponse();
aura->SaveMode();
controller->AwaitResponse();
controller->SaveMode();
}
@@ -13,18 +13,18 @@
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_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
};
class RGBController_AuraTUFKeyboard : public RGBController
{
public:
RGBController_AuraTUFKeyboard(AuraTUFKeyboardController* aura_ptr);
RGBController_AuraTUFKeyboard(AuraTUFKeyboardController* controller_ptr);
~RGBController_AuraTUFKeyboard();
void SetupZones();
@@ -40,5 +40,5 @@ public:
void DeviceSaveMode();
private:
AuraTUFKeyboardController* aura;
AuraTUFKeyboardController* controller;
};
@@ -1,264 +1,278 @@
/*-----------------------------------------*\
| 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::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)
{
controller->SetMode(zone_idx, modes[active_mode].value, red, grn, blu);
}
}
}
@@ -1,38 +1,38 @@
/*-----------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
private:
AuraUSBController* controller;
std::vector<unsigned int> leds_channel;
std::vector<unsigned int> zones_channel;
bool initializedMode;
};
@@ -0,0 +1,232 @@
/*-------------------------------------------------------------------*\
| 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::SetCustomMode()
{
for(std::size_t mode_idx = 0; mode_idx < modes.size() ; mode_idx++)
{
if (modes[mode_idx].value == ROGSTRIXLC_CONTROLLER_MODE_DIRECT)
{
active_mode = mode_idx;
break;
}
}
}
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,37 @@
/*-------------------------------------------------------------------*\
| 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 SetCustomMode();
void DeviceUpdateMode();
private:
int GetDeviceMode();
int GetLED_Zone(int led_idx);
ROGStrixLC_Controller* controller;
};
@@ -0,0 +1,130 @@
/*-------------------------------------------------------------------*\
| 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)
{
const int szTemp = HID_MAX_STR;
wchar_t tmpName[szTemp];
/*-----------------------------------------------------*\
| 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);
};
@@ -10,6 +10,17 @@
using namespace std::chrono_literals;
/**------------------------------------------------------------------*\
@name Asus TUF Laptop
@category Keyboard
@type WMI
@save :x:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectAsusTUFLaptopWMIControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_AsusTUFLaptopWMI::RGBController_AsusTUFLaptopWMI()
{
name = "ASUS TUF Keyboard";
@@ -34,3 +34,8 @@ void DetectBlinkyTapeControllers(std::vector<RGBController*> &rgb_controllers)
}
REGISTER_DETECTOR("BlinkyTape", DetectBlinkyTapeControllers);
/*---------------------------------------------------------------------------------------------------------*\
| Entries for dynamic UDEV rules |
| |
| DUMMY_DEVICE_DETECTOR("BlinkyTape", DetectBlinkyTapeControllers, 0x1D50, 0x605E ) |
\*---------------------------------------------------------------------------------------------------------*/
@@ -8,6 +8,17 @@
#include "RGBController_BlinkyTape.h"
/**------------------------------------------------------------------*\
@name Blinky Tape
@category LEDStrip
@type Serial
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectBlinkyTapeControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_BlinkyTape::RGBController_BlinkyTape(BlinkyTapeController* controller_ptr)
{
controller = controller_ptr;
@@ -0,0 +1,331 @@
/*-------------------------------------------------------------------*\
| CMMMController.cpp |
| |
| Driver for Coolermaster MasterMouse |
| |
| Chris M (Dr_No) 14th Feb 2021 - MM711 Base |
| Dracrius 12th Mar 2022 |
| |
\*-------------------------------------------------------------------*/
#include "CMMMController.h"
#include <cstring>
CMMMController::CMMMController(hid_device* dev_handle, char *_path, uint16_t pid) : product_id(pid)
{
const int szTemp = HID_MAX_STR;
wchar_t tmpName[szTemp];
dev = dev_handle;
location = _path;
current_speed = CM_MM_SPEED_3;
hid_get_manufacturer_string(dev, tmpName, szTemp);
std::wstring wName = std::wstring(tmpName);
vendor = std::string(wName.begin(), wName.end());
hid_get_indexed_string(dev, 2, tmpName, szTemp);
wName = std::wstring(tmpName);
serial = std::string(wName.begin(), wName.end());
if(product_id == CM_MM530_PID || product_id == CM_MM531_PID)
{
command_code = CM_MM5XX_COMMAND;
if(pid == CM_MM530_PID)
{
buttons_bytes[0] = CM_MM_MODE_BYTE;
buttons_bytes[1] = CM_MM_SPEED_BYTE;
buttons_bytes[2] = CM_MM_NFI_1;
wheel_bytes[0] = CM_MM_RED_BYTE;
wheel_bytes[1] = CM_MM_GREEN_BYTE;
wheel_bytes[2] = CM_MM_BLUE_BYTE;
}
else if(product_id == CM_MM531_PID) //Still Need Captures for Proper Mapping From a MM531 User
{
buttons_bytes[0] = CM_MM_MODE_BYTE;
buttons_bytes[1] = CM_MM_SPEED_BYTE;
buttons_bytes[2] = CM_MM_NFI_1;
wheel_bytes[0] = CM_MM_RED_BYTE;
wheel_bytes[1] = CM_MM_GREEN_BYTE;
wheel_bytes[2] = CM_MM_BLUE_BYTE;
}
}
else
{
command_code = CM_MM7XX_COMMAND;
buttons_bytes[0] = CM_MM_RED_BYTE;
buttons_bytes[1] = CM_MM_GREEN_BYTE;
buttons_bytes[2] = CM_MM_BLUE_BYTE;
wheel_bytes[0] = CM_MM_MODE_BYTE;
wheel_bytes[1] = CM_MM_SPEED_BYTE;
wheel_bytes[2] = CM_MM_NFI_1;
}
logo_bytes[0] = CM_MM_NFI_2;
logo_bytes[1] = CM_MM_NFI_3;
logo_bytes[2] = CM_MM_BRIGHTNESS_BYTE;
SendInitPacket();
GetColourStatus();
GetCustomStatus();
GetModeStatus();
}
CMMMController::~CMMMController()
{
hid_close(dev);
}
void CMMMController::GetColourStatus()
{
uint8_t buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x52, command_code };
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
current_brightness = buffer[CM_MM_BRIGHTNESS_BYTE - 1];
current_red = buffer[CM_MM_RED_BYTE - 1];
current_green = buffer[CM_MM_GREEN_BYTE - 1];
current_blue = buffer[CM_MM_BLUE_BYTE - 1];
}
void CMMMController::GetCustomStatus()
{
uint8_t buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x52, 0xA8 };
int read_size = CM_MM_PACKET_SIZE - 1;
int result = 0;
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
do
{
result = hid_read_timeout(dev, buffer, read_size, CM_MM_INTERRUPT_TIMEOUT);
}while(buffer[1] != 0xA8 && result == read_size);
if(result == read_size)
{
buttons_colour = ToRGBColor(buffer[4], buffer[5], buffer[6]);
logo_colour = ToRGBColor(buffer[7], buffer[8], buffer[9]);
wheel_colour = ToRGBColor(buffer[10], buffer[11], buffer[12]);
}
}
void CMMMController::GetModeStatus()
{
uint8_t buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x52, 0x28 };
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
hid_write(dev, buffer, buffer_size);
hid_read_timeout(dev, buffer, buffer_size, CM_MM_INTERRUPT_TIMEOUT);
current_mode = buffer[CM_MM_MODE_BYTE - 1];
}
std::string CMMMController::GetDeviceVendor()
{
return vendor;
}
std::string CMMMController::GetSerial()
{
return serial;
}
std::string CMMMController::GetLocation()
{
return("HID: " + location);
}
uint16_t CMMMController::GetProductID()
{
return product_id;
}
unsigned char CMMMController::GetMode()
{
return current_mode;
}
unsigned char CMMMController::GetLedRed()
{
return current_red;
}
unsigned char CMMMController::GetLedGreen()
{
return current_green;
}
unsigned char CMMMController::GetLedBlue()
{
return current_blue;
}
unsigned char CMMMController::GetLedSpeed()
{
return current_speed;
}
RGBColor CMMMController::GetWheelColour()
{
return wheel_colour;
}
RGBColor CMMMController::GetButtonsColour()
{
return buttons_colour;
}
RGBColor CMMMController::GetLogoColour()
{
return logo_colour;
}
void CMMMController::SetLedsDirect(RGBColor wheel_colour, RGBColor buttons_colour, RGBColor logo_colour)
{
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x51, 0xA8, 0x00, 0x00 };
buffer[buttons_bytes[0]] = RGBGetRValue(buttons_colour);
buffer[buttons_bytes[1]] = RGBGetGValue(buttons_colour);
buffer[buttons_bytes[2]] = RGBGetBValue(buttons_colour);
buffer[logo_bytes[0]] = RGBGetRValue(logo_colour);
buffer[logo_bytes[1]] = RGBGetGValue(logo_colour);
buffer[logo_bytes[2]] = RGBGetBValue(logo_colour);
buffer[wheel_bytes[0]] = RGBGetRValue(wheel_colour);
buffer[wheel_bytes[1]] = RGBGetGValue(wheel_colour);
buffer[wheel_bytes[2]] = RGBGetBValue(wheel_colour);
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
void CMMMController::SendUpdate(uint8_t mode, uint8_t speed, RGBColor colour, uint8_t brightness)
{
if (mode == CM_MM_MODE_CUSTOM || mode == CM_MM_MODE_MULTILAYER)
{
SendUsingZonesPacket(mode);
}
else
{
SendInitPacket();
SendApplyPacket(mode);
}
uint8_t nfi_1 = 0x20;
if (mode == CM_MM_MODE_STATIC || mode == CM_MM_MODE_SPECTRUM_CYCLE)
{
nfi_1 = 0x00;
}
if (mode != CM_MM_MODE_OFF)
{
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x51, command_code, 0x00, 0x00 };
buffer[CM_MM_MODE_BYTE] = mode;
buffer[CM_MM_SPEED_BYTE] = speed;
buffer[CM_MM_NFI_1] = nfi_1;
buffer[CM_MM_NFI_2] = 0xFF;
buffer[CM_MM_NFI_3] = 0xFF;
buffer[CM_MM_BRIGHTNESS_BYTE] = brightness;
buffer[CM_MM_RED_BYTE] = RGBGetRValue(colour);
buffer[CM_MM_GREEN_BYTE] = RGBGetGValue(colour);
buffer[CM_MM_BLUE_BYTE] = RGBGetBValue(colour);
buffer[CM_MM_SKY_RED_BYTE] = 0x00;
buffer[CM_MM_SKY_GREEN_BYTE] = 0x00;
buffer[CM_MM_SKY_BLUE_BYTE] = 0x00;
for (int i = 17; i < CM_MM_PACKET_SIZE; i++)
{
buffer[i] = 0xFF;
}
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
if (mode == CM_MM_MODE_CUSTOM || mode == CM_MM_MODE_MULTILAYER)
{
SendApplyPacket(mode); //Post Apply for Zoned Modes
}
}
void CMMMController::SendUpdate(uint8_t mode, uint8_t speed, RGBColor mode_one, RGBColor mode_two, uint8_t brightness)
{
SendApplyPacket(mode);
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x51, command_code, 0x00, 0x00 };
buffer[CM_MM_MODE_BYTE] = mode;
buffer[CM_MM_SPEED_BYTE] = speed;
buffer[CM_MM_NFI_1] = 0x00;
buffer[CM_MM_NFI_2] = 0x21;
buffer[CM_MM_NFI_3] = 0xFF;
buffer[CM_MM_BRIGHTNESS_BYTE] = brightness;
buffer[CM_MM_RED_BYTE] = RGBGetRValue(mode_one);
buffer[CM_MM_GREEN_BYTE] = RGBGetGValue(mode_one);
buffer[CM_MM_BLUE_BYTE] = RGBGetBValue(mode_one);
buffer[CM_MM_SKY_RED_BYTE] = RGBGetRValue(mode_two);
buffer[CM_MM_SKY_GREEN_BYTE] = RGBGetGValue(mode_two);
buffer[CM_MM_SKY_BLUE_BYTE] = RGBGetBValue(mode_two);
for (int i = 17; i < CM_MM_PACKET_SIZE; i++)
{
buffer[i] = 0xFF;
}
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
void CMMMController::SendInitPacket()
{
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x41, 0x80 };
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
void CMMMController::SendUsingZonesPacket(uint8_t mode)
{
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x51, 0x30, 0x00, 0x00 };
if (mode == CM_MM_MODE_MULTILAYER)
{
buffer[CM_MM_MODE_BYTE] = 0x01;
}
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
void CMMMController::SendApplyPacket(uint8_t mode)
{
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x51, 0x28, 0x00, 0x00 };
buffer[CM_MM_MODE_BYTE] = mode;
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
void CMMMController::SendMultilayerPacket(uint8_t zones[3])
{
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x51, 0xA0, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00 };
buffer[CM_MM_NFI_3] = zones[0];
buffer[CM_MM_BRIGHTNESS_BYTE] = zones[1];
buffer[CM_MM_RED_BYTE] = zones[2];
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
void CMMMController::SendSavePacket()
{
unsigned char buffer[CM_MM_PACKET_SIZE] = { 0x00, 0x50, 0x55 };
hid_write(dev, buffer, CM_MM_PACKET_SIZE);
hid_read_timeout(dev, buffer, CM_MM_PACKET_SIZE, CM_MM_INTERRUPT_TIMEOUT);
}
@@ -0,0 +1,147 @@
/*-------------------------------------------------------------------*\
| CMMMController.h |
| |
| Driver for Coolermaster MasterMouse |
| |
| Chris M (Dr_No) 14th Feb 2021 - MM711 Base |
| Dracrius 12th Mar 2022 |
| |
\*-------------------------------------------------------------------*/
#include <string>
#include <array>
#include <hidapi/hidapi.h>
#include "RGBController.h"
#pragma once
#define CM_MM_PACKET_SIZE 65
#define CM_MM_COLOUR_MODE_DATA_SIZE (sizeof(colour_mode_data[0]) / sizeof(colour_mode_data[0][0]))
#define CM_MM_HEADER_DATA_SIZE (sizeof(argb_header_data) / sizeof(argb_headers) )
#define CM_MM_INTERRUPT_TIMEOUT 250
#define CM_MM_DEVICE_NAME_SIZE (sizeof(device_name) / sizeof(device_name[ 0 ]))
#define HID_MAX_STR 255
enum
{
CM_MM530_PID = 0x0065,
CM_MM531_PID = 0x0097,
CM_MM711_PID = 0x0101,
CM_MM720_PID = 0x0141,
};
enum
{
CM_MM_REPORT_BYTE = 1,
CM_MM_COMMAND_BYTE = 2,
CM_MM_FUNCTION_BYTE = 3,
CM_MM_ZONE_BYTE = 4,
CM_MM_MODE_BYTE = 5,
CM_MM_SPEED_BYTE = 6,
CM_MM_NFI_1 = 7,
CM_MM_NFI_2 = 8,
CM_MM_NFI_3 = 9,
CM_MM_BRIGHTNESS_BYTE = 10,
CM_MM_RED_BYTE = 11,
CM_MM_GREEN_BYTE = 12,
CM_MM_BLUE_BYTE = 13,
CM_MM_SKY_RED_BYTE = 14,
CM_MM_SKY_GREEN_BYTE = 15,
CM_MM_SKY_BLUE_BYTE = 16
};
enum
{
CM_MM5XX_COMMAND = 0x2C,
CM_MM7XX_COMMAND = 0x2B
};
enum
{
CM_MM_CUSTOM_APPLY = 0x30, //Also Used for Multilayer Mode
CM_MM_APPLY = 0x28 //Sent Before Update, Unless using a Zoned Mode then UsingZones Before and Apply After
};
enum
{
CM_MM_MODE_STATIC = 0, //Static Mode
CM_MM_MODE_BREATHING = 1, //Breathing Mode
CM_MM_MODE_SPECTRUM_CYCLE = 2, //Spectrum Cycle Mode
CM_MM_MODE_STARS = 3, //Stars Mode
CM_MM_MODE_INDICATOR = 4, //Indicator Mode
CM_MM_MODE_CUSTOM = 176, //Custom LED Control
CM_MM_MODE_MULTILAYER = 224, //Multilayer Mode, i.e. Effect per Zone.
CM_MM_MODE_OFF = 254 //Turn Off
};
enum
{
CM_MM_SPEED_1 = 0x3C, // Slowest speed
CM_MM_SPEED_2 = 0x37,
CM_MM_SPEED_3 = 0x31, // Normal speed
CM_MM_SPEED_4 = 0x2C,
CM_MM_SPEED_5 = 0x26 // Fastest speed
};
class CMMMController
{
public:
CMMMController(hid_device* dev_handle, char *_path, uint16_t pid);
~CMMMController();
std::string GetDeviceVendor();
std::string GetSerial();
std::string GetLocation();
uint16_t GetProductID();
uint8_t GetZoneIndex();
uint8_t GetMode();
uint8_t GetLedRed();
uint8_t GetLedGreen();
uint8_t GetLedBlue();
uint8_t GetLedSpeed();
RGBColor GetWheelColour();
RGBColor GetButtonsColour();
RGBColor GetLogoColour();
void SendUpdate(uint8_t mode, uint8_t speed, RGBColor colour, uint8_t brightness);
void SendUpdate(uint8_t mode, uint8_t speed, RGBColor mode_one, RGBColor mode_two, uint8_t brightness);
void SetLedsDirect(RGBColor wheel_colour, RGBColor buttons_colour, RGBColor logo_colour);
void SendSavePacket();
private:
std::string name;
std::string vendor;
std::string serial;
std::string location;
hid_device* dev;
uint16_t product_id;
uint8_t command_code;
uint8_t current_mode;
uint8_t current_speed;
uint8_t current_brightness;
uint8_t current_red;
uint8_t current_green;
uint8_t current_blue;
uint8_t buttons_bytes[3];
uint8_t logo_bytes[3];
uint8_t wheel_bytes[3];
RGBColor buttons_colour;
RGBColor logo_colour;
RGBColor wheel_colour;
void GetColourStatus();
void GetCustomStatus();
void GetModeStatus();
void SendInitPacket();
void SendUsingZonesPacket(uint8_t mode);
void SendApplyPacket(uint8_t mode);
void SendMultilayerPacket(uint8_t zones[3]);
};
@@ -7,6 +7,7 @@
#include "CMR6000Controller.h"
#include "CMMKController.h"
#include "RGBController.h"
#include "RGBController_CMMMController.h"
#include "RGBController_CMMM711Controller.h"
#include "RGBController_CMMP750Controller.h"
#include "RGBController_CMARGBController.h"
@@ -18,6 +19,8 @@
#define COOLERMASTER_VID 0x2516
#define COOLERMASTER_MM530_PID 0x0065
#define COOLERMASTER_MM531_PID 0x0097
#define COOLERMASTER_MM711_PID 0x0101
#define COOLERMASTER_MM720_PID 0x0141
#define COOLERMASTER_MP750_XL_PID 0x0109
@@ -27,12 +30,12 @@
#define COOLERMASTER_SMALL_ARGB_PID 0x1000
#define COOLERMASTER_RGB_PID 0x004F
#define COOLERMASTER_RADEON_6000_PID 0x014D
#define COOLERMASTER_MASTERKEYS_PRO_L_PID CMMK_USB_MASTERKEYS_PRO_L
#define COOLERMASTER_MASTERKEYS_PRO_L_WHITE_PID CMMK_USB_MASTERKEYS_PRO_L_WHITE
#define COOLERMASTER_MASTERKEYS_PRO_S_PID CMMK_USB_MASTERKEYS_PRO_S
#define COOLERMASTER_MASTERKEYS_MK750_PID CMMK_USB_MASTERKEYS_MK750
#define COOLERMASTER_MASTERKEYS_SK630_PID CMMK_USB_MASTERKEYS_SK630
#define COOLERMASTER_MASTERKEYS_SK650_PID CMMK_USB_MASTERKEYS_SK650
#define COOLERMASTER_MASTERKEYS_PRO_L_PID 0x003B
#define COOLERMASTER_MASTERKEYS_PRO_L_WHITE_PID 0x0047
#define COOLERMASTER_MASTERKEYS_PRO_S_PID 0x003C
#define COOLERMASTER_MASTERKEYS_MK750_PID 0x0067
#define COOLERMASTER_MASTERKEYS_SK630_PID 0x0089
#define COOLERMASTER_MASTERKEYS_SK650_PID 0x008D
/******************************************************************************************\
* *
@@ -45,6 +48,7 @@
void DetectCoolerMasterARGB(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
/*-------------------------------------------------*\
@@ -55,7 +59,7 @@ void DetectCoolerMasterARGB(hid_device_info* info, const std::string&)
for(std::size_t i = 0; i < CM_ARGB_HEADER_DATA_SIZE; i++)
{
CMARGBController* controller = new CMARGBController(dev, info->path, i, cm_mutex);
CMARGBController* controller = new CMARGBController(dev, info->path, i, cm_mutex);
RGBController_CMARGBController* rgb_controller = new RGBController_CMARGBController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
@@ -66,9 +70,10 @@ void DetectCoolerMasterARGB(hid_device_info* info, const std::string&)
void DetectCoolerMasterGPU(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CMR6000Controller* controller = new CMR6000Controller(dev, info->path);
CMR6000Controller* controller = new CMR6000Controller(dev, info->path);
RGBController_CMR6000Controller* rgb_controller = new RGBController_CMR6000Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
@@ -77,35 +82,48 @@ void DetectCoolerMasterGPU(hid_device_info* info, const std::string&)
void DetectCoolerMasterKeyboards(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CMMKController* controller = new CMMKController(dev, info);
CMMKController* controller = new CMMKController(dev, info);
RGBController_CMMKController* rgb_controller = new RGBController_CMMKController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
void DetectCoolerMasterMouse(hid_device_info* info, const std::string&)
void DetectCoolerMasterMouse(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CMMM711Controller* controller = new CMMM711Controller(dev, info->path);
RGBController_CMMM711Controller* rgb_controller = new RGBController_CMMM711Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
if(info->product_id == COOLERMASTER_MM530_PID || info->product_id == COOLERMASTER_MM531_PID)
{
CMMMController* controller = new CMMMController(dev, info->path, info->product_id);
RGBController_CMMMController* rgb_controller = new RGBController_CMMMController(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
else if(info->product_id == COOLERMASTER_MM711_PID)
{
CMMM711Controller* controller = new CMMM711Controller(dev, info->path);
RGBController_CMMM711Controller* rgb_controller = new RGBController_CMMM711Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
}
void DetectCoolerMasterMousemats(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CMMP750Controller* controller = new CMMP750Controller(dev, info->path);
CMMP750Controller* controller = new CMMP750Controller(dev, info->path);
RGBController_CMMP750Controller* rgb_controller = new RGBController_CMMP750Controller(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
@@ -115,9 +133,10 @@ void DetectCoolerMasterMousemats(hid_device_info* info, const std::string&)
void DetectCoolerMasterRGB(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CMRGBController* controller = new CMRGBController(dev, info->path);
CMRGBController* controller = new CMRGBController(dev, info->path);
RGBController_CMRGBController* rgb_controller = new RGBController_CMRGBController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
@@ -127,15 +146,18 @@ void DetectCoolerMasterRGB(hid_device_info* info, const std::string&)
void DetectCoolerMasterSmallARGB(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CMSmallARGBController* controller = new CMSmallARGBController(dev, info->path, 0);
CMSmallARGBController* controller = new CMSmallARGBController(dev, info->path, 0);
RGBController_CMSmallARGBController* rgb_controller = new RGBController_CMSmallARGBController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
REGISTER_HID_DETECTOR_IPU("Cooler Master MM530", DetectCoolerMasterMouse, COOLERMASTER_VID, COOLERMASTER_MM530_PID, 1, 0xFF00, 1);
//REGISTER_HID_DETECTOR_IPU("Cooler Master MM531", DetectCoolerMasterMouse, COOLERMASTER_VID, COOLERMASTER_MM531_PID, 1, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master MM711", DetectCoolerMasterMouse, COOLERMASTER_VID, COOLERMASTER_MM711_PID, 1, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master MM720", DetectCoolerMasterMouse, COOLERMASTER_VID, COOLERMASTER_MM720_PID, 1, 0xFF00, 1);
REGISTER_HID_DETECTOR_PU ("Cooler Master MP750 XL", DetectCoolerMasterMousemats, COOLERMASTER_VID, COOLERMASTER_MP750_XL_PID, 0xFF00, 1);
@@ -147,7 +169,7 @@ REGISTER_HID_DETECTOR_IPU("Cooler Master MasterKeys Pro S", DetectCooler
REGISTER_HID_DETECTOR_IPU("Cooler Master MK570", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_MK750_PID, 1, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master SK630", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_SK630_PID, 1, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master SK650", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_SK650_PID, 1, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master ARGB", DetectCoolerMasterARGB, COOLERMASTER_VID, COOLERMASTER_ARGB_PID, 0, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master Small ARGB", DetectCoolerMasterSmallARGB, COOLERMASTER_VID, COOLERMASTER_SMALL_ARGB_PID, 0, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master RGB", DetectCoolerMasterRGB, COOLERMASTER_VID, COOLERMASTER_RGB_PID, 0, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master ARGB", DetectCoolerMasterARGB, COOLERMASTER_VID, COOLERMASTER_ARGB_PID, 0, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master Small ARGB", DetectCoolerMasterSmallARGB, COOLERMASTER_VID, COOLERMASTER_SMALL_ARGB_PID, 0, 0xFF00, 1);
REGISTER_HID_DETECTOR_IPU("Cooler Master RGB", DetectCoolerMasterRGB, COOLERMASTER_VID, COOLERMASTER_RGB_PID, 1, 0xFF00, 1);
REGISTER_HID_DETECTOR_I ("Cooler Master Radeon 6000 GPU", DetectCoolerMasterGPU, COOLERMASTER_VID, COOLERMASTER_RADEON_6000_PID, 1 );
@@ -9,20 +9,33 @@
#include "RGBController_CMARGBController.h"
RGBController_CMARGBController::RGBController_CMARGBController(CMARGBController *cmargb_ptr)
{
cmargb = cmargb_ptr;
unsigned char speed = cmargb->GetLedSpeed();
/**------------------------------------------------------------------*\
@name Coolermaster ARGB
@category LEDStrip
@type USB
@save :robot:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectCoolerMasterARGB
@comment The Coolermaster ARGB device supports `Direct` mode from
firmware 0028 onwards. Check the serial number for the date
"A202105291658" or newer.
\*-------------------------------------------------------------------*/
name = argb_header_data[cmargb->GetZoneIndex()].name;
RGBController_CMARGBController::RGBController_CMARGBController(CMARGBController* controller_ptr)
{
controller = controller_ptr;
unsigned char speed = controller->GetLedSpeed();
name = argb_header_data[controller->GetZoneIndex()].name;
vendor = "Cooler Master";
type = DEVICE_TYPE_LEDSTRIP;
description = cmargb->GetDeviceName();
description = controller->GetDeviceName();
version = "3.0 for FW0028";
serial = cmargb->GetSerial();
location = cmargb->GetLocation();
serial = controller->GetSerial();
location = controller->GetLocation();
if(argb_header_data[cmargb->GetZoneIndex()].digital)
if(argb_header_data[controller->GetZoneIndex()].digital)
{
mode Off;
Off.name = "Turn Off";
@@ -256,7 +269,7 @@ RGBController_CMARGBController::RGBController_CMARGBController(CMARGBController
Init_Controller();
SetupZones();
int temp_mode = cmargb->GetMode();
int temp_mode = controller->GetMode();
for(std::size_t mode_idx = 0; mode_idx < modes.size() ; mode_idx++)
{
if (temp_mode == modes[mode_idx].value)
@@ -267,23 +280,23 @@ RGBController_CMARGBController::RGBController_CMARGBController(CMARGBController
}
if (modes[active_mode].flags & MODE_FLAG_HAS_MODE_SPECIFIC_COLOR)
{
modes[active_mode].colors[0] = ToRGBColor(cmargb->GetLedRed(), cmargb->GetLedGreen(), cmargb->GetLedBlue());
modes[active_mode].color_mode = (cmargb->GetRandomColours()) ? MODE_COLORS_RANDOM : MODE_COLORS_MODE_SPECIFIC;
modes[active_mode].colors[0] = ToRGBColor(controller->GetLedRed(), controller->GetLedGreen(), controller->GetLedBlue());
modes[active_mode].color_mode = (controller->GetRandomColours()) ? MODE_COLORS_RANDOM : MODE_COLORS_MODE_SPECIFIC;
}
if (modes[active_mode].flags & MODE_FLAG_HAS_SPEED)
{
modes[active_mode].speed = cmargb->GetLedSpeed();
modes[active_mode].speed = controller->GetLedSpeed();
}
}
RGBController_CMARGBController::~RGBController_CMARGBController()
{
delete cmargb;
delete controller;
}
void RGBController_CMARGBController::Init_Controller()
{
int zone_idx = cmargb->GetZoneIndex();
int zone_idx = controller->GetZoneIndex();
int zone_led_count = argb_header_data[zone_idx].count;
/*-------------------------------------------------*\
@@ -319,7 +332,7 @@ void RGBController_CMARGBController::SetupZones()
if (!boolSingleLED)
{
cmargb->SetLedCount( std::stoi(zones[zone_idx].name), zones[zone_idx].leds_count);
controller->SetLedCount( std::stoi(zones[zone_idx].name), zones[zone_idx].leds_count);
}
for(unsigned int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
@@ -377,7 +390,7 @@ void RGBController_CMARGBController::DeviceUpdateLEDs()
void RGBController_CMARGBController::UpdateZoneLEDs(int zone)
{
cmargb->SetLedsDirect( zones[zone].colors, zones[zone].leds_count );
controller->SetLedsDirect( zones[zone].colors, zones[zone].leds_count );
}
void RGBController_CMARGBController::UpdateSingleLED(int led)
@@ -399,10 +412,10 @@ void RGBController_CMARGBController::SetCustomMode()
void RGBController_CMARGBController::DeviceUpdateMode()
{
bool random_colours = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
bool random_colours = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
RGBColor colour = (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC) ? modes[active_mode].colors[0] : 0;
cmargb->SetMode( modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, colour, random_colours );
controller->SetMode( modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, colour, random_colours );
}
int RGBController_CMARGBController::GetLED_Zone(int led_idx)
@@ -1,40 +1,40 @@
/*-------------------------------------------------------------------*\
| RGBController_CMARGBController.h |
| |
| Driver for Coolermaster ARGB Controller |
| |
| Chris M (Dr_No) 14th Oct 2020 |
| |
\*-------------------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "CMARGBcontroller.h"
#include <vector>
#define first_zone(zn) ((zones.size() > 1) ? 1 : 0)
#define last_zone(zn) ((zones.size() > 1) ? 4 : 1)
class RGBController_CMARGBController : public RGBController
{
public:
RGBController_CMARGBController(CMARGBController* cmargb_ptr);
~RGBController_CMARGBController();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
void Init_Controller();
int GetDeviceMode();
int GetLED_Zone(int led_idx);
CMARGBController* cmargb;
};
/*-------------------------------------------------------------------*\
| RGBController_CMARGBController.h |
| |
| Driver for Coolermaster ARGB Controller |
| |
| Chris M (Dr_No) 14th Oct 2020 |
| |
\*-------------------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "CMARGBcontroller.h"
#include <vector>
#define first_zone(zn) ((zones.size() > 1) ? 1 : 0)
#define last_zone(zn) ((zones.size() > 1) ? 4 : 1)
class RGBController_CMARGBController : public RGBController
{
public:
RGBController_CMARGBController(CMARGBController* controller_ptr);
~RGBController_CMARGBController();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
void Init_Controller();
int GetDeviceMode();
int GetLED_Zone(int led_idx);
CMARGBController* controller;
};
@@ -4,7 +4,7 @@
| Driver for Coolermaster MasterKeys keyboards |
| |
| Lukas N (chmod222) 28th Jun 2020 |
| Tam D (too.manyhobbies) 25th Apr 2021 |
| Tam D (too.manyhobbies) 25th Apr 2021 |
| |
\*-------------------------------------------------------------------*/
@@ -20,18 +20,29 @@ using namespace std::chrono_literals;
#define CMMK_MODE_FIRMWARE 0xFF
#define CMMK_MODE_MANUAL 0x7F
RGBController_CMMKController::RGBController_CMMKController(CMMKController* cmmk_ctrl)
{
cmmk = cmmk_ctrl;
/**------------------------------------------------------------------*\
@name Coolermaster Masterkeys Keyboards
@category Keyboard
@type USB
@save :robot:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectCoolerMasterKeyboards
@comment
\*-------------------------------------------------------------------*/
name = cmmk->GetDeviceName();
vendor = cmmk->GetDeviceVendor();
RGBController_CMMKController::RGBController_CMMKController(CMMKController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = controller->GetDeviceVendor();
type = DEVICE_TYPE_KEYBOARD;
description = "Cooler Master MasterKeys Device";
version = cmmk->GetFirmwareVersion();
version = controller->GetFirmwareVersion();
serial = "";
location = cmmk->GetLocation();
location = controller->GetLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = CMMK_MODE_MANUAL;
@@ -48,7 +59,7 @@ RGBController_CMMKController::RGBController_CMMKController(CMMKController* cmmk_
Static.colors_max = 1;
Static.colors.resize(1);
modes.push_back(Static);
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = CMMK_EFFECT_BREATHE;
@@ -98,7 +109,7 @@ RGBController_CMMKController::RGBController_CMMKController(CMMKController* cmmk_
Wave.colors_max = 1;
Wave.colors.resize(1);
modes.push_back(Wave);
mode Ripple;
Ripple.name = "Ripple Effect";
Ripple.value = CMMK_EFFECT_RIPPLE;
@@ -111,7 +122,7 @@ RGBController_CMMKController::RGBController_CMMKController(CMMKController* cmmk_
Ripple.colors_max = 2;
Ripple.colors.resize(2);
modes.push_back(Ripple);
mode Cross;
Cross.name = "Cross";
Cross.value = CMMK_EFFECT_CROSS;
@@ -137,7 +148,7 @@ RGBController_CMMKController::RGBController_CMMKController(CMMKController* cmmk_
Raindrops.colors_max = 2;
Raindrops.colors.resize(2);
modes.push_back(Raindrops);
mode Stars;
Stars.name = "Starfield";
Stars.value = CMMK_EFFECT_STARS;
@@ -173,7 +184,7 @@ RGBController_CMMKController::RGBController_CMMKController(CMMKController* cmmk_
RGBController_CMMKController::~RGBController_CMMKController()
{
delete cmmk;
delete controller;
}
void RGBController_CMMKController::SetupMatrixMap()
@@ -199,14 +210,14 @@ void RGBController_CMMKController::SetupMatrixMap()
void RGBController_CMMKController::SetupZones()
{
uint8_t row_count = cmmk->GetRowCount();
uint8_t column_count = cmmk->GetColumnCount();
uint8_t row_count = controller->GetRowCount();
uint8_t column_count = controller->GetColumnCount();
for(int y = 0; y < row_count; y++)
{
for(int x = 0; x < column_count; x++)
{
if(!cmmk->PositionValid(y, x))
if(!controller->PositionValid(y, x))
{
continue;
}
@@ -214,7 +225,7 @@ void RGBController_CMMKController::SetupZones()
std::stringstream namestrm;
led key;
namestrm << "Key @ Row " << (y + 1) << ", Column" << (x + 1);
key.name = namestrm.str();
@@ -308,7 +319,7 @@ void RGBController_CMMKController::DeviceUpdateLEDs()
if(force_update.load() || dirty.load())
{
cmmk->SetAll(current_matrix);
controller->SetAll(current_matrix);
force_update.store(false);
}
@@ -322,7 +333,7 @@ void RGBController_CMMKController::UpdateZoneLEDs(int zone_idx)
if(force_update.load() || dirty.load())
{
cmmk->SetAll(current_matrix);
controller->SetAll(current_matrix);
force_update.store(false);
}
@@ -337,7 +348,7 @@ void RGBController_CMMKController::UpdateSingleLED(int led_idx)
current_matrix.data[y][x] = map_to_cmmk_rgb(colors[led_idx]);
cmmk->SetSingle(y, x, map_to_cmmk_rgb(colors[led_idx]));
controller->SetSingle(y, x, map_to_cmmk_rgb(colors[led_idx]));
dirty.store(false);
}
@@ -353,11 +364,11 @@ void RGBController_CMMKController::DeviceUpdateMode()
switch(modes[active_mode].value)
{
case CMMK_MODE_FIRMWARE:
cmmk->SetFirmwareControl();
controller->SetFirmwareControl();
break;
case CMMK_MODE_MANUAL:
cmmk->SetManualControl();
controller->SetManualControl();
break;
case CMMK_EFFECT_FULLY_LIT:
@@ -366,7 +377,7 @@ void RGBController_CMMKController::DeviceUpdateMode()
fully_lit_effect.color = map_to_cmmk_rgb(modes[active_mode].colors[0]);
cmmk->SetMode(fully_lit_effect);
controller->SetMode(fully_lit_effect);
}
break;
@@ -377,7 +388,7 @@ void RGBController_CMMKController::DeviceUpdateMode()
breathe_effect.speed = (uint8_t)modes[active_mode].speed;
breathe_effect.color = map_to_cmmk_rgb(modes[active_mode].colors[0]);
cmmk->SetMode(breathe_effect);
controller->SetMode(breathe_effect);
}
break;
@@ -387,10 +398,10 @@ void RGBController_CMMKController::DeviceUpdateMode()
cycle_effect.speed = (uint8_t)modes[active_mode].speed;
cmmk->SetMode(cycle_effect);
controller->SetMode(cycle_effect);
}
break;
case CMMK_EFFECT_SINGLE:
{
cmmk_effect_single single_effect;
@@ -399,10 +410,10 @@ void RGBController_CMMKController::DeviceUpdateMode()
single_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
single_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
cmmk->SetMode(single_effect);
controller->SetMode(single_effect);
}
break;
case CMMK_EFFECT_WAVE:
{
cmmk_effect_wave wave_effect;
@@ -411,10 +422,10 @@ void RGBController_CMMKController::DeviceUpdateMode()
wave_effect.direction = map_to_cmmk_dir(modes[active_mode].direction);
wave_effect.start = map_to_cmmk_rgb(modes[active_mode].colors[0]);
cmmk->SetMode(wave_effect);
controller->SetMode(wave_effect);
}
break;
case CMMK_EFFECT_RIPPLE:
{
cmmk_effect_ripple ripple_effect;
@@ -432,10 +443,10 @@ void RGBController_CMMKController::DeviceUpdateMode()
ripple_effect.ripple_type = CMMK_RIPPLE_GIVEN_COLOR;
}
cmmk->SetMode(ripple_effect);
controller->SetMode(ripple_effect);
}
break;
case CMMK_EFFECT_CROSS:
{
cmmk_effect_cross cross_effect;
@@ -444,10 +455,10 @@ void RGBController_CMMKController::DeviceUpdateMode()
cross_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
cross_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
cmmk->SetMode(cross_effect);
controller->SetMode(cross_effect);
}
break;
case CMMK_EFFECT_RAINDROPS:
{
cmmk_effect_raindrops raindrops_effect;
@@ -457,30 +468,30 @@ void RGBController_CMMKController::DeviceUpdateMode()
raindrops_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
raindrops_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
cmmk->SetMode(raindrops_effect);
controller->SetMode(raindrops_effect);
}
break;
case CMMK_EFFECT_STARS:
{
cmmk_effect_stars stars_effect;
stars_effect.speed = (uint8_t)modes[active_mode].speed;
stars_effect.interval = CMMK_SPEED_MID;
stars_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
stars_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
cmmk->SetMode(stars_effect);
controller->SetMode(stars_effect);
}
break;
case CMMK_EFFECT_SNAKE:
{
cmmk_effect_snake snake_effect;
snake_effect.speed = (uint8_t)modes[active_mode].speed;
cmmk->SetMode(snake_effect);
controller->SetMode(snake_effect);
}
break;
}
@@ -1,42 +1,42 @@
/*-------------------------------------------------------------------*\
| RGBController_CMMKController.h |
| |
| Driver for Coolermaster MasterKeys keyboards |
| |
| Lukas N (chmod222) 28th Jun 2020 |
| Tam D (too.manyhobbies) 25th Apr 2021 |
| |
\*-------------------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "CMMKController.h"
class RGBController_CMMKController : public RGBController
{
public:
RGBController_CMMKController(CMMKController* cmmk_ptr);
~RGBController_CMMKController();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
void SetupMatrixMap();
CMMKController* cmmk;
int matrix_map[CMMK_ROWS_MAX][CMMK_COLS_MAX];
struct cmmk_color_matrix current_matrix;
std::atomic<bool> dirty;
std::atomic<bool> force_update;
};
/*-------------------------------------------------------------------*\
| RGBController_CMMKController.h |
| |
| Driver for Coolermaster MasterKeys keyboards |
| |
| Lukas N (chmod222) 28th Jun 2020 |
| Tam D (too.manyhobbies) 25th Apr 2021 |
| |
\*-------------------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "CMMKController.h"
class RGBController_CMMKController : public RGBController
{
public:
RGBController_CMMKController(CMMKController* controller_ptr);
~RGBController_CMMKController();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
void SetupMatrixMap();
CMMKController* controller;
int matrix_map[CMMK_ROWS_MAX][CMMK_COLS_MAX];
struct cmmk_color_matrix current_matrix;
std::atomic<bool> dirty;
std::atomic<bool> force_update;
};

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