|
1 | 1 | Overview and Warning: |
2 | 2 | ===== |
| 3 | +This Arduino library is for driving ILI9341 displays on Teensy 3.x or 4.x boards from |
| 4 | +PJRC(https://www.pjrc.com/) and I have played with it on a few different |
| 5 | +ILI9341 displays including ones from PJRC such as: https://www.pjrc.com/store/display_ili9341_touch.html and ones from Adafruit such as: https://www.adafruit.com/product/1770 |
| 6 | + |
3 | 7 | This is a modified version of the official PJRC ILI9341_t3 library (https://github.com/PaulStoffregen/ILI9341_t3). |
4 | 8 | And it is always a Work In Progress. |
5 | 9 |
|
| 10 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 11 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 12 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 13 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 14 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 15 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 16 | +SOFTWARE. |
| 17 | + |
| 18 | + |
6 | 19 | This library borrows some concepts and functionality like the usage of DMA from another variant library: https://github.com/FrankBoesing/ILI9341_t3DMA |
7 | 20 |
|
8 | 21 | This library was originally created to be able to test out SPI on the newer Teensy boards (3.5 and 3.6), which have multiple SPI busses. Later it was |
9 | 22 | also adapted to allow this on the Teensy LC as well. |
10 | 23 |
|
11 | 24 |
|
12 | | -SPIN |
| 25 | +Constructor and begin |
13 | 26 | ---- |
| 27 | +This library was developed to allow you to use any of the SPI busses on a Teensy 3.x or 4.x processor. |
| 28 | +It detects this by looking at which pins were specified on the constructor. |
14 | 29 |
|
15 | | -This version no longer uses or requires my SPIN library. |
16 | | -Currently this library uses my SPIN library (https://github.com/KurtE/SPIN), which allows me to use different SPI busses. |
17 | | - |
18 | | -As such it no longer accepts a SPIN object to be passed in to the constructor. |
| 30 | +``` |
| 31 | + ILI9341_t3n(uint8_t _CS, uint8_t _DC, uint8_t _RST = 255, uint8_t _MOSI = 11, |
| 32 | + uint8_t _SCLK = 13, uint8_t _MISO = 12); |
| 33 | +``` |
19 | 34 |
|
20 | | -However there is code in place that when the begin method is called. The paremeters passed in for MISO/MOSI/SCK are |
21 | | -checked to see if they are valid for the SPI object. If so SPI is used. If not and the board type has SPI1, it will check to |
| 35 | +When the begin method is called. The parameters passed in for MISO/MOSI/SCK are checked to see if they are valid |
| 36 | +for the SPI object. If so SPI is used. If not and the board type has SPI1, it will check to |
22 | 37 | see if those pins are valid for SPI1 and if so use SPI1, if not if there is an SPI2, it will check... |
| 38 | +``` |
| 39 | + void begin(uint32_t spi_clock = ILI9341_SPICLOCK, |
| 40 | + uint32_t spi_clock_read = ILI9341_SPICLOCK_READ); |
| 41 | +``` |
23 | 42 |
|
24 | | - |
25 | | -In addition, this code allows the ILI9341 code to work with only one hardware CS pin available, |
26 | | -which in this case must be used for the DC pin. This is very useful to support SPI1 on the new T3.5 and T3.6 boards which only |
| 43 | +In addition, On Teensy 3.x boards, this code allows the ILI9341 code to work with only |
| 44 | +one hardware CS pin available, which in this case must be used for the DC pin. |
| 45 | +This is very useful to support SPI1 on the T3.5 and T3.6 boards which only |
27 | 46 | have one CS pin unless you use some form of adapter to use the SPI pins that are on the SDCARD. |
28 | 47 |
|
| 48 | +On Teensy 4.x including the Sparkfun Micromod Teensy, you are free to use any digital pin for CS and DC, but you might |
| 49 | +get a modest speed increase if hardware CS pin is used for the DC signal. |
| 50 | + |
| 51 | + |
29 | 52 | Frame Buffer |
30 | 53 | ------------ |
31 | | -The teensy 3.6 and now 3.5 and now the T4.0 have a lot more memory than previous Teensy processors, so on these boards, I borrowed some ideas from the ILI9341_t3DMA library and added code to be able to use a logical Frame Buffer. To enable this I added a couple of API's |
| 54 | +The teensy 3.6 and now 3.5 and now the T4.x have a lot more memory than previous Teensy processors, so on these boards, |
| 55 | +I borrowed some ideas from the ILI9341_t3DMA library and added code to be able to use a logical Frame Buffer. |
| 56 | +To enable this I added a couple of API's |
32 | 57 | ```c++ |
33 | 58 | uint8_t useFrameBuffer(boolean b) - if b non-zero it will allocate memory and start using |
34 | 59 | void freeFrameBuffer(void) - Will free up the memory that was used. |
|
0 commit comments