Attached is a "sketch" and python program to demonstrate use of the RAWHID.
The sketch demonstrates data transfers in both directions and simple command processing. The python side includes an optional queue, using either thread or multiprocess, to handle rapid or asynchronous data from the teensy to the host computer. The read() is agnostic of whether the packets are being stored onto the queue .
The use cases here are related to data acquisition. I use the Teensy to implement a gated spectrometer and a high end analog and digital I/O card. So far, the RAWHID interface, compared to the serial interface, seems to resolve problems with fast and large data transfers.
The sketch demonstrates data transfers in both directions and simple command processing. The python side includes an optional queue, using either thread or multiprocess, to handle rapid or asynchronous data from the teensy to the host computer. The read() is agnostic of whether the packets are being stored onto the queue .
The use cases here are related to data acquisition. I use the Teensy to implement a gated spectrometer and a high end analog and digital I/O card. So far, the RAWHID interface, compared to the serial interface, seems to resolve problems with fast and large data transfers.