KurtE
Senior Member+
I am about to make another pass through my SPIN library to update it to make use of the new features and functionality of the newer SPI library, as portions of SPIN have logically now migrated into the main SPI library. Like one class to handle all SPI objects, like knowing which pins are valid for CS or MISO, MOSI, SCK...
It would be nice to be able to obsolete SPIN. Some of the features still in SPIN, not in SPI include:
Easy way to get to the SPI registers for the selected SPI port. This could be done by making the port() method public...
FIFO support - My motivation and test of the T3.6/5 and my first test was the ILI9341 display so I started form ili9341_t3 library, and extracted all of the stuff that was SPI port specific... Some of this was the FIFO stuff of the library, like pushing stuff onto the queue (PUSHR) and make sure it is not full, likewise check for popping things off of queue (POPR)...
Then made them work with ILI9341 code for all three busses. Where I found out the code relies on SPI queue size of 4... So I needed to modify as SPI1 and SPI2 have a queue size of 1... So code hung...
Recently I realized that some of this queue code has also been put into another header file (SPIFIFO.h), that is part of core. However this code again is hard coded for SPI object (KINETISK_SPI0) and also again code is hard coded to only work for queue size of 4. With lines like:
while (((KINETISK_SPI0.SR) & (15 << 12)) > (3 << 12))
So trying to figure out options, would be great if all of these could converge into one thing...
For now I will update SPIN... Wondering if SPIFIFO should be updated? Three classes? Or one class that is driven off of SPI class object?
Also FYI, I see three references to SPIFIFO1class in avr_emulation.h (friend class SPIFIFO1class
and I don't think that class exists... Probably me in early 3.6 days...
There are also other SPI libraries as well, like DMASpi and maybe slave support, but these are probably separate subjects.
Thoughts?
It would be nice to be able to obsolete SPIN. Some of the features still in SPIN, not in SPI include:
Easy way to get to the SPI registers for the selected SPI port. This could be done by making the port() method public...
FIFO support - My motivation and test of the T3.6/5 and my first test was the ILI9341 display so I started form ili9341_t3 library, and extracted all of the stuff that was SPI port specific... Some of this was the FIFO stuff of the library, like pushing stuff onto the queue (PUSHR) and make sure it is not full, likewise check for popping things off of queue (POPR)...
Then made them work with ILI9341 code for all three busses. Where I found out the code relies on SPI queue size of 4... So I needed to modify as SPI1 and SPI2 have a queue size of 1... So code hung...
Recently I realized that some of this queue code has also been put into another header file (SPIFIFO.h), that is part of core. However this code again is hard coded for SPI object (KINETISK_SPI0) and also again code is hard coded to only work for queue size of 4. With lines like:
while (((KINETISK_SPI0.SR) & (15 << 12)) > (3 << 12))
So trying to figure out options, would be great if all of these could converge into one thing...
For now I will update SPIN... Wondering if SPIFIFO should be updated? Three classes? Or one class that is driven off of SPI class object?
Also FYI, I see three references to SPIFIFO1class in avr_emulation.h (friend class SPIFIFO1class
There are also other SPI libraries as well, like DMASpi and maybe slave support, but these are probably separate subjects.
Thoughts?