高级会员

- 积分
- 853
- 金钱
- 853
- 注册时间
- 2012-8-3
- 在线时间
- 79 小时
|

楼主 |
发表于 2017-8-16 11:33:53
|
显示全部楼层
本帖最后由 EDA3rd 于 2017-8-16 11:48 编辑
来了来了
[mw_shl_code=c,true] typedef struct
{
struct
{
uint8_t DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe. */
bool DataINPipeDoubleBank; /**< Indicates if the HID interface's IN data pipe should use double banking. */
uint8_t DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe. */
bool DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking. */
uint8_t HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific
* boot subclass protocol is required, a protocol value from the
* @ref HID_Descriptor_ClassSubclassProtocol_t enum.
*/
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol
* is not used.
*
* @note When the \c HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined,
* this method is unavailable.
*/
#endif
uint8_t PortNumber; /**< Port number that this interface is running.
*/
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
*/
struct
{
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
* after @ref HID_Host_ConfigurePipes() is called and the Host state machine is in the
* Configured state.
*/
uint8_t InterfaceNumber; /**< Interface index of the HID interface within the attached device. */
uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe. */
uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe. */
bool SupportsBootProtocol; /**< Indicates if the current interface instance supports the HID Boot
* Protocol when enabled via @ref HID_Host_SetBootProtocol().
*/
bool DeviceUsesOUTPipe; /**< Indicates if the current interface instance uses a separate OUT data pipe for
* OUT reports, or if OUT reports are sent via the control pipe instead.
*/
bool UsingBootProtocol; /**< Indicates that the interface is currently initialized in Boot Protocol mode */
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device. */
uint8_t LargestReportSize; /**< Largest report the device will send, in bytes. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated.
*/
} USB_ClassInfo_HID_Host_t;[/mw_shl_code]
代码来自LPCOpen中 2.10 中的usbhost_keyboard.uvproj 例程
[url=http://www.nxp.com/products/developer-resources/software-development-tools/software-tools/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc17xx PCOPEN-SOFTWARE-FOR-LPC17XX]http://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_ea_devkit_1788.zip[/url] |
|