-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Adafruit PiTFT 1.14" #187
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now I realize that the naming of these adafruit specific files has not been that consistent. Would you mind renaming this file and the two existing files to have
|
||
|
||
// Data specific to Adafruit's PiTFT 1.14" display | ||
#ifdef ADAFRUIT_ST7789_PITFT_114 | ||
|
||
#if !defined(GPIO_TFT_DATA_CONTROL) | ||
// Adafruit 1.14" 135x240 has display control on pin 25: https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/pinouts | ||
#define GPIO_TFT_DATA_CONTROL 25 | ||
#endif | ||
|
||
#if !defined(GPIO_TFT_BACKLIGHT) | ||
// Adafruit 1.14" 135x240 has backlight on pin 22: https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/pinouts | ||
#define GPIO_TFT_BACKLIGHT 22 | ||
#endif | ||
|
||
#define DISPLAY_SPI_DRIVE_SETTINGS (1 | BCM2835_SPI0_CS_CPOL | BCM2835_SPI0_CS_CPHA) | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
#pragma once | ||
|
||
#if defined(ST7735R) || defined(ST7735S) || defined(ST7789) || defined(ST7789VW) | ||
#if defined(ST7735R) || defined(ST7735S) || defined(ST7789) || defined(ST7789VW) || defined(ADAFRUIT_ST7789_PITFT_114) | ||
|
||
// On Arduino "A000096" 160x128 ST7735R LCD Screen, the following speed configurations have been tested (on a Pi 3B): | ||
// core_freq=355: CDIV=6, results in 59.167MHz, works | ||
|
@@ -30,6 +31,16 @@ | |
|
||
#define DISPLAY_NATIVE_COVERED_LEFT_SIDE 2 | ||
#define DISPLAY_NATIVE_COVERED_TOP_SIDE 1 | ||
#elif defined(ADAFRUIT_ST7789_PITFT_114) | ||
// The Adafruit PiTFT 1.14" uses ST7789, but it has some quirks, such as not working with the chip select signal toggle, | ||
// and having a unique offset in display memory. | ||
#include "pitft_114r_st7789.h" | ||
#define DISPLAY_NATIVE_WIDTH 240 | ||
#define DISPLAY_NATIVE_HEIGHT 320 | ||
#define DISPLAY_NATIVE_COVERED_TOP_SIDE 40 | ||
#define DISPLAY_NATIVE_COVERED_BOTTOM_SIDE 40 | ||
#define DISPLAY_NATIVE_COVERED_LEFT_SIDE 53 | ||
#define DISPLAY_NATIVE_COVERED_RIGHT_SIDE 52 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reads like you chose in /boot/config.txt to have Would it be better to have here by default
and no cropping. And then in /boot/config.txt have
to get the full screen display outputted? For e.g. console use cases, that would probably be a sensible default? |
||
|
||
#else | ||
#error Unknown display controller! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of duplicating in all places below
defined(ST7789) || defined(ADAFRUIT_ST7789_PITFT_114)
, let's instead add heresince ADAFRUIT_ST7789_PITFT_114 uses ST7789. Then all ST7789 code blocks will automatically apply to ADAFRUIT_ST7789_PITFT_114.