USB composite device example program, drag-and-drop flash writer.

Dependencies:   SWD USBDevice mbed BaseDAP

Embed: (wiki syntax)

« Back to documentation index

USB_HID Class Reference

USB_HID Class Reference

USB HID device for CMSIS-DAP. More...

#include <USB_HID.h>

Public Member Functions

 USB_HID (USBDevice *device, uint8_t output_report_length=64, uint8_t input_report_length=64)
 Constructor.
bool send (HID_REPORT *report)
 Send a Report.
bool sendNB (HID_REPORT *report)
 Send a Report.
bool read (HID_REPORT *report)
 Read a report: blocking.
bool readNB (HID_REPORT *report)
 Read a report: non blocking.

Detailed Description

USB HID device for CMSIS-DAP.

Definition at line 34 of file USB_HID.h.


Constructor & Destructor Documentation

USB_HID ( USBDevice *  device,
uint8_t  output_report_length = 64,
uint8_t  input_report_length = 64 
)

Constructor.

Parameters:
output_report_lengthMaximum length of a sent report (up to 64 bytes) (default: 64 bytes)
input_report_lengthMaximum length of a received report (up to 64 bytes) (default: 64 bytes)

Definition at line 22 of file USB_HID.cpp.


Member Function Documentation

bool read ( HID_REPORT *  report )

Read a report: blocking.

Parameters:
reportpointer to the report to fill
Returns:
true if successful

Definition at line 38 of file USB_HID.cpp.

bool readNB ( HID_REPORT *  report )

Read a report: non blocking.

Parameters:
reportpointer to the report to fill
Returns:
true if successful

Definition at line 49 of file USB_HID.cpp.

bool send ( HID_REPORT *  report )

Send a Report.

warning: blocking

Parameters:
reportReport which will be sent (a report is defined by all data and the length)
Returns:
true if successful

Definition at line 28 of file USB_HID.cpp.

bool sendNB ( HID_REPORT *  report )

Send a Report.

warning: non blocking

Parameters:
reportReport which will be sent (a report is defined by all data and the length)
Returns:
true if successful

Definition at line 33 of file USB_HID.cpp.