The main ili9341_t3 library requires 2 unique hardware CS pins, one for CS and other DC. When I say unique it is because there are something like 5 or 6 max hardware cs pins (per SPI bus), To use these you encode which one(s) you wish to use when you do a pushr to the SPI. But some of these cs channels may have multiple IO pins that can be used for that channel. So for example if you look at the SPI class you will see a function pinIsChipSelect
Code:
uint8_t SPIClass::pinIsChipSelect(uint8_t pin)
{
switch (pin) {
case 10: return 0x01; // PTC4
case 2: return 0x01; // PTD0
case 9: return 0x02; // PTC3
case 6: return 0x02; // PTD4
case 20: return 0x04; // PTD5
case 23: return 0x04; // PTC2
case 21: return 0x08; // PTD6
case 22: return 0x08; // PTC1
case 15: return 0x10; // PTC0
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
case 26: return 0x01;
case 45: return 0x20; // CS5
#endif
}
return 0;
}
So pins 9 and 10 work as they map to different bits in the mask. But for example you can not use 21 with 22 as they both map to 0x8
My ili9341_t3n library I did the updates to allow it to work on all three SPI buses of the T3.6. But ran into issue that unless you take over the SDCard pins SPI1 only has 1 cs pin exposed... So I updated the library.
long story short: the ili9341_t3 library gains it speed by encoding both of these pins into the SPI registers. It gains it's biggest speed by allowing you to encode the DC pin into the command and not on the data outputs, such that if a command has something like: <cmd> x1 x2 <cmd> y1 y2 <cmd> color
As one logical command, such as setting a pixel, We can push the first command on with both bits set, then push x1 with just CS set... And not have to wait for the queue to empty to toggle the DC bits. The CS more or less stays set for the whole logical output. So really did not lose much by having the ability to simply do a digitalWrite(CS, LOW) at the start and HIGH at the end and simply encode the DC...
My changes are up in my github/kurte/ili9341_t3n library which also requires my spin library. I have done the changes to allow this to the main library (still only SPI) and it is part of an outstanding pull request to main library.