diff --git a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h b/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h index 0d733cb60..6c76588b5 100755 --- a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h +++ b/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h @@ -46,7 +46,7 @@ #define USB_HID_CONFIG_DESC_SIZ 34U #define USB_HID_DESC_SIZ 9U -#define HID_MOUSE_REPORT_DESC_SIZE 38U +#define HID_MOUSE_REPORT_DESC_SIZE 54U #define HID_DESCRIPTOR_TYPE 0x21U #define HID_REPORT_DESC 0x22U diff --git a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c b/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c index f2b94a2bf..2d3d5174e 100755 --- a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c +++ b/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c @@ -328,13 +328,21 @@ __ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] _ 0x09, 0x33, // USAGE (Rx) 0x09, 0x35, // USAGE (Rz) 0x09, 0x34, // USAGE (Ry) - 0x09, 0x40, // USAGE (Vx) - 0x09, 0x38, // USAGE (Wheel) + 0x09, 0x36, // USAGE (Slider) + 0x09, 0x37, // USAGE (Dial) 0x15, 0x81, // LOGICAL_MINIMUM (-127) 0x25, 0x7f, // LOGICAL_MAXIMUM (127) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x08, // REPORT_COUNT (8) 0x81, 0x02, // INPUT (Data,Var,Abs) + 0x05, 0x09, // USAGE_PAGE (Button) + 0x19, 0x01, // USAGE_MINIMUM (Button 1) + 0x29, 0x08, // USAGE_MAXIMUM (Button 8) + 0x15, 0x00, // LOGICAL_MINIMUM (0) + 0x25, 0x01, // LOGICAL_MAXIMUM (1) + 0x95, 0x08, // REPORT_COUNT (8) + 0x75, 0x01, // REPORT_SIZE (1) + 0x81, 0x02, // INPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xc0 /* END_COLLECTION */ }; diff --git a/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h b/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h index 0d733cb60..6c76588b5 100755 --- a/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h +++ b/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h @@ -46,7 +46,7 @@ #define USB_HID_CONFIG_DESC_SIZ 34U #define USB_HID_DESC_SIZ 9U -#define HID_MOUSE_REPORT_DESC_SIZE 38U +#define HID_MOUSE_REPORT_DESC_SIZE 54U #define HID_DESCRIPTOR_TYPE 0x21U #define HID_REPORT_DESC 0x22U diff --git a/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c b/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c index b21bcbaf3..348610069 100755 --- a/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c +++ b/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c @@ -328,13 +328,21 @@ __ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] _ 0x09, 0x33, // USAGE (Rx) 0x09, 0x35, // USAGE (Rz) 0x09, 0x34, // USAGE (Ry) - 0x09, 0x40, // USAGE (Vx) - 0x09, 0x38, // USAGE (Wheel) + 0x09, 0x36, // USAGE (Slider) + 0x09, 0x37, // USAGE (Dial) 0x15, 0x81, // LOGICAL_MINIMUM (-127) 0x25, 0x7f, // LOGICAL_MAXIMUM (127) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x08, // REPORT_COUNT (8) 0x81, 0x02, // INPUT (Data,Var,Abs) + 0x05, 0x09, // USAGE_PAGE (Button) + 0x19, 0x01, // USAGE_MINIMUM (Button 1) + 0x29, 0x08, // USAGE_MAXIMUM (Button 8) + 0x15, 0x00, // LOGICAL_MINIMUM (0) + 0x25, 0x01, // LOGICAL_MAXIMUM (1) + 0x95, 0x08, // REPORT_COUNT (8) + 0x75, 0x01, // REPORT_SIZE (1) + 0x81, 0x02, // INPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xc0 /* END_COLLECTION */ }; diff --git a/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h b/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h index 6afb12107..86d9116b4 100755 --- a/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h +++ b/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h @@ -46,7 +46,7 @@ extern "C" { #define USB_HID_CONFIG_DESC_SIZ 34U #define USB_HID_DESC_SIZ 9U -#define HID_MOUSE_REPORT_DESC_SIZE 38U +#define HID_MOUSE_REPORT_DESC_SIZE 54U #define HID_DESCRIPTOR_TYPE 0x21U #define HID_REPORT_DESC 0x22U diff --git a/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c b/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c index 5a8cc54b1..00560af42 100755 --- a/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c +++ b/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c @@ -328,13 +328,21 @@ __ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] _ 0x09, 0x33, // USAGE (Rx) 0x09, 0x35, // USAGE (Rz) 0x09, 0x34, // USAGE (Ry) - 0x09, 0x40, // USAGE (Vx) - 0x09, 0x38, // USAGE (Wheel) + 0x09, 0x36, // USAGE (Slider) + 0x09, 0x37, // USAGE (Dial) 0x15, 0x81, // LOGICAL_MINIMUM (-127) 0x25, 0x7f, // LOGICAL_MAXIMUM (127) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x08, // REPORT_COUNT (8) 0x81, 0x02, // INPUT (Data,Var,Abs) + 0x05, 0x09, // USAGE_PAGE (Button) + 0x19, 0x01, // USAGE_MINIMUM (Button 1) + 0x29, 0x08, // USAGE_MAXIMUM (Button 8) + 0x15, 0x00, // LOGICAL_MINIMUM (0) + 0x25, 0x01, // LOGICAL_MAXIMUM (1) + 0x95, 0x08, // REPORT_COUNT (8) + 0x75, 0x01, // REPORT_SIZE (1) + 0x81, 0x02, // INPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xc0 /* END_COLLECTION */ }; diff --git a/lib/main/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h b/lib/main/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h index b8ba16c7d..a5dade56f 100644 --- a/lib/main/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h +++ b/lib/main/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h @@ -48,7 +48,7 @@ #define USB_HID_CONFIG_DESC_SIZ 34 #define USB_HID_DESC_SIZ 9 -#define HID_MOUSE_REPORT_DESC_SIZE 38 +#define HID_MOUSE_REPORT_DESC_SIZE 54 #define HID_DESCRIPTOR_TYPE 0x21 #define HID_REPORT_DESC 0x22 diff --git a/lib/main/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c b/lib/main/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c index 9b5b6246d..84059eb79 100644 --- a/lib/main/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c +++ b/lib/main/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c @@ -249,13 +249,21 @@ __ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] __ 0x09, 0x33, // USAGE (Rx) 0x09, 0x35, // USAGE (Rz) 0x09, 0x34, // USAGE (Ry) -0x09, 0x40, // USAGE (Vx) -0x09, 0x38, // USAGE (Wheel) +0x09, 0x36, // USAGE (Slider) +0x09, 0x37, // USAGE (Dial) 0x15, 0x81, // LOGICAL_MINIMUM (-127) 0x25, 0x7f, // LOGICAL_MAXIMUM (127) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x08, // REPORT_COUNT (8) 0x81, 0x02, // INPUT (Data,Var,Abs) +0x05, 0x09, // USAGE_PAGE (Button) +0x19, 0x01, // USAGE_MINIMUM (Button 1) +0x29, 0x08, // USAGE_MAXIMUM (Button 8) +0x15, 0x00, // LOGICAL_MINIMUM (0) +0x25, 0x01, // LOGICAL_MAXIMUM (1) +0x95, 0x08, // REPORT_COUNT (8) +0x75, 0x01, // REPORT_SIZE (1) +0x81, 0x02, // INPUT (Data,Var,Abs) 0xc0, // END_COLLECTION 0xc0 /* END_COLLECTION */ }; diff --git a/src/main/vcpf4/usbd_conf.h b/src/main/vcpf4/usbd_conf.h index 9ece6c3da..e29b01958 100644 --- a/src/main/vcpf4/usbd_conf.h +++ b/src/main/vcpf4/usbd_conf.h @@ -41,7 +41,7 @@ #define CDC_CMD_EP 0x82 /* EP2 for CDC commands */ #define HID_IN_EP 0x83 -#define HID_IN_PACKET 8 +#define HID_IN_PACKET 9 /* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */ #ifdef USE_USB_OTG_HS