Working on new constructor addition, what do you think?
Code:
SPI_MSTransfer teensy_serial = SPI_MSTransfer("Serial", 43, &SPI2, 30000000);
SPI_MSTransfer teensy_serial2 = SPI_MSTransfer("Serial2", 43, &SPI2, 10000000);
you could assign different frequencies to differents ports and slaves
in this case Serial2 would be accessed at 10MHz and SerialUSB would be accessed at 30 MHz (for same slave)
in a multi-slave scenario, you could run the slaves at different clocks, so long range wiring would be possible to lower the frequency and not affect other slaves
as an example, we could set a default of 4MHz until overwritten:
Code:
SPI_MSTransfer teensy_gpio = SPI_MSTransfer("Serial", 43, &SPI2, 30000000);
SPI_MSTransfer teensy_gpio2 = SPI_MSTransfer("Serial2", 43, &SPI2);
1st would set a specified bus speed, 2nd would default to 4MHz since none defined (we don't know 'other' user uses, so a basic low frequency can help, especially if they have wiring issues)
Also possibly adding debugging method as well:
teensy_gpio.debug(Serial);
Not calling this should suppress slave & master debugging if you run it at either end
well, for slave end it would be slave.debug(Serial)
for master, use any object call to it