acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

Setup33_RPi_ILI9486_STM32.h (3236B)

      1         ///////////////////////////////////////////////////
      2         //  Setup for STM32 Nucleo and ILI9341 display   //
      3         ///////////////////////////////////////////////////
      4 #define USER_SETUP_ID 33
      5 
      6 // Last update by Bodmer: 28/11/19
      7 
      8 // STM32 optimised functions are not yet compatible with STM32H743 processor.
      9 // The STM32H743 does work with the slower generic processor drivers
     10 //
     11 // REMINDER - Nucleo-F743ZI and Nucleo-F743ZI2 have different pin port allocations
     12 // and require appropriate selection in IDE. ^---- Note the extra 2 in part number!
     13 
     14 
     15 // Define STM32 to invoke STM32 optimised driver (optimised fns only tested on STM32F767 so far)
     16 // so you may need to comment this out
     17 #define STM32
     18 
     19 // Define the TFT display driver
     20 #define RPI_DISPLAY_TYPE
     21 #define ILI9486_DRIVER
     22 
     23 // MOSI and SCK do not need to be defined, connect:
     24 //  - Arduino SCK  to TFT SCK
     25 //  - Arduino MOSI to TFT SDI(may be marked SDA or MOSI)
     26 // Standard Arduino SPI pins are(SCK=D13, MOSI=D11) this is port pins PA5 and PA7 on Nucleo-F767ZI
     27 
     28 // Can use Ardiuno pin references, arbitrary allocation, TFT_eSPI controls chip select
     29 #define TFT_CS   D5 // Chip select control pin to TFT CS
     30 #define TFT_DC   D6 // Data Command control pin to TFT DC (may be labelled RS = Register Select)
     31 #define TFT_RST  D7 // Reset pin to TFT RST (or RESET)
     32 
     33 // Alternatively, we can use STM32 port reference names PXnn
     34 //#define TFT_CS   PE11 // Nucleo-F767ZI equivalent of D5
     35 //#define TFT_DC   PE9  // Nucleo-F767ZI equivalent of D6
     36 //#define TFT_RST  PF13 // Nucleo-F767ZI equivalent of D7
     37 
     38 //#define TFT_RST  -1   // Set TFT_RST to -1 if the display RESET is connected to processor reset
     39                         // Use an Arduino pin for initial testing as connecting to processor reset
     40                         // may not work (pulse too short at power up?)
     41 
     42 // Chip select for XPT2046 touch controller
     43 //#define TOUCH_CS D4
     44 
     45 #define LOAD_GLCD   // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
     46 #define LOAD_FONT2  // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
     47 #define LOAD_FONT4  // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
     48 #define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
     49 #define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
     50 #define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
     51 #define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
     52 
     53 // STM32 support for smooth fonts via program memory (FLASH) arrays
     54 #define SMOOTH_FONT
     55 
     56 
     57 // Nucleo-F767ZI has a ~216MHZ CPU clock, this is divided by 4, 8, 16 etc
     58 
     59 #define SPI_FREQUENCY  20000000   // 27MHz SPI clock
     60 //#define SPI_FREQUENCY  55000000   // 55MHz is over-clocking ILI9341 but seems to work reliably!
     61 
     62 //#define SPI_READ_FREQUENCY  15000000 // Reads need a slower SPI clock, probably ends up at 13.75MHz (CPU clock/16)
     63 
     64 //#define SPI_TOUCH_FREQUENCY  2500000 // Must be very slow
     65 
     66 // This has no effect, transactions for STM32 are automatically enabled
     67 #define SUPPORT_TRANSACTIONS