Corrections/improvements to the online documentation:
New addition, based on pages 2899 - 2900 of the datasheet:
Please add
- Please add
SerialX.write(buffer, size)to the online documentation. The overload exists, according to Arduino IDE's autocomplete, but the online doc doesn't mention it yet; onlySerialX.write(byte). That by itself would have saved some frustration. - Likewise for
SerialX.readBytes(). - Please mention the default buffer size, above which
SerialX.addMemoryFor...()should be used. Right now, it's ambiguous except for just happening to stumble onto a post in a different thread that is only tangentially related:
New addition, based on pages 2899 - 2900 of the datasheet:
Please add
SerialX.configureBreak(), SerialX.sendBreak(), SerialX.sendIdle(), and SerialX.recvBreak() as new functions. (rename if something else works better) Assuming that all of these functions are non-blocking and only add to a buffer, this would allow easy synchronous timing, like:-
C:
void setup() { ... SerialX.configureBreak(...); //translates into Table 49-2 on pages 2899 - 2900. ... } -
C:
//hypothetical message, showing general use if (trigger) { trigger = false; SerialX.write(buffer1, size1); //setup SerialX.sendIdle(); //give the receiving end one byte time to self-configure SerialX.write(buffer2, size2); //data SerialX.sendBreak(); //end of message //continues immediately, //without waiting for any of it to appear on the wire } -
C:
//synchronous DMX, as opposed to free-running asynchronous that most libraries do if (trigger) { trigger = false; SerialX.sendBreak(); SerialX.write(dmx_out, 513); } //or if (trigger) { trigger = false; SerialX.sendBreak(); SerialX.write(dmx_out_start_code); SerialX.write(dmx_out, 512); } -
C:
//receive a message if (SerialX.recvBreak()) { timeout = 0; fresh_data = SerialX.readBytes(dmx_in, 513); } - Etc.