koendv / SerialWireOutput

Serial Wire Output (SWO) library for STM32duino arm Arduinos
21 stars 3 forks source link

Binary data output format #2

Closed Gasman2014 closed 4 years ago

Gasman2014 commented 4 years ago

At present the SWO output is string formatted only. Would it be possible to add a direct binary write format output too? I was hoping to graph some of the SWO outputs and the graphing system expects actual binary data to be sent over - so say if you were using 8 bit values then each value would be one single byte sent over with the actual value (so 0x00 0x01 0x02. Is it possible to add 8 & 16 bit binary outputs?

koendv commented 4 years ago

Yes and no. SWO can send data 1, 2 or 4 bytes at a time. You can specify what gets sent from your arduino source. With ch a char and str an array of char:

But there is always a header byte sent first. The header byte says how many data bytes follow and what channel the data bytes are in.