![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Represents a USB HID peripheral. More...
#include <UsbHidPeripheral.h>
Inheritance diagram for blfwk::UsbHidPeripheral:
Collaboration diagram for blfwk::UsbHidPeripheral:Public Types | |
| enum | _usbhid_contants { kDefault_Vid = 0x15a2, kDefault_Pid = 0x0073 } |
| Constants. More... | |
Public Types inherited from blfwk::Peripheral | |
| enum | _host_peripheral_types { kHostPeripheralType_None, kHostPeripheralType_UART, kHostPeripheralType_BUSPAL_UART, kHostPeripheralType_USB_HID, kHostPeripheralType_SIM } |
Public Member Functions | |
| UsbHidPeripheral () | |
| Default constructor. More... | |
| UsbHidPeripheral (unsigned short vendor_id, unsigned short product_id, const char *serial_number) | |
| Parameterized constructor. More... | |
| virtual | ~UsbHidPeripheral () |
| Destructor. | |
| virtual status_t | read (uint8_t *buffer, uint32_t requestedBytes, uint32_t *actualBytes, uint32_t timeoutMS) |
| Read bytes. More... | |
| virtual status_t | write (const uint8_t *buffer, uint32_t byteCount) |
| Write bytes. This is a do nothing function implemented here to satisfy abstract base class requirements. This function is not used. The write(buffer, count, timeout) function is used in this child class instead of the write(buffer, cout) function declared in the base class. | |
| status_t | write (const uint8_t *buffer, uint32_t byteCount, uint32_t timeoutMS) |
| Write bytes. More... | |
| unsigned short | getVendorId () |
| Return USB Vendor ID. | |
| unsigned short | getProductId () |
| Return USB Product ID. | |
| const wchar_t * | getSerialNumber () |
| Return USB Serial Number. | |
Represents a USB HID peripheral.
Interface class for objects that provide the source for commands or sink for responses.
| UsbHidPeripheral::UsbHidPeripheral | ( | ) |
Default constructor.
Uses vendor_id = kDefault_Vid and product_id = kDefault_Pid.
| UsbHidPeripheral::UsbHidPeripheral | ( | unsigned short | vendor_id, |
| unsigned short | product_id, | ||
| const char * | serial_number | ||
| ) |
Parameterized constructor.
| vendor_id | The Vendor ID of the USB HID device. |
| product_id | The Product ID of the USB HID device. |
| serial_number | The Serial Number of the USB HID device. |
|
virtual |
Read bytes.
| buffer | Pointer to buffer |
| requestedBytes | Number of bytes to read |
| timeoutMs | Time in milliseconds to wait for read to complete. |
| actualBytes | Number of bytes actually read. |
Implements blfwk::Peripheral.
| status_t UsbHidPeripheral::write | ( | const uint8_t * | buffer, |
| uint32_t | byteCount, | ||
| uint32_t | timeoutMS | ||
| ) |
Write bytes.
| buffer | Pointer to buffer to write |
| byteCount | Number of bytes to write |
| timeoutMs | Time in milliseconds to wait for write to complete. |