dxd - dynax driver framework  3010
cross platform open source driver development framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dx::usb::stream::pin< desc_t, device_t > Class Template Reference

#include <dx_usb_device.h>

+ Inheritance diagram for dx::usb::stream::pin< desc_t, device_t >:
+ Collaboration diagram for dx::usb::stream::pin< desc_t, device_t >:

Public Types

enum  type : unsigned char { type::control =::kUSBControl, type::isoc = ::kUSBIsoc, type::bulk = ::kUSBBulk, type::irq = ::kUSBInterrupt }
 

Public Member Functions

pipeabort ()
 
template<int channels>
pinattach (int **io[2], uint64_t channel_map[(channels+63)/64])
 
 catch (...)
 
 catchall_rethrow () void isoc_housekeeping(volatile uint64_t &rtx
 
pipeclear ()
 
pinflush () noexcept
 
uint64_t frame ()
 
catchall_rethrow() void
transmitted(dx 
if (status||!size)
 
 if (started) this-> transmit(circular->simulate_read<>(size), this->wMaxPacketSize)
 
 if (this->device.monitor())
 
 if (request_idx< ticks) return
 
catchall_rethrow() void
transmitted(dx 
if (started)
 
 if (this->device.monitor()) this-> device.template monitor<>() ->performance[dx::stream::clock::monitor::isr][dx::stream::clock::monitor::tx]=circular->tx-circular->rx
 
pininitialize (unsigned int linesize, unsigned int cycles) try
 creates circular backing store and frame buffers for isoc streaming More...
 
 isoc_housekeeping (circular->rx, timestamp)
 
void launch () noexcept try
 streaming out thread More...
 
pipemax_frame_size (unsigned int frame_size)
 
 operator struct circular * () const noexcept
 
struct circularoperator-> () const noexcept
 
template<typename data_t >
pipeoperator<< (const data_t &data)
 
template<typename data_t >
pipeoperator>> (data_t &data)
 
catchall_rethrow(started=0;) public pin (device_t &device, const dx::stream::open< bulk > &open, const typename desc_t::stream::pin_desc &desc={})
 
 pin (device_t &device, const dx::stream::open< usb::isoc > &open, const typename desc_t::stream::pin_desc &desc={})
 
piperead (void *data, size_t size)
 synchronous USB read request More...
 
pipereceive (void *data, size_t size)
 asynchronous USB read request More...
 
pipereceive (void *data, uint64_t &sequence,::IOUSBIsocFrame *frame, int frames=1)
 asynchronous USB isoc read request More...
 
void received (dx::os_result status, size_t size) override try
 
void received (dx::os_result status, size_t size, int64_t timestamp) override try
 
pinstart ()
 
pinstop (bool force=false)
 
pipetransmit (const void *data, size_t size)
 asynchronous USB write request More...
 
pipetransmit (const void *data, uint64_t &sequence,::IOUSBIsocFrame *frame, int frames=1)
 asynchronous USB isoc write request More...
 
pipewrite (const void *data, size_t size)
 synchronous USB write request More...
 
 ~pin () noexcept
 

Public Attributes

std::deque< audio
<>::descriptor::endpoint > 
audio
 
this zero count
 
int64_t last_timestamp = circular->timestamp
 signals new data availability to interested kernel parties, More...
 
int64_t timestamp noexcept
 
unsigned int request_idx = 0
 
 request_idx = 0
 
circular timestamp = timestamp
 
this zero timestamp = timestamp
 
enum dx::usb::pipe::type type
 
unsigned int micro_frames = 0
 

Private Member Functions

void initialize (unsigned int samplerate, unsigned line_size, unsigned int micro_frames)
 

Private Attributes

struct
dx::usb::audio::isoc::cycle::tick
tick = nullptr
 
unsigned int ticks = 0
 

Member Enumeration Documentation

template<typename device_t = device>
enum dx::usb::pipe::type : unsigned char
stronginherited
Enumerator
control 
isoc 
bulk 
irq 

Constructor & Destructor Documentation

template<typename desc_t , typename device_t = device<desc_t>>
catchall_rethrow (started= 0;) public dx::usb::stream::pin< desc_t, device_t >::pin ( device_t &  device,
const dx::stream::open< bulk > &  open,
const typename desc_t::stream::pin_desc &  desc = {} 
)
inline
template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::pin ( device_t &  device,
const dx::stream::open< usb::isoc > &  open,
const typename desc_t::stream::pin_desc &  desc = {} 
)
inline
template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::~pin ( )
inlinenoexcept

+ Here is the call graph for this function:

Member Function Documentation

template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::abort ( )
inlineinherited
template<typename desc_t , typename device_t = device<desc_t>>
template<int channels>
pin& dx::usb::stream::pin< desc_t, device_t >::attach ( int **  io[2],
uint64_t  channel_map[(channels+63)/64] 
)
inline
template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::catch (   ...)
inline
template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::catchall_rethrow ( ) volatile
Todo:
generally pre-increment isoc.cycle_idx and do isoc_housekeeping before rtx re-scheduling
template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::clear ( )
inlineinherited
template<typename desc_t , typename device_t = device<desc_t>>
pin& dx::usb::stream::pin< desc_t, device_t >::flush ( )
inlinenoexcept
template<typename device_t = device>
uint64_t dx::usb::pipe< device_t >::frame ( )
inlineinherited

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
catchall_rethrow () void transmitted (dx dx::usb::stream::pin< desc_t, device_t >::if ( status||!  size)
inline

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::if ( started  ) -> transmit(circular->simulate_read<>(size), this->wMaxPacketSize)
template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::if ( this->device.  monitor())
inline

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::if ( )
template<typename desc_t , typename device_t = device<desc_t>>
catchall_rethrow () void transmitted (dx dx::usb::stream::pin< desc_t, device_t >::if ( started  )
inline

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::if ( this->device.  monitor()) -> device.template monitor<>() ->performance[dx::stream::clock::monitor::isr][dx::stream::clock::monitor::tx]=circular->tx-circular->rx
template<typename desc_t , typename device_t = device<desc_t>>
pin& dx::usb::stream::pin< desc_t, device_t >::initialize ( unsigned int  linesize,
unsigned int  cycles 
)
inline

creates circular backing store and frame buffers for isoc streaming

generates isoc cycle metrics from sample rate,

update max frame size

Todo:
reset max frame size when pipe is closed

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::isoc_housekeeping ( circular->  rx,
timestamp   
)
template<typename desc_t , typename device_t = device<desc_t>>
void dx::usb::stream::pin< desc_t, device_t >::launch ( )
inlinenoexcept

streaming out thread

+ Here is the call graph for this function:

template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::max_frame_size ( unsigned int  frame_size)
inlineinherited
template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::operator struct circular * ( ) const
inlinenoexcept
template<typename desc_t , typename device_t = device<desc_t>>
struct circular* dx::usb::stream::pin< desc_t, device_t >::operator-> ( ) const
inlinenoexcept
template<typename device_t = device>
template<typename data_t >
pipe& dx::usb::pipe< device_t >::operator<< ( const data_t &  data)
inlineinherited
template<typename device_t = device>
template<typename data_t >
pipe& dx::usb::pipe< device_t >::operator>> ( data_t &  data)
inlineinherited
template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::read ( void *  data,
size_t  size 
)
inlineinherited

synchronous USB read request

template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::receive ( void *  data,
size_t  size 
)
inlineinherited

asynchronous USB read request

template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::receive ( void *  data,
uint64_t sequence,
::IOUSBIsocFrame *  frame,
int  frames = 1 
)
inlineinherited

asynchronous USB isoc read request

template<typename desc_t , typename device_t = device<desc_t>>
void dx::usb::stream::pin< desc_t, device_t >::received ( dx::os_result  status,
size_t  size 
)
inlineoverridevirtual

Reimplemented from dx::usb::pipe< device_t >.

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
void dx::usb::stream::pin< desc_t, device_t >::received ( dx::os_result  status,
size_t  size,
int64_t  timestamp 
)
inlineoverridevirtual

Reimplemented from dx::usb::pipe< device_t >.

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
pin& dx::usb::stream::pin< desc_t, device_t >::start ( )
inline

estimate upcoming timestamp

Todo:
compute timestamp in ticks (not nsec)!

scheduling all but one isoc requests at least 1 sequence ahead; aligned to whole cycles,

+ Here is the call graph for this function:

template<typename desc_t , typename device_t = device<desc_t>>
pin& dx::usb::stream::pin< desc_t, device_t >::stop ( bool  force = false)
inline
template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::transmit ( const void *  data,
size_t  size 
)
inlineinherited

asynchronous USB write request

template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::transmit ( const void *  data,
uint64_t sequence,
::IOUSBIsocFrame *  frame,
int  frames = 1 
)
inlineinherited

asynchronous USB isoc write request

template<typename device_t = device>
pipe& dx::usb::pipe< device_t >::write ( const void *  data,
size_t  size 
)
inlineinherited

synchronous USB write request

Member Data Documentation

std::deque<audio<>::descriptor::endpoint> dx::usb::__endpoint::audio
inherited
template<typename desc_t , typename device_t = device<desc_t>>
this zero dx::usb::stream::pin< desc_t, device_t >::count
template<typename desc_t , typename device_t = device<desc_t>>
int64_t dx::usb::stream::pin< desc_t, device_t >::last_timestamp = circular->timestamp

signals new data availability to interested kernel parties,

signals user events of all user client attached to this stream

Todo:
move isoc user data event signaling out of isoc_housekeeping to allow signaling in case of resceduling error

writes timestamp

template<typename device_t = device>
unsigned int dx::usb::pipe< device_t >::micro_frames = 0
inherited
template<typename desc_t , typename device_t = device<desc_t>>
int64_t timestamp dx::usb::stream::pin< desc_t, device_t >::noexcept
Initial value:
{
template<typename desc_t , typename device_t = device<desc_t>>
unsigned int dx::usb::stream::pin< desc_t, device_t >::request_idx = 0
template<typename desc_t , typename device_t = device<desc_t>>
dx::usb::stream::pin< desc_t, device_t >::request_idx = 0
template<typename desc_t , typename device_t = device<desc_t>>
circular dx::usb::stream::pin< desc_t, device_t >::timestamp = timestamp
template<typename desc_t , typename device_t = device<desc_t>>
this zero dx::usb::stream::pin< desc_t, device_t >::timestamp = timestamp
template<typename device_t = device>
enum dx::usb::pipe::type dx::usb::pipe< device_t >::type
inherited

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

(c) copyright 2009 dynamic acoustics e.U. generated on Tue Dec 10 2019

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.