{"push_id":600166702,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"1764c6f8ba715c2e05be9140ab78297560da7e7b","before":"4e2e1500bbb44e2fdf16f9137c82d329bb9b047b","commits":[{"sha":"1764c6f8ba715c2e05be9140ab78297560da7e7b","author":{"email":"aa743a0aaec8f7d7a1f01442503957f4d7a2d634@davidthings.com","name":"David Williams"},"message":"Added support for Single Wire serial mode to the three hardware serial ports, Serial1, Serial2, &\nSerial3.  Codewise, there are a small handful of changes to implement this.  In the initialization\nof the port, several bits are set to tell the UART to do Single Wire mode (LOOPS, RSRC) and the\ninitial pin direction (TXDIR) is set to 0 (receive).  Then, each time the transmitter starts up,\nserial_putchar() and serial_write() for Serial1 and Serial2 only, TXDIR is set to transmit.  In\nthe ISR, when transmission is ended, TXDIR is returned to the receive direction.\n\nAll 36 format settings have not been tested, however, 8N1 has been tested on all three ports in\nboth Single Wire and non-Single Wire modes.  It is hoped that having a #define remove all trace\nof the Single Wire modifications helps to offset the impact of any more complex interactions.\n\nUsing this mode is very simple.  Connect the TX pin of your Teensy serial port to the appropriate\npin of another device implementing single wire mode. Then uncomment the SERIAL_SINGLEWIRE_SUPPORT\ndefine in HardwareSerial.h (in ... arduino/hardware/teensy/avr/cores/teensy3).  In your code, open\nthe correct Serial port with the speed and format desired, adding \"_SINGLEWIRE\" to the format\nspecifier.  For example\n\n  Serial1.begin( 1500000, SERIAL_8N1_SINGLEWIRE );\n\nAnd use the serial port as usual.  All the switching of TX and RX is done automatically and there\nis no loop back from TX back into RX again.","distinct":true,"url":"https://api.github.com/repos/davidthings/cores/commits/1764c6f8ba715c2e05be9140ab78297560da7e7b"}]}