Hello,
我使用 LPC11U68 的 BSP(usbd_lib_hid_generic), 做 HID 開發,
使用上位機可以用USB通道傳送資料, 但無法將資料回傳給上位機,
hid_generic.c 內的HID_Ep_Hdlr的event只符合USB_EVT_OUT
並不會有符合USB_EVT_IN的情況, 是否需要做任何設定?
/* HID Interrupt endpoint event handler. */
static ErrorCode_t HID_Ep_Hdlr(USBD_HANDLE_T hUsb, void *data, uint32_t event)
{
USB_HID_CTRL_T *pHidCtrl = (USB_HID_CTRL_T *) data;
switch (event) {
case USB_EVT_IN:
USBD_API->hw->WriteEP(hUsb, pHidCtrl->epin_adr, loopback_report, 64);
break;
case USB_EVT_OUT:
USBD_API->hw->ReadEP(hUsb, pHidCtrl->epout_adr, loopback_report);
break;
}
return LPC_OK;
}
Solved! Go to Solution.
About USB lib HID usage, there is also demo under LPCopen, you can refer to the routine of interrup.
demo name is "usbd_rom_hid_generic".
Hello DL1210,
How about test the USB HID Generic domo under LPCopen first ?
Check how the interrupt work.
BR
Alice
你好,
我使用 usbd_lib_hid_generic專案, 當上位機用USB進行通訊時,
接收/傳送資料則會進入, 如下中斷
hid_param.HID_EpOut_Hdlr = HID_Ep_Hdlr;
hid_param.HID_EpIn_Hdlr = HID_Ep_Hdlr;
但傳送資料至上位機時, 並未發生此中斷 <hid_param.HID_EpIn_Hdlr = HID_Ep_Hdlr;>
是否需要做額外的設定?
About USB lib HID usage, there is also demo under LPCopen, you can refer to the routine of interrup.
demo name is "usbd_rom_hid_generic".
Hi Alice,
感謝你的回覆, 使用這個例程做修改,
其動作是我所預期的, 謝謝。