Fixed the Serial2 object to use the new correct pins, plus made Serial8 only valid for T4 B1 (not B2).
Also I defined IO pins for the six signals associated with the SD Card slot.
I have tested these both as IO pins and now as SPI2
Allow the user to call setTX with the one hardware pin, and hopefully allow them to turn on Open Drain mode or turn it back off. I don't currently have any test cases that use this, so not sure how well it works.
Add some support for serialEventX calls when yield is called.
Currently keep table of which SerialX objects are Used (.begin called) and each has their own function which does the
if (Serial1.available()) serialEvent1();
Calling SerialX.end(), removes the call from the list. Also the default weak pointer serialEventX functions call the disable function, as to only be called once as no one is actually processing them...
At some point will integrate this with EventResponder
Put in first pass at SerialX.end(),
Which should disable the Serial object, and I believe set the IO pins to be GPIO pins.
Also defined the extern void SerialEvent1() like functions in header in preperation for callbacks...
Fleshing out some of the missing pieces. - Need to test
copy NVIC execution priority from T3
Set priority per Serial object
RTS pin
CTS pin - only Serial3 supports
setRX, setTX - do nothing none of these have two pins defined.
Maybe temporary - but added from previous code ability to add second buffer for RX and TX
Used macros from OneWIre to fast set/clear the optional Transmitter Enable support.
Also fixed bug in ISR where was not properly looking for TC. This will help make SerialX->flush() to work
This pass has some more support for using the Hardware Serial objects.
Including setting an ISR for doing both reads and writes, sets up the FIFO,
Sitll lots more work to go.
Things like: fifo - need to better understand/set watermarks, also RX need to read in more than one byte if more available.
Also support fo r other features, like formats, 9 bit, ...
BUt at least you can do simple reads/writes