A library for reading/wring data via USB-UART adapters
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
usbuart::generic Class Reference

implementation of common driver methods More...

Inherits usbuart::driver.

Inherited by usbuart::ch34x, usbuart::ftdi, and usbuart::pl2303.

Public Member Functions

void read_callback (libusb_transfer *, size_t &pos) noexcept
 called on read transfer completion must fill pos with position of first payload data return true if transfer resubmitted
void write_callback (libusb_transfer *) noexcept
 called on write transfer completion
void prepare_write (libusb_transfer *) throw (error_t)
 called before first byte is actually written to xfer buffer so that the driver can place hardware specific payload, (if any)
const interfacegetifc () const noexcept
void sendbreak () const throw (error_t)
 Send break.
void reset () const throw (error_t)
 set baud rate only, keep other protocol properties intact
libusb_device_handle * handle () const noexcept
 Returns handle of associated USB device.
- Public Member Functions inherited from usbuart::driver
virtual void setbaudrate (baudrate_t) const =0 throw (error_t)
 set baud rate only, keep other protocol properties intact

Static Public Attributes

static constexpr unsigned default_timeout = 5000

Protected Member Functions

 generic (libusb_device_handle *handle, const interface &_ifc, uint8_t num=0) throw (error_t)
void setup (const eia_tia_232_info &) const throw (error_t)
 setup protocol on the hardware level
void control (uint8_t, uint8_t, void *, size_t) const throw (error_t)
void write_cv (uint8_t r, uint16_t v, uint16_t i) const throw (error_t)
void read_cv (uint8_t, uint16_t, uint8_t &) const throw (error_t)
void read_cv (uint8_t, uint16_t, uint16_t &) const throw (error_t)
void claim_interface () const throw (error_t)
void release_interface () const noexcept

Protected Attributes

libusb_device_handle *const dev
interface const & ifc
const uint8_t ifcnum
unsigned timeout

Detailed Description

Definition at line 126 of file usbuart.hpp.

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