The buffer transfer now uses FIFO queues,
Currently it only outputs the 8 bits per entry, unlike the T3.x version which packed the bytes into words in order to speed up some more.
Warning this change uses the updates I did in core library to define a
SPI structure for the T4...
The code now uses this structure as wlll as pointer to it passed in to constructor to talk to the SPI registers.
Also Miso, Mosi and SCK pins are defined in Hardware structure which again is passed in to constructor... Still a few more things to cleanup in ::begin to make it completely independant of the hardware such that I can define SPI1 as well...
Some libraries actually call this. So define the Hardware data for the one pin for each of the MISO, MOSI, SCK and CS...
So far setting does nothing.
Enough to get Sparkfun Teensyview to build, other than example uses String class which is not included in link phase.
Made the SPI code work like the old stuff where you could set the miso/mosi/sck pins after the begin.
Some people actually used this for changing SPI on the fly to use multiple sets of pins
The current table code was setup that when we choose a specific pin for MOSI or Miso or SCK (or CS), that the only thing set at the time was the MUX value.
Well the old enable_pins that was called off of the enumlated register was setting the PORT_PCR_DSE option on pins 11 and 13...
So to fix it, I have the table, allow you to fully set the options for each pin.
Still have most all of them just setting the MUX, but do have pins 11 and 13 setting the PCR_DSE option to be compatible with old code.
Experiment with making the whole transfer of the buffer act like it is
to logically hold the CS pins for that whole transfer. This removes
gaps between each 16 bit transfer.
Update SPI.transfer(buf, cnt) to use the FIFO queue to speed things up.
It also speeds things up to pack the data into 16 bit transfers instead
of 8 bits.
As this code is more complicated, no longer makes sense to inline it,
so functions moved from .h to .cpp files.
SPI1 and SPI2 transfer functions were updated as well for T3.5 and T3.6
These changes plus some changes in core (added register defines, plus
added logical SPCR1 register), allowed me to do quick hack to
serialFlash library and test and initialize flash memory using 3.5 test
board connected to prop shield using pins 0, 1, 20 and 6