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

Provides source and sink for packets that go over USB HID class. More...

#include <UsbHidPacketizer.h>

+ Inheritance diagram for blfwk::UsbHidPacketizer:
+ Collaboration diagram for blfwk::UsbHidPacketizer:

Public Types

enum  _usbhid_contants {
  kReadFlushTimeoutMs = 100000,
  kPollAbortTimeoutMs = 0,
  kPollAbortTimeoutMs = 0,
  kPollPacketMaxRetryCnt = 50,
  kContinuousReadMargin = 2
}
 Constants.
 

Public Member Functions

 UsbHidPacketizer (UsbHidPeripheral *peripheral, uint32_t readPacketTimeoutMs)
 Default Constructor.
 
virtual ~UsbHidPacketizer ()
 Destructor.
 
virtual status_t readPacket (uint8_t **packet, uint32_t *packetLength, packet_type_t packetType)
 Read a packet. More...
 
virtual status_t writePacket (const uint8_t *packet, uint32_t byteCount, packet_type_t packetType)
 Write a packet. More...
 
virtual void abortPacket ()
 Abort data phase.
 
virtual void sync ()
 Send framing packet ack/nak.
 
virtual void finalize ()
 Finalize.
 
virtual void enableSimulatorPump ()
 Enable simulator command processor pump.
 
virtual void pumpSimulator ()
 Pump simulator command processor.
 
virtual void setAborted (bool aborted)
 Set aborted flag.
 
virtual uint32_t getMaxPacketSize ()
 Returns the max packet size supported.
 
virtual UsbHidPeripheralgetPeripheral ()
 Peripheral accessor.
 
- Public Member Functions inherited from blfwk::Packetizer
 Packetizer (Peripheral *peripheral, uint32_t packetTimeoutMs)
 
standard_version_t getVersion ()
 Get Framing Protocol Version.
 
uint16_t getOptions ()
 Get Framing Protocol Options.
 
void setAbortEnabled (bool isEnabled)
 Set abort packet check enable.
 
bool isAbortEnabled ()
 Check if abort data phase is enabled.
 

Protected Member Functions

virtual void flushInput ()
 Flush input from device.
 
bool pollForAbortPacket ()
 Poll overlapped read for receiver data phase abort.
 

Protected Attributes

bl_hid_report_t m_report
 Used for building and receiving the report.
 
bl_hid_report_t m_abortReport
 Used for received abort report.
 
- Protected Attributes inherited from blfwk::Packetizer
Peripheralm_peripheral
 Peripheral to send/receive bytes on.
 
standard_version_t m_version
 Framing protocol version.
 
uint16_t m_options
 Framing protocol options bitfield.
 
clock_t m_startTime
 Beginning time of packet transaction.
 
uint32_t m_packetTimeoutMs
 
bool m_isAbortEnabled
 True if allowing abort packet. Not used by all packetizers.
 

Detailed Description

Provides source and sink for packets that go over USB HID class.

Member Function Documentation

status_t UsbHidPacketizer::readPacket ( uint8_t **  packet,
uint32_t *  packetLength,
packet_type_t  packetType 
)
virtual

Read a packet.

Provides the address of a buffer containing the packet.

Parameters
packetPointer location to write packet pointer
packetLengthNumber of bytes in returned packet

Implements blfwk::Packetizer.

status_t UsbHidPacketizer::writePacket ( const uint8_t *  packet,
uint32_t  byteCount,
packet_type_t  packetType 
)
virtual

Write a packet.

Parameters
packetPointer to packet to write
byteCountNumber of bytes in packet

Implements blfwk::Packetizer.


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