I’ve tried to make it as generic as possible.
- SW1 is a four position switch
- #0 - no connection (with test point that can inject custom voltage if required)
- #1 - USB 5v. Bus is powered with 5v from the USB (useful for bench testing)
- #2 - LDO 5v. Bus is powered with 5v using a LDO to regulate down vehicle 12v power
- #3 - 12v. Bus is powered from vehicle 12v
- S1 is a on/off switch. When on, it adds a diode+resistor to the K-Line (which is required by some cars for K-line tools being master).
- Test points everywhere, to help debugging
For roadster, SW1 is #2 and S1 is off.
It is exposed to the ESP32 as an async port, at 3.3v levels. But the transceiver handles the bus at 5v or 12v. It works with K-line, and should also work with LIN, if required. EGPIO8 is used to enabled/disable the transceiver (normally disabled).
Regards, Mark.
P.S. Circuit schematic attached.