Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
blfwk::UsbHidPeripheral Class Reference

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.
 

Detailed Description

Represents a USB HID peripheral.

Interface class for objects that provide the source for commands or sink for responses.

Member Enumeration Documentation

Constants.

Enumerator
kDefault_Vid 

Freescale VID.

kDefault_Pid 

PID for KL25Z48M.

Constructor & Destructor Documentation

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.

Parameters
vendor_idThe Vendor ID of the USB HID device.
product_idThe Product ID of the USB HID device.
serial_numberThe Serial Number of the USB HID device.

Member Function Documentation

status_t UsbHidPeripheral::read ( uint8_t *  buffer,
uint32_t  requestedBytes,
uint32_t *  actualBytes,
uint32_t  timeoutMS 
)
virtual

Read bytes.

Parameters
bufferPointer to buffer
requestedBytesNumber of bytes to read
timeoutMsTime in milliseconds to wait for read to complete.
actualBytesNumber of bytes actually read.

Implements blfwk::Peripheral.

status_t UsbHidPeripheral::write ( const uint8_t *  buffer,
uint32_t  byteCount,
uint32_t  timeoutMS 
)

Write bytes.

Parameters
bufferPointer to buffer to write
byteCountNumber of bytes to write
timeoutMsTime in milliseconds to wait for write to complete.

The documentation for this class was generated from the following files: