6kro rollback

This commit is contained in:
2025-09-06 23:32:00 -07:00
parent e3e99c177b
commit 03bc7686ae
6 changed files with 45 additions and 74 deletions

View File

@@ -43,11 +43,11 @@ extern "C" {
#ifndef HID_EPIN_ADDR #ifndef HID_EPIN_ADDR
#define HID_EPIN_ADDR 0x81U #define HID_EPIN_ADDR 0x81U
#endif /* HID_EPIN_ADDR */ #endif /* HID_EPIN_ADDR */
#define HID_EPIN_SIZE 0x0EU #define HID_EPIN_SIZE 0x04U
#define USB_HID_CONFIG_DESC_SIZ 34U #define USB_HID_CONFIG_DESC_SIZ 34U
#define USB_HID_DESC_SIZ 9U #define USB_HID_DESC_SIZ 9U
#define HID_MOUSE_REPORT_DESC_SIZE 0x2DU #define HID_MOUSE_REPORT_DESC_SIZE 63U
#define HID_DESCRIPTOR_TYPE 0x21U #define HID_DESCRIPTOR_TYPE 0x21U
#define HID_REPORT_DESC 0x22U #define HID_REPORT_DESC 0x22U

View File

@@ -41,9 +41,9 @@
* @{ * @{
*/ */
/** @defgroup USBD_DESC_Exported_Constants USBD_DESC_Exported_Constants /*
* @brief Constants. * User to provide a unique ID to define the USB device serial number
* @{ * The use of UID_BASE register can be considered as an example
*/ */
#define DEVICE_ID1 (UID_BASE) #define DEVICE_ID1 (UID_BASE)
#define DEVICE_ID2 (UID_BASE + 0x4) #define DEVICE_ID2 (UID_BASE + 0x4)

View File

@@ -158,7 +158,7 @@ __ALIGN_BEGIN static uint8_t USBD_HID_CfgDesc[USB_HID_CONFIG_DESC_SIZ] __ALIGN_E
0x01, /* bNumEndpoints */ 0x01, /* bNumEndpoints */
0x03, /* bInterfaceClass: HID */ 0x03, /* bInterfaceClass: HID */
0x00, /* bInterfaceSubClass : 1=BOOT, 0=no boot */ 0x00, /* bInterfaceSubClass : 1=BOOT, 0=no boot */
0x00, /* nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse */ 0x01, /* nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse */
0, /* iInterface: Index of string descriptor */ 0, /* iInterface: Index of string descriptor */
/******************** Descriptor of Joystick Mouse HID ********************/ /******************** Descriptor of Joystick Mouse HID ********************/
/* 18 */ /* 18 */
@@ -219,69 +219,39 @@ __ALIGN_BEGIN static uint8_t USBD_HID_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_
__ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] __ALIGN_END = __ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] __ALIGN_END =
{ {
// 0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */ 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
// 0x09, 0x05, /* Usage (Gamepad) */ 0x09, 0x06, // USAGE (Keyboard)
// 0xA1, 0x01, /* Collection (Application) */ 0xa1, 0x01, // COLLECTION (Application)
0x05, 0x07, // USAGE_PAGE (Keyboard)
// // --- Buttons: 13 total --- 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
// 0x05, 0x09, // USAGE_PAGE (Button) 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
// 0x19, 0x01, // USAGE_MINIMUM (Button 1) 0x15, 0x00, // LOGICAL_MINIMUM (0)
// 0x29, 0x0D, // USAGE_MAXIMUM (Button 13) 0x25, 0x01, // LOGICAL_MAXIMUM (1)
// 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x75, 0x01, // REPORT_SIZE (1)
// 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x95, 0x08, // REPORT_COUNT (8)
// 0x75, 0x01, // REPORT_SIZE (1 bit per button) 0x81, 0x02, // INPUT (Data,Var,Abs)
// 0x95, 0x0D, // REPORT_COUNT (13 bits total) 0x95, 0x01, // REPORT_COUNT (1)
// 0x81, 0x02, // INPUT (Data,Var,Abs) 0x75, 0x08, // REPORT_SIZE (8)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
// // --- Padding (3 bits) --- 0x95, 0x05, // REPORT_COUNT (5)
// 0x75, 0x01, // REPORT_SIZE (1) 0x75, 0x01, // REPORT_SIZE (1)
// 0x95, 0x03, // REPORT_COUNT (3 bits) 0x05, 0x08, // USAGE_PAGE (LEDs)
// 0x81, 0x03, // INPUT (Const,Var,Abs) 0x19, 0x01, // USAGE_MINIMUM (Num Lock)
0x29, 0x05, // USAGE_MAXIMUM (Kana)
// // --- Encoders (3 x int8_t) --- 0x91, 0x02, // OUTPUT (Data,Var,Abs)
// 0x05, 0x01, // USAGE_PAGE (Generic Desktop) 0x95, 0x01, // REPORT_COUNT (1)
// 0x09, 0x30, // USAGE (X) 0x75, 0x03, // REPORT_SIZE (3)
// 0x09, 0x31, // USAGE (Y) 0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
// 0x09, 0x32, // USAGE (Z) 0x95, 0x06, // REPORT_COUNT (6)
// 0x15, 0x81, // LOGICAL_MINIMUM (-127) 0x75, 0x08, // REPORT_SIZE (8)
// 0x25, 0x7F, // LOGICAL_MAXIMUM (127) 0x15, 0x00, // LOGICAL_MINIMUM (0)
// 0x75, 0x08, // REPORT_SIZE (8 bits) 0x25, 0x65, // LOGICAL_MAXIMUM (101)
// 0x95, 0x03, // REPORT_COUNT (3 axes) 0x05, 0x07, // USAGE_PAGE (Keyboard)
// 0x81, 0x02, // INPUT (Data,Var,Abs) 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
// 0xC0 /* End Collection */ 0x81, 0x00, // INPUT (Data,Ary,Abs)
0x05, 0x01, // Usage Page (Generic Desktop) 0xc0 // END_COLLECTION
0x09, 0x06, // Usage (Keyboard)
0xA1, 0x01, // Collection (Application)
// Modifiers (8 bits)
0x05, 0x07, // Usage Page (Keyboard/Keypad)
0x19, 0xE0, // Usage Minimum (224) - Left Control
0x29, 0xE7, // Usage Maximum (231) - Right GUI
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1 bit)
0x95, 0x08, // Report Count (8 bits)
0x81, 0x02, // Input (Data, Variable, Absolute)
// Reserved byte (8 bits)
0x75, 0x08, // Report Size (8 bits)
0x95, 0x01, // Report Count (1)
0x81, 0x01, // Input (Constant)
// Key bitfield (112 bits = 14 bytes)
0x05, 0x07, // Usage Page (Keyboard/Keypad)
0x19, 0x04, // Usage Minimum (4)
0x29, 0x73, // Usage Maximum (115) -- 0x73
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1 bit)
0x95, 0x70, // Report Count (112 bits, 0x70)
0x81, 0x02, // Input (Data, Variable, Absolute)
0xC0 // End Collection
}; };
static uint8_t HIDInEpAdd = HID_EPIN_ADDR; static uint8_t HIDInEpAdd = HID_EPIN_ADDR;
/** /**

View File

@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */ /* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************

View File

@@ -1,7 +1,7 @@
/* USER CODE BEGIN Header */ /* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file : usbd_desc.c * @file : App/usbd_desc.c
* @version : v1.0_Cube * @version : v1.0_Cube
* @brief : This file implements the USB device descriptors. * @brief : This file implements the USB device descriptors.
****************************************************************************** ******************************************************************************
@@ -62,11 +62,11 @@
* @{ * @{
*/ */
#define USBD_VID 0xCAFE #define USBD_VID 1155
#define USBD_LANGID_STRING 1033 #define USBD_LANGID_STRING 1033
#define USBD_MANUFACTURER_STRING "TeamSKBD" #define USBD_MANUFACTURER_STRING "Team SKBD"
#define USBD_PID_FS 22315 #define USBD_PID_FS 22315
#define USBD_PRODUCT_STRING_FS "MSKBD Mainboard" #define USBD_PRODUCT_STRING_FS "Modular Keyboard"
#define USBD_CONFIGURATION_STRING_FS "HID Config" #define USBD_CONFIGURATION_STRING_FS "HID Config"
#define USBD_INTERFACE_STRING_FS "HID Interface" #define USBD_INTERFACE_STRING_FS "HID Interface"