Add plumbing to allow `Wire`, `Serial1`, `SPI1` to map to the 2nd
hardware unit for devices where the PCB layout only brings out the
2nd port.
Fix the Seeedstudio XAIO pins
Fixes#594
Leave the SPI port initted after a transaction, and when a new one comes in
check if it is the same settings we're already running. If so, do nothing.
If not, deinit and reinit. In general the settings will be identical, so
this will speed things up massively.
Fixes#392
Fixes#169
Trying to change pinout while running, or to an illegal configuration,
will now immediately panic() with an error message. Such an attempt
is a pretty big problem since pinouts are hardware related/static.
Prior code would fail silently and return false, but nobody checked
the setXXX return values, anyway.
Fixes#167
For Serial when selecting TinyUSB. Can't include in the core because Arduino IDE
will not link in libraries called from the core. Instead, add the header to all
the standard libraries in the hope it will still catch some user cases where they
use these libraries.
See https://github.com/earlephilhower/arduino-pico/issues/167#issuecomment-848622174
Use a constexpr template to calculate the valid pins for different IO
hardware. This lets us have an easily readable list of pin numbers that
we can adjust/check.