Update OKS keyboard controller files to new standardized header comment

This commit is contained in:
Adam Honse 2024-06-03 11:30:50 -05:00
parent 35b6fd8c28
commit aac70462c5
5 changed files with 66 additions and 48 deletions

View file

@ -1,11 +1,13 @@
/*-----------------------------------------*\
| OKSKeyboardController.cpp |
| |
| Driver for OKS RGB keyboardlighting |
| controller |
| |
| Merafour (OKS) 2/24/2023 |
\*-----------------------------------------*/
/*---------------------------------------------------------*\
| OKSKeyboardController.cpp |
| |
| Driver for OKS keyboard |
| |
| Merafour (OKS) 24 Feb 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#include <cstring>
#include "OKSKeyboardController.h"

View file

@ -1,37 +1,38 @@
/*-----------------------------------------*\
| OKSKeyboardController.h |
| |
| Definitions and types for OKS RGB |
| keyboard lighting controller |
| |
| Merafour (OKS) 2/24/2023 |
\*-----------------------------------------*/
/*---------------------------------------------------------*\
| OKSKeyboardController.h |
| |
| Driver for OKS keyboard |
| |
| Merafour (OKS) 24 Feb 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#include "RGBController.h"
#pragma once
#include <stdint.h>
#include <string>
#include <hidapi/hidapi.h>
#pragma once
#include "RGBController.h"
/*-----------------------------------------------------*\
| OKS vendor ID |
| OKS vendor ID |
\*-----------------------------------------------------*/
#define OKS_VID 0x1C4F
#define OKS_VID 0x1C4F
/*-----------------------------------------------------*\
| Keyboard product IDs |
\*-----------------------------------------------------*/
#define OKS_OPTICAL_RGB_PID 0xEE88
#define OKS_OPTICAL_RGB_PID 0xEE88
/*-----------------------------------------------------*\
| communication protocol |
| Communication protocol |
\*-----------------------------------------------------*/
#define KB2_PACK_HEAD (0x5C&0xFF)
#define KB2_HEAD_SIZE 4
#define KB2_PORT_SIZE (64*4)
#define KB2_DATA_SIZE (KB2_PORT_SIZE-KB2_HEAD_SIZE)
#define KB2_PACK_HEAD (0x5C&0xFF)
#define KB2_HEAD_SIZE 4
#define KB2_PORT_SIZE (64*4)
#define KB2_DATA_SIZE (KB2_PORT_SIZE-KB2_HEAD_SIZE)
union kb2_port_t
{
uint8_t bin[KB2_PORT_SIZE];
@ -72,11 +73,10 @@ public:
std::string GetDeviceLocation();
std::string GetSerialString();
unsigned short GetUSBPID();
void SendColors(unsigned char* color_data, unsigned int color_data_size);
void SendKeyboardModeEx(const mode &m, unsigned char red, unsigned char green, unsigned char blue);
private:
hid_device* dev;
std::string location;

View file

@ -1,10 +1,21 @@
/*---------------------------------------------------------*\
| OKSKeyboardControllerDetect.cpp |
| |
| Detector for OKS keyboard |
| |
| Merafour (OKS) 24 Feb 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#include <hidapi/hidapi.h>
#include "Detector.h"
#include "OKSKeyboardController.h"
#include "RGBController.h"
#include "RGBController_OKSKeyboard.h"
#include <hidapi/hidapi.h>
/******************************************************************************************\
* *
* DetectOKSKeyboardControllers *
* Reference: DuckyKeyboardController *
* Tests the USB address to see if a OKS Optical Axis RGB Keyboard controller exists there.*

View file

@ -1,11 +1,13 @@
/*-----------------------------------------*\
| RGBController_OKSKeyboard.cpp |
| |
| Generic RGB Interface for OKS RGB |
| keyboard devices |
| |
| Merafour (OKS) 2/24/2023 |
\*-----------------------------------------*/
/*---------------------------------------------------------*\
| RGBController_OKSKeyboard.cpp |
| |
| RGBController for OKS keyboard |
| |
| Merafour (OKS) 24 Feb 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#include "RGBControllerKeyNames.h"
#include "RGBController_OKSKeyboard.h"

View file

@ -1,13 +1,16 @@
/*-----------------------------------------*\
| RGBController_OKSKeyboard.h |
| |
| Generic RGB Interface for OKS RGB |
| keyboard devices |
| |
| Merafour (OKS) 2/24/2023 |
\*-----------------------------------------*/
/*---------------------------------------------------------*\
| RGBController_OKSKeyboard.h |
| |
| RGBController for OKS keyboard |
| |
| Merafour (OKS) 24 Feb 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "OKSKeyboardController.h"
@ -58,7 +61,7 @@ public:
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);