I'm using the latest ChibiOS Version (20.3.3 => Kernel 6.1) on a STM32L052 and want to implement an usb hid driver. I found a sample project (ChibiOS/rawHID USB example from flabbergast). Unfortunately it was implemented for ChibiOS Kernel 3 and there exists a function called usbPrepareQueuedReceive and usbPrepareQueuedTransmit as well. These functions doesn't exist in Kernel 6 anymore. How can this be done in Kernel 6 ?
These are the In/Out functions for Endpoint 1 from the example:
Code: Select all
static void ep1in_cb (USBDriver *usbp, usbep_t ep)
{
(void)usbp;
(void)ep;
chSysLockFromISR ();
// Check if there is data to send in the output queue
if (oqGetFullI (&usb_output_queue) >= USB_HID_IN_REPORT_SIZE)
{
chSysUnlockFromISR ();
// Prepare the transmission
usbPrepareQueuedTransmit (&USB_DRIVER, USBD1_IN_EP, &usb_output_queue, USB_HID_IN_REPORT_SIZE);
chSysLockFromISR ();
usbStartTransmitI (&USB_DRIVER, USBD1_IN_EP);
}
chSysUnlockFromISR ();
}
static void ep1out_cb (USBDriver *usbp, usbep_t ep)
{
(void)usbp;
(void)ep;
chSysLockFromISR ();
// Check if there is still some space left in the input queue
if (iqGetEmptyI (&usb_input_queue) >= USB_HID_OUT_REPORT_SIZE)
{
chSysUnlockFromISR ();
// Prepares the reception of new data
usbPrepareQueuedReceive (&USB_DRIVER, USBD1_OUT_EP, &usb_input_queue, USB_HID_OUT_REPORT_SIZE);
chSysLockFromISR ();
usbStartReceiveI (&USB_DRIVER, USBD1_OUT_EP);
}
chSysUnlockFromISR ();
}
Has somebody an advice for me or usb hid implemented for STM32 in Kernel 6 ?
Thank you in advance.