Well your idea was to free up SPI0 for LCD FIFO usage, or host a slave on another port so user can control SPI instead of SPI1 (like some hardcoded libraries using SPI)
Either way, by encouraging the development on SPI1, and the memory map from kinetis.h, was able to open up all port possibilities, at the same time i learned how to use memory addresses and not just registers, to solve issues around multiple port accesses, as well as comparing 2 class references to detect the port being passed in to do the proper setup procedure for that specific port
also the slave library can further limit other peripheral accesses your not using to conserve space on the LC, like Wire, Serial, additional SPI remote usage, by having them undefined (in case you dont use them) those core libraries/functions wont be compiled
example, you can define serial1 to be used by the master and undefine the serial2 etc, each serial port control takes ~ 1k memory usage, ideally with a 3.5/3.6, you can have all features available, but 3.2/LC can be limited to save memory
The master side will be stripped down based on the github version, but not until the slave has a good run.
I suppose we should start a separate repo now for the slave driver?
they cant be inside the same folder, as both files have the same SPI_MSTransfer class...
The compiler will complain
I suppose I should match the class to the filename?
“SPI_MSTransfer” —> “SPI_MSTransfer_Slave” ?
Since the slave self-instantiates “slave” object when “included”, changing the class inside the slave files wont affect sketch code, then perhaps we can have both master and slave in same repo?
Code:
[ATTACH]13787._xfImport[/ATTACH]
Heres the new slave file with the renamed class ("SPI_MSTransfer_Slave"). The master will stay the same class ("SPI_MSTransfer"). It should compile with the future master in the same folder, provided I take the slave's globals out of the master side so they wont be seen as duplicates to throw off the compiler.