uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

mexHID write reports in batches #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I was outputting 15-bit words with mexHID, through the 1208FS device to Plexon. 
 It took four reports per word(!):
  * write the low byte
  * write the high byte
  * write the high byte, plus the strobe bit
  * write the high byte to clear the strobe bit

This worked consistently, but seems a bit slow and clumsy.  I think I can get a 
bit faster if I write the sequence of reports within the same call to 
mexHID--perhaps as few as 4 USB frames instead of the 8 I'm seeing now.

So mexHID should write n reports at once, to a device.  The report type and ID 
may be scalar or have n elements.  The report bytes might come as one uint8 
array or an n-element cell array of uint8 arrays.

Alternatively, each reports could come in struct arrays with type, ID, and 
bytes fields.  I'm not sure if this is really easier.

Original issue reported on code.google.com by Benjamin.Heasly on 17 Sep 2010 at 10:43

GoogleCodeExporter commented 8 years ago

Original comment by Benjamin.Heasly on 23 Sep 2010 at 5:46

GoogleCodeExporter commented 8 years ago
I'm going to support reading and writing of multiple reports at once from a 
device.

The currency of reading and writing will be a mxArray struct array, which will 
be validated in the mexHID interface and used elsewhere in place of the 
c-struct mexHIDReportInfo.

Both read and write will take a struct array as inputs, with "type" and "id" 
fields.  Write will require a "bytes" field, as well, and will return a status 
scalar.  Read will create a new struct array with a new "bytes" field filled in.

Both will return a matrix of timing information with a row for each struct 
element.

Original comment by Benjamin.Heasly on 23 Sep 2010 at 7:25

GoogleCodeExporter commented 8 years ago
As of r386, mexHID is dealing with mx struct arrays of report info and reading 
and writing multiple reports in the same call.  The structs have fields "type", 
"ID", and "bytes".

Original comment by Benjamin.Heasly on 24 Sep 2010 at 12:28