2018-09-25 08:25 AM
I'm tring to set up an HID on a NUCLEO-STM32H743ZI. My demo code is very simple:
uint8_t buffer[8] = { 1, 0, 0, 0x04, 0, 0, 0, 0 };
while (1) {
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13) == GPIO_PIN_SET) {
buffer[3] = 0x4E;
USBD_HID_SendReport(&hUsbDeviceFS, buffer, 8);
HAL_Delay(100);
buffer[3] = 0x0;
USBD_HID_SendReport(&hUsbDeviceFS, buffer, 8);
HAL_Delay(100);
}
}
I have changed also in the USBD_HID_CfgDesc the nInterfaceProtocol to 1 (keyboard).
I have some other trouble: