Commit 2ceeeb3
committed
Allow use to choose a different SPI port and also ability to use my FlexSPI code
Added the ability to specify a different SPI port on the begin method.
like
```
ts.begin(SPI1);
```
And use SPI1 for the touch screen.
Also for T4.x as an experiment I added support to allow you to include my FlexIO library including the FlexSPI object :
My library is up at: https://github.com/KurtE/FlexIO_t4
I experimented with my version of Touchpaint_xpt2046;, with using different pins for the touch SPI pins than the display..
On T4.1 I tried using SPI1, with pins that would work for either SPI1 or FlexIO.
For FlexIO I could do:
```
FlexIOSPI SPIFLEX(Touch_MOSI, Touch_MISO, Touch_SCK, -1); // Setup on (int mosiPin, int sckPin, int misoPin, int csPin=-1) :
XPT2046_Touchscreen ts(Touch_CS);
```
And later I would do:
```
ts.begin(SPIFLEX);
```
Or since these are actually SPI1 bpins. could use the defines like before:
```
XPT2046_Touchscreen ts(Touch_CS);
```
And then in setup do:
```
SPI1.setMISO(Touch_MISO);
if (!ts.begin(SPI1)) {
```
Which appeared to work.
I tried adding the use of my flexIO library with the syntax like:
```
#include <FlexIOSPI.h>
'''
So hopefully should not impact non T4 boards nor ones that don't have my libraries.1 parent 26b691b commit 2ceeeb3
2 files changed
Lines changed: 85 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
46 | 66 | | |
47 | 67 | | |
48 | 68 | | |
| |||
100 | 120 | | |
101 | 121 | | |
102 | 122 | | |
103 | | - | |
| 123 | + | |
104 | 124 | | |
105 | 125 | | |
106 | 126 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
121 | 170 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
127 | 175 | | |
128 | 176 | | |
129 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
46 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| |||
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
62 | 76 | | |
63 | 77 | | |
64 | 78 | | |
| |||
0 commit comments