acidportal- 😈 Worlds smallest Evil Portal on a LilyGo T-QT |
git clone git://git.acid.vegas/acidportal.git |
Log | Files | Refs | Archive | README | LICENSE |
Setup32_ILI9341_STM32F103.h (3196B)
1 ////////////////////////////////////////////////////////////// 2 // Setup for STM32F103 (e.g. Blue Pill) and ILI9341 display // 3 ////////////////////////////////////////////////////////////// 4 #define USER_SETUP_ID 32 5 6 // Last update by Bodmer: 14/1/20 7 8 // Define STM32 to invoke STM32 optimised driver 9 #define STM32 10 11 // Define the TFT display driver 12 #define ILI9341_DRIVER 13 //#define ILI9481_DRIVER 14 15 // MOSI and SCK do not need to be defined, connect: 16 // - Arduino SCK (Blue Pill pin A5) to TFT SCK 17 // - Arduino MOSI (Blue Pill pin A7) to TFT SDI (may be marked SDA or MOSI) 18 // - Optional to read TFT: Arduino MISO (Blue Pill pin A6) to TFT SDO (may be marked MISO or may not exist on TFT) 19 // Note: not all TFT's support reads 20 21 // reminder: Blue Pill SPI pins are SCK=A5, MISO = A6, MOSI=A7 22 23 // Can use Ardiuno pin references, arbitrary allocation, TFT_eSPI controls chip select 24 #define TFT_CS A0 // Chip select control pin to TFT CS 25 #define TFT_DC A1 // Data Command control pin to TFT DC (may be labelled RS = Register Select) 26 #define TFT_RST A2 // Reset pin to TFT RST (or RESET) 27 28 //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to processor reset 29 // Use an Arduino pin for initial testing as connecting to processor reset 30 // may not work (due to variations in display design) 31 32 #define TOUCH_CS A4 // Connect to T_CS (Touch controller chip select) if XPT2046 is connected to SPI bus 33 // You may need to wire the touch controller to the processor in addition to the TFT 34 // For example on some boards the pins are labelled: 35 // T_IRQ - no connection to processor 36 // T_DO - connect to processor MISO 37 // T_DIN - connect to processor MOSI 38 // T_CS - connect to processor pin specified by TOUCH_CS above 39 // T_SCK - connect to processor SCK 40 41 #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 42 #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 43 #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 44 #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 45 #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. 46 #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 47 #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 48 49 // STM32 support for smooth fonts via program memory (FLASH) arrays 50 #define SMOOTH_FONT 51 52 // Assuming the processor clock is 72MHz: 53 #define SPI_FREQUENCY 36000000 // 36MHz SPI clock 54 //#define SPI_FREQUENCY 18000000 // 18MHz SPI clock 55 56 #define SPI_READ_FREQUENCY 12000000 // Reads need a slower SPI clock 57 58 #define SPI_TOUCH_FREQUENCY 2500000 // Must be very slow 59 60 // This has no effect, transactions are automatically enabled for STM32 61 //#define SUPPORT_TRANSACTIONS