Compare commits

..
Author SHA1 Message Date
Adam Honse 14d543b9e4 Initial commit for Linux-only controller for Valve Steam Machine using
the leds-valve kernel module and sysfs interface
2026-07-25 01:16:11 -05:00
Ilya Miller 8a831cef04 Add Dark Project KD104A support to the Keyrox Classic driver 2026-07-24 13:53:06 -05:00
Ken Sanislo 9fd79b1ad2 RGBController_Virtual: signal update when description is replaced 2026-07-24 13:22:00 -05:00
Daniel Clark c9c37a4576 Add GC-USB dongle, per zone effects, Gen2 Zones, and Updated MB Layouts 2026-07-22 22:47:25 -05:00
Ken Sanislo fe53d90664 RGBController: fix callback list race and dangling device-page callback on rescan 2026-07-22 21:59:30 -05:00
Adam Honse 8e8a9c8e05 Split Alienware keyboard controller detect file into individual controllers 2026-07-22 19:08:23 -05:00
Adam Honse dafc6e9cbc Split Bloody/A4Tech detector file into individual files per controller 2026-07-22 11:37:15 -05:00
Bernd Loecke 68b113bf86 Add MSI MAG X870E TOMAHAWK MAX WIFI PZ support 2026-07-22 07:42:41 -05:00
Ken Sanislo eb5d8b579c MSIMysticLight761: restore resizable JAF/JARGB zones 2026-07-22 07:41:30 -05:00
Adam Honse 56df76dbfc Split HyperX keyboard detector file into individual detector files 2026-07-22 00:42:16 -05:00
Adam Honse 878f32fccf Split Holtek detector file into individual detector files for A1FA Mousemat and A070 Mouse 2026-07-21 23:50:13 -05:00
Adam Honse 63828313bd Split EVGAUSBControllerDetect into individual keyboard and mouse files 2026-07-21 23:34:06 -05:00
homelab black 31992acad1 Fix layout regression for KEY_EN_ESCAPE and KEY_JP_EJ 2026-07-21 22:44:15 +09:00
HNParda bd41ba3b5c Added Support for Gigabyte RX 6700 XT Eagle 12G 2026-07-21 00:15:58 -05:00
Adam Honse b9309c61e1 Split EVision keyboard files into folders and split the shared detector file 2026-07-21 00:14:12 -05:00
Ken Sanislo 7fc8aea930 MSIMonitorController: 0x72 layout support (MPG 322URX QD-OLED + siblings) 2026-07-20 23:22:02 -05:00
Ken Sanislo b35e119325 DetectionManager: controller lifecycle and thread-safe registration 2026-07-19 02:04:46 -05:00
eldiablo 8fb790358f Add support for SteelSeries Arctis Nova 3 headset 2026-07-18 18:54:38 -05:00
Ken Sanislo 39c6dbf361 DeviceView: add F13-F15 and Number Pad = device-view labels 2026-07-18 13:01:25 -05:00
John Hamlin 9d189d5b9b Add support for MSI B850 GAMING PLUS WIFI PZ (MS-7E75) motherboard 2026-07-17 19:07:39 -05:00
Adam Honse 9e5c63cc64 Add second sub-dev for MSI RTX4070Ti Super Gaming White X Slim 2026-07-17 18:54:54 -05:00
Adam Honse b664f35e17 Fix potential out of bounds reference in ASRockPolychromeUSB controller when zone size is 0 2026-07-17 17:17:39 -05:00
Filip Machałowski 381e3ac70c Add support for PowerColor Red Devil RX 9070 2026-07-17 13:19:35 +02:00
Stella e3225d93c4 Add support for Colorful iGAME RTX 5070Ti Ultra W OC 16GB 2026-07-17 00:14:57 -05:00
Andrey 1b3480bf8a Replace ADL2_ADAPTER_PRIMARY_GET function usage with adapter_index in i2c_smbus_amdadl 2026-07-16 08:17:16 -05:00
RedBlackAka a6bea17df2 Add Nvidia RTX 2080 Ti Cyperpunk 2077 Edition 2026-07-16 04:10:41 +02:00
Adam Honse 28d73d74bc Delete hidden pages if their controller no longer exists 2026-07-14 21:45:18 -05:00
Adam Honse cf383cacdd Use a blocking connection when updating the device list to prevent accessing deleted controllers 2026-07-14 21:45:18 -05:00
Adam Honse d9b0995b44 Run RescanDevices in a background thread to avoid locking the UI thread and causing a deadlock in the plugins 2026-07-14 21:45:18 -05:00
Ken Sanislo 79eb758a52 Logitech HID++ 2.0: restore COUNT fill for the keyboard matrix map 2026-07-14 21:45:18 -05:00
Daniel Clark 75463b8772 Fix K5 V2 layout and add ANSI Enter Expansion 2026-07-14 21:45:18 -05:00
Barry H 5da92fca4e Added all Skydimo Serial and HID devices 2026-07-14 21:42:42 -05:00
Darren You d11be2aa0b Initial commit for Colorful iGame GeForce RTX 4090 Neptune OC-V 2026-07-13 00:17:06 -05:00
Adam Honse 285a7bce4e Implement a matrix patching system in the Keychron QMK controller to apply keyboard-specific patches to correct for misplaced LEDs 2026-07-12 16:25:07 -05:00
Adam Honse 21009cdc45 Don't send RGBController packets that are too new for the current protocol in NetworkClient 2026-07-11 14:20:43 -05:00
Adam Honse a0cee2ce2b Maintain a list of created virtual controllers in the OpenRGBPluginAPI object and only allow registering virtual controllers that exist in this list 2026-07-11 14:20:38 -05:00
Joseph E ba33ff0c35 Steelseries Apex 9 merge into Apex controller + enable onboard mode 2026-07-11 00:11:45 -05:00
compguy284 795616e62d Fix Corsair keyboard cold-boot detection by retrying firmware info read 2026-07-10 17:55:23 -05:00
Adam Honse baa033ff7f Add Keychron Q0 HE 2026-07-10 15:40:35 -05:00
Eder Sanchez 33ec03d129 NetworkServer: reject SDK index == element count (off-by-one)
The SDK LED/zone update handlers checked the client-supplied index with '>'
instead of '>=', so an index equal to the element count passed the check and
reached an out-of-bounds access:

- UpdateSingleLED: out-of-bounds write to colors[led_idx]
- UpdateZoneLEDs / UpdateZoneMode: out-of-bounds read/write on zones[zone_idx]

UpdateMode had the same off-by-one (currently harmless due to a later check),
fixed for consistency. The num_colors check stays '>' since num_colors ==
leds_count is a valid "all LEDs" request.
2026-07-10 14:44:44 -05:00
Eder Sanchez a0d5a985f0 ZOTAC Blackwell GPU: fix firmware-version read
ReadVersion() issued a register-less block read, so the device returned a
status byte (0x01) instead of the version string. Read register 0xF0 (a
32-byte ASCII board string), as the vendor tool does, and validate it.

- fixes the empty/garbage firmware version in the log and GUI
- closes an out-of-bounds read (unbounded std::string over a 32-byte buffer)
- tested on RTX 5080 AMP Extreme INFINITY: now reads "N762A-2008e"
2026-07-10 13:42:01 -05:00
Adam Honse 1275fe816b Make tray icon menus translatable 2026-07-10 13:00:12 -05:00
homelab black d4e1ed5245 Controllers: RoccatVulcan: Add Japanese (JIS) layout support for Vulcan II Max 2026-07-10 00:14:02 -05:00
Marius Huecker b833a43490 Add Gainward RTX 4080 Phantom GS 2026-07-08 20:16:38 -05:00
Adam Honse 94295c52ba Dynamically set DeviceView minimum height based on height of contents to avoid devices with a lot of segments/zones getting squished 2026-07-08 20:05:21 -05:00
Adam Honse f32aa29ecd Put Device View in a QScrollArea so it can be scrolled if it is too large to fit in the window 2026-07-08 11:03:31 -05:00
Adam Honse 623fdfe522 DetectionManager fixes and optimizations 2026-07-07 23:01:39 -05:00
Adam Honse a122ccdc37 Add network packet for requesting USB serial ports 2026-07-07 21:00:46 -05:00
Dmitry K 74219e502a [next] Add function to retrieve ALL USB-attached COM ports 2026-07-07 21:00:36 -05:00
Dmitry K 73cd84f43c [next] Fix memory leak in serial port detection 2026-07-07 17:13:59 -05:00
Adam Honse f5a8ecc3f4 Rework RGBController functions that return vector counts to use unsigned int instead of std::size_t, to be consistent with the size used in the network protocol and to fix warnings 2026-07-07 17:13:59 -05:00
Adam Honse 86a6a130e7 Add network packet for getting list of serial ports 2026-07-07 17:13:59 -05:00
Adam Honse 703afac049 Update OpenRGB SDK Wireshark Dissector 2026-07-07 17:13:59 -05:00
Adam Honse 2d0ebb7279 Update RGBController API documentation 2026-07-07 17:13:59 -05:00
Adam Honse d9b51e4a02 Update SDK documentation and add a server flag to indicate if the server supports the device info requests 2026-07-07 17:13:45 -05:00
Adam Honse 387fed4f79 Add network request for requesting list of USB devices in local client mode 2026-07-07 01:35:35 -05:00
Adam Honse df0137c2b0 Add network request for requesting list of HID devices in local client mode 2026-07-07 01:35:35 -05:00
Adam Honse 7c059fa3e3 Fix RGBController callback registration in NetworkServer 2026-07-07 01:35:35 -05:00
Adam Honse 1a62db7246 Fixes for V6+ client on V5- server 2026-07-07 01:35:35 -05:00
Adam Honse 3a0b93c774 Remove mode::value and led::value accessors, remove these fields from protocol version 6 and newer. These should be internal use only, but are still accessed for protocol 5 and earlier for backwards compatibility. 2026-07-07 01:35:35 -05:00
Adam Honse 1afe65d206 Move CompareControllers to RGBController 2026-07-07 01:35:35 -05:00
Adam Honse 962754f379 Perform validity checking on received modes when UpdateMode/UpdateZoneMode/SaveMode are called from a network client 2026-07-07 01:35:35 -05:00
Adam Honse e69c9eedae Add display name fields to controller and zone instead of editing the existing name field 2026-07-07 01:35:35 -05:00
Adam Honse 9182d1e566 Add ConfigureDevice and the ability to configure device name 2026-07-07 01:35:35 -05:00
Adam Honse 893de3f076 Add SetHidden SDK packet 2026-07-07 01:35:35 -05:00
Adam Honse 4f1c623093 Use RGBControllerInterface for plugin API 2026-07-07 01:35:35 -05:00
Adam Honse 7846d22bd8 Add another thread in NetworkClient for handling ProfileManager requests outside of the main listener thread, to avoid deadlocking the waiting receivers 2026-07-07 01:35:35 -05:00
Adam Honse 68ae9ef9d5 Update translation files and fix some translation related issues 2026-07-07 01:35:35 -05:00
Adam Honse 44641ca8a6 NetworkClient cleanup and internal API standardization 2026-07-07 01:35:35 -05:00
Adam Honse 152f16b31c NetworkServer cleanup and internal API standardization 2026-07-07 01:35:35 -05:00
Adam Honse b87f7150fc Add indication of standalone or local client mode to about page 2026-07-07 01:35:35 -05:00
Adam Honse 831a7cf5eb Implement network request to get list of I2C buses so that the Get Hardware IDs dialog works in local client mode 2026-07-07 01:35:35 -05:00
Adam Honse f99843a550 Add option to force compact tabs and option to move tabs from left to top 2026-07-07 01:35:35 -05:00
Adam Honse 35217bce51 More LogManager cleanup, default to a log file count of 10, fix bug in log rotation 2026-07-07 01:35:35 -05:00
Adam Honse 00077347b4 Log manager SDK protocol 2026-07-07 01:35:35 -05:00
Adam Honse b2c9ace9c8 Log Console Updates 2026-07-07 01:35:35 -05:00
Adam Honse fd7dbd618d LogManager cleanup 2026-07-07 01:35:35 -05:00
Adam Honse 103b5f27bb Settings Rework
* Add JSON string configuration field to RGBController to store device-specific configurations
    * This JSON string holds both configuration and schema
    * Add settings schema tracking to SettingsManager
    * Implement dynamic settings widget that generates a settings UI based on a JSON schema
    * Implement SettingsManager callback for notifying of settings changes and settings schema updates
    * Always enable Entire Device zone option and use it to enable Edit Device
    * Rename SaveSizes to SaveConfiguration in ProfileManager and Sizes.json to Configuration.json
    * Add zone flag for indicating that a zone's geometry may change, informing profile manager to ignore this check
    * Remove Theme setting and Theme Manager, as this didn't work on most setups anyways and Qt6 has proper Windows dark theming
2026-07-07 01:35:35 -05:00
Dmitry Kychanov 71c1ffe91c Fix losing software info upon changing language [next] 2026-07-07 01:35:35 -05:00
Dmitry Kychanov 0154f3c5dc Fix device tabs not applying compact mode when hotplugging 2026-07-07 01:35:35 -05:00
Adam Honse 60bc375345 Close SDK connection if magic value is not correctly received 2026-07-07 01:35:35 -05:00
Adam Honse 5a2dca1ced Implement size verification on RGBController set description functions 2026-07-07 01:35:35 -05:00
Adam Honse c80f3be283 Clean up zone initialization dialog 2026-07-07 01:35:35 -05:00
Adam Honse 52f757ced2 Require local client permission for DeleteProfile, SaveProfile, UploadProfile, SetSettings, and SaveSettings operations, some general cleanup 2026-07-07 01:35:35 -05:00
Adam Honse 156b7d0f89 Sanitize profile filenames 2026-07-07 01:35:35 -05:00
Adam Honse 69a8c84b4d Add RescanDevices to plugin API 2026-07-07 01:35:35 -05:00
Adam Honse d30f3a5f03 Implement segment groups in zone editor 2026-07-07 01:35:35 -05:00
Adam Honse 2868f61766 Rework server initialization
* Only create server instance if server is actually needed
    * Pass initial server host and port through ResourceManager
    * Allow setting default server host and port in Server settings
2026-07-07 01:35:35 -05:00
stephen iacovelli 5d1c990b18 Sort profiles list alphabetically 2026-07-07 01:35:35 -05:00
Adam Honse e6eeb906b8 Organize OpenRGBSettingsPage with Group Boxes 2026-07-07 01:35:35 -05:00
Kasslim ea00807a06 Correct spelling Busses -> Buses
Commits merged by Adam Honse <[email protected]>
2026-07-07 01:35:35 -05:00
诺诺 95b1133395 Add Nollie controller OS2.1 2026-07-07 01:35:35 -05:00
Adam Honse d56a9133ab Initial implementation of OpenRGB SDK protocol Wireshark dissector 2026-07-07 01:35:34 -05:00
Adam Honse 8c96bf03f5 Add ACK to network packets processed by NetworkServer 2026-07-07 01:35:34 -05:00
Adam Honse 79e546fa43 Only update device view when RGBController::UpdateLEDs signal is sent to OpenRGBDevicePage, fix device view not refreshing if multiple LEDs are selected 2026-07-07 01:35:34 -05:00
Adam Honse baed37ecc7 Don't emit selection update on mouse click event to avoid sending unnecessary events, also only send one type of event per mouse release event. Fix LED box not being updated 2026-07-07 01:35:34 -05:00
Adam Honse c0be211236 Have dummy controller shut down its background thread immediately during constructor to save resources 2026-07-07 01:35:34 -05:00
Adam Honse 55506f984e DeviceView code cleanup, formatting, commenting 2026-07-07 01:35:34 -05:00
Adam Honse d03ca67ae5 Fix selecting LEDs in device view 2026-07-07 01:35:34 -05:00
Adam Honse b7f8eeb034 TabLabel sets its own tooltip so all tabs have a tooltip rather than just devices 2026-07-07 01:35:34 -05:00
Adam Honse e8e0362d85 Resize tabs when width is small 2026-07-07 01:35:34 -05:00
Adam Honse e9f430d8ed Rework adding segments with ConfigureZone 2026-07-07 01:35:34 -05:00
Adam Honse a306cf815b Zone and Segment type updates
* Add zone flags to indicate if fields are manually configurable and if they have been manually configured
  * Add flags field to segment type
  * Add segment flags for group start and group member
  * Add color mode support flags to zone (RGB, RBG, GRB, GBR, BRG, BGR)
  * Add color mode enum to zone
  * Update zone and segment description functions to support new fields
  * Rename the effects-only configurable size flag
  * Remove zone type and matrix map configuration from E1.31 manual configuration, use zone editor instead
  * Rework DeviceResizeZone to DeviceConfigureZone
  * Rework most ARGB controllers to allow zone customizations
  * Rework DRGBController to define devices in DRGBDevices list (similar to RazerDevices)
  * Rework NollieController to define devices in NollieDevices list (similar to RazerDevices)
2026-07-07 01:35:34 -05:00
Adam Honse 7c0eba1dc3 Add matrix map automatic generation to matrix map editor 2026-07-07 01:35:34 -05:00
Adam Honse 5d20744653 RGBController API changes and segment configuration updates
* Make the Get/Set RGBControler descriptor functions static
  * Add functions for getting the matrix_map_type for zone and segment matrix maps
  * Rename zone resize dialog to zone editor dialog
  * Add additional segment types
  * Add option to import segments configuration from JSON file in zone editor dialog
  * Update device view to be able to display matrix segment types
  * Add matrix map editor dialog for creating/editing segment matrix maps
  * Add option to export segments configuration to JSON file in zone editor dialog
2026-07-07 01:35:34 -05:00
Adam Honse 7e74c295a3 When updating existing profile without profile editor dialog, keep saved states for unavailable controllers, base color, and only update plugins already part of the existing profile 2026-07-07 01:35:34 -05:00
Adam Honse d145ee38e7 When saving sizes/manual configuration, keep any existing controllers that are not currently available 2026-07-07 01:35:34 -05:00
Adam Honse 0a39673b9d Rework how manual configuration (previously sizes) are loaded to newly detected controllers, load active profile to newly detected controllers 2026-07-07 01:35:34 -05:00
Adam Honse 6e93443034 Profile editor dialog 2026-07-07 01:35:34 -05:00
Adam Honse cb71627d29 Rework API interface passed into plugins from ResourceManagerInterface to OpenRGBPluginAPIInterface 2026-07-07 01:35:34 -05:00
Adam Honse 35f10dfb48 [next] Active profile tracking 2026-07-07 01:35:34 -05:00
Adam Honse 04ef7a2c28 Apply profiles server-side rather than client-side, signal active profile update, forward loaded profile to local client for plugins 2026-07-07 01:35:34 -05:00
Adam Honse a58e79ba71 Split HID and wrapped HID detector lists into specific detectors (with exact VID/PID matching) and generic detectors (with only IPU matching) and prioritize specific detectors when detecting HID devices 2026-07-07 01:35:34 -05:00
Adam Honse 3a74c85be8 Move RGBController base destructor functionality into RGBController::Shutdown() so that update thread can be stopped before deleting the controller. Shutdown() must be called in every RGBController implementation before deleting the controller. Also some fixes to the NetworkServer to avoid deadlocking and disconnect issues 2026-07-07 01:35:34 -05:00
Adam Honse 6e71cd39b9 Add detectors for filtering on IPU only (no VID/PID) 2026-07-07 01:35:34 -05:00
Adam Honse 248668ea7d Drop support for old hidapi versions that don't support usage information 2026-07-07 01:35:34 -05:00
Adam Honse 496a7a3609 Add some validity checks to mode setters and getters in RGBController 2026-07-07 01:35:34 -05:00
Adam Honse 112b6a2b9b [next] SDK v6: Implement client and server flags to indicate capabilities and... 2026-07-07 01:35:34 -05:00
Adam Honse 7c38dad1ab SDK documentation updates 2026-07-07 01:35:34 -05:00
Adam Honse cd1c9c705b Expose LogManager in ResourceManager so that plugins can use it 2026-07-07 01:35:34 -05:00
Adam Honse b7f68379c2 Update NetworkClient to use log manager and use common name constant in server logs 2026-07-07 01:35:34 -05:00
Adam Honse 43c0fea3be Use std::string.assign when setting strings in the SDK protocol and description handlers so that string size limit is enforced, then strip out null terminators 2026-07-07 01:35:34 -05:00
Adam Honse 39f112bb98 Add optional HID device hotplug support (requires https://gitlab.com/OpenRGBDevelopers/hidapi-hotplug) 2026-07-07 01:35:34 -05:00
Adam Honse 3d113dab3c SDK v6: Use unique IDs for identifying RGBControllers in SDK protocol 2026-07-07 01:35:34 -05:00
Adam Honse 92f397544b Rework list handling in ResourceManager by having NetworkClient own its own list rather than sharing ResourceManager's list 2026-07-07 01:35:34 -05:00
Adam Honse fe4ca34528 Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions 2026-07-07 01:35:34 -05:00
Adam Honse 464ef419e7 Detection progress SDK integration, NetworkClient callback rework 2026-07-07 01:35:34 -05:00
Adam Honse 30e35eb44c Split out detection system from ResourceManager into DetectionManager
* Split detection system out into its own class, DetectionManager
    * Clean up ResourceManger's many callbacks into just two, one for detection and one general purpose
2026-07-07 01:35:34 -05:00
Adam Honse b92a8996e9 SDK Version 6 Updates
* SDK Protocol
    * Server sends its name to client
    * ProfileManager
      * Rename existing profile commands
      * Add Upload Profile, Download Profile, and Get Active Profile commands
    * SettingsManager
      * Add Get, Set, and Save Settings commands
    * Add zone::active_mode, zone::mode fields for zone-specific modes
    * Add NET_PACKET_ID_RGBCONTROLLER_UPDATEZONEMODE packet for updating zone modes
    * Add segment::matrix_map to segment packet
    * Add NET_PACKET_ID_RGBCONTROLLER_SIGNALUPDATE packet for passing SignalUpdate signal from server to clients
  * NetworkServer
    * Formatting cleanup
    * Use per-controller threads for handling NetworkServer controller-specific packets to avoid delays from controller mutexes
  * NetworkClient
    * Formatting cleanup
  * RGBController
    * Clean up and modularize descriptor functions
2026-07-07 01:35:34 -05:00
Adam Honse c887ea94ff Rework Profiles to use JSON format
* Update OpenRGB Plugin Interface to include functions for loading/saving profile JSON data into OpenRGB profiles
    * Update ProfileManager to handle auto-load profiles (Exit, Open, Resume, Suspend) and move their settings to ProfileManager section
    * Update ProfileManager to store profiles in "profiles" folder in .json format
    * Update ProfileManager to store size profile in sizes.json
    * Update ProfileManager to perform device UpdateMode/UpdateColors when loading profile
    * Code cleanup of ProfileManager and profile-related code
2026-07-07 01:35:34 -05:00
Adam Honse 25a753b97a RGBController API Overhaul
* Reorganize and clean up RGBController API functions
    * Add functions to get protected RGBController member values
    * Make NetworkClient, ProfileManager, and ResourceManager friend classes so they can access protected members
    * Protected previously-public RGBController members
        * Information strings (name, vendor, description, version, serial location)
        * Device type
        * Active mode
        * Flags
        * LEDs vector
        * LED alternate names vector
        * Modes vector
        * Colors vector
        * Zones vector
    * Add CONTROLLER_FLAG_HIDDEN to allow plugins to hide controllers from control GUI
    * Add update reason codes to RGBController update callback and signal updates on more RGBController events
    * Add loop zone types and segmented zone type
    * Add matrix map field to segments
    * Rework matrix_map_type from using pointers to vector to prevent memory leaks
    * Rework KeyboardLayoutManager to return new matrix_map_type
    * Add access mutex to RGBController API
    * Add per-zone modes ot RGBController API
    * Add JSON description functions to RGBController API
2026-07-07 01:35:34 -05:00
Adam Honse a86ab2955a Move plugin SDK integration from callback into plugin API and PluginManager 2026-07-07 01:35:34 -05:00
Adam Honse 259e05360e Update Plugin API to 5 and SDK Protocol to 6 2026-07-07 01:35:33 -05:00
Adam Honse 36b4f52cbc Update default builds to Qt6
* Update Debian packages to use Qt6
  * Update Fedora packages to use Qt6
  * Update default AppImage builds to use Qt6
  * Update default Windows builds to use Qt6
  * Update default MacOS builds to use Qt6
2026-07-07 01:35:33 -05:00
Adam Honse ee6343900b Revert "Nollie 2.1 firmware for Master"
This reverts commit 07e7feca56.
2026-07-07 01:35:33 -05:00
Adam Honse 3818398d86 Handle differences in supported features protocol packet between Keychron QMK and ZMK 2026-07-07 01:34:16 -05:00
Adam Honse 0973f6149b Add Keychron Ultra 8K (ZMK) keyboards to Keychron QMK controller as they implement the same protocol 2026-07-07 01:22:02 -05:00
Adam Honse 1e1fb09821 Fix up mode setup in QMK Keychron controller 2026-07-05 17:20:39 -05:00
Adam Honse dfe099fe9b Fix warning in LogitechControllerDetect.cpp 2026-07-04 15:10:48 -05:00
Adam Honse 3b6450f188 Fix warnings in MSILaptopController.cpp 2026-07-04 13:42:17 -05:00
Adam Honse 971a2cc300 Fix warnings in QMKKeychronController 2026-07-04 13:41:57 -05:00
Adam Honse 6b8db478fb Fix Qt6 warning in SuspendResume_Linux_FreeBSD.cpp and clean up includes in SuspendResume files 2026-06-30 01:49:20 -05:00
Adam Honse 3932a9614c Minor cleanups and warning fixes 2026-06-29 18:08:48 -05:00
Adam Honse 4dde4fffe3 Fix unused variable warning in CorsairCommanderCoreController.cpp 2026-06-29 14:40:29 -05:00
Adam Honse 57d38be688 Fix unused variable warnings in CorsairDRAMController.cpp 2026-06-29 14:39:30 -05:00
Adam Honse b79522a955 Fix unused variable warning in NanoleafScanningThread.cpp 2026-06-29 14:10:20 -05:00
Adam Honse 94333ff2f1 Fix QChar warning in Qt6 builds from OpenRGBPluginList.cpp 2026-06-29 14:08:41 -05:00
Adam Honse d3f4bfe192 Fix warning in OpenRGBSystemInfoPage.cpp 2026-06-29 14:05:04 -05:00
Adam Honse d130e64f69 Add 1.0rc3 to releases in metainfo 2026-06-28 23:43:10 -05:00
Adam Honse f7e9cddae9 Change suffix back to get after 1.0rc3 release candidate 2026-06-28 23:40:32 -05:00
Adam Honse 6fbcf62d76 OpenRGB Release Candidate 1.0rc3 2026-06-28 16:25:51 -05:00
Vedant Bhandare 1a6943fe17 Add support for MSI PRO Z890-P WIFI (MS-7E34) 2026-06-28 15:55:58 -05:00
Dante M cde2343d09 MSI Mystic Light: Add support for MSI PRO B760M-VC WIFI (MS-7D37) 2026-06-28 15:50:09 -05:00
Adam Honse c746b30287 Add Keychron K-series V2 keyboards from wls_2025q1 branch 2026-06-28 15:45:48 -05:00
Ace 3582b96dd9 Fix Logitech G915 TKL: correct PID mapping and HID packet sizes 2026-06-28 03:21:57 -05:00
Adam Honse d258065e36 Convert static class variables to defines to fix linker error in debug builds 2026-06-28 01:30:40 -05:00
Adam Honse 7627466891 Get Keychron firmware version 2026-06-28 01:30:32 -05:00
Adam Honse c476ee46f8 Flatpak is now considered official 2026-06-28 00:51:43 -05:00
Adam Honse 6fc68f4e62 Add the rest of the Keychron keyboards in the 2025q3 branch 2026-06-27 20:03:50 -05:00
Adam Honse 75bac1fd4e Add all the Keychron K series keyboards from the 2025q3 firmware branch 2026-06-26 10:17:06 -05:00
Richard Harris 94042375a7 Add support for SayoDevice E1 2026-06-25 20:16:18 -05:00
Adam Honse 103306c6c8 Add all the Keychron C series keyboards from the 2025q3 firmware branch 2026-06-25 16:04:22 -05:00
Adam Honse 6d37d262ea Add all the Keychron Q series keyboards from the 2025q3 firmware branch 2026-06-25 12:55:39 -05:00
Adam Honse 473331dd3a Add option to skip reads for most packets as even short reads slow K57 effects 2026-06-25 01:27:22 -05:00
Adam Honse bc9d03ef48 Use short wait for StartTransaction if CTRL1 is selected, as K57 does not appear to respond and we only use the response for determining if switching to CTRL1 is needed 2026-06-25 01:15:10 -05:00
Sam Van maele 740c88fe0c Corsair V2: Fix K70 RGB PRO crash & add spacebar side lights 2026-06-25 00:42:56 -05:00
D W 684ef09168 Razer BlackWidow v4 Pro: new USB IPU values after upgrading firmware 2026-06-25 00:41:36 -05:00
Adam Honse e3b08fc15d Move Corsair K57 (Wired) to CorsairPeripheralV2Controller as it uses the same protocol 2026-06-25 00:35:01 -05:00
Adam Honse 5c931a61b4 Add support for Keychron K10 V2 in QMKKeychronController 2026-06-24 23:33:23 -05:00
Wolfieee Wolf ad7534d00d fix(razer): apply Tartarus V2 keypad LED layout in OpenRGB 2026-06-24 22:01:20 -05:00
Richard Harris c81f8699f1 Add support for Govee H6022 Smart Table Lamp 2 2026-06-24 21:52:47 -05:00
Adam Honse 2af03eb0dc Return false if no PawnIO bus was detected so that the warning dialog actually displays 2026-06-24 18:30:37 -05:00
Adam Honse 5064ba3f1d Update warning messages and remove references to help.openrgb.org. 2026-06-24 15:02:20 -05:00
Adam Honse c5abe47859 Create a common type for storing QMK LED info and use it in both VialRGB and Keychron controllers 2026-06-24 11:55:26 -05:00
Nikhil Jeikar P M 8fdd0e40f8 Adding support for MSI PRO X870E-S EVO WIFI 2026-06-24 16:14:26 +05:30
HorrorTroll a6a07ba0d7 Added support for Colorful iGame GeForce RTX 5060 Ultra W OC when using OC mode 2026-06-23 23:50:18 -05:00
Ken Sanislo 614fef4189 G515 LS TKL and G502 X PLUS support, via Logitech HID++ 2.0 controller with feature discovery 2026-06-23 19:33:18 -05:00
Adam Honse d3e7dba2b7 Add supported feature check in QMKKeychronController 2026-06-23 19:22:50 -05:00
Stefanie Jane 39343c3e9e Fix buffer overflow in KeyboardLayoutManager::GetKeyMap() 2026-06-22 20:49:53 -05:00
Adam Honse 73865fec59 Improve matrix generation for QMK Keychron controller, clean up modes, implement manual save 2026-06-22 18:42:03 -05:00
Adam Honse b508818f23 Update PawnIO Modules to Release 0.2.9 and re-add Intel Skylake-X IMC SMBus support 2026-06-21 22:17:49 -05:00
lin bef8ae0a2f Add support for Gigabyte AORUS GeForce RTX 5090 D V2 MASTER ICE 2026-06-22 10:33:29 +08:00
Adam Honse cce2d41500 Cleanups to QMKKeychronController and create common QMK VIA protocol header 2026-06-21 21:14:46 -05:00
Amadej Kastelic 175f3ed338 feat: add Keychron Q1 HE keyboard support and restructure Keychron controllers 2026-06-21 21:14:46 -05:00
Adam Honse c2cc7c6163 Move priority setup to ResourceManager and make it configurable 2026-06-21 21:14:46 -05:00
RedBlackAka 8fee041fad Lower process priority 2026-06-21 21:14:46 -05:00
Wolfieee Wolf dfc1f8524a fix(razer): add BlackWidow X Chroma keyboard layout 2026-06-21 18:30:31 -05:00
Wolfieee Wolf 752bd2e35a fix(intel): number Arc A770 LE per-LED dropdown labels 2026-06-21 18:26:31 -05:00
I-Kerosin-I 01fe0b4630 Add support for Gigabyte GeForce RTX 4070 GAMING OC V2 with AD103 2026-06-21 18:05:32 -05:00
Daniel Clark e7f8bc0136 Fix X870 Gaming WIFI6 and X870 Aorus Tachyon ICE layouts 2026-06-17 06:45:01 -07:00
Rodrigo Henrique 370918e07f Add Gigabyte GeForce RTX 5070 Eagle OC ICE 2026-06-17 07:35:31 -05:00
trjohnson19 133966677b Add support for ASUS TUF RTX5070 Ti OC BTF White 2026-06-16 07:52:28 -05:00
kStor2poche 44f84e4781 Add Gigabyte Radeon RX 6800 XT GAMING OC. Closes #5657 2026-06-16 07:41:56 -05:00
Roy Biggins a8354ee046 Add Gigabyte Aorus Waterforce X II 360 AIO controller (Castor3) 2026-06-16 00:02:41 -05:00
Luca Cesarano 4550e3073a Fix NZXT Kraken Elite V2 effects 2026-06-15 23:58:57 -05:00
Adam Honse abe7a49092 Updates to DRAM controllers to avoid use of SMBus Quick Write and add fallback paths if SMBus Block Write is unavailable, in preparation for X299 SMBus support 2026-06-15 23:54:33 -05:00
Adam Honse 82a486bfb6 Update SMBus tools page to add more SMBus operation commands 2026-06-15 23:54:33 -05:00
Victor Hugo Garzo Prado ad06e733f8 Add missing push_back to insert Corsair AIO leds into leds vector 2026-06-15 23:40:05 -05:00
Adam Honse 4306603a28 Remove Skylake-X IMC SMBus PawnIO module for now as it does not support the necessary features yet 2026-06-09 22:58:41 -05:00
Jerry Fan 554f834a90 Fix typo of custled in RealtekARGBController 2026-06-09 08:16:39 -05:00
manuelulreich 7236bec61f [New Device] Add razer blackwidow v4 low profile tenkeyless hyperspeed 2026-06-09 07:29:23 -05:00
XPRAMT c799f1bfe9 Improve ColorWheel drag behavior 2026-06-09 07:19:14 -05:00
Adam Honse f15c3c1420 Add Redragon M921 2026-06-07 14:08:34 -05:00
Adam Honse aa67045330 Fix duplicate entries in SteelSeriesControllerDetect 2026-06-07 13:28:46 -05:00
Alexey Kopytko 736640f38d Add support for Zotac RTX 5090 SOLID OC 2026-06-07 13:21:29 -05:00
David Glushkov e9caf663bc Fix MSILaptopController ALC zone mapping and packet initialization 2026-06-07 13:09:19 -05:00
Daniel Clark 8afbea53de Update RGBFusion2USB Driver. 2026-06-07 01:13:03 -05:00
metroite c3d496ad5b Initial commit for SteelSeries Apex Pro TKL Gen 3 2026-06-07 01:09:30 -05:00
ilyaKhalidov88 06501f528d Add support for ASUS ROG Astral 5090 2026-06-07 00:46:27 -05:00
Jerry Fan f6a678c1a4 Add support for RealtekARGBController 2026-06-05 01:03:29 -05:00
Andy Herbert 30690d0ebd New device- MSI MAG272CQR monitor 2026-06-04 11:54:51 -05:00
Kyle Finter 7a830cddf9 Added new Govee devices H612F and H607C 2026-06-04 07:27:02 +00:00
Adam Honse 3dc1365d39 Add PowerShell implementation of build-msi for building MSI on Windows, add additional information about PawnIO and the OpenRGB system service to the installer. 2026-06-02 22:07:17 -05:00
Adam Honse b03cd94ae8 Fix incorrect firmware packet format and add timeouts to HID reads in ThermaltakeRiingController 2026-06-02 01:07:33 -05:00
Jefferson González bbf348d273 Add HyperX Eve 1800 keyboard support 2026-06-02 00:15:19 -05:00
David Glushkov dce48eb415 Add MSI Raider A18 HX A9WJG SteelSeries RGB 2026-06-02 00:05:18 -05:00
Ox HaK decf14635d Add Fnatic Streak65 support 2026-06-01 08:27:17 -05:00
Richard Harris db4f49bbba Implement Direct mode support for Roccat Vulcan TKL (non-Pro) 2026-05-31 12:38:57 -05:00
HorrorTroll 26824fcb6e Added support for Colorful iGame GeForce RTX 5060 Ultra W OC 2026-05-31 15:12:36 +07:00
Jerry Fan 8afad91b33 Add support for RealtekBridgeController 2026-05-29 07:46:22 -05:00
Adam Honse 69de0b13c4 Update PawnIO modules to 0.2.6 and enable Intel Skylake IMC SMBus module 2026-05-28 23:48:42 -05:00
alstruit 967153bc10 Add support for ASUS ROG Gladius III Core 2026-05-25 12:08:43 -05:00
JAO1988 971d9be1bd Added Colorful iGame RTX 5060TI 16GB Ultra W DUO Variant 2026-05-23 23:10:36 -05:00
Mark Willis 7a3faef886 Initial commit for ASUS TUF GeForce RTX 5070 Ti Gaming White OC 2026-05-22 12:25:59 -05:00
Purrple Kitten f67030fcc7 Add support for the Gigabyte AORUS RTX 5080 MASTER ICE 2026-05-18 07:30:37 -05:00
Alex Jawhari 7353e99449 Fix AMD GPU i2c bus PCI ID detection on Linux (sysfs path traversal) 2026-05-17 23:58:21 -05:00
JAO1988 91d9597c89 Added Support for ASUS ROG ASTRAL GeForce RTX 5080 WHITE 2026-05-17 23:47:55 -05:00
Adam Honse 2eb569912b XPGSummonerKeyboardController - Remove fake modes 2026-05-13 11:49:05 -05:00
Ken Sanislo 9410d9c066 Add support for Thrustmaster Sol series joystick RGB LEDs 2026-05-09 00:21:40 -05:00
Adam Honse 29d8788e25 Allow value 0x27 at address 0x00 for Galax GPU controllers at address 0x23 2026-05-08 20:05:40 -05:00
Elvis Pranskevichus 0304c50bc6 Add support for Gigabyte AORUS RX 7900 XTX ELITE 24G 2026-05-08 00:12:43 -05:00
Adam Honse dd22150cfe Add vertical spacer to OpenRGBDeviceInfoPage 2026-05-07 16:17:46 -05:00
Barry H 07e7feca56 Nollie 2.1 firmware for Master 2026-05-04 14:16:29 -05:00
Sha_425 a93eec8f50 Add ASUS ROG STRIX RTX 3060 Ti V2 LHR (subsystem 1043:8835) 2026-05-03 12:15:13 -05:00
w43322 88bad762e5 add MSI MEG Z890 UNIFY-X (MS-7E20) support 2026-05-02 19:19:10 -05:00
w43322 18dfe6ca8b add ASUS TUF GeForce RTX 5060 Gaming OC support 2026-05-02 19:15:16 -05:00
mangobiche 96dfa7009f Add support for Corsair Vengeance RGB DDR5 CMH32GX5M2E6000C36 2026-05-02 15:06:09 -05:00
NaifuKishi 92a9d8ad11 Initial commit for ASUS TUF Radeon RX 7900 GRE Gaming OC 2026-05-01 11:09:31 -05:00
Francesco P 2ab9094b41 Add support for MSI MAG B850 TOMAHAWK WiFi7 2026-04-29 21:54:51 -05:00
M1dDler Official f6154ccbc4 Add msi rtx 5070 gaming trio 2026-04-28 20:04:53 -05:00
Illustrious-Net-8110 0be01dde19 Add Asus Ryujin AIO Gen1 support 2026-04-24 07:35:53 -05:00
Adam Honse e113e91423 Deploy QOpenGL and QtCore5Compat frameworks used by the OpenRGB Effects Plugin 2026-04-23 23:42:36 -05:00
Adam Honse 28c63b8b9d Call macdeployqt a second time on Qt6 builds to ensure frameworks depended on by default plugins are deployed 2026-04-23 12:37:49 -05:00
Adam Honse c5aac4c44f Fix libsharpyuv macdeployqt error for Qt5 builds 2026-04-23 10:52:54 -05:00
Adam Honse 42e7f2a5c3 Ignore SDK version in Mac build 2026-04-23 03:56:07 -05:00
Adam Honse ae9ae18d31 Add build-macos.sh script for easier MacOS builds 2026-04-23 00:37:45 -05:00
ricarim f89cdac198 Initial commit for HyperX Origins 2 65 2026-04-20 23:32:49 -05:00
acehighdan e8f345ff77 Sync autostart system configuration with OpenRGB settings on startup
If the autostart system configuration is deleted (e.g. by a reinstall or
package manager) but the JSON config still has enabled=true, OpenRGB
would silently fail to start at login. Fix by calling ConfigureAutoStart()
in the settings page constructor so the system configuration is always
reconciled with the stored JSON state every time OpenRGB starts.

Commit amended to make wording more generic by Adam Honse <[email protected]>
2026-04-20 23:32:49 -05:00
Dmitry Kychanov aff0610df9 Fix default language load on start 2026-04-20 23:32:49 -05:00
JAO1988 9199d062d1 Add Support for MSI GeForce RTX 5080 SUPRIM LIQUID SOC 2026-04-20 23:32:49 -05:00
Dmitry Kychanov 0ec4aaa629 Fix losing software info upon changing language 2026-04-20 23:32:49 -05:00
Adam Honse 9fca99b4ef Reduce i2c_smbus_linux PCI log messages from warning to info, they are expected in many cases 2026-04-20 23:32:31 -05:00
Vasily Galkin 14853895f3 Add support for Gigabyte GTX 1050 G1 Gaming 2GB (1458:372B) 2026-04-20 23:32:31 -05:00
Adam Honse d79a400c8c Fix corrupted text in TabLabels when translation occurs after the constructor 2026-04-20 23:32:31 -05:00
Adam Honse f741385e43 Fix bug introduced in MSI controller merge 2026-04-20 23:32:31 -05:00
Adam Honse 840bd92afb Add AI guidelines section to CONTRIBUTING.md 2026-04-20 23:32:31 -05:00
Nameless Monarch 96e1fb0b10 Add support for MSI PRO B850M-VC WIFI6E 2026-04-20 23:32:31 -05:00
Adam Honse 388557e5f9 Ensure device view is initialized if there are no LEDs to avoid accessing out of bounds 2026-04-20 23:32:17 -05:00
Slim Amamou 3f32817272 Added support for PNY GeForce RTX 5060Ti ARGB Epic-X OC 2026-04-20 23:32:10 -05:00
Adam Honse 056b383536 Add SMBus Sleep Mode settings page 2026-04-15 00:29:54 -05:00
Adam Honse 0691f40588 Update PawnIO modules to release 0.2.4 and implement SMBus sleep mode setting 2026-04-15 00:03:38 -05:00
Adam Honse 800ca0aa7c Fix same heap buffer overflow in RGBController_MSIMysticLight761.cpp 2026-04-13 11:42:03 -05:00
kuroki-kael a91679609b Fix heap-buffer-overflow in RGBController_MSIMysticLight185::GetDeviceConfig() 2026-04-13 11:40:46 -05:00
Adam Honse 19f9408990 Fix remaining warning 2026-04-13 11:34:28 -05:00
Adam Honse 0eea0c9aca Fix warnings 2026-04-13 10:54:34 -05:00
Stella 9f95aa8271 Add support for colorful igame rtx 5070 ultraw ocv 2 2026-04-11 02:24:15 -05:00
Adam Honse 0ee04c497b Revert "Change test in ENE SMBus controller to fix a conflict where it locks up Corsair DDR5 Light Enhancement Kit sticks"
This reverts commit c4e0164479.
2026-04-11 01:29:05 -05:00
Adam Honse 2847270c97 Remove out-of-range addresses from ENE RAM address list 2026-04-10 11:52:50 -05:00
Adam Honse b98174afba Fix off-by-one error in CorsairDRAMController 2026-04-10 11:03:34 -05:00
MissingDLL 3416980849 Add MSI MPG B850 EDGE TI WIFI (MS-7E62) to 761 controller 2026-04-09 20:49:35 -05:00
Joseph E c171bfbf3b Apex Pro Gen 3 TKL wired, add media light and regional layout support 2026-04-09 18:11:52 -05:00
Eder Sánchez 583a737cb5 Fix Windows build in ZOTAC Blackwell GPU controller 2026-04-09 15:03:21 -05:00
rjc862003 d2af6289dd Roccat vulcan ii max support 2026-04-09 13:28:33 -05:00
Moh'd Khier Abualruz 44e6f455e9 Fix Apex Pro TKL 2023 Wireless (PIDs 0x1630/0x1632) RGB control 2026-04-09 13:18:38 -05:00
Eder Sánchez b3a50d669e Add support for ZOTAC GAMING GeForce RTX 5080 AMP Extreme INFINITY 2026-04-09 12:21:52 -05:00
ricarim 0092ea22e2 Fix name assignment for HyperXAlloyOrigins60and65 2026-04-09 10:14:06 -05:00
Jérôme Bauer 58fb35a9bb Fix MSI Mystic Light 185 for Common PID boards (0x0DB0:0x0076) 2026-04-09 10:09:55 -05:00
Adam Honse 9a6ff77545 Combine Corsair RAM controllers, Corsair RAM identification packet testing 2026-04-09 00:47:06 -05:00
Adam Honse c4e0164479 Change test in ENE SMBus controller to fix a conflict where it locks up Corsair DDR5 Light Enhancement Kit sticks 2026-04-08 22:24:56 -05:00
Adam Honse f872f1c591 Ignore modes out of range in VialRGB controller 2026-04-08 18:50:47 -05:00
kuroki-kael 03e64da845 Fix heap corruption in i2c_smbus_linux when sysfs files are empty 2026-04-08 15:54:38 -05:00
Frans Meulenbroeks 3150f64895 Mountain Everest 60: fix led index 2026-04-08 09:33:56 -05:00
Hugo Chabert 8b36e9c317 Add razer blackwidow v4 tenkeyless hyperspeed 2026-04-07 07:30:59 -05:00
Stella c5c5fc6c02 Add support for Colorful iGAME RTX 5060Ti 16GB Ultra W DUO V 2026-04-05 03:46:51 -05:00
Artemis Tomaras c7d9992a3d Fix SL V2 SendStartAction/SendCommitAction packet size 2026-04-05 01:52:56 -05:00
InterStella0 0d8f2c6b14 add colorful rtx 5070 ultra w ocv support 2026-04-03 18:22:49 -05:00
vitutu1 c1800f2a6f Add support for MSI RTX 4070 SUPER Gaming X Slim MLG 2026-04-03 16:46:23 +00:00
Micael Pereira d41a115a07 Add support for MSI PRO A620M-B (MS-7E28) 2026-04-03 01:31:28 -05:00
Elijah Mock 2640a3b93f Update docstring detector to match registered detector 2026-03-26 21:50:02 -05:00
Adam Honse 984c18cb11 Add Gigabyte 9070XT GAMING OC ICE 2026-03-23 16:44:30 -05:00
Adam Honse 23db15dfb9 Add support for E6K5-1114 ENE device 2026-03-23 11:46:04 -05:00
Org van Rensburg 9426f954b0 Add support for MSI MAG Z890 Tomahawk WIFI (MS-7E32) - Resolves #5438 2026-03-23 07:24:22 -05:00
asheriif 133b64778b Add support for Apex Pro TKL Gen 3 Wireless 2026-03-22 22:19:37 +01:00
Aakrisht Sharma Paudel a8a97fa38d Legion 5 gen10 2026-03-17 07:50:23 -05:00
Roy Biggins da6061bbde Add X570 AORUS XTREME zone mapping for IT8297BX 2026-03-16 10:29:38 -05:00
539 changed files with 88360 additions and 24487 deletions
+4 -16
View File
@@ -536,10 +536,7 @@ before_script:
- macos
stage: build
script:
- eval $(/opt/homebrew/bin/brew shellenv)
- qmake OpenRGB.pro
- make -j16
- macdeployqt OpenRGB.app -codesign=OpenRGB
- ./scripts/build-macos.sh qt6 arm
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_ARM64_${CI_COMMIT_SHORT_SHA}"
@@ -555,10 +552,7 @@ before_script:
- macos
stage: build
script:
- eval $(/opt/homebrew/bin/brew shellenv)
- /opt/homebrew/opt/qt@5/bin/qmake OpenRGB.pro
- make -j16
- /opt/homebrew/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
- ./scripts/build-macos.sh qt5 arm
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Qt5_ARM64_${CI_COMMIT_SHORT_SHA}"
@@ -574,10 +568,7 @@ before_script:
- macos
stage: build
script:
- eval $(/usr/local/bin/brew shellenv)
- arch -x86_64 /usr/local/bin/qmake OpenRGB.pro
- arch -x86_64 make -j16
- arch -x86_64 /usr/local/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
- ./scripts/build-macos.sh qt6 intel
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Intel_${CI_COMMIT_SHORT_SHA}"
@@ -593,10 +584,7 @@ before_script:
- macos
stage: build
script:
- eval $(/usr/local/bin/brew shellenv)
- arch -x86_64 /usr/local/opt/qt@5/bin/qmake OpenRGB.pro
- arch -x86_64 make -j16
- arch -x86_64 /usr/local/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
- ./scripts/build-macos.sh qt5 intel
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Intel_Qt5_${CI_COMMIT_SHORT_SHA}"
+1 -2
View File
@@ -22,13 +22,12 @@ CODEOWNERS @Calcprogrammer1
/Controllers/BlinkyTapeController/
/Controllers/CoolerMasterController/ @Dr_No
/Controllers/CorsairCommanderCoreController/
/Controllers/CorsairDominatorPlatinumController/
/Controllers/CorsairDRAMController/
/Controllers/CorsairHydroController/
/Controllers/CorsairHydroPlatinumController/
/Controllers/CorsairLightingNodeController/
/Controllers/CorsairPeripheralController/
/Controllers/CorsairVengeanceController/
/Controllers/CorsairVengeanceProController/
/Controllers/CorsairWirelessController/
/Controllers/CreativeController/
/Controllers/CrucialController/
+4
View File
@@ -69,3 +69,7 @@ OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake buil
Translation files are located in [`OpenRGB/qt/i18n/`](https://gitlab.com/CalcProgrammer1/OpenRGB/-/tree/master/qt/i18n), where languages are formatted using ISO 639-1 format: `OpenRGB_xx_XX.ts` — `xx_XX` representing the language code.
In order to translate a file, you need to [fork](https://gitlab.com/CalcProgrammer1/OpenRGB/-/forks/new) the project, create a new file for your language with `lupdate` (or edit an exisiting one), edit the file with `qtlinguist`, commit, push, and create a merge request.
## AI Guidelines
OpenRGB is an open source project developed by humans for humans. As a general rule, AI generated submissions are not permitted. The licensing behind AI generated code is problematic. If you choose to use AI for assistance in your development process, we can't stop you, but do not credit the AI in commits (no AI authorship/co-authorship). Ultimately, you as a human developer are responsible for the code you submit and it is expected that any code you submit you fully understand and have manually vetted before submission. Merge requests that appear to be straight from an AI output, commits with AI tool authorship or co-authorship tags, or otherwise AI generated submissions are subject to closure.
@@ -1,66 +0,0 @@
/*---------------------------------------------------------*\
| A4TechDetector.cpp |
| |
| Detector for A4Tech Devices |
| |
| Chris M (Dr_No) 30 Jun 2022 |
| Mohammed Julfikar Ali Mahbub (o-julfikar) 01 Apr 2024 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "BloodyB820RController.h"
#include "BloodyMouseController.h"
#include "DetectionManager.h"
#include "RGBController_BloodyB820R.h"
#include "RGBController_BloodyMouse.h"
/*---------------------------------------------------------*\
| A4 Tech USB vendor ID |
\*---------------------------------------------------------*/
#define A4_TECH_VID 0x09DA
DetectedControllers DetectA4TechMouseControllers(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id, name);
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
DetectedControllers DetectBloodyB820R(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
BloodyB820RController* controller = new BloodyB820RController(dev, info->path, name);
RGBController_BloodyB820R* rgb_controller = new RGBController_BloodyB820R(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IPU("Bloody W60 Pro", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W60_PRO_PID, 2, 0xFF33, 0x0529);
REGISTER_HID_DETECTOR_IPU("Bloody W70 Max", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W70_MAX_PID, 2, 0xFF33, 0x0518);
REGISTER_HID_DETECTOR_IPU("Bloody W90 Max", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W90_MAX_PID, 2, 0xFF33, 0x053D);
REGISTER_HID_DETECTOR_IPU("Bloody W90 Pro", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W90_PRO_PID, 2, 0xFF33, 0x054D);
REGISTER_HID_DETECTOR_IPU("Bloody MP 50RS", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_MP_50RS_PID, 2, 0xFFF2, 0x6009);
REGISTER_HID_DETECTOR_IPU("Bloody B820R", DetectBloodyB820R, A4_TECH_VID, BLOODY_B820R_PID, 2, 0xFF52, 0x0210);
@@ -0,0 +1,40 @@
/*---------------------------------------------------------*\
| BloodyB820RControllerDetect.cpp |
| |
| Detector for Bloody B820R Devices |
| |
| Mohammed Julfikar Ali Mahbub (o-julfikar) 01 Apr 2024 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "BloodyB820RController.h"
#include "DetectionManager.h"
#include "RGBController_BloodyB820R.h"
/*---------------------------------------------------------*\
| A4 Tech USB vendor ID |
\*---------------------------------------------------------*/
#define A4_TECH_VID 0x09DA
DetectedControllers DetectBloodyB820R(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
BloodyB820RController* controller = new BloodyB820RController(dev, info->path, name);
RGBController_BloodyB820R* rgb_controller = new RGBController_BloodyB820R(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IPU("Bloody B820R", DetectBloodyB820R, A4_TECH_VID, BLOODY_B820R_PID, 2, 0xFF52, 0x0210);
@@ -0,0 +1,44 @@
/*---------------------------------------------------------*\
| BloodyMouseControllerDetect.cpp |
| |
| Detector for Bloody Mouse Devices |
| |
| Chris M (Dr_No) 30 Jun 2022 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "BloodyMouseController.h"
#include "DetectionManager.h"
#include "RGBController_BloodyMouse.h"
/*---------------------------------------------------------*\
| A4 Tech USB vendor ID |
\*---------------------------------------------------------*/
#define A4_TECH_VID 0x09DA
DetectedControllers DetectBloodyMouseControllers(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id, name);
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IPU("Bloody W60 Pro", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W60_PRO_PID, 2, 0xFF33, 0x0529);
REGISTER_HID_DETECTOR_IPU("Bloody W70 Max", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W70_MAX_PID, 2, 0xFF33, 0x0518);
REGISTER_HID_DETECTOR_IPU("Bloody W90 Max", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W90_MAX_PID, 2, 0xFF33, 0x053D);
REGISTER_HID_DETECTOR_IPU("Bloody W90 Pro", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W90_PRO_PID, 2, 0xFF33, 0x054D);
REGISTER_HID_DETECTOR_IPU("Bloody MP 50RS", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_MP_50RS_PID, 2, 0xFFF2, 0x6009);
@@ -31,7 +31,7 @@ AOCKeyboardController::~AOCKeyboardController()
std::string AOCKeyboardController::GetDeviceLocation()
{
return("HID " + location);
return("HID: " + location);
}
std::string AOCKeyboardController::GetDeviceName()
@@ -27,7 +27,7 @@ AOCMouseController::~AOCMouseController()
std::string AOCMouseController::GetDeviceLocation()
{
return("HID " + location);
return("HID: " + location);
}
std::string AOCMouseController::GetDeviceName()
@@ -27,7 +27,7 @@ AOCMousematController::~AOCMousematController()
std::string AOCMousematController::GetDeviceLocation()
{
return("HID " + location);
return("HID: " + location);
}
std::string AOCMousematController::GetDeviceName()
@@ -228,7 +228,8 @@ void RGBController_PolychromeUSB::SetupZones()
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -268,7 +269,7 @@ void RGBController_PolychromeUSB::SetupZones()
new_led.name = zones[channel_idx].name;
new_led.name.append(", LED ");
new_led.name.append(std::to_string(led_ch_idx + 1));
new_led.value = channel_idx;
new_led.value = (unsigned int)channel_idx;
leds.push_back(new_led);
}
@@ -333,9 +334,14 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
}
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
if(zones[zone_idx].leds_count == 0)
{
continue;
}
unsigned char set_mode = zones_info[zone_idx].mode;
if (set_mode>modes.size())
if(set_mode>modes.size())
{
set_mode = active_mode;
}
@@ -346,6 +352,11 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
{
if(zones[zone].leds_count == 0)
{
return;
}
unsigned char set_mode=zones_info[zone].mode;
if(set_mode > modes.size())
@@ -353,7 +364,7 @@ void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
set_mode = active_mode;
}
controller->WriteZone(zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
controller->WriteZone((unsigned char)zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
}
void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
@@ -361,12 +372,17 @@ void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
unsigned int channel = leds[led].value;
unsigned char set_mode = zones_info[channel].mode;
if(zones[channel].leds_count == 0)
{
return;
}
if(set_mode > modes.size())
{
set_mode = active_mode;
}
controller->WriteZone(channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
controller->WriteZone((unsigned char)channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
}
unsigned char RGBController_PolychromeUSB::GetDeviceMode(unsigned char zone)
@@ -36,7 +36,7 @@ ASRockASRRGBSMBusController::~ASRockASRRGBSMBusController()
std::string ASRockASRRGBSMBusController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -36,7 +36,7 @@ ASRockPolychromeV1SMBusController::~ASRockPolychromeV1SMBusController()
std::string ASRockPolychromeV1SMBusController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -37,7 +37,7 @@ ASRockPolychromeV2SMBusController::~ASRockPolychromeV2SMBusController()
std::string ASRockPolychromeV2SMBusController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -238,7 +238,6 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
}
}
unsigned int led_count = 0;
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
@@ -268,8 +267,6 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
\*---------------------------------------------------------*/
leds.push_back(*new_led);
led_count++;
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
{
break;
@@ -85,31 +85,31 @@ uint16_t GetFirmwareVersion(i2c_smbus_interface* bus, uint8_t address)
}
}
DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface*>& busses)
DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface*>& buses)
{
DetectedControllers detected_controllers;
for(unsigned int bus = 0; bus < busses.size(); bus++)
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
{
if(busses[bus]->pci_subsystem_vendor == ASROCK_SUB_VEN)
if(buses[bus]->info.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))
if(TestForPolychromeSMBusController(buses[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);
version.u16 = GetFirmwareVersion(buses[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);
ASRockASRRGBSMBusController* controller = new ASRockASRRGBSMBusController(buses[bus], SMBUS_ADDRESS);
controller-> fw_version = version.u16;
RGBController_ASRockASRRGBSMBus* rgb_controller = new RGBController_ASRockASRRGBSMBus(controller);
detected_controllers.push_back(rgb_controller);
@@ -119,7 +119,7 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
case ASROCK_TYPE_POLYCHROME_V1:
{
LOG_DEBUG("[%s] Found a Polychrome v1 Controller", ASROCK_DETECTOR_NAME);
ASRockPolychromeV1SMBusController* controller = new ASRockPolychromeV1SMBusController(busses[bus], SMBUS_ADDRESS);
ASRockPolychromeV1SMBusController* controller = new ASRockPolychromeV1SMBusController(buses[bus], SMBUS_ADDRESS);
controller-> fw_version = version.u16;
RGBController_ASRockPolychromeV1SMBus* rgb_controller = new RGBController_ASRockPolychromeV1SMBus(controller);
detected_controllers.push_back(rgb_controller);
@@ -129,7 +129,7 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
case ASROCK_TYPE_POLYCHROME_V2:
{
LOG_DEBUG("[%s] Found a Polychrome v2 Controller", ASROCK_DETECTOR_NAME);
ASRockPolychromeV2SMBusController* controller = new ASRockPolychromeV2SMBusController(busses[bus], SMBUS_ADDRESS);
ASRockPolychromeV2SMBusController* controller = new ASRockPolychromeV2SMBusController(buses[bus], SMBUS_ADDRESS);
controller-> fw_version = version.u16;
RGBController_ASRockPolychromeV2SMBus* rgb_controller = new RGBController_ASRockPolychromeV2SMBus(controller);
detected_controllers.push_back(rgb_controller);
@@ -1,7 +1,7 @@
/*---------------------------------------------------------*\
| AlienwareKeyboardControllerDetect.cpp |
| AlienwareAW410KControllerDetect.cpp |
| |
| Detector for Alienware Keyboard |
| Detector for Alienware AW410K Keyboard |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
@@ -10,38 +10,17 @@
#include <hidapi.h>
#include "DetectionManager.h"
#include "AlienwareAW410KController.h"
#include "AlienwareAW510KController.h"
#include "RGBController_AlienwareAW410K.h"
#include "RGBController_AlienwareAW510K.h"
/*---------------------------------------------------------*\
| Alienware vendor ID |
\*---------------------------------------------------------*/
#define ALIENWARE_VID 0x04F2
#define ALIENWARE_VID 0x04F2
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define ALIENWARE_AW510K_PID 0x1830
#define ALIENWARE_AW410K_PID 0x1968
DetectedControllers DetectAlienwareAW510KControllers(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path, name);
RGBController_AlienwareAW510K* rgb_controller = new RGBController_AlienwareAW510K(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
#define ALIENWARE_AW410K_PID 0x1968
DetectedControllers DetectAlienwareAW410KControllers(hid_device_info* info, const std::string& name)
{
@@ -61,5 +40,4 @@ DetectedControllers DetectAlienwareAW410KControllers(hid_device_info* info, cons
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IPU("Alienware AW510K", DetectAlienwareAW510KControllers, ALIENWARE_VID, ALIENWARE_AW510K_PID, 0x02, 0xFF00, 0x01);
REGISTER_HID_DETECTOR_IPU("Alienware AW410K", DetectAlienwareAW410KControllers, ALIENWARE_VID, ALIENWARE_AW410K_PID, 0x02, 0xFF00, 0x01);
@@ -0,0 +1,43 @@
/*---------------------------------------------------------*\
| AlienwareAW510KControllerDetect.cpp |
| |
| Detector for Alienware AW510K Keyboard |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "DetectionManager.h"
#include "AlienwareAW510KController.h"
#include "RGBController_AlienwareAW510K.h"
/*---------------------------------------------------------*\
| Alienware vendor ID |
\*---------------------------------------------------------*/
#define ALIENWARE_VID 0x04F2
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define ALIENWARE_AW510K_PID 0x1830
DetectedControllers DetectAlienwareAW510KControllers(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path, name);
RGBController_AlienwareAW510K* rgb_controller = new RGBController_AlienwareAW510K(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IPU("Alienware AW510K", DetectAlienwareAW510KControllers, ALIENWARE_VID, ALIENWARE_AW510K_PID, 0x02, 0xFF00, 0x01);
@@ -21,13 +21,13 @@
DetectedControllers DetectArcticControllers()
{
DetectedControllers detected_controllers;
std::vector<std::string *> ports;
std::vector<std::string> ports;
ports = find_usb_serial_port(CH341_VID, CH341_PID);
for(unsigned int device = 0; device < ports.size(); device++)
{
ArcticController *controller = new ArcticController(*ports[device]);
ArcticController *controller = new ArcticController(ports[device]);
if(controller->IsPresent())
{
@@ -38,8 +38,6 @@ DetectedControllers DetectArcticControllers()
{
delete controller;
}
delete ports[device];
}
return(detected_controllers);
@@ -32,7 +32,7 @@ std::string AuraGPUController::GetDeviceName()
std::string AuraGPUController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -79,7 +79,7 @@ void AuraGPUController::AuraGPURegisterWrite(unsigned char reg, unsigned char va
bool AuraGPUController::SaveOnlyApplies()
{
switch (bus->pci_subsystem_device)
switch (bus->info.pci_subsystem_device)
{
case ASUS_VEGA64_STRIX:
return false;
@@ -21,7 +21,7 @@
bool TestForAsusAuraGPUController(i2c_smbus_interface* bus, unsigned char address)
{
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
{
return false;
}
@@ -22,6 +22,7 @@
#define AURA_ROG_GLADIUS_II_WIRELESS_1_PID 0x189E
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
#define AURA_ROG_GLADIUS_III_PID 0x197B
#define AURA_ROG_GLADIUS_III_CORE_PID 0x1C8D
#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
@@ -217,6 +218,20 @@ static std::map<int,mouse_type> aura_mouse_devices =
{ 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_CORE_PID, // ROG Gladius III Core
{
0,
0,
0,
100,
false,
1,
false,
{ 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_ROG_GLADIUS_III_WIRELESS_USB_PID, // ROG Gladius III Wireless USB
{
@@ -19,7 +19,10 @@ AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, con
| Manually adding device info for now |
| TODO: Implement config table accurately |
\*-----------------------------------------------------*/
device_info.push_back({0x00, 0x00, 12, 0, AuraDeviceType::FIXED});
uint8_t leds = (dev_name.find("Ryujin") != std::string::npos) ? 5 : 12;
device_info.push_back({0x00, 0x00, leds, 0, AuraDeviceType::FIXED});
}
AsusAuraRyuoAIOController::~AsusAuraRyuoAIOController()
@@ -170,7 +170,8 @@ void RGBController_AuraUSB::SetupZones()
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -220,7 +221,7 @@ void RGBController_AuraUSB::SetupZones()
new_led.name.append(std::to_string(led_idx));
new_led.value = channel_idx;
new_led.value = (unsigned int)channel_idx;
leds.push_back(new_led);
}
@@ -120,6 +120,7 @@
#define AURA_TERMINAL_PID 0x1889
#define ROG_STRIX_LC120_PID 0x879E
#define AURA_RYUO_AIO_PID 0x1887
#define AURA_RYUJIN_AIO_PID 0x18AE
#define ASUS_ROG_ALLY_PID 0x1ABE
#define ASUS_ROG_ALLY_X_PID 0x1B4C
@@ -463,6 +464,7 @@ REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin COD",
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_1_PID, 1, 0xFF13);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_CORE_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless 2.4Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID, 0, 0xFF01);
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless Bluetooth", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_BT_PID, 0, 0xFF01);
@@ -523,6 +525,7 @@ REGISTER_HID_DETECTOR_PU("ASUS ROG PG32UQ", DetectAs
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_PU ("ASUS ROG Ryujin AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUJIN_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);
@@ -24,12 +24,12 @@
DetectedControllers DetectBlinkyTapeControllers()
{
DetectedControllers detected_controllers;
std::vector<std::string *> device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID);
std::vector<std::string> device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID);
for(unsigned int device_idx = 0; device_idx < device_locations.size(); device_idx++)
{
BlinkyTapeController* controller = new BlinkyTapeController();
controller->Initialize(*device_locations[device_idx]);
controller->Initialize(device_locations[device_idx]);
RGBController_BlinkyTape* rgb_controller = new RGBController_BlinkyTape(controller);
@@ -79,7 +79,8 @@ void RGBController_BlinkyTape::SetupZones()
zones[0].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[0].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -26,7 +26,7 @@ ColorfulGPUController::~ColorfulGPUController()
std::string ColorfulGPUController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -45,7 +45,8 @@ void ColorfulGPUController::SetDirect(RGBColor color)
uint8_t g = RGBGetGValue(color);
uint8_t b = RGBGetBValue(color);
if(this->bus->pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
if(this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV
|| this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4090_NEPTUNE_OCV)
{
uint8_t data_pkt[COLORFUL_PACKET_LENGTH_V2] = { 0xAA, 0xEF, 0x01, 0x04, 0x88, 0x26 };
for(int i=6; i < COLORFUL_PACKET_LENGTH_V2 -2; i = i + 3)
@@ -52,7 +52,7 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Advanced OC 12G L-V", Detec
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_GA106_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060TI_ADVANCED_OC, 0x61);
@@ -74,5 +74,13 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 Vulcan OC-V", Detec
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 SUPER Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070S_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4070S_ULTRAW_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Neptune OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_NEPTUNE_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC_2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV2, 0x61);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ti Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070TI_ULTRAW_OC, 0x61);
@@ -24,7 +24,7 @@ ColorfulTuringGPUController::~ColorfulTuringGPUController()
std::string ColorfulTuringGPUController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -17,7 +17,7 @@ DetectedControllers DetectColorfulTuringGPUControllers(i2c_smbus_interface* bus,
{
DetectedControllers detected_controllers;
if(bus->port_id == 1)
if(bus->info.port_id == 1)
{
ColorfulTuringGPUController* controller = new ColorfulTuringGPUController(bus, i2c_addr, name);
RGBController_ColorfulTuringGPU* rgb_controller = new RGBController_ColorfulTuringGPU(controller);
@@ -406,7 +406,8 @@ void RGBController_CMARGBController::SetupZones()
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -217,7 +217,8 @@ void RGBController_CMSmallARGBController::SetupZones()
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -340,7 +340,6 @@ void CorsairCommanderCoreController::SetDirectColor
lastzones = zones;
int packet_offset = 0;
int led_idx = 0;
int channel_idx = 0;
int packet_len = CORSAIR_COMMANDER_CORE_RGB_DATA_LENGTH;
if(pid == CORSAIR_COMMANDER_CORE_XT_PID)
@@ -369,8 +368,6 @@ void CorsairCommanderCoreController::SetDirectColor
{
packet_offset += 3 * (34 - zones[zone_idx].leds_count);
}
channel_idx++;
}
/*-----------------------------------------------------*\
@@ -111,7 +111,8 @@ void RGBController_CorsairCommanderCore::SetupZones()
zones[0].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[0].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -164,7 +165,8 @@ void RGBController_CorsairCommanderCore::SetupZones()
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -0,0 +1,487 @@
/*---------------------------------------------------------*\
| CorsairDRAMController.cpp |
| |
| Driver for Corsair DRAM RGB controllers |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "CRC.h"
#include "CorsairDRAMController.h"
#include "LogManager.h"
#define CORSAIR_DRAM_NAME "Corsair DRAM"
using namespace std::chrono_literals;
CorsairDRAMController::CorsairDRAMController(i2c_smbus_interface *bus, corsair_dev_id dev)
{
/*-----------------------------------------------------*\
| Initialize class variables |
\*-----------------------------------------------------*/
this->bus = bus;
this->dev = dev;
device_index = 0;
direct_mode = true;
pid = 0;
vid = 0;
protocol_version = 0;
/*-----------------------------------------------------*\
| Read device information |
\*-----------------------------------------------------*/
ReadDeviceInfo();
}
CorsairDRAMController::~CorsairDRAMController()
{
}
unsigned int CorsairDRAMController::GetLEDCount()
{
return(corsair_dram_device_list[device_index]->led_count);
}
unsigned char CorsairDRAMController::GetProtocolVersion()
{
return(protocol_version);
}
std::string CorsairDRAMController::GetDeviceLocation()
{
std::string return_string(bus->info.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 CorsairDRAMController::GetDeviceName()
{
return(corsair_dram_device_list[device_index]->name);
}
std::string CorsairDRAMController::GetDeviceVersion()
{
return(firmware_version);
}
void CorsairDRAMController::SetColorsPerLED(RGBColor* colors)
{
/*-----------------------------------------------------*\
| Get LED count from device list |
\*-----------------------------------------------------*/
unsigned int led_count = corsair_dram_device_list[device_index]->led_count;
if(direct_mode)
{
/*-------------------------------------------------*\
| Sanity check - Direct mode can only be used on |
| protocol 4+ |
\*-------------------------------------------------*/
if(protocol_version < 4)
{
LOG_ERROR("[%s] Protocol version %d tried to use direct mode, ignoring", CORSAIR_DRAM_NAME, protocol_version);
return;
}
/*-------------------------------------------------*\
| Packet format: |
| Size n is (LED count * 3) + 2 |
| 0: Command byte (0x0A or 0x0C) |
| 1 to (n-2): LED color data in R/G/B order |
| (n-1): CRC8 of bytes 0 to (n-2) |
\*-------------------------------------------------*/
unsigned int direct_packet_size = (led_count * 3) + 2;
unsigned char* direct_packet = new unsigned char[direct_packet_size];
/*-------------------------------------------------*\
| First byte in packet is LED count |
\*-------------------------------------------------*/
direct_packet[0] = led_count;
/*-------------------------------------------------*\
| Fill in LED data |
\*-------------------------------------------------*/
for(unsigned int led_idx = 0; led_idx < led_count; led_idx++)
{
unsigned int color_index = led_idx;
unsigned int offset = (led_idx * 3) + 1;
if(corsair_dram_device_list[device_index]->reverse)
{
color_index = (led_count -1) - led_idx;
}
direct_packet[offset + 0] = RGBGetRValue(colors[color_index]);
direct_packet[offset + 1] = RGBGetGValue(colors[color_index]);
direct_packet[offset + 2] = RGBGetBValue(colors[color_index]);
}
/*-------------------------------------------------*\
| Last byte in packet is CRC of all data up to it |
\*-------------------------------------------------*/
direct_packet[direct_packet_size - 1] = CRCPP::CRC::Calculate(direct_packet, (direct_packet_size - 1), CRCPP::CRC::CRC_8());
/*-------------------------------------------------*\
| Write using block writes, if packet exceeds 32 |
| bytes, use a second block write to the second |
| block write address for the remaining data |
\*-------------------------------------------------*/
s32 ret = bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1, 32, direct_packet);
if((ret >= 0) && (direct_packet_size > 32))
{
bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_2, direct_packet_size - 32, direct_packet + 32);
}
/*-------------------------------------------------*\
| Corsair DRAM supports an alternate means of |
| writing block data without using SMBus block |
| operations. If block operations are not |
| available, fall back to this scheme. |
| |
| Blocks are split up into word data writes. |
| Some data bytes are packed into the lower nibble |
| of the register address byte. |
\*-------------------------------------------------*/
if(ret < 0)
{
unsigned int block_index = 0;
while(block_index < direct_packet_size)
{
unsigned char reg_value_0 = 0xA0;
unsigned char reg_value_1 = 0x00;
unsigned short word_value_0 = 0;
unsigned short word_value_1 = 0;
if(block_index == 0)
{
reg_value_0 = 0x90;
}
word_value_0 = (direct_packet[block_index]);
block_index++;
if(block_index < direct_packet_size)
{
word_value_0 |= (direct_packet[block_index] << 8);
block_index++;
}
if(block_index < direct_packet_size)
{
reg_value_1 = 0xA0;
reg_value_0 |= (direct_packet[block_index] & 0x0F);
reg_value_1 |= (direct_packet[block_index] & 0xF0) >> 4;
block_index++;
}
if(block_index < direct_packet_size)
{
word_value_1 = (direct_packet[block_index]);
block_index++;
}
if(block_index < direct_packet_size)
{
word_value_1 |= (direct_packet[block_index] << 8);
block_index++;
}
bus->i2c_smbus_write_word_data(dev, reg_value_0, word_value_0);
if(reg_value_1 > 0)
{
bus->i2c_smbus_write_word_data(dev, reg_value_1, word_value_1);
}
}
}
/*-------------------------------------------------*\
| Remember to delete the data buffer |
\*-------------------------------------------------*/
delete[] direct_packet;
}
else
{
/*-------------------------------------------------*\
| Local variables |
\*-------------------------------------------------*/
unsigned char device_crc;
unsigned char calc_crc;
/*-------------------------------------------------*\
| Packet format: |
| Size n is (LED count * 4) |
| Format is 0xRR, 0xGG, 0xBB, 0xFF for each LED |
\*-------------------------------------------------*/
unsigned int color_data_size = (led_count * 4);
unsigned char* color_data_packet = new unsigned char[color_data_size];
for(unsigned int led_idx = 0; led_idx < led_count; led_idx++)
{
unsigned int color_index = led_idx;
if(corsair_dram_device_list[device_index]->reverse)
{
color_index = (led_count -1) - led_idx;
}
color_data_packet[(led_idx * 4) + 0] = RGBGetRValue(colors[color_index]);
color_data_packet[(led_idx * 4) + 1] = RGBGetGValue(colors[color_index]);
color_data_packet[(led_idx * 4) + 2] = RGBGetBValue(colors[color_index]);
color_data_packet[(led_idx * 4) + 3] = 0xFF;
}
/*-------------------------------------------------*\
| Write LED color data packet |
\*-------------------------------------------------*/
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_RESET_BUFFER, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
for(unsigned int i = 0; i < color_data_size; i++)
{
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_SET_BINARY_DATA, color_data_packet[i]);
}
/*-------------------------------------------------*\
| Calculate CRC and read CRC reported by device |
\*-------------------------------------------------*/
calc_crc = CRCPP::CRC::Calculate(color_data_packet, color_data_size, CRCPP::CRC::CRC_8());
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
/*-------------------------------------------------*\
| Write effect configuration only if CRCs match |
\*-------------------------------------------------*/
if(calc_crc == device_crc)
{
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_WRITE_CONFIGURATION, CORSAIR_DRAM_ID_COLOR_DATA);
WaitReady();
}
/*-------------------------------------------------*\
| Remember to delete the data buffer |
\*-------------------------------------------------*/
delete[] color_data_packet;
}
}
void CorsairDRAMController::SetDirect(bool direct)
{
direct_mode = direct;
}
void CorsairDRAMController::SetEffect
(
unsigned char mode,
unsigned char speed,
unsigned char direction,
bool random,
unsigned char brightness,
unsigned char red1,
unsigned char grn1,
unsigned char blu1,
unsigned char red2,
unsigned char grn2,
unsigned char blu2
)
{
/*-----------------------------------------------------*\
| Local variables |
\*-----------------------------------------------------*/
unsigned char effect_data[20];
unsigned char device_crc;
unsigned char calc_crc;
unsigned char random_byte;
/*-----------------------------------------------------*\
| If mode is direct (which is a dummy value not |
| understood by the hardware), return. Direct mode is |
| not set in the effect configuration. |
\*-----------------------------------------------------*/
direct_mode = (mode == CORSAIR_DRAM_MODE_DIRECT);
if(direct_mode)
{
return;
}
/*-----------------------------------------------------*\
| Determine random byte |
\*-----------------------------------------------------*/
if(random)
{
random_byte = CORSAIR_DRAM_EFFECT_RANDOM_COLORS;
}
else
{
random_byte = CORSAIR_DRAM_EFFECT_CUSTOM_COLORS;
}
/*-----------------------------------------------------*\
| Fill in effect packet |
\*-----------------------------------------------------*/
effect_data[0] = mode; // Mode
effect_data[1] = speed; // Speed
effect_data[2] = random_byte; // Custom color
effect_data[3] = direction; // Direction
effect_data[4] = red1; // Custom color 1 red
effect_data[5] = grn1; // Custom color 1 green
effect_data[6] = blu1; // Custom color 1 blue
effect_data[7] = brightness;
effect_data[8] = red2; // Custom color 2 red
effect_data[9] = grn2; // Custom color 2 green
effect_data[10] = blu2; // Custom color 2 blue
effect_data[11] = brightness;
effect_data[12] = 0x00;
effect_data[13] = 0x00;
effect_data[14] = 0x00;
effect_data[15] = 0x00;
effect_data[16] = 0x00;
effect_data[17] = 0x00;
effect_data[18] = 0x00;
effect_data[19] = 0x00;
/*-----------------------------------------------------*\
| Write effect packet |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_RESET_BUFFER, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
for(unsigned int i = 0; i < 20; i++)
{
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_SET_BINARY_DATA, effect_data[i]);
}
/*-----------------------------------------------------*\
| Calculate CRC and read CRC reported by device |
\*-----------------------------------------------------*/
calc_crc = CRCPP::CRC::Calculate(effect_data, sizeof(effect_data), CRCPP::CRC::CRC_8());
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
/*-----------------------------------------------------*\
| Write effect configuration only if CRCs match |
\*-----------------------------------------------------*/
if(calc_crc == device_crc)
{
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_WRITE_CONFIGURATION, CORSAIR_DRAM_ID_EFFECT_CONFIGURATION);
WaitReady();
}
}
bool CorsairDRAMController::WaitReady()
{
/*-----------------------------------------------------*\
| Poll status register 0x30; bit 3 (0x08) = busy. |
| Device is ready when bit 3 is clear. |
\*-----------------------------------------------------*/
for(int retry = 0; retry < 5; retry++)
{
int status = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_STATUS);
if(status >= 0 && (status & 0x08) == 0)
{
return true;
}
std::this_thread::sleep_for(10ms);
}
return false;
}
void CorsairDRAMController::ReadDeviceInfo()
{
unsigned char device_information_data[32];
unsigned char device_crc;
unsigned char calc_crc;
/*-----------------------------------------------------*\
| Request Device Information Data |
\*-----------------------------------------------------*/
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_GET_DEVICE_INFO, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
/*-----------------------------------------------------*\
| Read Device Information Data |
\*-----------------------------------------------------*/
for(unsigned int i = 0; i < 32; i++)
{
device_information_data[i] = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_BINARY_DATA);
}
/*-----------------------------------------------------*\
| Compare CRC |
\*-----------------------------------------------------*/
calc_crc = CRCPP::CRC::Calculate(device_information_data, sizeof(device_information_data), CRCPP::CRC::CRC_8());
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
if(calc_crc != device_crc)
{
LOG_ERROR("[%s] ReadDeviceInfo CRC Mismatch", CORSAIR_DRAM_NAME);
}
/*-----------------------------------------------------*\
| Log Device Information Data |
\*-----------------------------------------------------*/
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
{
char device_info_buf[256];
unsigned int pos;
pos = snprintf(device_info_buf, sizeof(device_info_buf), "%02X: ", dev);
for(unsigned int i = 0; i < 32; i++)
{
pos += snprintf(&device_info_buf[pos], sizeof(device_info_buf) - pos, "%02X ", device_information_data[i]);
}
LOG_TRACE("[%s] Device Info: %s", CORSAIR_DRAM_NAME, device_info_buf);
}
/*-----------------------------------------------------*\
| Read VID |
\*-----------------------------------------------------*/
vid = (device_information_data[1] << 8) | device_information_data[0];
/*-----------------------------------------------------*\
| Read PID |
\*-----------------------------------------------------*/
pid = (device_information_data[3] << 8) | device_information_data[2];
/*-----------------------------------------------------*\
| Format Firwmare Version |
\*-----------------------------------------------------*/
firmware_version = std::to_string(device_information_data[9]) + "." + std::to_string(device_information_data[8]) + "." + std::to_string((device_information_data[11] << 8) | device_information_data[10]);
/*-----------------------------------------------------*\
| Read Protocol Version |
\*-----------------------------------------------------*/
protocol_version = device_information_data[28];
/*-----------------------------------------------------*\
| Loop through all known devices to look for a PID |
| match |
\*-----------------------------------------------------*/
for(unsigned int i = 0; i < CORSAIR_DRAM_NUM_DEVICES; i++)
{
for(unsigned int j = 0; j < CORSAIR_DRAM_MAX_PIDS; j++)
{
if(corsair_dram_device_list[i]->pids[j] == pid)
{
/*-----------------------------------------*\
| Set device ID |
\*-----------------------------------------*/
device_index = i;
break;
}
}
}
}
@@ -0,0 +1,149 @@
/*---------------------------------------------------------*\
| CorsairDRAMController.h |
| |
| Driver for Corsair DRAM RGB controllers |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include "i2c_smbus.h"
#include "CorsairDRAMDevices.h"
#include "RGBController.h"
typedef unsigned char corsair_dev_id;
enum
{ /* (*) indicates deprecated registers no longer used by iCue */
CORSAIR_DRAM_REG_RESET_BUFFER = 0x0B, /* Reset buffer by writing 0x00 */
CORSAIR_DRAM_REG_SET_BINARY_DATA = 0x20, /* Write byte to active binary data buffer */
CORSAIR_DRAM_REG_BINARY_START = 0x21, /* Start binary data transfer by writing 0x00 */
CORSAIR_DRAM_REG_SWITCH_MODE = 0x23, /* Switch between Bootloader(0x00) and Normal(0x01) */
CORSAIR_DRAM_REG_SET_BUFFER = 0x26, /* Select configuration buffer to write by ID (*) */
CORSAIR_DRAM_REG_STATUS = 0x30, /* Status register */
CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1 = 0x31, /* Direct color buffer block register 1 */
CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_2 = 0x32, /* Direct color buffer block register 2 */
CORSAIR_DRAM_REG_GET_BINARY_DATA = 0x40, /* Read byte from active binary data buffer */
CORSAIR_DRAM_REG_BUSY_STATUS = 0x41, /* Reads nonzero while busy, zero when ready(*) */
CORSAIR_DRAM_REG_GET_CHECKSUM = 0x42, /* Get checksum (CRC8) of active binary data buffer */
CORSAIR_DRAM_REG_GET_DEVICE_INFO = 0x61, /* Select device info buffer */
CORSAIR_DRAM_REG_GET_CONFIGURATION = 0x63, /* Select configuration buffer to read by ID */
CORSAIR_DRAM_REG_WRITE_CONFIGURATION = 0x82, /* Write/Apply configuration by writing buffer ID */
};
enum
{
CORSAIR_DRAM_ID_COMMAND_LIST = 0, /* Command list */
CORSAIR_DRAM_ID_EFFECT_CONFIGURATION = 1, /* Effect configuration */
CORSAIR_DRAM_ID_COLOR_DATA = 2, /* Color data */
};
enum
{
CORSAIR_DRAM_MODE_DIRECT = 0xDD, /* Arbitrary value to compare against later. Not the actual packet */
CORSAIR_DRAM_MODE_COLOR_SHIFT = 0x00, /* Color Shift mode */
CORSAIR_DRAM_MODE_COLOR_PULSE = 0x01, /* Color Pulse mode */
CORSAIR_DRAM_MODE_RAINBOW_WAVE = 0x03, /* Rainbow Wave mode */
CORSAIR_DRAM_MODE_COLOR_WAVE = 0x04, /* Color Wave mode */
CORSAIR_DRAM_MODE_VISOR = 0x05, /* Visor mode */
CORSAIR_DRAM_MODE_RAIN = 0x06, /* Rain mode */
CORSAIR_DRAM_MODE_MARQUEE = 0x07, /* Marquee mode */
CORSAIR_DRAM_MODE_RAINBOW = 0x08, /* Rainbow mode */
CORSAIR_DRAM_MODE_SEQUENTIAL = 0x09, /* Sequential mode */
CORSAIR_DRAM_MODE_STATIC = 0x10, /* Static mode */
CORSAIR_DRAM_NUMBER_MODES = 10, /* Number of Corsair Pro modes */
};
enum
{
CORSAIR_DRAM_SPEED_SLOW = 0x00, /* Slow speed */
CORSAIR_DRAM_SPEED_MEDIUM = 0x01, /* Medium speed */
CORSAIR_DRAM_SPEED_FAST = 0x02, /* Fast speed */
};
enum
{
CORSAIR_DRAM_EFFECT_RANDOM_COLORS = 0x00, /* Random colors */
CORSAIR_DRAM_EFFECT_CUSTOM_COLORS = 0x01, /* Custom colors */
};
enum
{
CORSAIR_DRAM_DIRECTION_UP = 0x00, /* Up direction */
CORSAIR_DRAM_DIRECTION_DOWN = 0x01, /* Down direction */
CORSAIR_DRAM_DIRECTION_LEFT = 0x02, /* Left direction */
CORSAIR_DRAM_DIRECTION_RIGHT = 0x03, /* Right direction */
CORSAIR_DRAM_DIRECTION_VERTICAL = 0x01, /* Vertical direction */
CORSAIR_DRAM_DIRECTION_HORIZONTAL = 0x03, /* Horizontal direction */
};
enum
{
CORSAIR_DRAM_BRIGHTNESS_MIN = 0, /* Minimum brightness */
CORSAIR_DRAM_BRIGHTNESS_MAX = 255, /* Maximum brightness */
CORSAIR_DRAM_BRIGHTNESS_DEFAULT = 255, /* Default brightness */
};
class CorsairDRAMController
{
public:
CorsairDRAMController(i2c_smbus_interface *bus, corsair_dev_id dev);
~CorsairDRAMController();
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetDeviceVersion();
unsigned int GetLEDCount();
unsigned char GetProtocolVersion();
void SetColorsPerLED(RGBColor* colors);
void SetDirect(bool direct);
void SetEffect(unsigned char mode,
unsigned char speed,
unsigned char direction,
bool random,
unsigned char brightness,
unsigned char red1,
unsigned char grn1,
unsigned char blu1,
unsigned char red2,
unsigned char grn2,
unsigned char blu2);
bool WaitReady();
private:
/*-----------------------------------------------------*\
| I2C |
\*-----------------------------------------------------*/
i2c_smbus_interface* bus;
corsair_dev_id dev;
/*-----------------------------------------------------*\
| State tracking |
\*-----------------------------------------------------*/
bool direct_mode;
/*-----------------------------------------------------*\
| Corsair DRAM information |
\*-----------------------------------------------------*/
unsigned short vid;
unsigned short pid;
std::string firmware_version;
unsigned char protocol_version;
unsigned int device_index;
/*-----------------------------------------------------*\
| Private functions |
\*-----------------------------------------------------*/
void ReadDeviceInfo();
};
@@ -0,0 +1,93 @@
/*---------------------------------------------------------*\
| CorsairDRAMControllerDetect.cpp |
| |
| Detector for Corsair DRAM RGB controllers |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <vector>
#include "CorsairDRAMController.h"
#include "DetectionManager.h"
#include "i2c_smbus.h"
#include "LogManager.h"
#include "pci_ids.h"
#include "RGBController_CorsairDRAM.h"
using namespace std::chrono_literals;
#define CORSAIR_DRAM_NAME "Corsair DRAM"
bool TestForCorsairDRAMController(i2c_smbus_interface *bus, unsigned char address)
{
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_DRAM_NAME, address);
int res = bus->i2c_smbus_read_byte_data(address, 0x43);
if(res < 0)
{
return false;
}
if(!(res == 0x1A || res == 0x1B || res == 0x1C))
{
LOG_DEBUG("[%s] Failed: expected 0x1A, 0x1B, or 0x1C, got %04X", CORSAIR_DRAM_NAME, res);
return false;
}
res = bus->i2c_smbus_read_byte_data(address, 0x44);
if(!(res == 0x01 || res == 0x03 || res == 0x04))
{
LOG_DEBUG("[%s] Failed: expected 0x01, 0x03, or 0x04, got %04X", CORSAIR_DRAM_NAME, res);
return false;
}
return true;
}
DetectedControllers DetectCorsairDRAMControllers(std::vector<i2c_smbus_interface *> &buses)
{
DetectedControllers detected_controllers;
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
{
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DRAM_NAME, bus);
std::vector<unsigned char> addresses;
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
{
addresses.push_back(addr);
}
for(unsigned char addr = 0x18; addr <= 0x1F; addr++)
{
addresses.push_back(addr);
}
for(unsigned char addr : addresses)
{
if(TestForCorsairDRAMController(buses[bus], addr))
{
CorsairDRAMController* controller = new CorsairDRAMController(buses[bus], addr);
RGBController_CorsairDRAM* rgb_controller = new RGBController_CorsairDRAM(controller);
detected_controllers.push_back(rgb_controller);
}
std::this_thread::sleep_for(10ms);
}
}
}
return(detected_controllers);
}
REGISTER_I2C_DETECTOR(CORSAIR_DRAM_NAME, DetectCorsairDRAMControllers);
@@ -0,0 +1,163 @@
/*---------------------------------------------------------*\
| CorsairDRAMDevices.cpp |
| |
| Device list for Corsair DRAM RGB controllers |
| |
| Adam Honse (CalcProgrammer1) 07 Apr 2026 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "CorsairDRAMDevices.h"
static const corsair_dram_device corsair_vengeance_pro_ddr4_device =
{
"Corsair Vengeance RGB Pro DDR4",
{
CORSAIR_VENGEANCE_PRO_DDR4_PID_1,
CORSAIR_VENGEANCE_PRO_DDR4_PID_2,
0,
0,
0,
0,
},
10,
false
};
static const corsair_dram_device corsair_dominator_platinum_ddr4_device =
{
"Corsair Dominator Platinum RGB DDR4",
{
CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_1,
CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_2,
0,
0,
0,
0,
},
12,
true
};
static const corsair_dram_device corsair_vengeance_pro_sl_ddr4_device =
{
"Corsair Vengeance RGB Pro SL DDR4",
{
CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_1,
CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_2,
0,
0,
0,
0,
},
10,
false
};
static const corsair_dram_device corsair_vengeance_rs_ddr4_device =
{
"Corsair Vengeance RGB RS DDR4",
{
CORSAIR_VENGEANCE_RS_DDR4_PID_1,
CORSAIR_VENGEANCE_RS_DDR4_PID_2,
0,
0,
0,
0,
},
6,
false
};
static const corsair_dram_device corsair_dominator_platinum_ddr5_device =
{
"Corsair Dominator Platinum RGB DDR5",
{
CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_1,
CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_2,
0,
0,
0,
0,
},
12,
true
};
static const corsair_dram_device corsair_dominator_titanium_ddr5_device =
{
"Corsair Dominator Titanium RGB DDR5",
{
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_1,
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_2,
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_3,
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_4,
0,
0,
},
12,
true
};
static const corsair_dram_device corsair_vengeance_ddr5_device =
{
"Corsair Vengeance RGB DDR5",
{
CORSAIR_VENGEANCE_DDR5_PID_1,
CORSAIR_VENGEANCE_DDR5_PID_2,
CORSAIR_VENGEANCE_DDR5_PID_3,
CORSAIR_VENGEANCE_DDR5_PID_4,
CORSAIR_VENGEANCE_DDR5_PID_5,
CORSAIR_VENGEANCE_DDR5_PID_6,
},
10,
false
};
static const corsair_dram_device corsair_vengeance_shugo_series_ddr5_device =
{
"Corsair Vengeance Shugo Series DDR5",
{
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_1,
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_2,
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_3,
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_4,
0,
0,
},
10,
false
};
static const corsair_dram_device corsair_vengeance_rs_ddr5_device =
{
"Corsair Vengeance RGB RS DDR5",
{
CORSAIR_VENGEANCE_RS_DDR5_PID_1,
CORSAIR_VENGEANCE_RS_DDR5_PID_2,
0,
0,
0,
0,
},
6,
false
};
static const corsair_dram_device* device_list[] =
{
&corsair_vengeance_pro_ddr4_device,
&corsair_dominator_platinum_ddr4_device,
&corsair_vengeance_pro_sl_ddr4_device,
&corsair_vengeance_rs_ddr4_device,
&corsair_dominator_platinum_ddr5_device,
&corsair_dominator_titanium_ddr5_device,
&corsair_vengeance_ddr5_device,
&corsair_vengeance_shugo_series_ddr5_device,
&corsair_vengeance_rs_ddr5_device,
};
const unsigned int CORSAIR_DRAM_NUM_DEVICES = (sizeof(device_list) / sizeof(device_list[ 0 ]));
const corsair_dram_device** corsair_dram_device_list = device_list;
@@ -0,0 +1,68 @@
/*---------------------------------------------------------*\
| CorsairDRAMDevices.h |
| |
| Device list for Corsair DRAM RGB controllers |
| |
| Adam Honse (CalcProgrammer1) 07 Apr 2026 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
/*---------------------------------------------------------*\
| Maximum number of PIDs for a given DRAM model |
\*---------------------------------------------------------*/
#define CORSAIR_DRAM_MAX_PIDS 6
/*---------------------------------------------------------*\
| Corsair DRAM vendor ID |
\*---------------------------------------------------------*/
#define CORSAIR_DRAM_VID 0x1B1C
/*---------------------------------------------------------*\
| Corsair DRAM product IDs |
\*---------------------------------------------------------*/
#define CORSAIR_VENGEANCE_PRO_DDR4_PID_1 0x0100
#define CORSAIR_VENGEANCE_PRO_DDR4_PID_2 0x0101
#define CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_1 0x0200
#define CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_2 0x0201
#define CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_1 0x0300
#define CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_2 0x0301
#define CORSAIR_VENGEANCE_RS_DDR4_PID_1 0x0400
#define CORSAIR_VENGEANCE_RS_DDR4_PID_2 0x0401
#define CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_1 0x0600
#define CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_2 0x0601
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_1 0x0800
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_2 0x0801
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_3 0x0810
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_4 0x0811
#define CORSAIR_VENGEANCE_DDR5_PID_1 0x0700
#define CORSAIR_VENGEANCE_DDR5_PID_2 0x0701
#define CORSAIR_VENGEANCE_DDR5_PID_3 0x0900
#define CORSAIR_VENGEANCE_DDR5_PID_4 0x0901
#define CORSAIR_VENGEANCE_DDR5_PID_5 0x0910
#define CORSAIR_VENGEANCE_DDR5_PID_6 0x0911
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_1 0x0A00
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_2 0x0A01
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_3 0x0A10
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_4 0x0A11
#define CORSAIR_VENGEANCE_RS_DDR5_PID_1 0x0B00
#define CORSAIR_VENGEANCE_RS_DDR5_PID_2 0x0B01
typedef struct
{
std::string name;
unsigned short pids[CORSAIR_DRAM_MAX_PIDS];
unsigned int led_count;
bool reverse;
} corsair_dram_device;
/*-----------------------------------------------------*\
| These constant values are defined in RazerDevices.cpp |
\*-----------------------------------------------------*/
extern const unsigned int CORSAIR_DRAM_NUM_DEVICES;
extern const corsair_dram_device** corsair_dram_device_list;
@@ -0,0 +1,324 @@
/*---------------------------------------------------------*\
| RGBController_CorsairDRAM.cpp |
| |
| RGBController for Corsair DRAM RGB controllers |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_CorsairDRAM.h"
/**------------------------------------------------------------------*\
@name Corsair DRAM
@category RAM
@type SMBus
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectCorsairDRAMControllers
@comment
The Corsair DRAM RGB controller chip can be found on several
Corsair memory sticks which have different LED counts. This can be controlled
by editing the Part Number in OpenRGB.json with values in the below table.
| Part Number | LED Count |
| :---------: | --------: |
| CMG | 6 |
| CMH | 10 |
| CMN | 10 |
| CMT | 12 |
\*-------------------------------------------------------------------*/
RGBController_CorsairDRAM::RGBController_CorsairDRAM(CorsairDRAMController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "Corsair";
type = DEVICE_TYPE_DRAM;
description = "Corsair DRAM RGB Device";
location = controller->GetDeviceLocation();
version = controller->GetDeviceVersion();
if(controller->GetProtocolVersion() >= 4)
{
mode Direct;
Direct.name = "Direct";
Direct.value = CORSAIR_DRAM_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
}
mode Custom;
Custom.name = "Custom";
Custom.value = CORSAIR_DRAM_MODE_STATIC;
Custom.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
Custom.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Custom);
mode ColorShift;
ColorShift.name = "Color Shift";
ColorShift.value = CORSAIR_DRAM_MODE_COLOR_SHIFT;
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
ColorShift.color_mode = MODE_COLORS_MODE_SPECIFIC;
ColorShift.speed_min = CORSAIR_DRAM_SPEED_SLOW;
ColorShift.speed_max = CORSAIR_DRAM_SPEED_FAST;
ColorShift.speed = CORSAIR_DRAM_SPEED_SLOW;
ColorShift.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
ColorShift.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
ColorShift.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
ColorShift.colors_min = 2;
ColorShift.colors_max = 2;
ColorShift.colors.resize(2);
modes.push_back(ColorShift);
mode ColorPulse;
ColorPulse.name = "Color Pulse";
ColorPulse.value = CORSAIR_DRAM_MODE_COLOR_PULSE;
ColorPulse.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
ColorPulse.color_mode = MODE_COLORS_MODE_SPECIFIC;
ColorPulse.speed_min = CORSAIR_DRAM_SPEED_SLOW;
ColorPulse.speed_max = CORSAIR_DRAM_SPEED_FAST;
ColorPulse.speed = CORSAIR_DRAM_SPEED_SLOW;
ColorPulse.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
ColorPulse.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
ColorPulse.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
ColorPulse.colors_min = 2;
ColorPulse.colors_max = 2;
ColorPulse.colors.resize(2);
modes.push_back(ColorPulse);
mode RainbowWave;
RainbowWave.name = "Rainbow Wave";
RainbowWave.value = CORSAIR_DRAM_MODE_RAINBOW_WAVE;
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
RainbowWave.color_mode = MODE_COLORS_NONE;
RainbowWave.speed_min = CORSAIR_DRAM_SPEED_SLOW;
RainbowWave.speed_max = CORSAIR_DRAM_SPEED_FAST;
RainbowWave.speed = CORSAIR_DRAM_SPEED_SLOW;
RainbowWave.direction = MODE_DIRECTION_DOWN;
modes.push_back(RainbowWave);
mode ColorWave;
ColorWave.name = "Color Wave";
ColorWave.value = CORSAIR_DRAM_MODE_COLOR_WAVE;
ColorWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
ColorWave.color_mode = MODE_COLORS_MODE_SPECIFIC;
ColorWave.speed_min = CORSAIR_DRAM_SPEED_SLOW;
ColorWave.speed_max = CORSAIR_DRAM_SPEED_FAST;
ColorWave.speed = CORSAIR_DRAM_SPEED_SLOW;
ColorWave.direction = MODE_DIRECTION_DOWN;
ColorWave.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
ColorWave.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
ColorWave.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
ColorWave.colors_min = 2;
ColorWave.colors_max = 2;
ColorWave.colors.resize(2);
modes.push_back(ColorWave);
mode Visor;
Visor.name = "Visor";
Visor.value = CORSAIR_DRAM_MODE_VISOR;
Visor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
Visor.color_mode = MODE_COLORS_MODE_SPECIFIC;
Visor.speed_min = CORSAIR_DRAM_SPEED_SLOW;
Visor.speed_max = CORSAIR_DRAM_SPEED_FAST;
Visor.speed = CORSAIR_DRAM_SPEED_SLOW;
Visor.direction = MODE_DIRECTION_VERTICAL;
Visor.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
Visor.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
Visor.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
Visor.colors_min = 2;
Visor.colors_max = 2;
Visor.colors.resize(2);
modes.push_back(Visor);
mode Rain;
Rain.name = "Rain";
Rain.value = CORSAIR_DRAM_MODE_RAIN;
Rain.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
Rain.color_mode = MODE_COLORS_MODE_SPECIFIC;
Rain.speed_min = CORSAIR_DRAM_SPEED_SLOW;
Rain.speed_max = CORSAIR_DRAM_SPEED_FAST;
Rain.speed = CORSAIR_DRAM_SPEED_SLOW;
Rain.direction = MODE_DIRECTION_DOWN;
Rain.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
Rain.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
Rain.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
Rain.colors_min = 2;
Rain.colors_max = 2;
Rain.colors.resize(2);
modes.push_back(Rain);
mode Marquee;
Marquee.name = "Marquee";
Marquee.value = CORSAIR_DRAM_MODE_MARQUEE;
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
Marquee.color_mode = MODE_COLORS_MODE_SPECIFIC;
Marquee.speed_min = CORSAIR_DRAM_SPEED_SLOW;
Marquee.speed_max = CORSAIR_DRAM_SPEED_FAST;
Marquee.speed = CORSAIR_DRAM_SPEED_SLOW;
Marquee.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
Marquee.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
Marquee.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
Marquee.colors_min = 1;
Marquee.colors_max = 1;
Marquee.colors.resize(1);
modes.push_back(Marquee);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = CORSAIR_DRAM_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
Rainbow.color_mode = MODE_COLORS_NONE;
Rainbow.speed_min = CORSAIR_DRAM_SPEED_SLOW;
Rainbow.speed_max = CORSAIR_DRAM_SPEED_FAST;
Rainbow.speed = CORSAIR_DRAM_SPEED_SLOW;
modes.push_back(Rainbow);
mode Sequential;
Sequential.name = "Sequential";
Sequential.value = CORSAIR_DRAM_MODE_SEQUENTIAL;
Sequential.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
Sequential.color_mode = MODE_COLORS_MODE_SPECIFIC;
Sequential.speed_min = CORSAIR_DRAM_SPEED_SLOW;
Sequential.speed_max = CORSAIR_DRAM_SPEED_FAST;
Sequential.speed = CORSAIR_DRAM_SPEED_SLOW;
Sequential.direction = MODE_DIRECTION_DOWN;
Sequential.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
Sequential.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
Sequential.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
Sequential.colors_min = 1;
Sequential.colors_max = 1;
Sequential.colors.resize(1);
modes.push_back(Sequential);
SetupZones();
}
RGBController_CorsairDRAM::~RGBController_CorsairDRAM()
{
Shutdown();
delete controller;
}
void RGBController_CorsairDRAM::SetupZones()
{
/*-----------------------------------------------------*\
| Set up zone |
\*-----------------------------------------------------*/
zone new_zone;
new_zone.name = "Corsair DRAM";
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.leds_min = controller->GetLEDCount();
new_zone.leds_max = controller->GetLEDCount();
new_zone.leds_count = controller->GetLEDCount();
zones.push_back(new_zone);
/*-----------------------------------------------------*\
| Set up LEDs |
\*-----------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
{
led new_led;
new_led.name = "Corsair DRAM LED ";
new_led.name.append(std::to_string(led_idx));
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_CorsairDRAM::DeviceUpdateLEDs()
{
controller->SetColorsPerLED(colors.data());
}
void RGBController_CorsairDRAM::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_CorsairDRAM::DeviceUpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_CorsairDRAM::DeviceUpdateMode()
{
unsigned int corsair_direction = 0;
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
unsigned char mode_colors[6];
switch(modes[active_mode].direction)
{
case MODE_DIRECTION_LEFT:
corsair_direction = CORSAIR_DRAM_DIRECTION_LEFT;
break;
case MODE_DIRECTION_RIGHT:
corsair_direction = CORSAIR_DRAM_DIRECTION_RIGHT;
break;
case MODE_DIRECTION_UP:
corsair_direction = CORSAIR_DRAM_DIRECTION_UP;
break;
case MODE_DIRECTION_DOWN:
corsair_direction = CORSAIR_DRAM_DIRECTION_DOWN;
break;
case MODE_DIRECTION_HORIZONTAL:
corsair_direction = CORSAIR_DRAM_DIRECTION_HORIZONTAL;
break;
case MODE_DIRECTION_VERTICAL:
corsair_direction = CORSAIR_DRAM_DIRECTION_VERTICAL;
break;
}
mode_colors[0] = 0;
mode_colors[1] = 0;
mode_colors[2] = 0;
mode_colors[3] = 0;
mode_colors[4] = 0;
mode_colors[5] = 0;
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
mode_colors[0] = RGBGetRValue(modes[active_mode].colors[0]);
mode_colors[1] = RGBGetGValue(modes[active_mode].colors[0]);
mode_colors[2] = RGBGetBValue(modes[active_mode].colors[0]);
if(modes[active_mode].colors.size() == 2)
{
mode_colors[3] = RGBGetRValue(modes[active_mode].colors[1]);
mode_colors[4] = RGBGetGValue(modes[active_mode].colors[1]);
mode_colors[5] = RGBGetBValue(modes[active_mode].colors[1]);
}
}
if(modes[active_mode].name == "Direct")
{
controller->SetDirect(true);
}
else
{
controller->SetDirect(false);
}
controller->SetEffect(modes[active_mode].value,
modes[active_mode].speed,
corsair_direction,
random,
(unsigned char)modes[active_mode].brightness,
mode_colors[0],
mode_colors[1],
mode_colors[2],
mode_colors[3],
mode_colors[4],
mode_colors[5]);
std::this_thread::sleep_for(std::chrono::milliseconds(15));
}
@@ -1,8 +1,9 @@
/*---------------------------------------------------------*\
| RGBController_CorsairDominatorPlatinum.h |
| RGBController_CorsairDRAM.h |
| |
| RGBController for Corsair Dominator Platinum RAM |
| RGBController for Corsair DRAM RGB controllers |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
@@ -12,13 +13,13 @@
#pragma once
#include "RGBController.h"
#include "CorsairDominatorPlatinumController.h"
#include "CorsairDRAMController.h"
class RGBController_CorsairDominatorPlatinum : public RGBController
class RGBController_CorsairDRAM : public RGBController
{
public:
RGBController_CorsairDominatorPlatinum(CorsairDominatorPlatinumController* controller_ptr);
~RGBController_CorsairDominatorPlatinum();
RGBController_CorsairDRAM(CorsairDRAMController* controller_ptr);
~RGBController_CorsairDRAM();
void SetupZones();
@@ -29,5 +30,5 @@ public:
void DeviceUpdateMode();
private:
CorsairDominatorPlatinumController* controller;
CorsairDRAMController* controller;
};
@@ -1,134 +0,0 @@
/*---------------------------------------------------------*\
| CorsairDominatorPlatinumController.cpp |
| |
| Driver for Corsair Dominator Platinum RAM |
| |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <cstring>
#include <chrono>
#include "CorsairDominatorPlatinumController.h"
using namespace std::chrono_literals;
CorsairDominatorPlatinumController::CorsairDominatorPlatinumController(i2c_smbus_interface *bus, corsair_dev_id dev, unsigned int leds_count, std::string dev_name)
{
this->bus = bus;
this->dev = dev;
this->leds_count = leds_count;
this->name = dev_name;
led_data[0] = 0xc;
}
CorsairDominatorPlatinumController::~CorsairDominatorPlatinumController()
{
}
unsigned int CorsairDominatorPlatinumController::GetLEDCount()
{
return leds_count;
}
std::string CorsairDominatorPlatinumController::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 CorsairDominatorPlatinumController::GetDeviceName()
{
return(name);
}
void CorsairDominatorPlatinumController::SetAllColors
(
unsigned char red,
unsigned char green,
unsigned char blue
)
{
for(unsigned int led = 0; led < leds_count; led++)
{
SetLEDColor(led, red, green, blue);
}
}
void CorsairDominatorPlatinumController::SetLEDColor
(
unsigned int led,
unsigned char red,
unsigned char green,
unsigned char blue
)
{
if(led >= leds_count)
{
return;
}
unsigned int offset = (led * 3) + 1;
led_data[offset] = red;
led_data[offset + 1] = green;
led_data[offset + 2] = blue;
}
unsigned char CorsairDominatorPlatinumController::crc8
(
unsigned char init,
unsigned char poly,
unsigned char* data,
unsigned char len
)
{
unsigned char crc = init;
for(unsigned int i = 0; i < len; i++)
{
unsigned char val = data[i];
for(unsigned char mask = 0x80; mask != 0; mask >>= 1)
{
unsigned char bit;
if ((val & mask) != 0)
{
bit = (crc & 0x80) ^ 0x80;
}
else
{
bit = crc & 0x80;
}
if (bit == 0)
{
crc <<= 1;
}
else
{
crc = (crc << 1) ^ poly;
}
}
}
return crc;
}
void CorsairDominatorPlatinumController::ApplyColors()
{
unsigned char data[sizeof(led_data)];
memcpy(data, led_data, sizeof(led_data));
unsigned char crc = crc8(0x0, 0x7, data, sizeof(data) - 1);
data[sizeof(data) - 1] = crc;
bus->i2c_smbus_write_block_data(dev, 0x31, 0x20, data);
std::this_thread::sleep_for(800us);
bus->i2c_smbus_write_block_data(dev, 0x32, sizeof(data) - 0x20, data + 0x20);
std::this_thread::sleep_for(200us);
}
@@ -1,44 +0,0 @@
/*---------------------------------------------------------*\
| CorsairDominatorPlatinumController.h |
| |
| Driver for Corsair Dominator Platinum RAM |
| |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include "i2c_smbus.h"
#define CORSAIR_DOMINATOR_PLATINUM_DATA_SIZE 38
typedef unsigned char corsair_dev_id;
class CorsairDominatorPlatinumController
{
public:
CorsairDominatorPlatinumController(i2c_smbus_interface *bus, corsair_dev_id dev, unsigned int leds_count, std::string dev_name);
~CorsairDominatorPlatinumController();
std::string GetDeviceLocation();
std::string GetDeviceName();
unsigned int GetLEDCount();
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
void ApplyColors();
bool WaitReady();
private:
unsigned char led_data[CORSAIR_DOMINATOR_PLATINUM_DATA_SIZE];
i2c_smbus_interface* bus;
corsair_dev_id dev;
unsigned int leds_count;
std::string name;
static unsigned char crc8(unsigned char init, unsigned char poly, unsigned char *data, unsigned char len);
};
@@ -1,168 +0,0 @@
/*---------------------------------------------------------*\
| CorsairDominatorPlatinumControllerDetect.cpp |
| |
| Detector for Corsair Dominator Platinum RAM |
| |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <vector>
#include "CorsairDominatorPlatinumController.h"
#include "DetectionManager.h"
#include "i2c_smbus.h"
#include "LogManager.h"
#include "pci_ids.h"
#include "ResourceManager.h"
#include "RGBController_CorsairDominatorPlatinum.h"
#include "SettingsManager.h"
using namespace std::chrono_literals;
json corsair_dominator_models =
{
{
"CMT",
{
{"name", "Corsair Dominator Platinum"},
{"leds", 12}
}
},
{
"CMH",
{
{"name", "Corsair Vengeance Pro SL"},
{"leds", 10}
}
},
{
"CMN",
{
{"name", "Corsair Vengeance RGB RT"},
{"leds", 10}
}
},
{
"CMG",
{
{"name", "Corsair Vengeance RGB RS"},
{"leds", 6}
}
},
{
"CMP",
{
{"name", "Corsair Dominator Titanium"},
{"leds", 11}
}
}
};
#define CORSAIR_DOMINATOR_PLATINUM_NAME "Corsair Dominator Platinum"
bool TestForCorsairDominatorPlatinumController(i2c_smbus_interface *bus, unsigned char address)
{
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_DOMINATOR_PLATINUM_NAME, address);
if(res < 0)
{
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
return false;
}
res = bus->i2c_smbus_read_byte_data(address, 0x43);
if(!(res == 0x1A || res == 0x1B))
{
LOG_DEBUG("[%s] Failed: expected 0x1a or 0x1b, got %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
return false;
}
res = bus->i2c_smbus_read_byte_data(address, 0x44);
if(res != 0x04)
{
LOG_DEBUG("[%s] Failed: expected 0x04, got %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
return false;
}
return true;
}
DetectedControllers DetectCorsairDominatorPlatinumControllers(std::vector<i2c_smbus_interface *> &busses)
{
DetectedControllers detected_controllers;
SettingsManager* settings_manager = ResourceManager::get()->GetSettingsManager();
json corsair_dominator_settings = settings_manager->GetSettings("CorsairDominatorSettings");
if(!corsair_dominator_settings.contains("model"))
{
// Set default value
corsair_dominator_settings["model"] = "CMT";
settings_manager->SetSettings("CorsairDominatorSettings", corsair_dominator_settings);
settings_manager->SaveSettings();
}
std::string model = corsair_dominator_settings["model"];
for(unsigned int bus = 0; bus < busses.size(); bus++)
{
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
{
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DOMINATOR_PLATINUM_NAME, bus);
std::vector<unsigned char> addresses;
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
{
addresses.push_back(addr);
}
for(unsigned char addr = 0x18; addr <= 0x1F; addr++)
{
addresses.push_back(addr);
}
for(unsigned char addr : addresses)
{
if(TestForCorsairDominatorPlatinumController(busses[bus], addr))
{
unsigned int leds;
std::string name;
if(corsair_dominator_models.contains(model))
{
leds = corsair_dominator_models[model]["leds"];
name = corsair_dominator_models[model]["name"];
}
else
{
leds = corsair_dominator_models["CMT"]["leds"];
name = corsair_dominator_models["CMT"]["name"];
}
LOG_DEBUG("[%s] Model: %s, Leds: %d", CORSAIR_DOMINATOR_PLATINUM_NAME, name.c_str(), leds);
CorsairDominatorPlatinumController* controller = new CorsairDominatorPlatinumController(busses[bus], addr, leds, name);
RGBController_CorsairDominatorPlatinum* rgb_controller = new RGBController_CorsairDominatorPlatinum(controller);
detected_controllers.push_back(rgb_controller);
}
std::this_thread::sleep_for(10ms);
}
}
else
{
LOG_DEBUG("[%s] Bus %d is not a DRAM bus", CORSAIR_DOMINATOR_PLATINUM_NAME, bus);
}
}
return(detected_controllers);
}
REGISTER_I2C_DETECTOR(CORSAIR_DOMINATOR_PLATINUM_NAME, DetectCorsairDominatorPlatinumControllers);
@@ -1,128 +0,0 @@
/*---------------------------------------------------------*\
| RGBController_CorsairDominatorPlatinum.cpp |
| |
| RGBController for Corsair Dominator Platinum RAM |
| |
| Erik Gilling (konkers) 25 Sep 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_CorsairDominatorPlatinum.h"
/**------------------------------------------------------------------*\
@name Corsair Dominator Platinum
@category RAM
@type SMBus
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectCorsairDominatorPlatinumControllers
@comment
The Corsair Dominator controller chip can be found on several
Corsair memory sticks which have different LED counts. This can be controlled
by editing the Part Number in OpenRGB.json with values in the below table.
| Part Number | LED Count |
| :---------: | --------: |
| CMG | 6 |
| CMH | 10 |
| CMN | 10 |
| CMT | 12 |
\*-------------------------------------------------------------------*/
RGBController_CorsairDominatorPlatinum::RGBController_CorsairDominatorPlatinum(CorsairDominatorPlatinumController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "Corsair";
type = DEVICE_TYPE_DRAM;
description = "Corsair RAM RGB Device";
location = controller->GetDeviceLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.speed_min = 0;
Direct.speed_max = 0;
Direct.speed = 0;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
active_mode = 0;
}
RGBController_CorsairDominatorPlatinum::~RGBController_CorsairDominatorPlatinum()
{
Shutdown();
delete controller;
}
void RGBController_CorsairDominatorPlatinum::SetupZones()
{
/*---------------------------------------------------------*\
| Set up zone |
\*---------------------------------------------------------*/
zone new_zone;
new_zone.name = "Corsair RAM Zone";
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.leds_min = controller->GetLEDCount();
new_zone.leds_max = controller->GetLEDCount();
new_zone.leds_count = controller->GetLEDCount();
zones.push_back(new_zone);
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
{
led new_led;
new_led.name = "Corsair RAM LED ";
new_led.name.append(std::to_string(led_idx));
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_CorsairDominatorPlatinum::DeviceUpdateLEDs()
{
for(unsigned int led = 0; led < (unsigned int)colors.size(); led++)
{
RGBColor color = colors[led];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
controller->SetLEDColor(led, red, grn, blu);
}
controller->ApplyColors();
}
void RGBController_CorsairDominatorPlatinum::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_CorsairDominatorPlatinum::DeviceUpdateSingleLED(int led)
{
RGBColor color = colors[led];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
controller->SetLEDColor(led, red, grn, blu);
controller->ApplyColors();
}
void RGBController_CorsairDominatorPlatinum::DeviceUpdateMode()
{
}
@@ -110,7 +110,8 @@ void RGBController_CorsairHydroPlatinum::SetupZones()
zones[1].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[1].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -98,7 +98,16 @@ void RGBController_CorsairICueLink::SetupZones()
lcd_zone.leds_min = controller->GetEndpoints()[lcd_idx]->led_channels;
lcd_zone.leds_max = lcd_zone.leds_min;
lcd_zone.leds_count = lcd_zone.leds_min;
zones.push_back(lcd_zone);
for(unsigned int led_idx = 0; led_idx < lcd_zone.leds_count; led_idx++)
{
led new_led;
new_led.name = "LED " + std::to_string(led_idx + 1);
leds.push_back(new_led);
}
}
}
}
@@ -332,7 +332,8 @@ void RGBController_CorsairLightingNode::SetupZones()
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -364,7 +365,7 @@ void RGBController_CorsairLightingNode::SetupZones()
new_led.name = zones[zone_idx].name + ", LED " + std::to_string(led_ch_idx + 1);
leds.push_back(new_led);
leds_channel.push_back(zone_idx);
leds_channel.push_back((unsigned int)zone_idx);
}
}
@@ -412,7 +413,7 @@ void RGBController_CorsairLightingNode::DeviceUpdateMode()
{
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
DeviceUpdateZoneMode(zone_idx);
DeviceUpdateZoneMode((int)zone_idx);
}
}
@@ -526,27 +526,26 @@ void CorsairPeripheralController::ReadFirmwareInfo()
char offset = 0;
/*-----------------------------------------------------*\
| Zero out buffer |
| Some Corsair keyboards (e.g. K70 RGB MK.2) do not |
| answer the firmware-info query on the control |
| interface until several seconds after the host first |
| talks to them following a cold boot. A single read |
| attempt returns all zeros, the device type comes back |
| as 0x00, and the device is discarded as UNKNOWN. |
| Retry the query until a valid device type byte is |
| returned or the attempt cap is reached. Each failed |
| attempt is paced by the 1s hid_read_timeout below, so |
| the cap also bounds the detection stall for a device |
| that opens but never answers. Observed need |
| on a K70 RGB MK.2 cold boot is 2 attempts; the cap |
| leaves generous headroom. |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, CORSAIR_PERIPHERAL_PACKET_LENGTH);
int attempt = 0;
/*-----------------------------------------------------*\
| Set up Read Firmware Info packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = CORSAIR_COMMAND_READ;
usb_buf[0x02] = CORSAIR_PROPERTY_FIRMWARE_INFO;
/*-----------------------------------------------------*\
| Send packet and try reading it using an HID read |
| If that fails, repeat the send and read the reply as |
| a feature report. |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
actual = hid_read_timeout(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH, 1000);
if(actual == 0)
do
{
offset = 0;
/*-------------------------------------------------*\
| Zero out buffer |
\*-------------------------------------------------*/
@@ -559,10 +558,48 @@ void CorsairPeripheralController::ReadFirmwareInfo()
usb_buf[0x01] = CORSAIR_COMMAND_READ;
usb_buf[0x02] = CORSAIR_PROPERTY_FIRMWARE_INFO;
hid_send_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
actual = hid_get_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
offset = 1;
}
/*-------------------------------------------------*\
| Send packet and try reading it using an HID read |
| If that fails, repeat the send and read the reply |
| as a feature report. |
\*-------------------------------------------------*/
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
actual = hid_read_timeout(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH, 1000);
if(actual == 0)
{
/*---------------------------------------------*\
| Zero out buffer |
\*---------------------------------------------*/
memset(usb_buf, 0x00, CORSAIR_PERIPHERAL_PACKET_LENGTH);
/*---------------------------------------------*\
| Set up Read Firmware Info packet |
\*---------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = CORSAIR_COMMAND_READ;
usb_buf[0x02] = CORSAIR_PROPERTY_FIRMWARE_INFO;
hid_send_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
actual = hid_get_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
offset = 1;
}
attempt++;
LOG_DEBUG("[%s] Firmware info attempt %d/%d: device type %02X", CORSAIR_PERIPHERAL_CONTROLLER_NAME, attempt, CORSAIR_FW_INFO_MAX_ATTEMPTS, usb_buf[0x14 + offset]);
/*-------------------------------------------------*\
| Stop as soon as a valid device type is returned |
| 0xC0 keyboard / 0xC1 mouse / 0xC2 pad or stand |
\*-------------------------------------------------*/
if(usb_buf[0x14 + offset] == 0xC0
|| usb_buf[0x14 + offset] == 0xC1
|| usb_buf[0x14 + offset] == 0xC2)
{
break;
}
} while(attempt < CORSAIR_FW_INFO_MAX_ATTEMPTS);
/*-----------------------------------------------------*\
| Get device type |
@@ -570,7 +607,7 @@ void CorsairPeripheralController::ReadFirmwareInfo()
| 0xC1 Device is a mouse |
| 0xC2 Device is a mousepad or headset stand |
\*-----------------------------------------------------*/
LOG_DEBUG("[%s] Device type %02X", CORSAIR_PERIPHERAL_CONTROLLER_NAME, usb_buf[0x14 + offset]);
LOG_DEBUG("[%s] Device type %02X after %d attempt(s)", CORSAIR_PERIPHERAL_CONTROLLER_NAME, usb_buf[0x14 + offset], attempt);
switch(usb_buf[0x14 + offset])
{
@@ -16,6 +16,7 @@
#include "RGBController.h"
#define CORSAIR_PERIPHERAL_PACKET_LENGTH 65
#define CORSAIR_FW_INFO_MAX_ATTEMPTS 10
enum
{
@@ -35,6 +35,12 @@ CorsairPeripheralV2Controller::CorsairPeripheralV2Controller(hid_device* dev_han
write_cmd = CORSAIR_V2_WRITE_WIRELESS_ID;
pid = GetAddress(0x12);
break;
case CORSAIR_K57_RGB_WIRED_PID:
write_cmd = 0x80;
light_ctrl = CORSAIR_V2_LIGHT_CTRL1;
skip_reads = true;
break;
}
/*---------------------------------------------------------*\
@@ -93,14 +99,17 @@ CorsairPeripheralV2Controller::CorsairPeripheralV2Controller(hid_device* dev_han
| If lighting control endpoint 2 is unavailable |
| then use endpoint 1. |
\*---------------------------------------------------------*/
result = StartTransaction(0);
if(result > 0)
if(light_ctrl == CORSAIR_V2_LIGHT_CTRL2)
{
light_ctrl = CORSAIR_V2_LIGHT_CTRL1;
StartTransaction(0);
result = StartTransaction(0);
if(result > 0)
{
light_ctrl = CORSAIR_V2_LIGHT_CTRL1;
StartTransaction(0);
}
StopTransaction(0);
LOG_DEBUG("[%s] Lighting Endpoint set to %02X", device_name.c_str(), light_ctrl);
}
StopTransaction(0);
LOG_DEBUG("[%s] Lighting Endpoint set to %02X", device_name.c_str(), light_ctrl);
}
CorsairPeripheralV2Controller::~CorsairPeripheralV2Controller()
@@ -171,7 +180,11 @@ void CorsairPeripheralV2Controller::SetRenderMode(corsair_v2_device_mode mode)
buffer[5] = mode;
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
if(!skip_reads)
{
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
}
}
void CorsairPeripheralV2Controller::LightingControl(uint8_t opt1)
@@ -191,7 +204,11 @@ void CorsairPeripheralV2Controller::LightingControl(uint8_t opt1)
buffer[5] = 0x00;
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
if(!skip_reads)
{
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
}
}
unsigned int CorsairPeripheralV2Controller::GetKeyboardLayout()
@@ -240,7 +257,11 @@ unsigned char CorsairPeripheralV2Controller::StartTransaction(uint8_t opt1)
buffer[4] = light_ctrl;
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
if(!skip_reads)
{
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
}
return buffer[2];
}
@@ -257,11 +278,20 @@ void CorsairPeripheralV2Controller::StopTransaction(uint8_t opt1)
buffer[4] = opt1;
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
if(!skip_reads)
{
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
}
}
void CorsairPeripheralV2Controller::ClearPacketBuffer()
{
if(skip_reads)
{
return;
}
uint8_t result = 0;
uint8_t buffer[CORSAIR_V2_PACKET_SIZE];
@@ -304,7 +334,11 @@ void CorsairPeripheralV2Controller::SetLEDs(uint8_t *data, uint16_t data_size)
memcpy(&buffer[offset1], &data[0], copy_bytes);
hid_write(dev, buffer, pkt_sze);
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
if(!skip_reads)
{
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
}
remaining -= copy_bytes;
buffer[2] = CORSAIR_V2_CMD_BLK_WN;
@@ -325,7 +359,11 @@ void CorsairPeripheralV2Controller::SetLEDs(uint8_t *data, uint16_t data_size)
memcpy(&buffer[offset2], &data[index], copy_bytes);
hid_write(dev, buffer, pkt_sze);
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
if(!skip_reads)
{
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
}
remaining -= copy_bytes;
}
@@ -109,6 +109,7 @@ private:
uint8_t write_cmd = CORSAIR_V2_WRITE_WIRED_ID;
uint16_t pkt_sze = CORSAIR_V2_WRITE_SIZE;
bool skip_reads = false;
std::string firmware_version;
std::string location;
};
@@ -67,6 +67,7 @@ DetectedControllers DetectCorsairV2SoftwareControllers(hid_device_info* info, co
| Keyboards |
\*---------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("Corsair K55 RGB PRO", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K55_RGB_PRO_PID, 1, 0xFF42);
REGISTER_HID_DETECTOR_IP("Corsair K57 RGB (Wired)", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K57_RGB_WIRED_PID, 1, 0xFF42);
REGISTER_HID_DETECTOR_IP("Corsair K60 RGB PRO", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K60_RGB_PRO_PID, 1, 0xFF42);
REGISTER_HID_DETECTOR_IP("Corsair K60 RGB PRO Low Profile", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K60_RGB_PRO_LP_PID, 1, 0xFF42);
REGISTER_HID_DETECTOR_IP("Corsair K60 RGB PRO TKL Black", DetectCorsairV2HardwareControllers, CORSAIR_VID, CORSAIR_K60_RGB_PRO_TKL_B_PID, 1, 0xFF42);
@@ -48,6 +48,31 @@ std::vector<unsigned int> corsair_full_size_values =
/*-------------------------------------------------------------------------*\
| KEYMAPS |
\*-------------------------------------------------------------------------*/
keyboard_keymap_overlay_values corsair_K57_layout
{
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
{
corsair_full_size_values,
{
/* Add more regional layout fixes here */
}
},
{
/*-------------------------------------------------------------------------------------------------------------------------------------*\
| Edit Keys |
| Zone, Row, Column, Value, Name, Alternate Name, OpCode |
\*-------------------------------------------------------------------------------------------------------------------------------------*/
{ 0, 0, 17, 0, "Power/Wireless Indicator", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_ROW, }, // Insert Profile into new row
{ 0, 0, 18, 1, "Lock/Macro Indicator", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Light key
{ 0, 1, 0, 131, "Key: G1", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G1 key
{ 0, 2, 0, 132, "Key: G2", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G2 key
{ 0, 3, 0, 133, "Key: G3", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G3 key
{ 0, 4, 0, 134, "Key: G4", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G4 key
{ 0, 5, 0, 135, "Key: G5", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G5 key
{ 0, 6, 0, 136, "Key: G6", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G6 key
}
};
keyboard_keymap_overlay_values corsair_K60_layout
{
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
@@ -116,12 +141,14 @@ keyboard_keymap_overlay_values corsair_k70_pro_layout
{ 0, 0, 0, 128, "Profile", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_ROW, }, // Insert Profile into new row
{ 0, 0, 1, 113, "Light", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Light key
{ 0, 0, 2, 114, "Lock", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Lock Key
{ 0, 0, 10, 191, "Logo", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Logo
{ 0, 0, 10, 138, "Logo", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Logo
{ 0, 0, 18, 102, KEY_EN_MEDIA_MUTE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Mute Key
{ 0, 1, 17, 123, KEY_EN_MEDIA_STOP, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Stop Key
{ 0, 1, 18, 126, KEY_EN_MEDIA_PREVIOUS, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Previous Track Key
{ 0, 1, 19, 124, KEY_EN_MEDIA_PLAY_PAUSE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Play Pause Key
{ 0, 1, 20, 125, KEY_EN_MEDIA_NEXT, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Next Tack Key
{ 0, 6, 5, 140, KEY_EN_SPACE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert spacebar L
{ 0, 6, 7, 141, KEY_EN_SPACE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert spacebar R
}
};
@@ -167,10 +194,10 @@ keyboard_keymap_overlay_values corsair_K70_CORE_TKL_layout
| Edit Keys |
| Zone, Row, Column, Value, Name, Alternate Name, OpCode, |
\*-------------------------------------------------------------------------------------------------------------------------------------*/
{ 0, 0, 14, 70, KEY_EN_MEDIA_MUTE, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PRSC with Mute
{ 0, 0, 14, 70, KEY_EN_MEDIA_MUTE, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PRSC with Mute
{ 0, 0, 15, 71, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Remove SCLK
{ 0, 0, 16, 72, KEY_EN_MEDIA_VOLUME_UP, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PSBK with Volume Potion Up
{ 0, 0, 16, 72, KEY_EN_MEDIA_VOLUME_UP, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PSBK with Volume Potion Up
}
};
@@ -772,6 +799,38 @@ static const corsair_v2_device k55_rgb_pro_device =
nullptr
};
/*-------------------------------------------------------------*\
| Corsair K57 RGB (Wired) 1B1C:1B6E |
| |
| Zone "Keyboard" |
| Matrix |
| 7 Rows, 22 Columns |
\*-------------------------------------------------------------*/
static const corsair_v2_zone k57_rgb_wired_zone =
{
ZONE_EN_KEYBOARD,
ZONE_TYPE_MATRIX,
7,
22
};
static const corsair_v2_device k57_rgb_wired_device =
{
CORSAIR_K57_RGB_WIRED_PID,
DEVICE_TYPE_KEYBOARD,
7,
22,
{
&k57_rgb_wired_zone,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
},
&corsair_K57_layout
};
/*-------------------------------------------------------------*\
| Corsair K60 RGB Pro 1B1C:1BA0 |
| |
@@ -1461,6 +1520,7 @@ const corsair_v2_device* corsair_v2_device_list_data[] =
| KEYBOARDS |
\*-----------------------------------------------------------------*/
&k55_rgb_pro_device,
&k57_rgb_wired_device,
&k60_rgb_pro_device,
&k60_rgb_pro_lp_device,
&k60_rgb_pro_tkl_device_b,
@@ -69,6 +69,8 @@ typedef struct
| Corsair V2 Protocol Keyboards |
\*-----------------------------------------------------*/
#define CORSAIR_K55_RGB_PRO_PID 0x1BA4
#define CORSAIR_K57_RGB_WIRED_PID 0x1B6E
#define CORSAIR_K57_RGB_WIRELESS_PID 0x1B62
#define CORSAIR_K60_RGB_PRO_PID 0x1BA0
#define CORSAIR_K60_RGB_PRO_LP_PID 0x1BAD
#define CORSAIR_K60_RGB_PRO_TKL_B_PID 0x1BC7
@@ -34,7 +34,7 @@ std::string CorsairVengeanceController::GetDeviceName()
std::string CorsairVengeanceController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -1,213 +0,0 @@
/*---------------------------------------------------------*\
| CorsairVengeanceProController.cpp |
| |
| Driver for Corsair Vengeance Pro RGB RAM |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <cstring>
#include <chrono>
#include "CorsairVengeanceProController.h"
using namespace std::chrono_literals;
CorsairVengeanceProController::CorsairVengeanceProController(i2c_smbus_interface* bus, corsair_dev_id dev)
{
this->bus = bus;
this->dev = dev;
strcpy(device_name, "Corsair Vengeance Pro RGB");
led_count = CORSAIR_PRO_LED_COUNT;
direct_mode = false;
effect_mode = CORSAIR_PRO_MODE_STATIC;
for (unsigned int i = 0; i < led_count; i++)
{
led_red[i] = 0;
led_green[i] = 0;
led_blue[i] = 0;
}
}
CorsairVengeanceProController::~CorsairVengeanceProController()
{
}
std::string CorsairVengeanceProController::GetDeviceName()
{
return(device_name);
}
std::string CorsairVengeanceProController::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);
}
unsigned int CorsairVengeanceProController::GetLEDCount()
{
return(led_count);
}
unsigned char CorsairVengeanceProController::GetEffect()
{
return(effect_mode);
}
void CorsairVengeanceProController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
{
for (unsigned int i = 0; i < led_count; i++)
{
led_red[i] = red;
led_green[i] = green;
led_blue[i] = blue;
}
}
void CorsairVengeanceProController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
{
led_red[led] = red;
led_green[led] = green;
led_blue[led] = blue;
}
void CorsairVengeanceProController::ApplyColors()
{
if(direct_mode)
{
unsigned char full_packet[32];
unsigned char crc_packet[31];
full_packet[0] = 0x0A;
crc_packet[0] = 0x0A;
for (int i = 0; i < 10; i++)
{
crc_packet[(i * 3) + 1] = led_red[i];
full_packet[(i * 3) + 1] = led_red[i];
crc_packet[(i * 3) + 2] = led_green[i];
full_packet[(i * 3) + 2] = led_green[i];
crc_packet[(i * 3) + 3] = led_blue[i];
full_packet[(i * 3) + 3] = led_blue[i];
}
uint8_t footer = CRCPP::CRC::Calculate(crc_packet, 31, CRCPP::CRC::CRC_8());
full_packet[31] = footer;
bus->i2c_smbus_write_block_data(dev, CORSAIR_PRO_DIRECT_COMMAND, 32, full_packet);
}
else
{
bus->i2c_smbus_write_byte_data(dev, 0x26, 0x02);
std::this_thread::sleep_for(1ms);
bus->i2c_smbus_write_byte_data(dev, 0x21, 0x00);
std::this_thread::sleep_for(1ms);
for (int i = 0; i < 10; i++)
{
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, led_red[i]);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, led_green[i]);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, led_blue[i]);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0xFF);
}
bus->i2c_smbus_write_byte_data(dev, 0x82, 0x02);
}
}
void CorsairVengeanceProController::SetEffect(unsigned char mode,
unsigned char speed,
unsigned char direction,
bool random,
unsigned char red1,
unsigned char grn1,
unsigned char blu1,
unsigned char red2,
unsigned char grn2,
unsigned char blu2
)
{
if(mode == effect_mode)
{
return;
}
effect_mode = mode;
direct_mode = (effect_mode == CORSAIR_PRO_MODE_DIRECT);
if(direct_mode)
{
return;
}
bus->i2c_smbus_write_byte_data(dev, 0x26, 0x01);
std::this_thread::sleep_for(1ms);
bus->i2c_smbus_write_byte_data(dev, 0x21, 0x00);
std::this_thread::sleep_for(1ms);
unsigned char random_byte;
if(random)
{
random_byte = CORSAIR_PRO_EFFECT_RANDOM_COLORS;
}
else
{
random_byte = CORSAIR_PRO_EFFECT_CUSTOM_COLORS;
}
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, effect_mode); // Mode
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, speed); // Speed
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, random_byte); // Custom color
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, direction); // Direction
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, red1); // Custom color 1 red
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, grn1); // Custom color 1 green
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, blu1); // Custom color 1 blue
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0xFF);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, red2); // Custom color 2 red
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, grn2); // Custom color 2 green
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, blu2); // Custom color 2 blue
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0xFF);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
bus->i2c_smbus_write_byte_data(dev, 0x82, 0x01);
WaitReady();
}
bool CorsairVengeanceProController::WaitReady()
{
int i = 0;
while (bus->i2c_smbus_read_byte_data(dev, 0x41) != 0x00)
{
i++;
std::this_thread::sleep_for(1ms);
}
return false;
}
void CorsairVengeanceProController::SetDirect(bool direct)
{
direct_mode = direct;
}
@@ -1,109 +0,0 @@
/*---------------------------------------------------------*\
| CorsairVengeanceProController.h |
| |
| Driver for Corsair Vengeance Pro RGB RAM |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include "i2c_smbus.h"
#include "CRC.h"
typedef unsigned char corsair_dev_id;
#define CORSAIR_PRO_LED_COUNT ( 10 )
#define CORSAIR_VENGEANCE_RGB_PRO_NAME "Corsair Vengeance RGB PRO"
enum
{
CORSAIR_PRO_REG_COMMAND = 0x20, /* Command write register */
CORSAIR_PRO_DIRECT_COMMAND = 0x31, /* Where it writes direct mode colors */
};
enum
{
CORSAIR_PRO_MODE_DIRECT = 0xDD, /* Arbitrary value to compare against later. Not the actual packet */
CORSAIR_PRO_MODE_COLOR_SHIFT = 0x00, /* Color Shift mode */
CORSAIR_PRO_MODE_COLOR_PULSE = 0x01, /* Color Pulse mode */
CORSAIR_PRO_MODE_RAINBOW_WAVE = 0x03, /* Rainbow Wave mode */
CORSAIR_PRO_MODE_COLOR_WAVE = 0x04, /* Color Wave mode */
CORSAIR_PRO_MODE_VISOR = 0x05, /* Visor mode */
CORSAIR_PRO_MODE_RAIN = 0x06, /* Rain mode */
CORSAIR_PRO_MODE_MARQUEE = 0x07, /* Marquee mode */
CORSAIR_PRO_MODE_RAINBOW = 0x08, /* Rainbow mode */
CORSAIR_PRO_MODE_SEQUENTIAL = 0x09, /* Sequential mode */
CORSAIR_PRO_MODE_STATIC = 0x10, /* Static mode */
CORSAIR_PRO_NUMBER_MODES = 10, /* Number of Corsair Pro modes */
};
enum
{
CORSAIR_PRO_SPEED_SLOW = 0x00, /* Slow speed */
CORSAIR_PRO_SPEED_MEDIUM = 0x01, /* Medium speed */
CORSAIR_PRO_SPEED_FAST = 0x02, /* Fast speed */
};
enum
{
CORSAIR_PRO_EFFECT_RANDOM_COLORS = 0x00, /* Random colors */
CORSAIR_PRO_EFFECT_CUSTOM_COLORS = 0x01, /* Custom colors */
};
enum
{
CORSAIR_PRO_DIRECTION_UP = 0x00, /* Up direction */
CORSAIR_PRO_DIRECTION_DOWN = 0x01, /* Down direction */
CORSAIR_PRO_DIRECTION_LEFT = 0x02, /* Left direction */
CORSAIR_PRO_DIRECTION_RIGHT = 0x03, /* Right direction */
CORSAIR_PRO_DIRECTION_VERTICAL = 0x01, /* Vertical direction */
CORSAIR_PRO_DIRECTION_HORIZONTAL = 0x03, /* Horizontal direction */
};
class CorsairVengeanceProController
{
public:
CorsairVengeanceProController(i2c_smbus_interface* bus, corsair_dev_id dev);
~CorsairVengeanceProController();
std::string GetDeviceName();
std::string GetDeviceLocation();
unsigned int GetLEDCount();
unsigned char GetEffect();
void SetEffect(unsigned char mode,
unsigned char speed,
unsigned char direction,
bool random,
unsigned char red1,
unsigned char grn1,
unsigned char blu1,
unsigned char red2,
unsigned char grn2,
unsigned char blu2
);
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
void ApplyColors();
bool WaitReady();
void SetDirect(bool direct);
private:
char device_name[32];
unsigned int led_count;
bool direct_mode;
unsigned char effect_mode;
unsigned char led_red[CORSAIR_PRO_LED_COUNT];
unsigned char led_green[CORSAIR_PRO_LED_COUNT];
unsigned char led_blue[CORSAIR_PRO_LED_COUNT];
i2c_smbus_interface* bus;
corsair_dev_id dev;
};
@@ -1,89 +0,0 @@
/*---------------------------------------------------------*\
| CorsairVengeanceProControllerDetect.cpp |
| |
| Detector for Corsair Vengeance Pro RGB RAM |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <vector>
#include "DetectionManager.h"
#include "CorsairVengeanceProController.h"
#include "RGBController_CorsairVengeancePro.h"
#include "i2c_smbus.h"
#include "pci_ids.h"
#include "LogManager.h"
using namespace std::chrono_literals;
bool TestForCorsairVengeanceProController(i2c_smbus_interface* bus, unsigned char address)
{
bool pass = false;
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, address);
if(res >= 0)
{
pass = true;
res = bus->i2c_smbus_read_byte_data(address, 0x43);
if (res != 0x1C)
{
pass = false;
LOG_DEBUG("[%s] Failed: was expecting 0x1C got %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
}
res = bus->i2c_smbus_read_byte_data(address, 0x44);
if(!((res == 0x03) || (res == 0x04)))
{
pass = false;
LOG_DEBUG("[%s] Failed: was expecting 0x03 or 0x04 got %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
}
}
else
{
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
}
std::this_thread::sleep_for(10ms);
return(pass);
}
DetectedControllers DetectCorsairVengeanceProControllers(std::vector<i2c_smbus_interface*> &busses)
{
DetectedControllers detected_controllers;
for(unsigned int bus = 0; bus < busses.size(); bus++)
{
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_VENGEANCE_RGB_PRO_NAME, bus);
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
{
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
{
if(TestForCorsairVengeanceProController(busses[bus], addr))
{
CorsairVengeanceProController* controller = new CorsairVengeanceProController(busses[bus], addr);
RGBController_CorsairVengeancePro* rgb_controller = new RGBController_CorsairVengeancePro(controller);
detected_controllers.push_back(rgb_controller);
}
}
}
else
{
LOG_DEBUG("[%s] Bus %d is not a DRAM bus", CORSAIR_VENGEANCE_RGB_PRO_NAME, bus);
}
}
return(detected_controllers);
}
REGISTER_I2C_DETECTOR("Corsair Vengeance Pro", DetectCorsairVengeanceProControllers);
@@ -1,310 +0,0 @@
/*---------------------------------------------------------*\
| RGBController_CorsairVengeancePro.cpp |
| |
| RGBController for Corsair Vengeance Pro RGB RAM |
| |
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_CorsairVengeancePro.h"
/**------------------------------------------------------------------*\
@name Corsair Vengeance Pro
@category RAM
@type SMBus
@save :robot:
@direct :white_check_mark:
@effects :white_check_mark:
@detectors DetectCorsairVengeanceProControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_CorsairVengeancePro::RGBController_CorsairVengeancePro(CorsairVengeanceProController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetDeviceName();
vendor = "Corsair";
type = DEVICE_TYPE_DRAM;
description = "Corsair Vengeance Pro RGB Device";
location = controller->GetDeviceLocation();
mode Direct;
Direct.name = "Direct";
Direct.value = CORSAIR_PRO_MODE_DIRECT;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.speed_min = 0;
Direct.speed_max = 0;
Direct.speed = 0;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
mode Static;
Static.name = "Static";
Static.value = CORSAIR_PRO_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Static.speed_min = 0;
Static.speed_max = 0;
Static.speed = 0;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
mode ColorShift;
ColorShift.name = "Color Shift";
ColorShift.value = CORSAIR_PRO_MODE_COLOR_SHIFT;
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
ColorShift.speed_min = CORSAIR_PRO_SPEED_SLOW;
ColorShift.speed_max = CORSAIR_PRO_SPEED_FAST;
ColorShift.colors_min = 2;
ColorShift.colors_max = 2;
ColorShift.speed = CORSAIR_PRO_SPEED_SLOW;
ColorShift.color_mode = MODE_COLORS_MODE_SPECIFIC;
ColorShift.colors.resize(2);
modes.push_back(ColorShift);
mode ColorPulse;
ColorPulse.name = "Color Pulse";
ColorPulse.value = CORSAIR_PRO_MODE_COLOR_PULSE;
ColorPulse.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
ColorPulse.speed_min = CORSAIR_PRO_SPEED_SLOW;
ColorPulse.speed_max = CORSAIR_PRO_SPEED_FAST;
ColorPulse.colors_min = 2;
ColorPulse.colors_max = 2;
ColorPulse.speed = CORSAIR_PRO_SPEED_SLOW;
ColorPulse.color_mode = MODE_COLORS_MODE_SPECIFIC;
ColorPulse.colors.resize(2);
modes.push_back(ColorPulse);
mode RainbowWave;
RainbowWave.name = "Rainbow Wave";
RainbowWave.value = CORSAIR_PRO_MODE_RAINBOW_WAVE;
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD;
RainbowWave.speed_min = CORSAIR_PRO_SPEED_SLOW;
RainbowWave.speed_max = CORSAIR_PRO_SPEED_FAST;
RainbowWave.speed = CORSAIR_PRO_SPEED_SLOW;
RainbowWave.direction = MODE_DIRECTION_DOWN;
RainbowWave.color_mode = MODE_COLORS_NONE;
modes.push_back(RainbowWave);
mode ColorWave;
ColorWave.name = "Color Wave";
ColorWave.value = CORSAIR_PRO_MODE_COLOR_WAVE;
ColorWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
ColorWave.speed_min = CORSAIR_PRO_SPEED_SLOW;
ColorWave.speed_max = CORSAIR_PRO_SPEED_FAST;
ColorWave.colors_min = 2;
ColorWave.colors_max = 2;
ColorWave.speed = CORSAIR_PRO_SPEED_SLOW;
ColorWave.direction = MODE_DIRECTION_DOWN;
ColorWave.color_mode = MODE_COLORS_MODE_SPECIFIC;
ColorWave.colors.resize(2);
modes.push_back(ColorWave);
mode Visor;
Visor.name = "Visor";
Visor.value = CORSAIR_PRO_MODE_VISOR;
Visor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
Visor.speed_min = CORSAIR_PRO_SPEED_SLOW;
Visor.speed_max = CORSAIR_PRO_SPEED_FAST;
Visor.colors_min = 2;
Visor.colors_max = 2;
Visor.speed = CORSAIR_PRO_SPEED_SLOW;
Visor.direction = MODE_DIRECTION_VERTICAL;
Visor.color_mode = MODE_COLORS_MODE_SPECIFIC;
Visor.colors.resize(2);
modes.push_back(Visor);
mode Rain;
Rain.name = "Rain";
Rain.value = CORSAIR_PRO_MODE_RAIN;
Rain.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
Rain.speed_min = CORSAIR_PRO_SPEED_SLOW;
Rain.speed_max = CORSAIR_PRO_SPEED_FAST;
Rain.colors_min = 2;
Rain.colors_max = 2;
Rain.speed = CORSAIR_PRO_SPEED_SLOW;
Rain.direction = MODE_DIRECTION_DOWN;
Rain.color_mode = MODE_COLORS_MODE_SPECIFIC;
Rain.colors.resize(2);
modes.push_back(Rain);
mode Marquee;
Marquee.name = "Marquee";
Marquee.value = CORSAIR_PRO_MODE_MARQUEE;
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Marquee.speed_min = CORSAIR_PRO_SPEED_SLOW;
Marquee.speed_max = CORSAIR_PRO_SPEED_FAST;
Marquee.colors_min = 1;
Marquee.colors_max = 1;
Marquee.speed = CORSAIR_PRO_SPEED_SLOW;
Marquee.color_mode = MODE_COLORS_MODE_SPECIFIC;
Marquee.colors.resize(1);
modes.push_back(Marquee);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = CORSAIR_PRO_MODE_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED;
Rainbow.speed_min = CORSAIR_PRO_SPEED_SLOW;
Rainbow.speed_max = CORSAIR_PRO_SPEED_FAST;
Rainbow.speed = CORSAIR_PRO_SPEED_SLOW;
Rainbow.color_mode = MODE_COLORS_NONE;
modes.push_back(Rainbow);
mode Sequential;
Sequential.name = "Sequential";
Sequential.value = CORSAIR_PRO_MODE_SEQUENTIAL;
Sequential.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
Sequential.speed_min = CORSAIR_PRO_SPEED_SLOW;
Sequential.speed_max = CORSAIR_PRO_SPEED_FAST;
Sequential.colors_min = 1;
Sequential.colors_max = 1;
Sequential.speed = CORSAIR_PRO_SPEED_SLOW;
Sequential.direction = MODE_DIRECTION_DOWN;
Sequential.color_mode = MODE_COLORS_MODE_SPECIFIC;
Sequential.colors.resize(1);
modes.push_back(Sequential);
SetupZones();
active_mode = 9;
}
RGBController_CorsairVengeancePro::~RGBController_CorsairVengeancePro()
{
Shutdown();
delete controller;
}
void RGBController_CorsairVengeancePro::SetupZones()
{
/*---------------------------------------------------------*\
| Set up zone |
\*---------------------------------------------------------*/
zone new_zone;
new_zone.name = "Corsair Pro Zone";
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.leds_min = controller->GetLEDCount();
new_zone.leds_max = controller->GetLEDCount();
new_zone.leds_count = controller->GetLEDCount();
zones.push_back(new_zone);
/*---------------------------------------------------------*\
| Set up LEDs |
\*---------------------------------------------------------*/
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
{
led* new_led = new led();
new_led->name = "Corsair Pro LED ";
new_led->name.append(std::to_string(led_idx));
leds.push_back(*new_led);
}
SetupColors();
}
void RGBController_CorsairVengeancePro::DeviceUpdateLEDs()
{
for(unsigned int led = 0; led < (unsigned int)colors.size(); led++)
{
RGBColor color = colors[led];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
controller->SetLEDColor(led, red, grn, blu);
}
controller->ApplyColors();
}
void RGBController_CorsairVengeancePro::DeviceUpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_CorsairVengeancePro::DeviceUpdateSingleLED(int led)
{
RGBColor color = colors[led];
unsigned char red = RGBGetRValue(color);
unsigned char grn = RGBGetGValue(color);
unsigned char blu = RGBGetBValue(color);
controller->SetLEDColor(led, red, grn, blu);
controller->ApplyColors();
}
void RGBController_CorsairVengeancePro::DeviceUpdateMode()
{
unsigned int corsair_direction = 0;
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
unsigned char mode_colors[6];
switch(modes[active_mode].direction)
{
case MODE_DIRECTION_LEFT:
corsair_direction = CORSAIR_PRO_DIRECTION_LEFT;
break;
case MODE_DIRECTION_RIGHT:
corsair_direction = CORSAIR_PRO_DIRECTION_RIGHT;
break;
case MODE_DIRECTION_UP:
corsair_direction = CORSAIR_PRO_DIRECTION_UP;
break;
case MODE_DIRECTION_DOWN:
corsair_direction = CORSAIR_PRO_DIRECTION_DOWN;
break;
case MODE_DIRECTION_HORIZONTAL:
corsair_direction = CORSAIR_PRO_DIRECTION_HORIZONTAL;
break;
case MODE_DIRECTION_VERTICAL:
corsair_direction = CORSAIR_PRO_DIRECTION_VERTICAL;
break;
}
mode_colors[0] = 0;
mode_colors[1] = 0;
mode_colors[2] = 0;
mode_colors[3] = 0;
mode_colors[4] = 0;
mode_colors[5] = 0;
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
{
mode_colors[0] = RGBGetRValue(modes[active_mode].colors[0]);
mode_colors[1] = RGBGetGValue(modes[active_mode].colors[0]);
mode_colors[2] = RGBGetBValue(modes[active_mode].colors[0]);
if(modes[active_mode].colors.size() == 2)
{
mode_colors[3] = RGBGetRValue(modes[active_mode].colors[1]);
mode_colors[4] = RGBGetGValue(modes[active_mode].colors[1]);
mode_colors[5] = RGBGetBValue(modes[active_mode].colors[1]);
}
}
if (modes[active_mode].name == "Direct")
{
controller->SetDirect(true);
}
else
{
controller->SetDirect(false);
}
controller->SetEffect(modes[active_mode].value,
modes[active_mode].speed,
corsair_direction,
random,
mode_colors[0],
mode_colors[1],
mode_colors[2],
mode_colors[3],
mode_colors[4],
mode_colors[5]);
std::this_thread::sleep_for(std::chrono::milliseconds(15));
}
@@ -1,217 +0,0 @@
/*---------------------------------------------------------*\
| CorsairWirelessController.cpp |
| |
| Driver for Corsair wireless keyboard |
| |
| Adam Honse (CalcProgrammer1) 08 May 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <cstring>
#include "CorsairWirelessController.h"
#include "StringUtils.h"
using namespace std::chrono_literals;
CorsairWirelessController::CorsairWirelessController(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
location = path;
type = DEVICE_TYPE_KEYBOARD;
EnterDirectMode();
}
CorsairWirelessController::~CorsairWirelessController()
{
hid_close(dev);
}
device_type CorsairWirelessController::GetDeviceType()
{
return type;
}
std::string CorsairWirelessController::GetDeviceLocation()
{
return("HID: " + location);
}
std::string CorsairWirelessController::GetFirmwareString()
{
return firmware_version;
}
std::string CorsairWirelessController::GetName()
{
return name;
}
std::string CorsairWirelessController::GetSerialString()
{
wchar_t serial_string[128];
int ret = hid_get_serial_number_string(dev, serial_string, 128);
if(ret != 0)
{
return("");
}
return(StringUtils::wstring_to_string(serial_string));
}
void CorsairWirelessController::SetLEDs(std::vector<RGBColor>colors)
{
unsigned char buf[3 * 137];
for(int color = 0; color < 137; color++)
{
buf[0 + color] = RGBGetRValue(colors[color]);
buf[137 + color] = RGBGetGValue(colors[color]);
buf[274+color] = RGBGetBValue(colors[color]);
}
StartDirectMode();
SendDirectFrame(true, &buf[0]);
SendDirectFrame(false, &buf[57]);
SendDirectFrame(false, &buf[118]);
SendDirectFrame(false, &buf[179]);
SendDirectFrame(false, &buf[240]);
SendDirectFrame(false, &buf[301]);
SendDirectFrame(false, &buf[362]);
}
void CorsairWirelessController::SetName(std::string device_name)
{
name = device_name;
}
/*-------------------------------------------------------------------------------------------------*\
| Private packet sending functions. |
\*-------------------------------------------------------------------------------------------------*/
void CorsairWirelessController::EnterDirectMode()
{
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Set up Submit Mouse Colors packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x80;
usb_buf[0x02] = 0x01;
usb_buf[0x03] = 0x03;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = 0x02;
/*-----------------------------------------------------*\
| Send packet using feature reports, as headset stand |
| seems to not update completely using HID writes |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
}
void CorsairWirelessController::StartDirectMode()
{
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Set up Submit Mouse Colors packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x80;
usb_buf[0x02] = 0x0D;
usb_buf[0x03] = 0x00;
usb_buf[0x04] = 0x01;
/*-----------------------------------------------------*\
| Send packet using feature reports, as headset stand |
| seems to not update completely using HID writes |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
}
void CorsairWirelessController::ExitDirectMode()
{
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Set up Submit Mouse Colors packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x80;
usb_buf[0x02] = 0x01;
usb_buf[0x03] = 0x03;
usb_buf[0x04] = 0x00;
usb_buf[0x05] = 0x01;
/*-----------------------------------------------------*\
| Send packet using feature reports, as headset stand |
| seems to not update completely using HID writes |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
}
void CorsairWirelessController::SendDirectFrame(bool first_frame, unsigned char* data)
{
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
/*-----------------------------------------------------*\
| Set up Submit Mouse Colors packet |
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x80;
usb_buf[0x02] = first_frame ? 0x06 : 0x07;
usb_buf[0x03] = 0x00;
if(first_frame)
{
usb_buf[0x04] = 0x9B;
usb_buf[0x05] = 0x01;
}
/*-----------------------------------------------------*\
| Copy in colors in <RED> <GREEN> <BLUE> order |
\*-----------------------------------------------------*/
if(first_frame)
{
memcpy(&usb_buf[0x08], data, 57);
}
else
{
memcpy(&usb_buf[0x04], data, 61);
}
/*-----------------------------------------------------*\
| Send packet using feature reports, as headset stand |
| seems to not update completely using HID writes |
\*-----------------------------------------------------*/
hid_write(dev, usb_buf, 65);
}
@@ -1,45 +0,0 @@
/*---------------------------------------------------------*\
| CorsairWirelessController.h |
| |
| Driver for Corsair wireless keyboard |
| |
| Adam Honse (CalcProgrammer1) 08 May 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include <hidapi.h>
#include "RGBController.h"
class CorsairWirelessController
{
public:
CorsairWirelessController(hid_device* dev_handle, const char* path);
~CorsairWirelessController();
device_type GetDeviceType();
std::string GetDeviceLocation();
std::string GetFirmwareString();
std::string GetName();
std::string GetSerialString();
void SetLEDs(std::vector<RGBColor> colors);
void SetName(std::string device_name);
private:
hid_device* dev;
std::string firmware_version;
std::string location;
std::string name;
device_type type;
void EnterDirectMode();
void ExitDirectMode();
void StartDirectMode();
void SendDirectFrame(bool first_frame, unsigned char* data);
};
@@ -1,59 +0,0 @@
/*---------------------------------------------------------*\
| CorsairWirelessControllerDetect.cpp |
| |
| Detector for Corsair wireless keyboard |
| |
| Adam Honse (CalcProgrammer1) 08 May 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "DetectionManager.h"
#include "CorsairWirelessController.h"
#include "RGBController.h"
#include "RGBController_CorsairWireless.h"
/*---------------------------------------------------------*\
| Corsair vendor ID |
\*---------------------------------------------------------*/
#define CORSAIR_VID 0x1B1C
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define CORSAIR_K57_RGB_WIRED_PID 0x1B6E
#define CORSAIR_K57_RGB_WIRELESS_PID 0x1B62
DetectedControllers DetectCorsairWirelessControllers(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
CorsairWirelessController* controller = new CorsairWirelessController(dev, info->path);
controller->SetName(name);
if(controller->GetDeviceType() != DEVICE_TYPE_UNKNOWN)
{
RGBController_CorsairWireless* rgb_controller = new RGBController_CorsairWireless(controller);
detected_controllers.push_back(rgb_controller);
}
else
{
delete controller;
}
}
return(detected_controllers);
}
/*---------------------------------------------------------*\
| Keyboards |
\*---------------------------------------------------------*/
REGISTER_HID_DETECTOR_IPU("Corsair K57 RGB (Wired)", DetectCorsairWirelessControllers, CORSAIR_VID, CORSAIR_K57_RGB_WIRED_PID, 1, 0xFF42, 1);
//REGISTER_HID_DETECTOR_IPU("Corsair K57 RGB (Wireless)", DetectCorsairWirelessControllers, CORSAIR_VID, CORSAIR_K57_RGB_WIRELESS_PID, 1, 0xFF42, 1);
@@ -1,319 +0,0 @@
/*---------------------------------------------------------*\
| RGBController_CorsairWireless.cpp |
| |
| RGBController for Corsair wireless keyboard |
| |
| Adam Honse (CalcProgrammer1) 08 May 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_CorsairWireless.h"
using namespace std::chrono_literals;
//0xFFFFFFFF indicates an unused entry in matrix
#define NA 0xFFFFFFFF
static unsigned int matrix_map[7][24] =
{ { NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 1, NA, NA, NA },
{ 131, 41, NA, 58, 59, 60, 61, NA, 62, 63, 64, 65, NA, 66, 67, 68, 69, 70, 71, 72, NA, NA, NA, NA },
{ 132, 53, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, NA, 45, 46, 42, NA, 73, 74, 75, 83, 84, 85, 86 },
{ 133, 43, NA, 20, 26, 8, 21, NA, 23, 28, 24, 12, 18, 19, 47, 48, 49, 76, 77, 78, 95, 96, 97, 87 },
{ 134, 57, NA, 4, 22, 7, 9, NA, 10, 11, 13, 14, 15, 51, 52, NA, 40, NA, NA, NA, 92, 93, 94, NA },
{ 135, 106, NA, 29, 27, 6, 25, NA, 5, NA, 17, 16, 54, 55, 56, 110, NA, NA, 82, NA, 89, 90, 91, 88 },
{ 136, 105, 108, 107, NA, NA, NA, NA, 44, NA, NA, NA, NA, 111, 122, 101, 109, 80, 81, 79, 98, NA, 99, NA } };
static const char* zone_names[] =
{
ZONE_EN_KEYBOARD,
};
static const unsigned int zone_sizes[] =
{
137
};
static const zone_type zone_types[] =
{
ZONE_TYPE_MATRIX,
};
static const char* led_names[] =
{
"Power/Wireless Indicator",
"Lock/Macro Indicator",
"N/A",
"N/A",
KEY_EN_A,
KEY_EN_B,
KEY_EN_C,
KEY_EN_D,
KEY_EN_E,
KEY_EN_F,
KEY_EN_G,
KEY_EN_H,
KEY_EN_I,
KEY_EN_J,
KEY_EN_K,
KEY_EN_L,
KEY_EN_M,
KEY_EN_N,
KEY_EN_O,
KEY_EN_P,
KEY_EN_Q,
KEY_EN_R,
KEY_EN_S,
KEY_EN_T,
KEY_EN_U,
KEY_EN_V,
KEY_EN_W,
KEY_EN_X,
KEY_EN_Y,
KEY_EN_Z,
KEY_EN_1,
KEY_EN_2,
KEY_EN_3,
KEY_EN_4,
KEY_EN_5,
KEY_EN_6,
KEY_EN_7,
KEY_EN_8,
KEY_EN_9,
KEY_EN_0,
KEY_EN_ANSI_ENTER,
KEY_EN_ESCAPE,
KEY_EN_BACKSPACE,
KEY_EN_TAB,
KEY_EN_SPACE,
KEY_EN_MINUS,
KEY_EN_EQUALS,
KEY_EN_LEFT_BRACKET,
KEY_EN_RIGHT_BRACKET,
KEY_EN_ANSI_BACK_SLASH,
KEY_EN_UNUSED,
KEY_EN_SEMICOLON,
KEY_EN_QUOTE,
KEY_EN_BACK_TICK,
KEY_EN_COMMA,
KEY_EN_PERIOD,
KEY_EN_FORWARD_SLASH,
KEY_EN_CAPS_LOCK,
KEY_EN_F1,
KEY_EN_F2,
KEY_EN_F3,
KEY_EN_F4,
KEY_EN_F5,
KEY_EN_F6,
KEY_EN_F7,
KEY_EN_F8,
KEY_EN_F9,
KEY_EN_F10,
KEY_EN_F11,
KEY_EN_F12,
KEY_EN_PRINT_SCREEN,
KEY_EN_SCROLL_LOCK,
KEY_EN_PAUSE_BREAK,
KEY_EN_INSERT,
KEY_EN_HOME,
KEY_EN_PAGE_UP,
KEY_EN_DELETE,
KEY_EN_END,
KEY_EN_PAGE_DOWN,
KEY_EN_RIGHT_ARROW,
KEY_EN_LEFT_ARROW,
KEY_EN_DOWN_ARROW,
KEY_EN_UP_ARROW,
KEY_EN_NUMPAD_LOCK,
KEY_EN_NUMPAD_DIVIDE,
KEY_EN_NUMPAD_TIMES,
KEY_EN_NUMPAD_MINUS,
KEY_EN_NUMPAD_PLUS,
KEY_EN_NUMPAD_ENTER,
KEY_EN_NUMPAD_1,
KEY_EN_NUMPAD_2,
KEY_EN_NUMPAD_3,
KEY_EN_NUMPAD_4,
KEY_EN_NUMPAD_5,
KEY_EN_NUMPAD_6,
KEY_EN_NUMPAD_7,
KEY_EN_NUMPAD_8,
KEY_EN_NUMPAD_9,
KEY_EN_NUMPAD_0,
KEY_EN_NUMPAD_PERIOD,
KEY_EN_UNUSED,
KEY_EN_MENU,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_LEFT_CONTROL,
KEY_EN_LEFT_SHIFT,
KEY_EN_LEFT_ALT,
KEY_EN_LEFT_WINDOWS,
KEY_EN_RIGHT_CONTROL,
KEY_EN_RIGHT_SHIFT,
KEY_EN_RIGHT_ALT,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_RIGHT_FUNCTION,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
KEY_EN_UNUSED,
"Key: G1",
"Key: G2",
"Key: G3",
"Key: G4",
"Key: G5",
"Key: G6",
};
/**------------------------------------------------------------------*\
@name Corsair Wireless Peripheral
@category Keyboard
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectCorsairWirelessControllers
@comment
\*-------------------------------------------------------------------*/
RGBController_CorsairWireless::RGBController_CorsairWireless(CorsairWirelessController* controller_ptr)
{
controller = controller_ptr;
name = controller->GetName();
vendor = "Corsair";
description = "Corsair RGB Peripheral Device";
type = controller->GetDeviceType();
version = controller->GetFirmwareString();
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();
/*-----------------------------------------------------*\
| The Corsair Lighting Node Pro requires a packet within|
| 20 seconds of sending the lighting change in order |
| to not revert back into rainbow mode. Start a thread |
| to continuously send a keepalive packet every 5s |
\*-----------------------------------------------------*/
keepalive_thread_run = true;
keepalive_thread = new std::thread(&RGBController_CorsairWireless::KeepaliveThread, this);
}
RGBController_CorsairWireless::~RGBController_CorsairWireless()
{
Shutdown();
/*-----------------------------------------------------*\
| Close keepalive thread |
\*-----------------------------------------------------*/
keepalive_thread_run = false;
keepalive_thread->join();
delete keepalive_thread;
delete controller;
}
void RGBController_CorsairWireless::SetupZones()
{
/*---------------------------------------------------------*\
| Determine number of zones |
| For now, keyboard has 2 zones and mousemat has 1 |
\*---------------------------------------------------------*/
unsigned int num_zones = 1;
/*---------------------------------------------------------*\
| Set up zones |
\*---------------------------------------------------------*/
unsigned int total_led_count = 0;
for(unsigned int zone_idx = 0; zone_idx < num_zones; zone_idx++)
{
zone new_zone;
new_zone.name = zone_names[zone_idx];
new_zone.type = zone_types[zone_idx];
new_zone.leds_min = zone_sizes[zone_idx];
new_zone.leds_max = zone_sizes[zone_idx];
new_zone.leds_count = zone_sizes[zone_idx];
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
{
new_zone.matrix_map.Set(7, 24, (unsigned int *)&matrix_map);
}
zones.push_back(new_zone);
total_led_count += new_zone.leds_count;
}
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
{
led new_led;
new_led.name = led_names[led_idx];
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_CorsairWireless::DeviceUpdateLEDs()
{
last_update_time = std::chrono::steady_clock::now();
controller->SetLEDs(colors);
}
void RGBController_CorsairWireless::DeviceUpdateZoneLEDs(int /*zone*/)
{
controller->SetLEDs(colors);
}
void RGBController_CorsairWireless::DeviceUpdateSingleLED(int /*led*/)
{
controller->SetLEDs(colors);
}
void RGBController_CorsairWireless::DeviceUpdateMode()
{
}
void RGBController_CorsairWireless::KeepaliveThread()
{
while(keepalive_thread_run.load())
{
if(active_mode == 0)
{
if((std::chrono::steady_clock::now() - last_update_time) > std::chrono::milliseconds(5000))
{
DeviceUpdateLEDs();
}
}
std::this_thread::sleep_for(1000ms);
}
}
@@ -23,7 +23,7 @@ CreativeSoundBlasterXG6Controller::~CreativeSoundBlasterXG6Controller()
std::string CreativeSoundBlasterXG6Controller::GetDeviceLocation()
{
return("HID " + location);
return("HID: " + location);
}
std::string CreativeSoundBlasterXG6Controller::GetDeviceName()
@@ -87,7 +87,8 @@ void RGBController_CreativeSoundBlasterAE5::SetupZones()
zones[1].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[1].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -35,7 +35,7 @@ std::string CrucialController::GetDeviceVersion()
std::string CrucialController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -134,7 +134,14 @@ void CrucialController::CrucialRegisterWriteBlock(crucial_register reg, unsigned
bus->i2c_smbus_write_word_data(dev, 0x00, ((reg << 8) & 0xFF00) | ((reg >> 8) & 0x00FF));
//Write Crucial block data
bus->i2c_smbus_write_block_data(dev, 0x03, sz, data);
if(bus->i2c_smbus_write_block_data(dev, 0x03, sz, data) == -1)
{
//Fall back to individual byte operations if the block operation fails
for(unsigned int block_byte = 0; block_byte < sz; block_byte++)
{
bus->i2c_smbus_write_byte_data(dev, 0x01, data[block_byte]);
}
}
}
void CrucialController::SendEffectColor
@@ -28,12 +28,6 @@ using namespace std::chrono_literals;
static const unsigned char crucial_addresses[] =
{
/*---------------------------------------------------------*\
| These addresses have been disabled due to conflict with |
| ENE DRAM. Since the detection scheme is the same, ENE |
| RAM will be detected as Crucial. We need to improve the |
| Crucial detection scheme. |
\*---------------------------------------------------------*/
0x39,
0x3A,
0x3B,
@@ -71,19 +65,19 @@ bool TestForCrucialController(i2c_smbus_interface* bus, unsigned char address)
{
bool pass = false;
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
int res = bus->i2c_smbus_read_byte(address);
if (res >= 0)
if(res >= 0)
{
pass = true;
LOG_DEBUG("[%s] Detected an I2C device at address %02X", CRUCIAL_CONTROLLER_NAME, address);
for (int i = 0xA0; i < 0xB0; i++)
for(int i = 0xA0; i < 0xB0; i++)
{
res = bus->i2c_smbus_read_byte_data(address, i);
if (res != (i - 0xA0))
if(res != (i - 0xA0))
{
LOG_VERBOSE("[%s] Detection failed testing register %02X. Expected %02X, got %02X.", CRUCIAL_CONTROLLER_NAME, i, (i - 0xA0), res);
@@ -137,19 +131,19 @@ void CrucialRegisterWrite(i2c_smbus_interface* bus, unsigned char dev, unsigned
bus->i2c_smbus_write_byte_data(dev, 0x01, val);
}
DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &busses)
DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &buses)
{
DetectedControllers detected_controllers;
for(unsigned int bus = 0; bus < busses.size(); bus++)
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
int address_list_idx = -1;
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
{
for(unsigned int slot = 0; slot < 4; slot++)
{
int res = busses[bus]->i2c_smbus_write_quick(0x27, I2C_SMBUS_WRITE);
int res = buses[bus]->i2c_smbus_read_byte(0x27);
if(res < 0)
{
@@ -163,7 +157,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
if(address_list_idx < CRUCIAL_ADDRESS_COUNT)
{
res = busses[bus]->i2c_smbus_write_quick(crucial_addresses[address_list_idx], I2C_SMBUS_WRITE);
res = buses[bus]->i2c_smbus_read_byte(crucial_addresses[address_list_idx]);
}
else
{
@@ -174,24 +168,24 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
if(address_list_idx < CRUCIAL_ADDRESS_COUNT)
{
LOG_DEBUG("[%s] Remapping slot %d to address %02X", CRUCIAL_CONTROLLER_NAME, slot, crucial_addresses[address_list_idx]);
CrucialRegisterWrite(busses[bus], 0x27, 0x82EE, slot);
CrucialRegisterWrite(busses[bus], 0x27, 0x82EF, (crucial_addresses[address_list_idx] << 1));
CrucialRegisterWrite(busses[bus], 0x27, 0x82F0, 0xF0);
CrucialRegisterWrite(buses[bus], 0x27, 0x82EE, slot);
CrucialRegisterWrite(buses[bus], 0x27, 0x82EF, (crucial_addresses[address_list_idx] << 1));
CrucialRegisterWrite(buses[bus], 0x27, 0x82F0, 0xF0);
}
std::this_thread::sleep_for(1ms);
}
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, busses[bus]->pci_vendor, busses[bus]->pci_device, TESTING_ADDRESSES);
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, buses[bus]->info.pci_vendor, buses[bus]->info.pci_device, TESTING_ADDRESSES);
// Add Crucial controllers
for(unsigned int address_list_idx = 0; address_list_idx < CRUCIAL_ADDRESS_COUNT; address_list_idx++)
{
LOG_DEBUG("[%s] Testing address %02X to see if there is a device there", CRUCIAL_CONTROLLER_NAME, crucial_addresses[address_list_idx]);
if(TestForCrucialController(busses[bus], crucial_addresses[address_list_idx]))
if(TestForCrucialController(buses[bus], crucial_addresses[address_list_idx]))
{
CrucialController* controller = new CrucialController(busses[bus], crucial_addresses[address_list_idx]);
CrucialController* controller = new CrucialController(buses[bus], crucial_addresses[address_list_idx]);
RGBController_Crucial* rgb_controller = new RGBController_Crucial(controller);
detected_controllers.push_back(rgb_controller);
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
#include "nlohmann/json.hpp"
#include <nlohmann/json.hpp>
#include "DetectionManager.h"
#include "LogManager.h"
#include "ResourceManager.h"
@@ -85,7 +85,8 @@ void RGBController_DRGB::SetupZones()
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
}
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
@@ -115,7 +116,7 @@ void RGBController_DRGB::SetupZones()
led new_led;
new_led.name = zones[channel_idx].name + ", LED " + std::to_string(led_ch_idx);
leds.push_back(new_led);
leds_channel.push_back(channel_idx);
leds_channel.push_back((unsigned int)channel_idx);
}
}
@@ -13,6 +13,7 @@
#include <algorithm>
#include <cstring>
#include "KeyboardLayoutManager.h"
#include "JsonUtils.h"
#include "RGBController_Debug.h"
/**------------------------------------------------------------------*\
@@ -51,100 +52,6 @@ RGBController_Debug::RGBController_Debug(bool custom, json settings)
custom_controller = custom;
debug_settings = settings;
if(custom_controller)
{
/*-------------------------------------------------*\
| Set the name |
\*-------------------------------------------------*/
name = debug_settings["DeviceName"];
/*-------------------------------------------------*\
| Find the device type |
\*-------------------------------------------------*/
if (debug_settings["DeviceType"] == "motherboard") type = DEVICE_TYPE_MOTHERBOARD;
else if (debug_settings["DeviceType"] == "dram") type = DEVICE_TYPE_DRAM;
else if (debug_settings["DeviceType"] == "gpu") type = DEVICE_TYPE_GPU;
else if (debug_settings["DeviceType"] == "cooler") type = DEVICE_TYPE_COOLER;
else if (debug_settings["DeviceType"] == "led_strip") type = DEVICE_TYPE_LEDSTRIP;
else if (debug_settings["DeviceType"] == "keyboard") type = DEVICE_TYPE_KEYBOARD;
else if (debug_settings["DeviceType"] == "mouse") type = DEVICE_TYPE_MOUSE;
else if (debug_settings["DeviceType"] == "mousemat") type = DEVICE_TYPE_MOUSEMAT;
else if (debug_settings["DeviceType"] == "headset") type = DEVICE_TYPE_HEADSET;
else if (debug_settings["DeviceType"] == "headset_stand") type = DEVICE_TYPE_HEADSET_STAND;
else if (debug_settings["DeviceType"] == "gamepad") type = DEVICE_TYPE_GAMEPAD;
else if (debug_settings["DeviceType"] == "light") type = DEVICE_TYPE_LIGHT;
else if (debug_settings["DeviceType"] == "speaker") type = DEVICE_TYPE_SPEAKER;
else if (debug_settings["DeviceType"] == "unknown") type = DEVICE_TYPE_UNKNOWN;
/*-------------------------------------------------*\
| Set description, location, version, and serial |
\*-------------------------------------------------*/
description = debug_settings["DeviceDescription"];
location = debug_settings["DeviceLocation"];
version = debug_settings["DeviceVersion"];
serial = debug_settings["DeviceSerial"];
}
else
{
std::string name_setting = "";
std::string type_setting = "keyboard";
if(debug_settings.contains("name"))
{
name_setting = debug_settings["name"];
}
if(debug_settings.contains("type"))
{
type_setting = debug_settings["type"];
}
if(type_setting == "motherboard")
{
name = "Debug Motherboard";
type = DEVICE_TYPE_MOTHERBOARD;
}
else if(type_setting == "dram")
{
name = "Debug DRAM";
type = DEVICE_TYPE_DRAM;
}
else if(type_setting == "gpu")
{
name = "Debug GPU";
type = DEVICE_TYPE_GPU;
}
else if(type_setting == "keyboard")
{
name = "Debug Keyboard";
type = DEVICE_TYPE_KEYBOARD;
}
else if(type_setting == "mouse")
{
name = "Debug Mouse";
type = DEVICE_TYPE_MOUSE;
}
else if(type_setting == "argb")
{
name = "Debug ARGB Controller";
type = DEVICE_TYPE_LEDSTRIP;
}
/*---------------------------------------------------------*\
| Fill in debug controller information |
\*---------------------------------------------------------*/
description = name + " Device";
vendor = name + " Vendor String";
location = name + " Location String";
version = name + " Version String";
serial = name + " Serial String";
if(name_setting != "")
{
name = name_setting;
}
}
/*-----------------------------------------------------*\
| Create the mode |
\*-----------------------------------------------------*/
@@ -157,6 +64,7 @@ RGBController_Debug::RGBController_Debug(bool custom, json settings)
modes.push_back(Direct);
SetupDevice();
SetupZones();
}
@@ -165,6 +73,137 @@ RGBController_Debug::~RGBController_Debug()
Shutdown();
}
void RGBController_Debug::SetupDevice()
{
if(custom_controller)
{
/*-------------------------------------------------*\
| Set the name, description, location, version, and |
| serial |
\*-------------------------------------------------*/
name = JsonUtils::JsonGetString(debug_settings, "DeviceName", "Custom Device");
description = JsonUtils::JsonGetString(debug_settings, "DeviceDescription");
location = JsonUtils::JsonGetString(debug_settings, "DeviceLocation");
version = JsonUtils::JsonGetString(debug_settings, "DeviceVersion");
serial = JsonUtils::JsonGetString(debug_settings, "DeviceSerial");
/*-------------------------------------------------*\
| Find the device type |
\*-------------------------------------------------*/
std::string device_type = JsonUtils::JsonGetString(debug_settings, "DeviceType", "keyboard");
if( device_type == "motherboard") type = DEVICE_TYPE_MOTHERBOARD;
else if(device_type == "dram") type = DEVICE_TYPE_DRAM;
else if(device_type == "gpu") type = DEVICE_TYPE_GPU;
else if(device_type == "cooler") type = DEVICE_TYPE_COOLER;
else if(device_type == "led_strip") type = DEVICE_TYPE_LEDSTRIP;
else if(device_type == "keyboard") type = DEVICE_TYPE_KEYBOARD;
else if(device_type == "mouse") type = DEVICE_TYPE_MOUSE;
else if(device_type == "mousemat") type = DEVICE_TYPE_MOUSEMAT;
else if(device_type == "headset") type = DEVICE_TYPE_HEADSET;
else if(device_type == "headset_stand") type = DEVICE_TYPE_HEADSET_STAND;
else if(device_type == "gamepad") type = DEVICE_TYPE_GAMEPAD;
else if(device_type == "light") type = DEVICE_TYPE_LIGHT;
else if(device_type == "speaker") type = DEVICE_TYPE_SPEAKER;
else if(device_type == "unknown") type = DEVICE_TYPE_UNKNOWN;
}
else
{
std::string name_value;
std::string name_setting = JsonUtils::JsonGetString(debug_settings, "name");
std::string type_setting = JsonUtils::JsonGetString(debug_settings, "type", "keyboard");
if(type_setting == "motherboard")
{
name_value = "Debug Motherboard";
type = DEVICE_TYPE_MOTHERBOARD;
}
else if(type_setting == "dram")
{
name_value = "Debug DRAM";
type = DEVICE_TYPE_DRAM;
}
else if(type_setting == "gpu")
{
name_value = "Debug GPU";
type = DEVICE_TYPE_GPU;
}
else if(type_setting == "keyboard")
{
name_value = "Debug Keyboard";
type = DEVICE_TYPE_KEYBOARD;
}
else if(type_setting == "mouse")
{
name_value = "Debug Mouse";
type = DEVICE_TYPE_MOUSE;
}
else if(type_setting == "argb")
{
name_value = "Debug ARGB Controller";
type = DEVICE_TYPE_LEDSTRIP;
}
/*---------------------------------------------------------*\
| Fill in debug controller information |
\*---------------------------------------------------------*/
description = name_value + " Device";
vendor = name_value + " Vendor String";
location = name_value + " Location String";
version = name_value + " Version String";
serial = name_value + " Serial String";
flags |= CONTROLLER_FLAG_MANUALLY_CONFIGURABLE_NAME | CONTROLLER_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC;
if(name_setting != "")
{
name_value = name_setting;
}
if((flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME) == 0)
{
name = name_value;
}
/*---------------------------------------------------------*\
| Create test configuration |
\*---------------------------------------------------------*/
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
configuration_json["schema"]["test_string"]["title"] = "String Setting";
configuration_json["schema"]["test_string"]["type"] = "string";
configuration_json["schema"]["test_bool"]["title"] = "Boolean Setting";
configuration_json["schema"]["test_bool"]["type"] = "bool";
configuration_json["schema"]["test_enum"]["title"] = "String Enum Setting";
configuration_json["schema"]["test_enum"]["type"] = "string";
configuration_json["schema"]["test_enum"]["enum"][0] = "Option 1";
configuration_json["schema"]["test_enum"]["enum"][1] = "Option 2";
configuration_json["schema"]["test_enum"]["enum"][2] = "Option 3";
configuration_json["schema"]["test_enum_int"]["title"] = "Integer Enum Setting";
configuration_json["schema"]["test_enum_int"]["type"] = "integer";
configuration_json["schema"]["test_enum_int"]["enum"][0] = 2;
configuration_json["schema"]["test_enum_int"]["enum"][1] = 4;
configuration_json["schema"]["test_enum_int"]["enum"][2] = 8;
configuration_json["schema"]["test_int"]["title"] = "Integer Setting";
configuration_json["schema"]["test_int"]["type"] = "integer";
if((flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["configuration"]["test_string"] = "This is a test";
configuration_json["configuration"]["test_bool"] = true;
configuration_json["configuration"]["test_enum"] = "Option 2";
configuration_json["configuration"]["test_enum_int"] = 4;
configuration_json["configuration"]["test_int"] = 12345;
}
configuration = configuration_json.dump();
}
}
void RGBController_Debug::SetupZones()
{
/*-------------------------------------------------*\
@@ -181,6 +220,7 @@ void RGBController_Debug::SetupZones()
/*-------------------------------------------------*\
| Clear any existing color/LED configuration |
\*-------------------------------------------------*/
led_display_names.clear();
leds.clear();
colors.clear();
@@ -216,9 +256,9 @@ void RGBController_Debug::SetupZones()
continue;
}
custom_zone.leds_min = ZoneJson["leds_min"];
custom_zone.leds_max = ZoneJson["leds_max"];
custom_zone.leds_count = ZoneJson["leds_count"];
custom_zone.leds_min = JsonUtils::JsonGetInt(ZoneJson, "leds_min");
custom_zone.leds_max = JsonUtils::JsonGetInt(ZoneJson, "leds_max");
custom_zone.leds_count = JsonUtils::JsonGetInt(ZoneJson, "leds_count");
/*---------------------------------------------*\
| Fill in the matrix map |
@@ -241,8 +281,8 @@ void RGBController_Debug::SetupZones()
continue;
}
unsigned int H = ZoneJson["matrix_width"];
unsigned int W = ZoneJson["matrix_height"];
unsigned int H = JsonUtils::JsonGetInt(ZoneJson, "matrix_width");
unsigned int W = JsonUtils::JsonGetInt(ZoneJson, "matrix_height");
BadVal = ((unsigned int)ZoneJson["matrix_map"].size() != H);
@@ -333,36 +373,11 @@ void RGBController_Debug::SetupZones()
}
else
{
bool zone_single = true;
bool zone_linear = true;
bool zone_resizable = false;
bool zone_keyboard = false;
bool zone_underglow = false;
if(debug_settings.contains("single"))
{
zone_single = debug_settings["single"];
}
if(debug_settings.contains("linear"))
{
zone_linear = debug_settings["linear"];
}
if(debug_settings.contains("resizable"))
{
zone_resizable = debug_settings["resizable"];
}
if(debug_settings.contains("keyboard"))
{
zone_keyboard = debug_settings["keyboard"];
}
if(debug_settings.contains("underglow"))
{
zone_underglow = debug_settings["underglow"];
}
bool zone_single = JsonUtils::JsonGetBool(debug_settings, "single", true);
bool zone_linear = JsonUtils::JsonGetBool(debug_settings, "linear", true);
bool zone_resizable = JsonUtils::JsonGetBool(debug_settings, "resizable", false);
bool zone_keyboard = JsonUtils::JsonGetBool(debug_settings, "keyboard", false);
bool zone_underglow = JsonUtils::JsonGetBool(debug_settings, "underglow", false);
/*-------------------------------------------------*\
| Create a single zone/LED |
@@ -371,28 +386,51 @@ void RGBController_Debug::SetupZones()
{
zone single_zone;
single_zone.name = "Single Zone";
single_zone.type = ZONE_TYPE_SINGLE;
single_zone.leds_min = 1;
single_zone.leds_max = 1;
single_zone.leds_count = 1;
if(first_run)
{
zones.push_back(single_zone);
}
else
zones[zone_idx].name = "Single Zone";
zones[zone_idx].type = ZONE_TYPE_SINGLE;
if(first_run)
{
zones[zone_idx] = single_zone;
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC;
}
zones[zone_idx].leds_min = 1;
zones[zone_idx].leds_max = 1;
zones[zone_idx].leds_count = 1;
led single_led;
single_led.name = "Single LED";
leds.push_back(single_led);
led_alt_names.push_back("");
led_display_names.push_back("");
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
if(first_run)
{
/*-----------------------------------------*\
| Create test configuration |
\*-----------------------------------------*/
configuration_json["zones"][zone_idx]["schema"]["color_order"]["title"] = "Color Order";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["type"] = "string";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["enum"][0] = "RGB";
configuration_json["zones"][zone_idx]["schema"]["color_order"]["enum"][1] = "GRB";
}
if((zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["zones"][zone_idx]["configuration"]["color_order"] = "RGB";
}
configuration = configuration_json.dump();
zone_idx++;
}
@@ -404,22 +442,18 @@ void RGBController_Debug::SetupZones()
{
zone linear_zone;
linear_zone.name = "Linear Zone";
linear_zone.type = ZONE_TYPE_LINEAR;
linear_zone.leds_min = 10;
linear_zone.leds_max = 10;
linear_zone.leds_count = 10;
if(first_run)
{
zones.push_back(linear_zone);
}
else
{
zones[zone_idx] = linear_zone;
}
for(std::size_t led_idx = 0; led_idx < 10; led_idx++)
zones[zone_idx].name = "Linear Zone";
zones[zone_idx].type = ZONE_TYPE_LINEAR;
zones[zone_idx].leds_min = 10;
zones[zone_idx].leds_max = 10;
zones[zone_idx].leds_count = 10;
for(std::size_t led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
{
led linear_led;
@@ -427,7 +461,7 @@ void RGBController_Debug::SetupZones()
leds.push_back(linear_led);
led_alt_names.push_back("");
led_display_names.push_back("");
}
zone_idx++;
@@ -441,6 +475,24 @@ void RGBController_Debug::SetupZones()
KEYBOARD_LAYOUT layout = KEYBOARD_LAYOUT::KEYBOARD_LAYOUT_ANSI_QWERTY;
KEYBOARD_SIZE size = KEYBOARD_SIZE::KEYBOARD_SIZE_FULL;
nlohmann::json configuration_json;
JsonUtils::JsonParse(configuration, configuration_json);
zone keyboard_zone;
if(first_run)
{
zones.push_back(keyboard_zone);
}
zones[zone_idx].name = "Keyboard Zone";
zones[zone_idx].type = ZONE_TYPE_MATRIX;
if(first_run)
{
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC | ZONE_FLAG_ZONE_GEOMETRY_MAY_CHANGE;
}
if(debug_settings.contains("layout"))
{
KEYBOARD_LAYOUT temp_layout = debug_settings["layout"];
@@ -451,6 +503,29 @@ void RGBController_Debug::SetupZones()
}
}
if(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC)
{
if(configuration_json.contains("zones") && (zone_idx < configuration_json["zones"].size()))
{
if(configuration_json["zones"][zone_idx].contains("configuration"))
{
if(configuration_json["zones"][zone_idx]["configuration"].contains("layout"))
{
std::string layout_string = configuration_json["zones"][zone_idx]["configuration"]["layout"];
for(std::size_t layout_idx = 0; layout_idx < NUM_LAYOUTS; layout_idx++)
{
if(layout_names[layout_idx] == layout_string)
{
layout = (KEYBOARD_LAYOUT)layout_idx;
break;
}
}
}
}
}
}
if(debug_settings.contains("size"))
{
size = debug_settings["size"];
@@ -458,8 +533,6 @@ void RGBController_Debug::SetupZones()
KeyboardLayoutManager new_kb(layout, size);
description += ", Layout: " + layout_names[layout] + ", Size: " + new_kb.GetName();
/*---------------------------------------------*\
| Check for custom key inserts and swaps |
\*---------------------------------------------*/
@@ -518,25 +591,12 @@ void RGBController_Debug::SetupZones()
new_kb.ChangeKeys(change);
}
zone keyboard_zone;
zones[zone_idx].leds_min = new_kb.GetKeyCount();
zones[zone_idx].leds_max = new_kb.GetKeyCount();
zones[zone_idx].leds_count = new_kb.GetKeyCount();
zones[zone_idx].matrix_map = new_kb.GetKeyMap(KEYBOARD_MAP_FILL_TYPE_COUNT);
keyboard_zone.name = "Keyboard Zone";
keyboard_zone.type = ZONE_TYPE_MATRIX;
keyboard_zone.leds_min = new_kb.GetKeyCount();
keyboard_zone.leds_max = new_kb.GetKeyCount();
keyboard_zone.leds_count = new_kb.GetKeyCount();
keyboard_zone.matrix_map = new_kb.GetKeyMap(KEYBOARD_MAP_FILL_TYPE_COUNT);
if(first_run)
{
zones.push_back(keyboard_zone);
}
else
{
zones[zone_idx] = keyboard_zone;
}
for(unsigned int led_idx = 0; led_idx < keyboard_zone.leds_count; led_idx++)
for(unsigned int led_idx = 0; led_idx < zones[zone_idx].leds_count; led_idx++)
{
led keyboard_led;
@@ -544,9 +604,31 @@ void RGBController_Debug::SetupZones()
leds.push_back(keyboard_led);
led_alt_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
led_display_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
}
if(first_run)
{
/*-----------------------------------------*\
| Create test configuration |
\*-----------------------------------------*/
configuration_json["zones"][zone_idx]["schema"]["layout"]["title"] = "Layout";
configuration_json["zones"][zone_idx]["schema"]["layout"]["type"] = "string";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][0] = "Default",
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][1] = "ANSI QWERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][2] = "ISO QWERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][3] = "ISO QWERTZ";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][4] = "ISO AZERTY";
configuration_json["zones"][zone_idx]["schema"]["layout"]["enum"][5] = "JIS";
}
if((zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC) == 0)
{
configuration_json["zones"][zone_idx]["configuration"]["layout"] = "Default";
}
configuration = configuration_json.dump();
zone_idx++;
}
@@ -581,7 +663,7 @@ void RGBController_Debug::SetupZones()
leds.push_back(underglow_led);
led_alt_names.push_back("");
led_display_names.push_back("");
}
zone_idx++;
@@ -602,7 +684,8 @@ void RGBController_Debug::SetupZones()
resizable_zone.flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
zones.push_back(resizable_zone);
}
@@ -636,7 +719,7 @@ void RGBController_Debug::SetupZones()
leds.push_back(resizable_led);
led_alt_names.push_back("");
led_display_names.push_back("");
}
zone_idx++;
@@ -646,6 +729,11 @@ void RGBController_Debug::SetupZones()
SetupColors();
}
void RGBController_Debug::DeviceConfigureDevice()
{
SetupDevice();
}
void RGBController_Debug::DeviceConfigureZone(int zone_idx)
{
if((size_t)zone_idx < zones.size())
@@ -673,3 +761,13 @@ void RGBController_Debug::DeviceUpdateMode()
{
}
void RGBController_Debug::DeviceUpdateDeviceSpecificConfiguration()
{
}
void RGBController_Debug::DeviceUpdateDeviceSpecificZoneConfiguration(int /*zone*/)
{
SetupZones();
}
@@ -23,8 +23,10 @@ public:
RGBController_Debug(bool custom, json settings);
~RGBController_Debug();
void SetupDevice();
void SetupZones();
void DeviceConfigureDevice();
void DeviceConfigureZone(int zone_idx);
void DeviceUpdateLEDs();
@@ -33,6 +35,9 @@ public:
void DeviceUpdateMode();
void DeviceUpdateDeviceSpecificConfiguration();
void DeviceUpdateDeviceSpecificZoneConfiguration(int zone);
private:
json debug_settings;
bool custom_controller;
@@ -21,14 +21,14 @@
DetectedControllers DetectDygmaRaiseControllers()
{
DetectedControllers detected_controllers;
std::vector<std::string *> ports = find_usb_serial_port(DYGMA_RAISE_VID, DYGMA_RAISE_PID);
std::vector<std::string> ports = find_usb_serial_port(DYGMA_RAISE_VID, DYGMA_RAISE_PID);
for(std::size_t i = 0; i < ports.size(); i++)
{
if(*ports[i] != "")
if(ports[i] != "")
{
DygmaRaiseController* controller = new DygmaRaiseController();
controller->Initialize((char *)ports[i]->c_str());
controller->Initialize((char *)ports[i].c_str());
RGBController_DygmaRaise* rgb_controller = new RGBController_DygmaRaise(controller);
@@ -235,8 +235,7 @@ void RGBController_E131::SetupZones()
led_zone.leds_count = devices[zone_idx].num_leds;
led_zone.flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS
| ZONE_FLAG_MANUALLY_CONFIGURABLE_COLOR_ORDER;
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
zones.push_back(led_zone);
}
@@ -53,7 +53,7 @@ ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id
| If this is running with TRACE or higher loglevel |
| then dump the entire Feature list to log |
\*-------------------------------------------------*/
if(LogManager::get()->getLoglevel() >= LL_TRACE)
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
{
LOG_TRACE("[ENE SMBus] ENE config table for 0x%02X:", dev);
LOG_TRACE(" %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", config_table[0], config_table[1], config_table[2], config_table[3],
@@ -266,6 +266,21 @@ ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id
led_count = config_table[ENE_CONFIG_LED_COUNT_0107];
}
/*-----------------------------------------------------*\
| AUMA0-E6K5-1114 |
| Found on ASUS ROG MATRIX PLATINUM 5090 |
\*-----------------------------------------------------*/
else if(strcmp(device_version, "AUMA0-E6K5-1114") == 0)
{
direct_reg = ENE_REG_COLORS_DIRECT_V2;
effect_reg = ENE_REG_COLORS_EFFECT_V2;
channel_cfg = ENE_CONFIG_CHANNEL_V2;
/*-------------------------------------------------*\
| Read LED count from configuration table |
\*-------------------------------------------------*/
led_count = config_table[ENE_CONFIG_LED_COUNT_0107];
}
/*-----------------------------------------------------*\
| ROG ARION - ASUS ROG Arion external SSD enclosure |
| This device does not support ENE read, so we fake the |
| device name string if the interface is ROG Arion type.|
@@ -36,7 +36,7 @@ using namespace std::chrono_literals;
| This list contains the available SMBus addresses for |
| mapping ENE RAM |
\*---------------------------------------------------------*/
#define ENE_RAM_ADDRESS_COUNT 23
#define ENE_RAM_ADDRESS_COUNT (sizeof(ene_ram_addresses) / sizeof(ene_ram_addresses[0]))
static const unsigned char ene_ram_addresses[] =
{
@@ -47,14 +47,7 @@ static const unsigned char ene_ram_addresses[] =
0x74,
0x75,
0x76,
0x78,
0x79,
0x7A,
0x7B,
0x7C,
0x7D,
0x7E,
0x7F,
0x77,
0x4F,
0x66,
0x67,
@@ -69,7 +62,7 @@ static const unsigned char ene_ram_addresses[] =
| This list contains the available SMBus addresses for |
| mapping Aura motherboards |
\*---------------------------------------------------------*/
#define AURA_MOBO_ADDRESS_COUNT 3
#define AURA_MOBO_ADDRESS_COUNT (sizeof(aura_mobo_addresses) / sizeof(aura_mobo_addresses[0]))
static const unsigned char aura_mobo_addresses[] =
{
@@ -153,21 +146,21 @@ bool TestForENESMBusController(i2c_smbus_interface* bus, unsigned char address)
return(pass);
}
DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interface*> &busses)
DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interface*> &buses)
{
DetectedControllers detected_controllers;
for(unsigned int bus = 0; bus < busses.size(); bus++)
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
int address_list_idx = -1;
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
{
LOG_DEBUG("[ENE SMBus DRAM] Remapping ENE SMBus RAM modules on 0x77");
for(unsigned int slot = 0; slot < 8; slot++)
{
int res = busses[bus]->i2c_smbus_write_quick(0x77, I2C_SMBUS_WRITE);
int res = buses[bus]->i2c_smbus_read_byte(0x77);
if(res < 0)
{
@@ -179,11 +172,11 @@ DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interfac
{
address_list_idx++;
if(address_list_idx < ENE_RAM_ADDRESS_COUNT)
if(address_list_idx < (int)ENE_RAM_ADDRESS_COUNT)
{
LOG_DEBUG("[ENE SMBus DRAM] Testing address %02X to see if there is a device there", ene_ram_addresses[address_list_idx]);
res = busses[bus]->i2c_smbus_write_quick(ene_ram_addresses[address_list_idx], I2C_SMBUS_WRITE);
res = buses[bus]->i2c_smbus_read_byte(ene_ram_addresses[address_list_idx]);
}
else
{
@@ -191,21 +184,21 @@ DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interfac
}
} while(res >= 0);
if(address_list_idx < ENE_RAM_ADDRESS_COUNT)
if(address_list_idx < (int)ENE_RAM_ADDRESS_COUNT)
{
LOG_DEBUG("[ENE SMBus DRAM] Remapping slot %d to address %02X", slot, ene_ram_addresses[address_list_idx]);
ENERegisterWrite(busses[bus], 0x77, ENE_REG_SLOT_INDEX, slot);
ENERegisterWrite(busses[bus], 0x77, ENE_REG_I2C_ADDRESS, (ene_ram_addresses[address_list_idx] << 1));
ENERegisterWrite(buses[bus], 0x77, ENE_REG_SLOT_INDEX, slot);
ENERegisterWrite(buses[bus], 0x77, ENE_REG_I2C_ADDRESS, (ene_ram_addresses[address_list_idx] << 1));
}
}
// Add ENE controllers at their remapped addresses
for(unsigned int address_list_idx = 0; address_list_idx < ENE_RAM_ADDRESS_COUNT; address_list_idx++)
{
if(TestForENESMBusController(busses[bus], ene_ram_addresses[address_list_idx]))
if(TestForENESMBusController(buses[bus], ene_ram_addresses[address_list_idx]))
{
ENESMBusInterface_i2c_smbus* interface = new ENESMBusInterface_i2c_smbus(busses[bus]);
ENESMBusInterface_i2c_smbus* interface = new ENESMBusInterface_i2c_smbus(buses[bus]);
ENESMBusController* controller = new ENESMBusController(interface, ene_ram_addresses[address_list_idx], "ENE DRAM", DEVICE_TYPE_DRAM);
RGBController_ENESMBus* rgb_controller = new RGBController_ENESMBus(controller);
@@ -220,26 +213,26 @@ DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interfac
return(detected_controllers);
}
DetectedControllers DetectENESMBusMotherboardControllers(std::vector<i2c_smbus_interface*> &busses)
DetectedControllers DetectENESMBusMotherboardControllers(std::vector<i2c_smbus_interface*> &buses)
{
DetectedControllers detected_controllers;
for(unsigned int bus = 0; bus < busses.size(); bus++)
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
// Add ENE (ASUS Aura) motherboard controllers
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
{
if(busses[bus]->pci_subsystem_vendor == ASUS_SUB_VEN || busses[bus]->pci_subsystem_vendor == 0 || busses[bus]->pci_subsystem_vendor == 0xFFFF)
if(buses[bus]->info.pci_subsystem_vendor == ASUS_SUB_VEN || buses[bus]->info.pci_subsystem_vendor == 0 || buses[bus]->info.pci_subsystem_vendor == 0xFFFF)
{
for(unsigned int address_list_idx = 0; address_list_idx < AURA_MOBO_ADDRESS_COUNT; address_list_idx++)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, DETECTOR_NAME, bus, VENDOR_NAME, aura_mobo_addresses[address_list_idx]);
if(TestForENESMBusController(busses[bus], aura_mobo_addresses[address_list_idx]))
if(TestForENESMBusController(buses[bus], aura_mobo_addresses[address_list_idx]))
{
DMIInfo dmi;
ENESMBusInterface_i2c_smbus* interface = new ENESMBusInterface_i2c_smbus(busses[bus]);
ENESMBusInterface_i2c_smbus* interface = new ENESMBusInterface_i2c_smbus(buses[bus]);
ENESMBusController* controller = new ENESMBusController(interface, aura_mobo_addresses[address_list_idx], "ASUS " + dmi.getMainboard(), DEVICE_TYPE_MOTHERBOARD);
RGBController_ENESMBus* rgb_controller = new RGBController_ENESMBus(controller);
@@ -309,6 +302,7 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 3060 Ti Gaming OC",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 3060 Ti OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_3060TI_O8G_OC_V2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti V2 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_V2_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3060 Ti V2 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3060TI_O8G_V2_2_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_O8G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 3070 White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_3070_O8G_WHITE, 0x67);
@@ -416,8 +410,11 @@ REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4090_O24G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 4090 Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_4090_O24G_GAMING_WHITE_2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG MATRIX PLATINUM GeForce RTX 4090", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, ASUS_SUB_VEN, ASUS_ROG_MATRIX_PLATINUM_RTX_4090_24G, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Gaming", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5060 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5060_O8G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070_O12G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming BTF White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING_BTF_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_5070TI_O16G_GAMING_OC, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5080 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5080_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5090 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5090_O32G_GAMING, 0x67);
@@ -425,7 +422,9 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5090 Gaming",
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 OC WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_O16G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_16G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_2, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC BTF", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_BTF, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_WHITE, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL LC GeForce RTX 5090 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_LC_RTX_5090_O32G_GAMING, 0x67);
@@ -455,6 +454,7 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7700 XT Gaming OC",
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_GAMING_0606, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7800 XT Gaming White OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7800XT_O16G_WHITE_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 GRE Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900GRE_O16G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 XT Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900XT_020G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 7900 XTX Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_7900XTX_O24G_GAMING, 0x67);
REGISTER_I2C_PCI_DETECTOR("ASUS TUF Radeon RX 9070 Gaming OC", DetectENESMBusGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, ASUS_SUB_VEN, ASUS_TUF_RX_9070_016G_GAMING, 0x67);
@@ -28,7 +28,7 @@ ene_interface_type ENESMBusInterface_i2c_smbus::GetInterfaceType()
std::string ENESMBusInterface_i2c_smbus::GetLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
return("I2C: " + return_string);
}
@@ -61,5 +61,12 @@ void ENESMBusInterface_i2c_smbus::ENERegisterWriteBlock(ene_dev_id dev, ene_regi
bus->i2c_smbus_write_word_data(dev, 0x00, ((reg << 8) & 0xFF00) | ((reg >> 8) & 0x00FF));
//Write ENE block data
bus->i2c_smbus_write_block_data(dev, 0x03, sz, data);
if(bus->i2c_smbus_write_block_data(dev, 0x03, sz, data) == -1)
{
//Fall back to individual byte operations if the block operation fails
for(unsigned int block_byte = 0; block_byte < sz; block_byte++)
{
bus->i2c_smbus_write_byte_data(dev, 0x01, data[block_byte]);
}
}
}
@@ -20,7 +20,7 @@ DetectedControllers DetectEVGAAmpereGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->port_id == 1)
if(bus->info.port_id == 1)
{
EVGAGPUv3Controller* controller;
RGBController_EVGAGPUv3* rgb_controller;
@@ -26,7 +26,7 @@ EVGAGPUv3Controller::~EVGAGPUv3Controller()
std::string EVGAGPUv3Controller::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
@@ -25,7 +25,7 @@ EVGAGP102Controller::~EVGAGP102Controller()
std::string EVGAGP102Controller::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", zi.dev_addr);
return_string.append(", address ");
@@ -21,7 +21,7 @@ DetectedControllers DetectEVGAGP102GPUControllers(i2c_smbus_interface* bus, uint
{
DetectedControllers detected_controllers;
if(bus->port_id == 1)
if(bus->info.port_id == 1)
{
std::vector<EVGAGP102Controller*> controllers;
@@ -25,7 +25,7 @@ EVGAGPUv1Controller::~EVGAGPUv1Controller()
std::string EVGAGPUv1Controller::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -20,7 +20,7 @@ DetectedControllers DetectEVGAPascalGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->port_id == 1)
if(bus->info.port_id == 1)
{
EVGAGPUv1Controller* controller = new EVGAGPUv1Controller(bus, address, name);
RGBController_EVGAGPUv1* rgb_controller = new RGBController_EVGAGPUv1(controller);
@@ -32,7 +32,7 @@ EVGAACX30SMBusController::~EVGAACX30SMBusController()
std::string EVGAACX30SMBusController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
@@ -40,21 +40,21 @@ bool TestForAcx30SMBusController(i2c_smbus_interface *bus, uint8_t address)
return(pass);
}
DetectedControllers DetectAcx30SMBusControllers(std::vector<i2c_smbus_interface *> &busses)
DetectedControllers DetectAcx30SMBusControllers(std::vector<i2c_smbus_interface *> &buses)
{
DetectedControllers detected_controllers;
for(unsigned int bus = 0; bus < busses.size(); bus++)
for(unsigned int bus = 0; bus < buses.size(); bus++)
{
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
{
if(busses[bus]->pci_subsystem_vendor == EVGA_SUB_VEN)
if(buses[bus]->info.pci_subsystem_vendor == EVGA_SUB_VEN)
{
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, EVGA_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
// Check for ACX 30 controller at 0x28
if(TestForAcx30SMBusController(busses[bus], SMBUS_ADDRESS))
if(TestForAcx30SMBusController(buses[bus], SMBUS_ADDRESS))
{
EVGAACX30SMBusController * controller = new EVGAACX30SMBusController(busses[bus], SMBUS_ADDRESS);
EVGAACX30SMBusController * controller = new EVGAACX30SMBusController(buses[bus], SMBUS_ADDRESS);
RGBController_EVGAACX30SMBus * rgb_controller = new RGBController_EVGAACX30SMBus(controller);
detected_controllers.push_back(rgb_controller);
@@ -25,7 +25,7 @@ EVGAGPUv2Controller::~EVGAGPUv2Controller()
std::string EVGAGPUv2Controller::GetDeviceLocation()
{
std::string return_string(bus->device_name);
std::string return_string(bus->info.device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
@@ -19,7 +19,7 @@ DetectedControllers DetectEVGATuringGPUControllers(i2c_smbus_interface* bus, uin
{
DetectedControllers detected_controllers;
if(bus->port_id == 1)
if(bus->info.port_id == 1)
{
EVGAGPUv2Controller* controller = new EVGAGPUv2Controller(bus, address, name);
RGBController_EVGAGPUv2* rgb_controller = new RGBController_EVGAGPUv2(controller);
@@ -0,0 +1,49 @@
/*---------------------------------------------------------*\
| EVGAKeyboardControllerDetect.cpp |
| |
| Detector for EVGA keyboard devices |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "DetectionManager.h"
#include "RGBController_EVGAKeyboard.h"
/*---------------------------------------------------------*\
| EVGA USB vendor ID |
\*---------------------------------------------------------*/
#define EVGA_USB_VID 0x3842
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define Z15_ISO_PID 0x260E
#define Z15_ANSI_PID 0x2608
#define Z20_ANSI_PID 0x260A
#define Z20_UK_PID 0x2610
DetectedControllers DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
EVGAKeyboardController* controller = new EVGAKeyboardController(dev, info->path, info->product_id, name);
RGBController_EVGAKeyboard* rgb_controller = new RGBController_EVGAKeyboard(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ISO_PID, 1, 0x08, 0x4B);
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ANSI_PID, 1, 0x08, 0x4B);
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_ANSI_PID, 1, 0x08, 0x4B);
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_UK_PID, 1, 0x08, 0x4B);
@@ -1,7 +1,7 @@
/*---------------------------------------------------------*\
| EVGAUSBControllerDetect.cpp |
| EVGAMouseControllerDetect.cpp |
| |
| Detector for EVGA USB devices |
| Detector for EVGA mouse devices |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
@@ -9,45 +9,18 @@
#include <hidapi.h>
#include "DetectionManager.h"
#include "RGBController_EVGAKeyboard.h"
#include "RGBController_EVGAMouse.h"
/*---------------------------------------------------------*\
| EVGA USB vendor ID |
\*---------------------------------------------------------*/
#define EVGA_USB_VID 0x3842
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define Z15_ISO_PID 0x260E
#define Z15_ANSI_PID 0x2608
#define Z20_ANSI_PID 0x260A
#define Z20_UK_PID 0x2610
#define EVGA_USB_VID 0x3842
/*---------------------------------------------------------*\
| Mouse product IDs |
\*---------------------------------------------------------*/
#define X20_WIRED_PID 0x2420
#define X20_WIRELESS_ADAPTER_PID 0x2402
DetectedControllers DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
EVGAKeyboardController* controller = new EVGAKeyboardController(dev, info->path, info->product_id, name);
RGBController_EVGAKeyboard* rgb_controller = new RGBController_EVGAKeyboard(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
#define X20_WIRED_PID 0x2420
#define X20_WIRELESS_ADAPTER_PID 0x2402
DetectedControllers DetectEVGAMouse(hid_device_info* info, const std::string &name, int connection_type)
{
@@ -77,10 +50,5 @@ DetectedControllers DetectWirelessEVGAMouse(hid_device_info* info, const std::st
return(DetectEVGAMouse(info, name, EVGA_PERIPHERAL_CONNECTION_TYPE_WIRELESS));
}
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ISO_PID, 1, 0x08, 0x4B);
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ANSI_PID, 1, 0x08, 0x4B);
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_ANSI_PID, 1, 0x08, 0x4B);
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_UK_PID, 1, 0x08, 0x4B);
REGISTER_HID_DETECTOR_IPU("EVGA X20 Gaming Mouse", DetectWiredEVGAMouse, EVGA_USB_VID, X20_WIRED_PID, 2, 0xFFFF, 0);
REGISTER_HID_DETECTOR_IPU("EVGA X20 USB Receiver", DetectWirelessEVGAMouse, EVGA_USB_VID, X20_WIRELESS_ADAPTER_PID, 2, 0xFFFF, 0);
@@ -0,0 +1,81 @@
/*---------------------------------------------------------*\
| EVisionKeyboardControllerDetect.cpp |
| |
| Detector for EVision/Huafenda keyboards |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "DetectionManager.h"
#include "EVisionKeyboardController.h"
#include "RGBController_EVisionKeyboard.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
/*---------------------------------------------------------*\
| EVision vendor ID |
| NOTE: EVision (and Huafenda) use rebranded Sonix MCUs |
| Some EVision/Huafenda keyboards use the Sonix VID while |
| others use EVision's VID |
\*---------------------------------------------------------*/
#define SONIX_VID 0x0C45
#define EVISION_VID 0x320F
/*---------------------------------------------------------*\
| EVision Usage Page |
\*---------------------------------------------------------*/
#define EVISION_KEYBOARD_USAGE_PAGE 0xFF1C
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define EVISION_SONIX_5004_PID 0x5004
#define EVISION_SONIX_5104_PID 0x5104
#define EVISION_SONIX_5204_PID 0x5204
#define EVISION_SONIX_652F_PID 0x652F
#define EVISION_SONIX_7672_PID 0x7672
#define EVISION_SONIX_7698_PID 0x7698
#define EVISION_SONIX_8520_PID 0x8520
#define EVISION_5000_PID 0x5000
#define EVISION_502A_PID 0x502A
#define EVISION_505B_PID 0x505B
#define EVISION_5064_PID 0x5064
#define EVISION_5078_PID 0x5078
#define EVISION_5084_PID 0x5084
DetectedControllers DetectEVisionKeyboards(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
EVisionKeyboardController* controller = new EVisionKeyboardController(dev, info->path, name);
RGBController_EVisionKeyboard* rgb_controller = new RGBController_EVisionKeyboard(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
/*---------------------------------------------------------*\
| Keyboards |
\*---------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5004", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_5004_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5104", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_5104_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5204", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_5204_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:652F", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_652F_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:7672", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_7672_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:7698", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_7698_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:8520", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_8520_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5000", DetectEVisionKeyboards, EVISION_VID, EVISION_5000_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:502A", DetectEVisionKeyboards, EVISION_VID, EVISION_502A_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:505B", DetectEVisionKeyboards, EVISION_VID, EVISION_505B_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5078", DetectEVisionKeyboards, EVISION_VID, EVISION_5078_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5064", DetectEVisionKeyboards, EVISION_VID, EVISION_5064_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5084", DetectEVisionKeyboards, EVISION_VID, EVISION_5084_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
@@ -1,129 +0,0 @@
/*---------------------------------------------------------*\
| EVisionKeyboardControllerDetect.cpp |
| |
| Detector for EVision keyboards |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "DetectionManager.h"
#include "EVisionKeyboardController.h"
#include "EVisionV2KeyboardController.h"
#include "RGBController_EVisionKeyboard.h"
#include "RGBController_EVisionV2Keyboard.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define EVISION_KEYBOARD_VID 0x0C45
#define EVISION_KEYBOARD2_VID 0x320F
#define EVISION_KEYBOARD3_VID 0x3299
#define EVISION_KEYBOARD_USAGE_PAGE 0xFF1C
#define ENDORFY_OMNIS_PID 0x0012
#define DEXP_BLAZE_PID 0x5084
#define GLORIOUS_GMMK_TKL_PID 0x5064
#define REDRAGON_K550_PID 0x5204
#define MARS_GAMING_MKMINI_PID 0x5078
#define SKILLKORP_K5_PID 0x505B
#define REDRAGON_K552_PID 0x5104
#define REDRAGON_K552_V2_PID 0x5000
#define REDRAGON_K556_PID 0x5004
#define TECWARE_PHANTOM_ELITE_PID 0x652F
#define WARRIOR_KANE_TC235 0x8520
#define WOMIER_K87_PID 0x502A
#define WOMIER_K66_PID 0x7698
#define BYGG_CSB_ICL01_PID 0x5041
#define GAMEPOWER_OGRE_RGB_PID 0x7672
DetectedControllers DetectEVisionKeyboards(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
EVisionKeyboardController* controller = new EVisionKeyboardController(dev, info->path, name);
RGBController_EVisionKeyboard* rgb_controller = new RGBController_EVisionKeyboard(controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
DetectedControllers DetectEVisionV2Keyboards(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EVision2Settings");
hid_device* dev = hid_open_path(info->path);
if(dev)
{
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, EVISION_V2_KEYBOARD_LAYOUT, name);
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
detected_controllers.push_back(rgb_controller);
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
{
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_LOGO);
detected_controllers.push_back(rgb_controller);
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_EDGE);
detected_controllers.push_back(rgb_controller);
}
}
return(detected_controllers);
}
DetectedControllers DetectEndorfyKeyboards(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EndorfySettings");
hid_device* dev = hid_open_path(info->path);
if(dev)
{
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, ENDORFY_KEYBOARD_LAYOUT, name);
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
detected_controllers.push_back(rgb_controller);
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
{
rgb_controller = new RGBController_EVisionV2Keyboard(controller, ENDORFY_KEYBOARD_PART_EDGE);
detected_controllers.push_back(rgb_controller);
}
}
return(detected_controllers);
}
/*---------------------------------------------------------------------------------------------------------------------------------------------*\
| Keyboards |
\*---------------------------------------------------------------------------------------------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5078", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, MARS_GAMING_MKMINI_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5204", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, REDRAGON_K550_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5104", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, REDRAGON_K552_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5000", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, REDRAGON_K552_V2_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5004", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, REDRAGON_K556_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:652F", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, TECWARE_PHANTOM_ELITE_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:8520", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, WARRIOR_KANE_TC235, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:502A", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, WOMIER_K87_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:7698", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, WOMIER_K66_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5064", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, GLORIOUS_GMMK_TKL_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5084", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, DEXP_BLAZE_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:505B", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, SKILLKORP_K5_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("Endorfy Omnis", DetectEndorfyKeyboards, EVISION_KEYBOARD3_VID, ENDORFY_OMNIS_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("CSB/ICL01 Keyboard", DetectEVisionV2Keyboards, EVISION_KEYBOARD2_VID, BYGG_CSB_ICL01_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("Gamepower Ogre RGB 0C45:7672", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, GAMEPOWER_OGRE_RGB_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
@@ -0,0 +1,90 @@
/*---------------------------------------------------------*\
| EVisionKeyboardV2ControllerDetect.cpp |
| |
| Detector for EVision V2 keyboards |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "DetectionManager.h"
#include "EVisionV2KeyboardController.h"
#include "RGBController_EVisionV2Keyboard.h"
#include "ResourceManager.h"
#include "SettingsManager.h"
/*---------------------------------------------------------*\
| EVision vendor ID |
\*---------------------------------------------------------*/
#define EVISION_VID 0x320F
#define SPCGEAR_VID 0x3299
/*---------------------------------------------------------*\
| EVision Usage Page |
\*---------------------------------------------------------*/
#define EVISION_KEYBOARD_USAGE_PAGE 0xFF1C
/*---------------------------------------------------------*\
| Keyboard product IDs |
\*---------------------------------------------------------*/
#define ENDORFY_OMNIS_PID 0x0012
#define BYGG_CSB_ICL01_PID 0x5041
DetectedControllers DetectEVisionV2Keyboards(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EVision2Settings");
hid_device* dev = hid_open_path(info->path);
if(dev)
{
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, EVISION_V2_KEYBOARD_LAYOUT, name);
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
detected_controllers.push_back(rgb_controller);
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
{
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_LOGO);
detected_controllers.push_back(rgb_controller);
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_EDGE);
detected_controllers.push_back(rgb_controller);
}
}
return(detected_controllers);
}
DetectedControllers DetectEndorfyKeyboards(hid_device_info* info, const std::string& name)
{
DetectedControllers detected_controllers;
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EndorfySettings");
hid_device* dev = hid_open_path(info->path);
if(dev)
{
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, ENDORFY_KEYBOARD_LAYOUT, name);
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
detected_controllers.push_back(rgb_controller);
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
{
rgb_controller = new RGBController_EVisionV2Keyboard(controller, ENDORFY_KEYBOARD_PART_EDGE);
detected_controllers.push_back(rgb_controller);
}
}
return(detected_controllers);
}
/*---------------------------------------------------------*\
| Keyboards |
\*---------------------------------------------------------*/
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5041", DetectEVisionV2Keyboards, EVISION_VID, BYGG_CSB_ICL01_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
REGISTER_HID_DETECTOR_IP("Endorfy Omnis", DetectEndorfyKeyboards, SPCGEAR_VID, ENDORFY_OMNIS_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);

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