Compare commits

...
16 Commits
Author SHA1 Message Date
kuba ab6e8766b8 compiute offsets 2026-01-08 22:06:32 +01:00
kuba 8b758851c3 whyd i even make it a detector 2026-01-08 21:51:36 +01:00
kuba ccd5ae694b c with classes and also remove useless drivers in tft_espi 2026-01-08 21:43:59 +01:00
kuba 67109d544d fix graphics 2026-01-08 18:03:51 +01:00
kuba b66f821e84 sorta fix ecc and others, more tomorrow 2026-01-07 23:23:26 +01:00
kuba 4a6a1a1849 fix encoder 2026-01-07 22:57:12 +01:00
kuba f09ff8978f partitions and also class for scrolling text, 87.3% flash usage 2026-01-07 22:12:03 +01:00
kuba 3a92d1cdf1 little funcitonal changes, just performance 2026-01-07 21:42:22 +01:00
kuba aa5bd3f847 update readme 2026-01-07 18:26:09 +01:00
kuba 6f97d420e7 "Ah, yeah! This is happenin!' - Sonic the Hedgehog, 1998 2026-01-07 17:41:20 +01:00
kuba 68d76e0959 globals.h 2026-01-07 16:29:40 +01:00
kuba f0abda9158 move things around 2026-01-06 22:07:46 +01:00
kuba 0ceb8047e8 small refactorings 2026-01-06 19:58:51 +01:00
kuba 70cbed7570 some cleanup and refactoring, nothing functional 2026-01-06 17:29:48 +01:00
kuba 0110291b97 remove airband 2026-01-06 16:27:18 +01:00
kuba 41f0140a22 89.9 flash usage 2026-01-06 13:56:00 +01:00
195 changed files with 2576 additions and 15714 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"port": 9145,
"time": 1767822324423,
"version": "0.0.3"
}
+3 -12
View File
@@ -1,18 +1,13 @@
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/PE5PVB/TEF6686_ESP32#contributing)
[![License](https://img.shields.io/badge/license%20-%20GNU_GPLv3-GPLv3?color=blue)](https://github.com/PE5PVB/TEF6686_ESP32/blob/main/LICENSE)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#contributing)
[![License](https://img.shields.io/badge/license%20-%20GNU_GPLv3-GPLv3?color=blue)](https://www.gnu.org/licenses/gpl-3.0.en.html#license-text)
# Note:
The version in the repository is an ongoing development. It could and will contain bugs. To make sure you use the latest fully tested firmware, check the releases!
# TEF6686_ESP32
Advanced Tuner software for NXP TEF668x tuners with ESP32 board\
Advanced Tuner software for NXP TEF668x tuners with ESP32 board
More information: https://www.pe5pvb.nl/tef6686/
## TFT_eSPI
When compiling for the first time, please edit the User_Setup.h file in the lib/TFT_eSPI/
## Wiki
- [About the software & features](https://github.com/PE5PVB/TEF6686_ESP32/wiki)
- [Getting started](https://github.com/PE5PVB/TEF6686_ESP32/wiki#getting-started)
@@ -35,7 +30,3 @@ Special thanks to all [contributors](https://github.com/PE5PVB/TEF6686_ESP32/gra
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
## If you like this software
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/pe5pvb)
+9
View File
@@ -0,0 +1,9 @@
Import("env")
# Apply C++-only flags
env.Append(
CXXFLAGS=[
"-fno-exceptions",
"-fno-rtti"
]
)
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include <pgmspace.h>
const uint8_t FONT16[] PROGMEM = {
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include <pgmspace.h>
const uint8_t FONT16_CHS[] PROGMEM = {
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include <pgmspace.h>
const uint8_t FONT28[] PROGMEM = {
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include <pgmspace.h>
const uint8_t FONT28_CHS[] PROGMEM = {
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include <pgmspace.h>
const uint8_t FONT48[] PROGMEM = {
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include <pgmspace.h>
const uint8_t FREQFONT0[] PROGMEM = { // Classic
+1 -15
View File
@@ -1,25 +1,11 @@
#pragma once
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiUdp.h>
#include "ESP32Time.h"
#include "TimeLib.h"
#include "TEF6686.h"
#include "globals.h"
static const char ntpServerName[] = "0.pool.ntp.org";
static const int localPort = 8944;
const int NTP_PACKET_SIZE = 48;
extern ESP32Time rtc;
extern WiFiClient RemoteClient;
extern WiFiUDP Udp;
extern TEF6686 radio;
extern bool wifi;
extern bool NTPupdated;
extern bool rtcset;
void sendNTPpacket(IPAddress &address);
void NTPupdate();
time_t getNtpTime();
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef RDS_PI_BUFFER_H
#define RDS_PI_BUFFER_H
#pragma once
#include <stdint.h>
@@ -26,5 +25,3 @@ private:
State getState(uint16_t value);
};
#endif
+21 -25
View File
@@ -4,6 +4,7 @@
#include "Tuner_Drv_Lithio.h"
#include "Tuner_Interface.h"
#include "RdsPiBuffer.hpp"
#include "change_detector.h"
extern const unsigned char tuner_init_tab[] PROGMEM;
extern const unsigned char tuner_init_tab9216[] PROGMEM;
@@ -367,7 +368,7 @@ static const char* const oda_app_names[] {
"To warn people in case of disasters or emergency",
"Personal weather station",
"Hybradio RDS-Net (for testing use, only)",
"RDS2 9 bit AF lists ODA",
"RDS2 - 9 bit AF lists ODA",
"Enhanced RadioText / eRT",
"Warning receiver",
"Enhanced early warning system",
@@ -433,13 +434,13 @@ const DABFrequencyLabel DABfrequencyTable[] = {
typedef struct _rds_ {
byte region;
byte PTY;
Detector<byte, 1> PTY{0};
String stationName;
String stationText;
String stationText32;
String RTContent1;
String RTContent2;
String PTYN;
Detector<String, 1> PTYN{""};
String ECCtext;
String stationIDtext;
String stationNameLong;
@@ -460,32 +461,32 @@ typedef struct _rds_ {
uint32_t dabaffreq;
byte aid_counter;
byte fastps;
unsigned int ECC;
Detector<unsigned int, 1> ECC{0};
bool rdsAerror;
bool rdsBerror;
bool rdsCerror;
bool rdsDerror;
bool hasArtificialhead;
bool hasCompressed;
Detector<bool, 1> hasArtificialhead{false};
Detector<bool, 1> hasCompressed{false};
bool hasDynamicPTY;
bool hasStereo;
Detector<bool, 1> hasStereo{false};
bool hasRDS;
bool hasECC;
bool hasDABAF;
bool hasLongPS;
bool hasRT;
bool hasEnhancedRT;
bool TP;
bool hasTA;
bool hasEON;
Detector<bool, 1> TP{false};
Detector<bool, 1> TA{false};
Detector<bool, 1> hasEON{false};
bool hasAID;
bool hasTMC;
Detector<bool, 1> hasTMC{false};
bool hasAF;
bool hasCT;
Detector<bool, 1> hasCT{false};
bool hasPTYN;
bool rtAB;
bool rtAB32;
bool hasRTplus;
Detector<bool, 1> hasRTplus{false};
bool filter;
bool rdsreset;
bool pierrors;
@@ -506,10 +507,10 @@ typedef struct _af_ {
} af_;
typedef struct _eon_ {
uint16_t mappedfreq;
uint16_t mappedfreq2;
uint16_t mappedfreq3;
uint16_t pi;
uint16_t mappedfreq;
uint16_t mappedfreq2;
uint16_t mappedfreq3;
uint16_t pi;
char picode[6];
String ps;
bool ta;
@@ -529,7 +530,7 @@ typedef struct _logbook_ {
class TEF6686 {
public:
af_ af[51];
af_ af[51];
eon_ eon[21];
rds_ rds;
logbook_ logbook[22];
@@ -538,10 +539,9 @@ class TEF6686 {
void readRDS(byte showrdserrors);
void SetFreq(uint16_t frequency);
void SetFreqAM(uint16_t frequency);
void SetFreqAIR(uint16_t frequency);
void getProcessing(uint16_t &highcut, uint16_t &stereo, uint16_t &sthiblend, uint8_t &stband_1, uint8_t &stband_2, uint8_t &stband_3, uint8_t &stband_4);
void getStatus(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
void getStatusAM(int16_t &level, uint16_t &noise, uint16_t &cochannel, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
void getStatus(int16_t *level, uint16_t *USN, uint16_t *WAM, int16_t *offset, uint16_t *bandwidth, uint16_t *modulation, int8_t *snr);
void getStatusAM(int16_t *level, uint16_t *noise, uint16_t *cochannel, int16_t *offset, uint16_t *bandwidth, uint16_t *modulation, int8_t *snr);
void getIdentification(uint16_t *device, uint16_t *hw_version, uint16_t *sw_version);
void setSoftmuteFM(uint8_t mode);
void setSoftmuteAM(uint8_t mode);
@@ -580,7 +580,6 @@ class TEF6686 {
void tone(uint16_t time, int16_t amplitude, uint16_t frequency);
void extendBW(bool yesno);
uint16_t getBlockA(void);
String trimTrailingSpaces(String str);
uint8_t af_counter;
uint8_t eon_counter;
uint8_t logbook_counter;
@@ -594,9 +593,6 @@ class TEF6686 {
private:
void RDScharConverter(const char* input, wchar_t* output, size_t size, bool under);
String convertToUTF8(const wchar_t* input);
String extractUTF8Substring(const String& utf8String, size_t start, size_t length, bool under);
String ucs2ToUtf8(const char* ucs2Input);
bool isFixedCallsign(uint16_t stationID, char* stationIDStr);
String PSLongtext;
char ps_buffer[9];
+2 -5
View File
@@ -67,14 +67,11 @@ typedef enum {
void devTEF_Set_Cmd(TEF_MODULE module, uint8_t cmd, uint16_t len, ...);
bool devTEF_Get_Cmd(TEF_MODULE module, uint8_t cmd, uint8_t *receive, uint16_t len);
void devTEF_Radio_Set_Noiseblanker_AM(uint8_t mode, uint16_t start);
void devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq);
void devTEF_Radio_Set_GPIO(uint8_t mode);
bool devTEF_Radio_Get_Quality_Status (uint16_t *status, int16_t *level, uint16_t *usn, uint16_t *wam, int16_t *offset, uint16_t *bandwidth, uint16_t *mod, int8_t *snr);
void devTEF_Radio_Get_Quality_Status (uint16_t *status, int16_t *level, uint16_t *usn, uint16_t *wam, int16_t *offset, uint16_t *bandwidth, uint16_t *mod, int8_t *snr);
bool devTEF_Radio_Get_Processing_Status (uint16_t *highcut, uint16_t *stereo, uint16_t *sthiblend, uint8_t *stband_1, uint8_t *stband_2, uint8_t *stband_3, uint8_t *stband_4);
bool devTEF_Radio_Get_Quality_Status_AM (int16_t *level, uint16_t *noise, uint16_t *cochannel, int16_t *offset, uint16_t *bandwidth, uint16_t *mod, int8_t *snr);
uint8_t devTEF_APPL_Get_Operation_Status();
bool devTEF_Radio_Get_Stereo_Status(uint16_t *status);
bool devTEF_Radio_Get_RDS_Status(uint16_t *status, uint16_t *A_block, uint16_t *B_block, uint16_t *C_block, uint16_t *D_block, uint16_t *dec_error);
void devTEF_Radio_Get_RDS_Status(uint16_t *status, uint16_t *A_block, uint16_t *B_block, uint16_t *C_block, uint16_t *D_block, uint16_t *dec_error);
bool devTEF_Radio_Get_RDS_Data(uint16_t *status, uint16_t *A_block, uint16_t *B_block, uint16_t *C_block, uint16_t *D_block, uint16_t *dec_error);
+1
View File
@@ -1,3 +1,4 @@
#pragma once
static const unsigned char PatchByteValues102[] PROGMEM = {
0xF0, 0x00, 0x38, 0x3B, 0xD0, 0x80, 0xF0, 0x00, 0x38, 0x43, 0xD0, 0x80, 0x43, 0xB2, 0x38, 0x46, 0xD0, 0x80, 0xF0, 0x00, 0x70, 0x00, 0xC2, 0xF7,
0xF0, 0x00, 0x38, 0x77, 0xD0, 0x80, 0xF0, 0x00, 0x38, 0x7B, 0xDF, 0x80, 0x80, 0xFC, 0x39, 0x0E, 0xD0, 0x80, 0xC2, 0x38, 0x20, 0x11, 0x40, 0xB7,
+1
View File
@@ -1,3 +1,4 @@
#pragma once
static const unsigned char PatchByteValues205[] PROGMEM = {
0xF0, 0x00, 0x60, 0x40, 0xD0, 0x80, 0x20, 0x87, 0x60, 0x4C, 0xD0, 0x80, 0x90, 0x00, 0x60, 0x4E, 0xD0, 0x80, 0x22, 0x02, 0x00, 0x55, 0x60, 0x04,
0xF0, 0x00, 0x60, 0x65, 0xDF, 0x80, 0xF0, 0x00, 0x05, 0xBA, 0x60, 0x0E, 0x20, 0x90, 0x60, 0x9B, 0xD0, 0x80, 0x31, 0x40, 0x60, 0x9F, 0xD0, 0x80,
+95
View File
@@ -0,0 +1,95 @@
#pragma once
#include <Arduino.h>
template <typename T, size_t MaxObservers>
class Detector {
public:
explicit Detector(T initial) : value(initial), prev(initial) {
for (size_t i = 0; i < MaxObservers; ++i) seen[i] = false;
}
void set(const T& v) {
if (v == value) return;
prev = value;
value = v;
for (size_t i = 0; i < MaxObservers; ++i) seen[i] = false;
}
void amend(const T& v) {
value = v;
}
bool changed(size_t id) {
if (id >= MaxObservers) return false;
if (!seen[id]) {
seen[id] = true;
return true;
}
return false;
}
const T& get() const { return value; }
const T& getPrev() const { return prev; }
template <typename U>
Detector& operator+=(const U& d) { set(value + d); return *this; }
template <typename U>
Detector& operator-=(const U& d) { set(value - d); return *this; }
template <typename U>
Detector& operator*=(const U& d) { set(value * d); return *this; }
template <typename U>
Detector& operator/=(const U& d) { set(value / d); return *this; }
template <typename U>
Detector& operator%=(const U& d) { set(value % d); return *this; }
template <typename U>
T operator+(const U& d) const { return value + d; }
template <typename U>
T operator-(const U& d) const { return value - d; }
template <typename U>
T operator*(const U& d) const { return value * d; }
template <typename U>
T operator/(const U& d) const { return value / d; }
template <typename U>
T operator%(const U& d) const { return value % d; }
template <typename U>
bool operator==(const U& v) const { return value == v; }
template <typename U>
bool operator!=(const U& v) const { return value != v; }
template <typename U>
bool operator<(const U& v) const { return value < v; }
template <typename U>
bool operator>(const U& v) const { return value > v; }
template <typename U>
bool operator<=(const U& v) const { return value <= v; }
template <typename U>
bool operator>=(const U& v) const { return value >= v; }
Detector& operator=(const T& v) {
set(v);
return *this;
}
operator const T&() const {
return value;
}
private:
T value;
T prev;
bool seen[MaxObservers];
};
+3 -130
View File
@@ -1,133 +1,7 @@
#ifndef COMMS_H
#define COMMS_H
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <WiFiClient.h>
#include "TEF6686.h"
#include <WiFi.h>
#include "globals.h"
#include <Hash.h>
#include "WiFiConnect.h"
#include "WiFiConnectParam.h"
extern bool advancedRDS;
extern bool afscreen;
extern bool aftest;
extern bool autosquelch;
extern bool BWreset;
extern bool Data_Accelerator;
extern bool direction;
extern bool externaltune;
extern bool fullsearchrds;
extern bool menu;
extern bool RDSSPYTCP;
extern bool RDSSPYUSB;
extern bool RDSstatus;
extern bool scandxmode;
extern bool screenmute;
extern bool seek;
extern bool setupmode;
extern bool softmuteam;
extern bool softmutefm;
extern bool SQ;
extern bool StereoToggle;
extern bool store;
extern bool usesquelch;
extern bool wifi;
extern bool wificonnected;
extern bool XDRGTKdata;
extern bool XDRGTKTCP;
extern bool XDRGTKUSB;
extern bool XDRGTKMuteScreen;
extern bool XDRScan;
extern bool XDRMute;
extern byte band;
extern byte audiomode;
extern byte BWset;
extern byte BWsetRecall;
extern byte EQset;
extern byte fmagc;
extern byte fmscansens;
extern byte iMSEQ;
extern byte iMSset;
extern byte language;
extern byte memorypos;
extern byte scanhold;
extern byte stepsize;
extern byte subnetclient;
extern byte TEF;
extern byte tunemode;
extern char buff[16];
extern int ActiveColor;
extern int ActiveColorSmooth;
extern int BackgroundColor;
extern byte fmdeemphasis;
extern int freqold;
extern int GreyoutColor;
extern int InsignificantColor;
extern int InsignificantColorSmooth;
extern int PrimaryColor;
extern int PrimaryColorSmooth;
extern int RDSColor;
extern int RDSColorSmooth;
extern int RDSDropoutColor;
extern int RDSDropoutColorSmooth;
extern int scanner_filter;
extern int SignificantColor;
extern int SignificantColorSmooth;
extern int Squelch;
extern int Squelchold;
extern int Stereostatus;
extern int XDRBWset;
extern int XDRBWsetold;
extern int16_t OStatus;
extern int16_t SStatus;
extern int8_t LowLevelSet;
extern int8_t VolSet;
extern IPAddress remoteip;
extern String cryptedpassword;
extern String salt;
extern String saltkey;
extern String StereoStatusCommand;
extern String StereoStatusCommandold;
extern String XDRGTK_key;
extern uint16_t BW;
extern uint16_t MStatus;
extern uint16_t USN;
extern uint16_t WAM;
extern uint8_t buff_pos;
extern int8_t CN;
extern unsigned int ConverterSet;
extern unsigned int freq_scan;
extern unsigned int frequency;
extern unsigned int frequency_OIRT;
extern unsigned int frequency_LW;
extern unsigned int frequency_AM;
extern unsigned int frequency_MW;
extern unsigned int frequency_SW;
extern unsigned int frequencyold;
extern unsigned int HighEdgeOIRTSet;
extern unsigned int LowEdgeOIRTSet;
extern unsigned int LWHighEdgeSet;
extern unsigned int LWLowEdgeSet;
extern unsigned int MWHighEdgeSet;
extern unsigned int MWLowEdgeSet;
extern unsigned int scanner_end;
extern unsigned int scanner_start;
extern unsigned int scanner_step;
extern unsigned int SWHighEdgeSet;
extern unsigned int SWLowEdgeSet;
extern unsigned long aftimer;
extern unsigned long signalstatustimer;
extern byte amagc;
extern TFT_eSPI tft;
extern TEF6686 radio;
extern WiFiClient RemoteClient;
extern WiFiUDP Udp;
extern WiFiServer Server;
extern WiFiConnect wc;
extern WebServer webserver;
void Communication();
void XDRGTKRoutine();
@@ -161,5 +35,4 @@ extern void TuneUp();
extern void TuneDown();
extern void ShowTuneMode();
extern const char* textUI(uint16_t number);
extern void saveData();
#endif
extern void saveData();
+9 -37
View File
@@ -1,3 +1,5 @@
#pragma once
#define VERSION "v2.20.5b"
#define REVERSE false
@@ -36,10 +38,6 @@
#define FREQ_MW_STEP_9K 9
#define FREQ_MW_STEP_10K 10
#define FREQ_SW_STEP_5K 5
#ifdef HAS_AIR_BAND
#define FREQ_AIR_STEP_25K 25
#define FREQ_AIR_STEP_8K33 8.33
#endif
#define FREQ_OIRT_STEP_30K 3
#define FREQ_FM_STEP_50K 5
#define FREQ_FM_STEP_100K 10
@@ -56,11 +54,6 @@
#define FREQ_SW_HIGH_EDGE_MIN (FREQ_SW_11M_END)
#define FREQ_SW_HIGH_EDGE_MAX (FREQ_SW_END)
#ifdef HAS_AIR_BAND
#define FREQ_AIR_LOW_EDGE_MIN 108000
#define FREQ_AIR_HIGH_EDGE_MIN 137000
#endif
#define FREQ_FM_OIRT_START 6500 // use values of 1/10 * kHz
#define FREQ_FM_OIRT_END 7400 // use values of 1/10 * kHz
@@ -225,11 +218,7 @@
#define EE_PRESETS_CNT 99 // When set > 99 change the complete EEPROM adressing!
#define EE_CHECKBYTE_VALUE 20 // 0 ~ 255,add new entry, change for new value
#define EE_PRESETS_FREQUENCY 0 // Default value when memory channel should be skipped!
#ifdef HAS_AIR_BAND
#define EE_TOTAL_CNT 2292 // Total occupied eeprom bytes
#else
#define EE_TOTAL_CNT 2287 // Total occupied eeprom bytes
#endif
#define EE_PRESETS_BAND_START 0 // 99 * 1 byte
#define EE_PRESET_BW_START 99 // 99 * 1 byte
@@ -351,10 +340,6 @@
#define EE_BYTE_CLOCKAMPM 2278
#define EE_UINT16_LOGCOUNTER 2279
#define EE_UINT16_PICTLOCK 2283
#ifdef HAS_AIR_BAND
#define EE_BYTE_AIRSTEPSIZE 2287
#define EE_UINT16_FREQUENCY_AIR 2288
#endif
// End of EEPROM index defines
// Memory channel database
@@ -382,33 +367,20 @@ enum SCAN_CANCEL {
};
enum RADIO_BAND {
BAND_OIRT = 0, BAND_FM, BAND_GAP, BAND_LW, BAND_MW, BAND_SW, BAND_AIR
BAND_OIRT = 0, BAND_FM, BAND_GAP, BAND_LW, BAND_MW, BAND_SW, BAND_NONEXISTENT
};
#ifndef HAS_AIR_BAND
enum RADIO_AM_BAND_SELECTION {
AM_BAND_ALL = 0, AM_BAND_LW_MW, AM_BAND_LW_SW, AM_BAND_MW_SW,
AM_BAND_LW, AM_BAND_MW, AM_BAND_SW, AM_BAND_NONE,
AM_BAND_CNT
};
#else
// Toggle: LW -> MW -> SW -> AIR
enum RADIO_AM_BAND_SELECTION {
AM_BAND_ALL = 0,
AM_BAND_LW_MW_SW, AM_BAND_LW_MW_AIR, AM_BAND_LW_SW_AIR, AM_BAND_MW_SW_AIR,
AM_BAND_LW_MW, AM_BAND_LW_SW, AM_BAND_LW_AIR,
AM_BAND_MW_SW, AM_BAND_MW_AIR,
AM_BAND_SW_AIR,
AM_BAND_LW, AM_BAND_MW, AM_BAND_SW, AM_BAND_AIR, AM_BAND_NONE,
AM_BAND_CNT
};
#endif
enum RADIO_FM_BAND_SELECTION {
FM_BAND_ALL = 0, FM_BAND_OIRT, FM_BAND_FM, FM_BAND_NONE,
FM_BAND_CNT
};
enum RADIO_AM_BAND_SELECTION {
AM_BAND_ALL = 0, AM_BAND_LW_MW, AM_BAND_LW_SW, AM_BAND_MW_SW,
AM_BAND_LW, AM_BAND_MW, AM_BAND_SW, AM_BAND_NONE,
AM_BAND_CNT
};
enum RADIO_TUNE_MODE {
TUNE_MAN, TUNE_AUTO, TUNE_MEM, TUNE_MI_BAND
};
+392
View File
@@ -0,0 +1,392 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "TEF6686.h"
#include "constants.h"
#include "change_detector.h"
#include "language.h"
#include <WiFi.h>
#include <WiFiUdp.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include "WiFiConnect.h"
#include "WiFiConnectParam.h"
#include "ESP32Time.h"
#include "scrolling_text.h"
#define ROTARY_PIN_A 34
#define ROTARY_PIN_B 36
#define ROTARY_BUTTON 39
#define PIN_POT 35
#define BATTERY_PIN 13
#define BANDBUTTON 4
#define BWBUTTON 25
#define MODEBUTTON 26
#define CONTRASTPIN 2
#define STANDBYLED 19
#define SMETERPIN 27
#define TOUCHIRQ 33
#define EXT_IRQ 14
#define DYNAMIC_SPI_SPEED
extern bool RDSstatus;
extern bool RDSstatusold;
extern TFT_eSPI tft;
extern bool dynamicspi;
extern bool Data_Accelerator;
extern bool advancedRDS, afmethodBold, afpage;
extern bool afscreen, aftest;
extern bool autoDST, autolog, autologged;
extern bool autosquelch, batterydetect, beepresetstart;
extern bool beepresetstop, BWreset, bwtouchtune;
extern bool BWtune, change, clockampm;
extern bool direction, dropout;
extern bool dynamicPTYold, edgebeep, externaltune;
extern bool findMemoryAF;
extern bool firstTouchHandled;
extern bool flashing;
extern bool fmsi, fullsearchrds;
extern bool hasafold, haseonold;
extern bool initdxscan, invertdisplay, leave;
extern bool LowLevelInit;
extern bool memorystore;
extern bool memreset, memtune;
extern bool menu, menuopen;
extern bool mwstepsize;
extern bool nobattery;
extern bool NTPupdated;
extern bool optenc;
extern bool rdsflagreset;
extern bool rdsreset;
extern bool rdsstatscreen;
extern bool RDSSPYTCP, RDSSPYUSB;
extern bool rotaryaccelerate;
extern bool rtcset;
extern bool scandxmode;
extern bool scanholdflag;
extern bool scanholdonsignal;
extern bool scanmem;
extern bool scanmute;
extern bool screenmute;
extern bool screensavertriggered;
extern bool seek;
extern bool seekinit;
extern bool setextendbw;
extern bool setupmode;
extern bool showclock;
extern bool showlongps;
extern bool usesquelch;
extern bool softmuteam;
extern bool softmutefm;
extern bool SQ;
extern bool Stereostatusold;
extern bool StereoToggle;
extern bool store;
extern bool touchrepeat;
extern bool touch_detect;
extern bool tuned;
extern bool USBmode;
extern bool XDRGTKdata;
extern bool XDRGTKMuteScreen;
extern bool XDRGTKTCP, XDRGTKUSB;
extern bool XDRMute, XDRScan;
extern bool wifi, wificonnected;
extern byte af_counterold;
extern byte aid_counterold;
extern byte af;
extern byte afpagenr;
extern byte amagc;
extern byte amnb;
extern byte amscansens;
extern byte audiomode;
extern byte band;
extern byte bandAM;
extern byte bandFM;
extern byte bandforbidden;
extern byte battery;
extern byte batteryold;
extern byte batteryoptions;
extern byte BWset;
extern byte BWsettemp;
extern byte BWsetAM;
extern byte BWsetFM;
extern byte BWsetRecall;
extern byte BWtemp;
extern byte charwidth;
extern byte chipmodel;
extern byte hardwaremodel;
extern byte ContrastSet;
extern byte CurrentSkin;
extern byte CurrentTheme;
extern byte displayflip;
extern byte eonptyold[20];
extern byte EQset;
extern byte fmagc;
extern byte fmscansens;
extern byte fmdefaultstepsize;
extern byte fmnb;
extern byte fmdeemphasis;
extern byte freqfont;
extern byte amcodect;
extern byte amcodectcount;
extern byte amgain;
extern byte freqoldcount;
extern byte HighCutLevel;
extern byte HighCutOffset;
extern byte items[10];
extern byte iMSEQ;
extern byte iMSset;
extern byte language;
extern byte longbandpress;
extern byte memdoublepi;
extern byte memorypos;
extern byte memoryposold;
extern byte memoryposstatus;
extern byte mempionly;
extern byte memstartpos;
extern byte memstoppos;
extern byte menuitem;
extern byte menupage;
extern byte poweroptions;
extern byte rdsblockold;
extern byte rdsqualityold;
extern byte rotarymode;
extern byte touchrotating;
extern byte scancancel;
extern byte scanstart;
extern byte scanstop;
extern byte scanhold;
extern byte scanmodeold;
extern byte screensaverOptions[5];
extern byte screensaverset;
extern byte showmodulation;
extern byte showrdserrors;
extern byte showSWMIBand;
extern byte submenu;
extern byte stationlistid;
extern byte nowToggleSWMIBand;
extern byte stepsize;
extern byte StereoLevel;
extern byte subnetclient;
extern byte TEF, tot, tunemode;
extern byte unit, spispeed;
extern char buff[16];
extern char eonpicodeold[20][6];
extern const uint8_t* currentFont;
extern float vPerold;
extern int ActiveColor;
extern int ActiveColorSmooth;
extern int AGC;
extern int AMLevelOffset;
extern int BackgroundColor;
extern int BackgroundColor1;
extern int BackgroundColor2;
extern int BackgroundColor3;
extern int BackgroundColor4;
extern int BackgroundColor5;
extern int BarSignificantColor;
extern int BarInsignificantColor;
extern int BatteryValueColor;
extern int BatteryValueColorSmooth;
extern int batupdatetimer;
extern int berPercentold;
extern int BWAutoColor;
extern int BWAutoColorSmooth;
extern int BWOld;
extern int bwupdatetimer;
extern int DisplayedSegments;
extern int ForceMono;
extern int FrameColor;
extern int FreqColor;
extern int FreqColorSmooth;
extern int freq_in;
extern int freqold;
extern int GreyoutColor;
extern int InsignificantColor;
extern int InsignificantColorSmooth;
extern int menuoption;
extern int ModBarInsignificantColor;
extern int ModBarSignificantColor;
extern int MStatusold;
extern int offsetupdatetimer;
extern int OStatusold;
extern int peakholdold;
extern int peakholdtimer;
extern int PrimaryColor;
extern int PrimaryColorSmooth;
extern int RDSColor, RDSColorSmooth;
extern int RDSDropoutColor, RDSDropoutColorSmooth;
extern int SignificantColor;
extern int SignificantColorSmooth;
extern int StereoColor;
extern int StereoColorSmooth;
extern int WifiColorHigh;
extern int WifiColorLow;
extern int SquelchShow;
extern int rotary;
extern int rotarycounter;
extern int rotarycounteraccelerator;
extern int rssi;
extern int rssiold;
extern int scanner_filter;
extern int SecondaryColor;
extern int SecondaryColorSmooth;
extern int SNRupdatetimer;
extern int Sqstatusold;
extern int Squelch;
extern int Squelchold;
extern int SStatusold;
extern int Stereostatus;
extern int volume;
extern int XDRBWset;
extern int xPos;
extern int xPos2;
extern int16_t OStatus;
extern int16_t SAvg;
extern int16_t SAvg2;
extern int16_t SAvg3;
extern int16_t SAvg4;
extern int16_t SAvg5;
extern int16_t SStatus;
extern int16_t MP;
extern int16_t US;
extern int8_t MPold;
extern int8_t USold;
extern int8_t LevelOffset;
extern int8_t LowLevelSet;
extern int8_t NTPoffset;
extern int8_t CN;
extern int8_t CNold;
extern int8_t VolSet;
extern float batteryVold;
extern IPAddress remoteip;
extern String AIDString;
extern String cryptedpassword;
extern String ECColdString;
extern String ECCString;
extern String eonpsold[20];
extern String PIold;
extern String PSold;
extern String PTYold;
extern String rds_clock;
extern String rds_clockold;
extern String rds_date;
extern String rds_dateold;
extern String RDSSPYRDS;
extern String RDSSPYRDSold;
extern String RTold;
extern String salt;
extern String saltkey;
extern String stationIDold;
extern String stationStateold;
extern String StereoStatusCommand;
extern String StereoStatusCommandold;
extern String SWMIBandstring;
extern String SWMIBandstringold;
extern String XDRGTK_key;
extern Detector<String, 1> XDRGTKRDS;
extern uint16_t BW;
extern uint16_t MStatus;
extern uint16_t SWMIBandPos;
extern uint16_t SWMIBandPosold;
extern uint16_t TouchCalData[5];
extern uint16_t USN;
extern uint16_t WAM;
extern uint8_t buff_pos;
extern unsigned int ConverterSet;
extern unsigned int freq_scan;
extern unsigned int frequency;
extern unsigned int frequency_OIRT;
extern unsigned int frequency_AM;
extern unsigned int frequency_LW;
extern unsigned int frequency_MIBand_11M;
extern unsigned int frequency_MIBand_120M;
extern unsigned int frequency_MIBand_13M;
extern unsigned int frequency_MIBand_15M;
extern unsigned int frequency_MIBand_160M;
extern unsigned int frequency_MIBand_16M;
extern unsigned int frequency_MIBand_19M;
extern unsigned int frequency_MIBand_22M;
extern unsigned int frequency_MIBand_25M;
extern unsigned int frequency_MIBand_31M;
extern unsigned int frequency_MIBand_41M;
extern unsigned int frequency_MIBand_49M;
extern unsigned int frequency_MIBand_60M;
extern unsigned int frequency_MIBand_75M;
extern unsigned int frequency_MIBand_90M;
extern unsigned int frequency_MW;
extern unsigned int frequency_SW;
extern unsigned int HighEdgeOIRTSet;
extern unsigned int HighEdgeSet;
extern unsigned int LowEdgeOIRTSet;
extern unsigned int logcounter;
extern unsigned int LowEdgeSet;
extern unsigned int LWHighEdgeSet;
extern unsigned int LWLowEdgeSet;
extern unsigned int mappedfreqold[20];
extern unsigned int mappedfreqold2[20];
extern unsigned int mappedfreqold3[20];
extern unsigned int memstartfreq;
extern unsigned int memstopfreq;
extern unsigned int MWHighEdgeSet;
extern unsigned int MWLowEdgeSet;
extern unsigned int scanner_end;
extern unsigned int scanner_start;
extern unsigned int scanner_step;
extern unsigned int SWHighEdgeSet;
extern unsigned int SWLowEdgeSet;
extern unsigned long afticker;
extern unsigned long aftickerhold;
extern unsigned long aftimer;
extern unsigned long autosquelchtimer;
extern unsigned long blockcounterold[33];
extern unsigned long eonticker;
extern unsigned long eontickerhold;
extern unsigned long flashingtimer;
extern unsigned long keypadtimer;
extern unsigned long lastTouchTime;
extern unsigned long lowsignaltimer;
extern unsigned long ModulationpreviousMillis;
extern unsigned long ModulationpeakPreviousMillis;
extern unsigned long NTPtimer;
extern unsigned long peakholdmillis;
extern unsigned long processed_rdsblocksold[33];
extern unsigned long pslongticker;
extern unsigned long pslongtickerhold;
extern unsigned long rtticker;
extern unsigned long rttickerhold;
extern unsigned long rotarytimer;
extern unsigned long scantimer;
extern unsigned long screensavertimer;
extern unsigned long signalstatustimer;
extern unsigned long tottimer;
extern unsigned long tuningtimer;
extern unsigned long udplogtimer;
extern unsigned long udptimer;
extern const size_t language_totalnumber;
extern const size_t language_entrynumber;
extern mem presets[EE_PRESETS_CNT];
extern TEF6686 radio;
extern ESP32Time rtc;
extern TFT_eSprite FrequencySprite;
extern TFT_eSprite RDSSprite;
extern TFT_eSprite SquelchSprite;
extern TFT_eSprite FullLineSprite;
extern TFT_eSprite OneBigLineSprite;
extern TFT_eSprite SignalSprite;
extern TFT_eSprite PSSprite;
extern WiFiConnect wc;
extern WiFiServer Server;
extern WiFiClient RemoteClient;
extern WiFiUDP Udp;
extern WebServer webserver;
extern ScrollingTextDisplay rtplusDisplay;
extern ScrollingTextDisplay eonDisplay;
extern ScrollingTextDisplay eccDisplay;
extern ScrollingTextDisplay rtDisplay;
+4 -219
View File
@@ -1,11 +1,7 @@
#ifndef GUI_H
#define GUI_H
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "TEF6686.h"
#include "WiFiConnect.h"
#include "WiFiConnectParam.h"
#include "globals.h"
#include "utils.h"
#include "menugraphics.h"
static const char* const unitString[] = {"dBμV", "dBf", "dBm"};
@@ -15,215 +11,6 @@ static const char* const Skin[] = {"Essential"};
static const char* BWButtonLabelsFM[] = {"56 kHz", "64 kHz", "72 kHz", "84 kHz", "97 kHz", "114 kHz", "133 kHz", "151 kHz", "168 kHz", "184 kHz", "200 kHz", "217 kHz", "236 kHz", "254 kHz", "287 kHz", "311 kHz", "Auto", "iMS", "EQ"};
static const char* BWButtonLabelsAM[] = {"3 kHz", "4 kHz", "6 kHz", "8 kHz"};
#define SMETERPIN 27
#define CONTRASTPIN 2
extern bool advancedRDS;
extern bool afmethodBold;
extern bool afpage;
extern bool afscreen;
extern bool artheadold;
extern bool autoDST;
extern bool autolog;
extern bool autosquelch;
extern bool BWreset;
extern bool BWtune;
extern bool change;
extern bool clockampm;
extern bool compressedold;
extern bool dropout;
extern bool dynamicPTYold;
extern bool dynamicspi;
extern bool edgebeep;
extern bool fmsi;
extern bool fullsearchrds;
extern bool hasafold;
extern bool haseonold;
extern bool hasrtplusold;
extern bool hastmcold;
extern bool LowLevelInit;
extern bool menu;
extern bool menuopen;
extern bool mwstepsize;
extern bool rdsreset;
extern bool RDSstatus;
extern bool RDSstatusold;
extern bool rdsstatscreen;
extern bool rdsstereoold;
extern bool usesquelch;
extern bool scandxmode;
extern bool scanholdonsignal;
extern bool scanmem;
extern bool scanmute;
extern bool setupmode;
extern bool showclock;
extern bool showlongps;
extern bool softmuteam;
extern bool softmutefm;
extern bool Stereostatusold;
extern bool StereoToggle;
extern bool TAold;
extern bool TPold;
extern bool USBmode;
extern bool XDRGTKMuteScreen;
extern bool wifi;
extern byte af;
extern byte af_counterold;
extern byte afpagenr;
extern byte amagc;
extern byte amnb;
extern byte amscansens;
extern byte audiomode;
extern byte band;
extern byte bandAM;
extern byte bandFM;
extern byte bandforbidden;
extern byte batteryold;
extern byte batteryoptions;
extern byte BWset;
extern byte BWsettemp;
extern byte ContrastSet;
extern byte CurrentSkin;
extern byte CurrentTheme;
extern byte ECCold;
extern byte fmagc;
extern byte fmscansens;
extern byte fmdefaultstepsize;
extern byte fmnb;
extern byte fmdeemphasis;
extern byte freqfont;
extern byte EQset;
extern byte iMSset;
extern byte amcodect;
extern byte amcodectcount;
extern byte amgain;
extern byte hardwaremodel;
extern byte HighCutLevel;
extern byte HighCutOffset;
extern byte items[10];
extern byte language;
extern byte longbandpress;
extern byte memorypos;
extern byte memdoublepi;
extern byte mempionly;
extern byte memstartpos;
extern byte memstoppos;
extern byte menuitem;
extern byte menupage;
extern byte poweroptions;
extern byte eonptyold[20];
extern byte rdsblockold;
extern byte scancancel;
extern byte scanstart;
extern byte scanstop;
extern byte scanhold;
extern byte scanmodeold;
extern byte screensaverOptions[5];
extern byte screensaverset;
extern byte showmodulation;
extern byte showSWMIBand;
extern byte showrdserrors;
extern byte stationlistid;
extern int8_t CNold;
extern byte StereoLevel;
extern byte StereoLevel;
extern byte submenu;
extern byte subnetclient;
extern byte TEF;
extern byte tot;
extern byte touchrotating;
extern byte tunemode;
extern byte unit;
extern byte spispeed;
extern char eonpicodeold[20][6];
extern byte programTypePrevious;
extern float batteryVold;
extern float vPerold;
extern int ActiveColor;
extern int ActiveColorSmooth;
extern int AMLevelOffset;
extern int BackgroundColor;
extern int BackgroundColor1;
extern int BackgroundColor2;
extern int BackgroundColor3;
extern int BackgroundColor4;
extern int BackgroundColor5;
extern int BarInsignificantColor;
extern int BarSignificantColor;
extern int BatteryValueColor;
extern int BatteryValueColorSmooth;
extern int berPercentold;
extern int BWAutoColor;
extern int BWAutoColorSmooth;
extern int FrameColor;
extern int FreqColor;
extern int FreqColorSmooth;
extern int GreyoutColor;
extern int InsignificantColor;
extern int InsignificantColorSmooth;
extern int menuoption;
extern int ModBarInsignificantColor;
extern int ModBarSignificantColor;
extern int PrimaryColor;
extern int PrimaryColorSmooth;
extern int RDSColor;
extern int RDSColorSmooth;
extern int RDSDropoutColor;
extern int RDSDropoutColorSmooth;
extern int rssiold;
extern int SecondaryColor;
extern int SecondaryColorSmooth;
extern int SignificantColor;
extern int SignificantColorSmooth;
extern int Squelchold;
extern int SStatusold;
extern int StereoColor;
extern int StereoColorSmooth;
extern int WifiColorHigh;
extern int WifiColorLow;
extern int xPos;
extern int xPos2;
extern int xPos3;
extern int xPos4;
extern int xPos5;
extern int16_t SStatus;
extern int8_t LevelOffset;
extern int8_t LowLevelSet;
extern int8_t MPold;
extern int8_t USold;
extern int8_t NTPoffset;
extern int8_t VolSet;
extern String eonpsold[20];
extern String PIold;
extern String PSold;
extern String ptynold;
extern String rds_clockold;
extern String stationIDold;
extern String stationStateold;
extern String XDRGTK_key;
extern unsigned int ConverterSet;
extern unsigned int HighEdgeSet;
extern unsigned int LowEdgeSet;
extern unsigned int mappedfreqold[20];
extern unsigned int mappedfreqold2[20];
extern unsigned int mappedfreqold3[20];
extern unsigned int memstartfreq;
extern unsigned int memstopfreq;
extern unsigned long blockcounterold[33];
extern unsigned long processed_rdsblocksold[33];
extern unsigned long scantimer;
extern byte items[10];
extern const size_t language_totalnumber;
extern TFT_eSPI tft;
extern TEF6686 radio;
extern WiFiConnect wc;
extern TFT_eSprite MenuInfobox;
extern TFT_eSprite FullLineSprite;
extern TFT_eSprite OneBigLineSprite;
extern TFT_eSprite PSSprite;
extern TFT_eSprite FrequencySprite;
void BuildAFScreen();
void BuildRDSStatScreen();
void BuildMenu();
@@ -235,7 +22,6 @@ void DoMenu();
void doTheme();
void Infoboxprint(const char* input);
void drawButton(const char* text, byte button_number, bool active, bool selected);
String removeNewline(String inputString);
String shortLine(String text);
void showMenuOpenTouchButtons();
void showBWSelector();
@@ -263,5 +49,4 @@ extern void showAutoSquelch(bool mode);
extern uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, uint8_t stopmem, bool rdsonly, uint8_t doublepi);
extern void ClearMemoryRange(uint8_t start, uint8_t stop);
extern bool handleCreateNewLogbook();
extern const char* textUI(uint16_t number);
#endif
extern const char* textUI(uint16_t number);
+2 -29
View File
@@ -1,36 +1,10 @@
#ifndef LOGBOOK_H
#define LOGBOOK_H
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <WiFi.h>
#include <FS.h>
using fs::FS;
#include <WebServer.h>
#include <SPIFFS.h>
#include "TEF6686.h"
extern bool autoDST;
extern bool clockampm;
extern bool NTPupdated;
extern bool rtcset;
extern bool scandxmode;
extern byte band;
extern byte chipmodel;
extern byte language;
extern byte scanhold;
extern byte unit;
extern int16_t SStatus;
extern int8_t NTPoffset;
extern unsigned int ConverterSet;
extern unsigned int frequency;
extern unsigned int frequency_OIRT;
extern unsigned int logcounter;
extern IPAddress remoteip;
extern TEF6686 radio;
extern WebServer webserver;
extern WiFiUDP Udp;
#include "globals.h"
void handleRoot();
void handleDownloadCSV();
@@ -44,4 +18,3 @@ void sendUDPlog();
IPAddress makeBroadcastAddress(IPAddress ip);
extern const char* textUI(uint16_t number);
#endif
+2 -4
View File
@@ -1,5 +1,4 @@
#ifndef MENUGRAPHICS_H
#define MENUGRAPHICS_H
#pragma once
static const uint16_t bwselector_wo[] PROGMEM = {
0x630c, 0x39c7, 0x528a, 0x73ae, 0x9492, 0xa514, 0xa534, 0xa534, 0xa534, 0xa534, 0xa534, 0xa534, 0xa534, 0xa514, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0xa514, 0x9cf3, 0x8c71, 0x7bef, 0x7bef, 0x7bef, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x8410, 0x7bef, 0x7bcf, 0x7bcf, 0x7bcf, 0x73ae, 0x73ae, 0x738e, 0x9492, 0xe71c,
@@ -1011,5 +1010,4 @@ static const uint16_t configurationbackground_wo[] PROGMEM = {
0xffff, 0xffff, 0xffff, 0xffdf, 0xffff, 0xef5d, 0xa534, 0x8430, 0x8430, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8430, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8c51, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x8430, 0x9cf3, 0xe71c, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
};
#endif
};
+2 -138
View File
@@ -1,5 +1,4 @@
#ifndef RDS_H
#define RDS_H
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
@@ -7,141 +6,7 @@
#include "TEF6686.h"
#include <WiFi.h>
#include <ESP32Time.h>
extern bool advancedRDS;
extern bool afmethodBold;
extern bool afpage;
extern bool afscreen;
extern bool aftest;
extern bool autoDST;
extern bool artheadold;
extern bool BWreset;
extern bool compressedold;
extern bool clearrds;
extern bool clockampm;
extern bool dropout;
extern bool dynamicPTYold;
extern bool fullsearchrds;
extern bool hasafold;
extern bool hasCTold;
extern bool haseonold;
extern bool hasrtplusold;
extern bool hastmcold;
extern bool memreset;
extern bool NTPupdated;
extern bool rdsreset;
extern bool RDSSPYTCP;
extern bool RDSSPYUSB;
extern bool RDSstatus;
extern bool rdsstatscreen;
extern bool rdsstereoold;
extern bool rtcset;
extern bool screenmute;
extern bool setupmode;
extern bool showclock;
extern bool showlongps;
extern bool TAold;
extern bool TPold;
extern bool wifi;
extern bool XDRGTKTCP;
extern bool XDRGTKUSB;
extern byte af_counterold;
extern byte aid_counterold;
extern byte afpagenr;
extern byte band;
extern byte charwidth;
extern byte CurrentSkin;
extern byte ECCold;
extern byte language;
extern byte eonptyold[20];
extern byte rdsblockold;
extern byte rdsqualityold;
extern byte showrdserrors;
extern byte stationlistid;
extern byte programTypePrevious;
extern char eonpicodeold[20][6];
extern int ActiveColor;
extern int ActiveColorSmooth;
extern int BackgroundColor;
extern int BackgroundColor1;
extern int BackgroundColor2;
extern int BackgroundColor4;
extern int BarSignificantColor;
extern int BarInsignificantColor;
extern int berPercentold;
extern int BWAutoColor;
extern int BWAutoColorSmooth;
extern int FrameColor;
extern int FreqColor;
extern int FreqColorSmooth;
extern int GreyoutColor;
extern int InsignificantColor;
extern int InsignificantColorSmooth;
extern int PrimaryColor;
extern int PrimaryColorSmooth;
extern int RDSColor;
extern int RDSColorSmooth;
extern int RDSDropoutColor;
extern int RDSDropoutColorSmooth;
extern int SecondaryColor;
extern int SecondaryColorSmooth;
extern int SignificantColor;
extern int SignificantColorSmooth;
extern int xPos;
extern int xPos2;
extern int xPos3;
extern int xPos4;
extern int xPos5;
extern int xPos6;
extern int8_t NTPoffset;
extern int16_t SAvg3;
extern IPAddress remoteip;
extern String AIDString;
extern String ECColdString;
extern String ECCString;
extern String eonpsold[20];
extern String PIold;
extern String PSold;
extern String ptynold;
extern String PTYold;
extern String rds_clock;
extern String rds_clockold;
extern String rds_date;
extern String rds_dateold;
extern String RDSSPYRDS;
extern String RDSSPYRDSold;
extern String RTold;
extern String stationIDold;
extern String stationStateold;
extern String XDRGTKRDS;
extern String XDRGTKRDSold;
extern unsigned int mappedfreqold[20];
extern unsigned int mappedfreqold2[20];
extern unsigned int mappedfreqold3[20];
extern unsigned long afticker;
extern unsigned long aftickerhold;
extern unsigned long aftimer;
extern unsigned long blockcounterold[33];
extern unsigned long eccticker;
extern unsigned long ecctickerhold;
extern unsigned long eonticker;
extern unsigned long eontickerhold;
extern unsigned long processed_rdsblocksold[33];
extern unsigned long pslongticker;
extern unsigned long pslongtickerhold;
extern unsigned long rtplusticker;
extern unsigned long rtplustickerhold;
extern unsigned long rtticker;
extern unsigned long rttickerhold;
extern ESP32Time rtc;
extern TFT_eSPI tft;
extern TEF6686 radio;
extern WiFiClient RemoteClient;
extern WiFiUDP Udp;
extern TFT_eSprite FullLineSprite;
extern TFT_eSprite RDSSprite;
extern TFT_eSprite PSSprite;
#include "globals.h"
void ShowAdvancedRDS();
void readRds();
@@ -161,4 +26,3 @@ extern void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, i
extern void tftReplace(int8_t offset, const String & textold, const String & text, int16_t x, int16_t y, int color, int smoothcolor, int background, uint8_t fontsize);
extern bool isDST(time_t t);
extern const char* textUI(uint16_t number);
#endif
+91
View File
@@ -0,0 +1,91 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
class ScrollingTextDisplay {
private:
TFT_eSprite* sprite;
int yPos;
int maxWidth;
int xPos;
int textWidth;
unsigned long lastTick;
unsigned long holdTick;
bool isScrolling;
std::function<void(TFT_eSprite*, bool)> postDrawCallback;
static const unsigned long SCROLL_INTERVAL = 5;
static const unsigned long HOLD_DURATION = 2000;
public:
ScrollingTextDisplay(TFT_eSprite* spr, int y, int maxW)
: sprite(spr), yPos(y), maxWidth(maxW),
xPos(0), textWidth(0), lastTick(0), holdTick(0), isScrolling(false), postDrawCallback(nullptr) {}
void setPostDrawCallback(std::function<void(TFT_eSprite*, bool)> callback) {
postDrawCallback = callback;
}
void update(const String& text, bool status, uint16_t activeColor, uint16_t activeSmooth, uint16_t dropoutColor, uint16_t dropoutSmooth, uint16_t backgroundColor) {
textWidth = sprite->textWidth(text);
if (textWidth < maxWidth) {
xPos = 0;
isScrolling = false;
drawText(text, status, activeColor, activeSmooth, dropoutColor, dropoutSmooth, backgroundColor);
} else {
isScrolling = true;
if (millis() - lastTick >= SCROLL_INTERVAL) {
if (xPos < -textWidth) xPos = 0;
if (xPos == 0) {
if (millis() - holdTick >= HOLD_DURATION) {
xPos--;
holdTick = millis();
}
} else {
xPos--;
holdTick = millis();
}
drawScrollingText(text, status, activeColor, activeSmooth, dropoutColor, dropoutSmooth, backgroundColor);
lastTick = millis();
}
}
}
void reset() {
xPos = 0;
holdTick = millis();
lastTick = millis();
}
void setYPosition(int y) {
yPos = y;
}
bool getIsScrolling() const {
return isScrolling;
}
private:
void drawText(const String& text, bool status, uint16_t activeColor, uint16_t activeSmooth, uint16_t dropoutColor, uint16_t dropoutSmooth, uint16_t backgroundColor) {
sprite->fillSprite(backgroundColor);
if (status) sprite->setTextColor(activeColor, activeSmooth, false);
else sprite->setTextColor(dropoutColor, dropoutSmooth, false);
sprite->drawString(text, xPos, 0);
if (postDrawCallback) postDrawCallback(sprite, false);
sprite->pushSprite(35, yPos);
}
void drawScrollingText(const String& text, bool status, uint16_t activeColor, uint16_t activeSmooth, uint16_t dropoutColor, uint16_t dropoutSmooth, uint16_t backgroundColor) {
sprite->fillSprite(backgroundColor);
if (status) sprite->setTextColor(activeColor, activeSmooth, false);
else sprite->setTextColor(dropoutColor, dropoutSmooth, false);
sprite->drawString(text, xPos, 0);
sprite->drawString(text, xPos + textWidth, 0);
if (postDrawCallback) postDrawCallback(sprite, true);
sprite->pushSprite(35, yPos);
}
};
+1 -20
View File
@@ -1,25 +1,6 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "TEF6686.h"
extern TFT_eSPI tft;
extern TEF6686 radio;
extern bool advancedRDS, afpage, afscreen;
extern bool bwtouchtune, BWtune, leave;
extern bool menu, menuopen, scandxmode;
extern bool seek, touchrepeat;
extern bool XDRGTKTCP, XDRGTKUSB;
extern byte afpagenr;
extern byte band;
extern byte BWset, BWtemp;
extern byte EQset, iMSEQ, iMSset;
extern byte menuitem;
extern byte items[10];
extern byte menupage;
extern int menuoption;
#include "globals.h"
void doTouchEvent(uint16_t x, uint16_t y);
+6 -1
View File
@@ -10,4 +10,9 @@ struct HSV {
};
HSV RGB565toHSV(uint16_t color);
uint16_t HSVtoRGB565(float h, float s, float v);
uint16_t HSVtoRGB565(float h, float s, float v);
String convertToUTF8(const wchar_t* input);
String trimTrailingSpaces(String str);
String ucs2ToUtf8(const char* ucs2Input);
String extractUTF8Substring(const String & utf8String, size_t start, size_t length, bool underscore);
String removeNewline(String inputString);
-40
View File
@@ -1,40 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 240
#endif
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_RGB 0x00
-232
View File
@@ -1,232 +0,0 @@
// This is the command sequence that initialises the GC9A01 driver
{
writecommand(0xEF);
writecommand(0xEB);
writedata(0x14);
writecommand(0xFE);
writecommand(0xEF);
writecommand(0xEB);
writedata(0x14);
writecommand(0x84);
writedata(0x40);
writecommand(0x85);
writedata(0xFF);
writecommand(0x86);
writedata(0xFF);
writecommand(0x87);
writedata(0xFF);
writecommand(0x88);
writedata(0x0A);
writecommand(0x89);
writedata(0x21);
writecommand(0x8A);
writedata(0x00);
writecommand(0x8B);
writedata(0x80);
writecommand(0x8C);
writedata(0x01);
writecommand(0x8D);
writedata(0x01);
writecommand(0x8E);
writedata(0xFF);
writecommand(0x8F);
writedata(0xFF);
writecommand(0xB6);
writedata(0x00);
writedata(0x20);
writecommand(0x3A);
writedata(0x05);
writecommand(0x90);
writedata(0x08);
writedata(0x08);
writedata(0x08);
writedata(0x08);
writecommand(0xBD);
writedata(0x06);
writecommand(0xBC);
writedata(0x00);
writecommand(0xFF);
writedata(0x60);
writedata(0x01);
writedata(0x04);
writecommand(0xC3);
writedata(0x13);
writecommand(0xC4);
writedata(0x13);
writecommand(0xC9);
writedata(0x22);
writecommand(0xBE);
writedata(0x11);
writecommand(0xE1);
writedata(0x10);
writedata(0x0E);
writecommand(0xDF);
writedata(0x21);
writedata(0x0c);
writedata(0x02);
writecommand(0xF0);
writedata(0x45);
writedata(0x09);
writedata(0x08);
writedata(0x08);
writedata(0x26);
writedata(0x2A);
writecommand(0xF1);
writedata(0x43);
writedata(0x70);
writedata(0x72);
writedata(0x36);
writedata(0x37);
writedata(0x6F);
writecommand(0xF2);
writedata(0x45);
writedata(0x09);
writedata(0x08);
writedata(0x08);
writedata(0x26);
writedata(0x2A);
writecommand(0xF3);
writedata(0x43);
writedata(0x70);
writedata(0x72);
writedata(0x36);
writedata(0x37);
writedata(0x6F);
writecommand(0xED);
writedata(0x1B);
writedata(0x0B);
writecommand(0xAE);
writedata(0x77);
writecommand(0xCD);
writedata(0x63);
writecommand(0x70);
writedata(0x07);
writedata(0x07);
writedata(0x04);
writedata(0x0E);
writedata(0x0F);
writedata(0x09);
writedata(0x07);
writedata(0x08);
writedata(0x03);
writecommand(0xE8);
writedata(0x34);
writecommand(0x62);
writedata(0x18);
writedata(0x0D);
writedata(0x71);
writedata(0xED);
writedata(0x70);
writedata(0x70);
writedata(0x18);
writedata(0x0F);
writedata(0x71);
writedata(0xEF);
writedata(0x70);
writedata(0x70);
writecommand(0x63);
writedata(0x18);
writedata(0x11);
writedata(0x71);
writedata(0xF1);
writedata(0x70);
writedata(0x70);
writedata(0x18);
writedata(0x13);
writedata(0x71);
writedata(0xF3);
writedata(0x70);
writedata(0x70);
writecommand(0x64);
writedata(0x28);
writedata(0x29);
writedata(0xF1);
writedata(0x01);
writedata(0xF1);
writedata(0x00);
writedata(0x07);
writecommand(0x66);
writedata(0x3C);
writedata(0x00);
writedata(0xCD);
writedata(0x67);
writedata(0x45);
writedata(0x45);
writedata(0x10);
writedata(0x00);
writedata(0x00);
writedata(0x00);
writecommand(0x67);
writedata(0x00);
writedata(0x3C);
writedata(0x00);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0x54);
writedata(0x10);
writedata(0x32);
writedata(0x98);
writecommand(0x74);
writedata(0x10);
writedata(0x85);
writedata(0x80);
writedata(0x00);
writedata(0x00);
writedata(0x4E);
writedata(0x00);
writecommand(0x98);
writedata(0x3e);
writedata(0x07);
writecommand(0x35);
writecommand(0x21);
writecommand(0x11);
delay(120);
writecommand(0x29);
delay(20);
}
@@ -1,56 +0,0 @@
// This is the command sequence that rotates the GC9A01 driver coordinate frame
rotation = m % 4;
writecommand(TFT_MADCTL);
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
#ifdef CGRAM_OFFSET
if (_init_width == 128)
{
colstart = 2;
rowstart = 1;
}
#endif
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
_width = _init_height;
_height = _init_width;
#ifdef CGRAM_OFFSET
if (_init_width == 128)
{
colstart = 1;
rowstart = 2;
}
#endif
break;
case 2: // Inverter portrait
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
#ifdef CGRAM_OFFSET
if (_init_width == 128)
{
colstart = 2;
rowstart = 1;
}
#endif
break;
case 3: // Inverted landscape
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
_width = _init_height;
_height = _init_width;
#ifdef CGRAM_OFFSET
if (_init_width == 128)
{
colstart = 1;
rowstart = 2;
}
#endif
break;
}
@@ -1,52 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPar.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
-76
View File
@@ -1,76 +0,0 @@
// This is the command sequence that initialises the HX8357B driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
// Configure HX8357-B display
writecommand(0x11);
delay(20);
writecommand(0xD0);
writedata(0x07);
writedata(0x42);
writedata(0x18);
writecommand(0xD1);
writedata(0x00);
writedata(0x07);
writedata(0x10);
writecommand(0xD2);
writedata(0x01);
writedata(0x02);
writecommand(0xC0);
writedata(0x10);
writedata(0x3B);
writedata(0x00);
writedata(0x02);
writedata(0x11);
writecommand(0xC5);
writedata(0x08);
writecommand(0xC8);
writedata(0x00);
writedata(0x32);
writedata(0x36);
writedata(0x45);
writedata(0x06);
writedata(0x16);
writedata(0x37);
writedata(0x75);
writedata(0x77);
writedata(0x54);
writedata(0x0C);
writedata(0x00);
writecommand(0x36);
writedata(0x0a);
writecommand(0x3A);
writedata(0x55);
writecommand(0x2A);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0x3F);
writecommand(0x2B);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0xDF);
delay(120);
writecommand(0x29);
delay(25);
// End of HX8357B display configuration
@@ -1,47 +0,0 @@
// This is the command sequence that rotates the HX8357C driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 8;
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX);
_width = _init_width;
_height = _init_height;
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV);
_width = _init_height;
_height = _init_width;
break;
case 2: // Inverter portrait
writedata( TFT_MAD_COLOR_ORDER | TFT_MAD_MY);
_width = _init_width;
_height = _init_height;
break;
case 3: // Inverted landscape
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
_width = _init_height;
_height = _init_width;
break;
case 4: // Portrait
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX | TFT_MAD_MY);
_width = _init_width;
_height = _init_height;
break;
case 5: // Landscape (Portrait + 90)
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX);
_width = _init_height;
_height = _init_width;
break;
case 6: // Inverter portrait
writedata( TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 7: // Inverted landscape
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MY);
_width = _init_height;
_height = _init_width;
break;
}
@@ -1,52 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPar.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
-116
View File
@@ -1,116 +0,0 @@
// This is the command sequence that initialises the HX8357C driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
// Configure HX8357C display
writecommand(0xB9); // Enable extension command
writedata(0xFF);
writedata(0x83);
writedata(0x57);
delay(50);
writecommand(0xB6); //Set VCOM voltage
writedata(0x2C); //0x52 for HSD 3.0"
writecommand(0x11); // Sleep off
delay(200);
writecommand(0x35); // Tearing effect on
writedata(0x00); // Added parameter
writecommand(0x3A); // Interface pixel format
writedata(0x55); // 16 bits per pixel
//writecommand(0xCC); // Set panel characteristic
//writedata(0x09); // S960>S1, G1>G480, R-G-B, normally black
//writecommand(0xB3); // RGB interface
//writedata(0x43);
//writedata(0x00);
//writedata(0x06);
//writedata(0x06);
writecommand(0xB1); // Power control
writedata(0x00);
writedata(0x15);
writedata(0x0D);
writedata(0x0D);
writedata(0x83);
writedata(0x48);
writecommand(0xC0); // Does this do anything?
writedata(0x24);
writedata(0x24);
writedata(0x01);
writedata(0x3C);
writedata(0xC8);
writedata(0x08);
writecommand(0xB4); // Display cycle
writedata(0x02);
writedata(0x40);
writedata(0x00);
writedata(0x2A);
writedata(0x2A);
writedata(0x0D);
writedata(0x4F);
writecommand(0xE0); // Gamma curve
writedata(0x00);
writedata(0x15);
writedata(0x1D);
writedata(0x2A);
writedata(0x31);
writedata(0x42);
writedata(0x4C);
writedata(0x53);
writedata(0x45);
writedata(0x40);
writedata(0x3B);
writedata(0x32);
writedata(0x2E);
writedata(0x28);
writedata(0x24);
writedata(0x03);
writedata(0x00);
writedata(0x15);
writedata(0x1D);
writedata(0x2A);
writedata(0x31);
writedata(0x42);
writedata(0x4C);
writedata(0x53);
writedata(0x45);
writedata(0x40);
writedata(0x3B);
writedata(0x32);
writedata(0x2E);
writedata(0x28);
writedata(0x24);
writedata(0x03);
writedata(0x00);
writedata(0x01);
writecommand(0x36); // MADCTL Memory access control
writedata(0x48);
delay(20);
writecommand(0x21); //Display inversion on
delay(20);
writecommand(0x29); // Display on
delay(120);
// End of HX8357C display configuration
@@ -1,47 +0,0 @@
// This is the command sequence that rotates the HX8357C driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 8;
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX);
_width = _init_width;
_height = _init_height;
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV);
_width = _init_height;
_height = _init_width;
break;
case 2: // Inverter portrait
writedata( TFT_MAD_COLOR_ORDER | TFT_MAD_MY);
_width = _init_width;
_height = _init_height;
break;
case 3: // Inverted landscape
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
_width = _init_height;
_height = _init_width;
break;
case 4: // Portrait
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MX | TFT_MAD_MY);
_width = _init_width;
_height = _init_height;
break;
case 5: // Landscape (Portrait + 90)
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MX);
_width = _init_height;
_height = _init_width;
break;
case 6: // Inverter portrait
writedata( TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 7: // Inverted landscape
writedata(TFT_MAD_COLOR_ORDER | TFT_MAD_MV | TFT_MAD_MY);
_width = _init_height;
_height = _init_width;
break;
}
@@ -1,96 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPar.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#endif
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
#define HX8357_NOP 0x00
#define HX8357_SWRESET 0x01
#define HX8357_RDDID 0x04
#define HX8357_RDDST 0x09
#define HX8357_RDPOWMODE 0x0A
#define HX8357_RDMADCTL 0x0B
#define HX8357_RDCOLMOD 0x0C
#define HX8357_RDDIM 0x0D
#define HX8357_RDDSDR 0x0F
#define HX8357_SLPIN 0x10
#define HX8357_SLPOUT 0x11
#define HX8357_INVOFF 0x20
#define HX8357_INVON 0x21
#define HX8357_DISPOFF 0x28
#define HX8357_DISPON 0x29
#define HX8357_CASET 0x2A
#define HX8357_PASET 0x2B
#define HX8357_RAMWR 0x2C
#define HX8357_RAMRD 0x2E
#define HX8357_TEON 0x35
#define HX8357_TEARLINE 0x44
#define HX8357_MADCTL 0x36
#define HX8357_COLMOD 0x3A
#define HX8357_SETOSC 0xB0
#define HX8357_SETPWR1 0xB1
#define HX8357_SETRGB 0xB3
#define HX8357D_SETCOM 0xB6
#define HX8357D_SETCYC 0xB4
#define HX8357D_SETC 0xB9
#define HX8357D_SETSTBA 0xC0
#define HX8357_SETPANEL 0xCC
#define HX8357D_SETGAMMA 0xE0
-118
View File
@@ -1,118 +0,0 @@
// This is the command sequence that initialises the HX8357D driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
// Configure HX8357D display
// setextc
writecommand(HX8357D_SETC);
writedata(0xFF);
writedata(0x83);
writedata(0x57);
delay(300);
// setRGB which also enables SDO
writecommand(HX8357_SETRGB);
writedata(0x80); //enable SDO pin!
// writedata(0x00); //disable SDO pin!
writedata(0x0);
writedata(0x06);
writedata(0x06);
writecommand(HX8357D_SETCOM);
writedata(0x25); // -1.52V
writecommand(HX8357_SETOSC);
writedata(0x68); // Normal mode 70Hz, Idle mode 55 Hz
writecommand(HX8357_SETPANEL); //Set Panel
writedata(0x05); // BGR, Gate direction swapped
writecommand(HX8357_SETPWR1);
writedata(0x00); // Not deep standby
writedata(0x15); //BT
writedata(0x1C); //VSPR
writedata(0x1C); //VSNR
writedata(0x83); //AP
writedata(0xAA); //FS
writecommand(HX8357D_SETSTBA);
writedata(0x50); //OPON normal
writedata(0x50); //OPON idle
writedata(0x01); //STBA
writedata(0x3C); //STBA
writedata(0x1E); //STBA
writedata(0x08); //GEN
writecommand(HX8357D_SETCYC);
writedata(0x02); //NW 0x02
writedata(0x40); //RTN
writedata(0x00); //DIV
writedata(0x2A); //DUM
writedata(0x2A); //DUM
writedata(0x0D); //GDON
writedata(0x78); //GDOFF
writecommand(HX8357D_SETGAMMA);
writedata(0x02);
writedata(0x0A);
writedata(0x11);
writedata(0x1d);
writedata(0x23);
writedata(0x35);
writedata(0x41);
writedata(0x4b);
writedata(0x4b);
writedata(0x42);
writedata(0x3A);
writedata(0x27);
writedata(0x1B);
writedata(0x08);
writedata(0x09);
writedata(0x03);
writedata(0x02);
writedata(0x0A);
writedata(0x11);
writedata(0x1d);
writedata(0x23);
writedata(0x35);
writedata(0x41);
writedata(0x4b);
writedata(0x4b);
writedata(0x42);
writedata(0x3A);
writedata(0x27);
writedata(0x1B);
writedata(0x08);
writedata(0x09);
writedata(0x03);
writedata(0x00);
writedata(0x01);
writecommand(HX8357_COLMOD);
writedata(0x55); // 16-bit
writecommand(HX8357_MADCTL);
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
writecommand(HX8357_TEON); // TE off
writedata(0x00);
writecommand(HX8357_TEARLINE); // tear line
writedata(0x00);
writedata(0x02);
writecommand(HX8357_SLPOUT); //Exit Sleep
delay(150);
writecommand(HX8357_DISPON); // display on
delay(50);
// End of HX8357D display configuration
@@ -1,26 +0,0 @@
// This is the command sequence that rotates the HX8357D driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 4;
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
case 2: // Inverter portrait
writedata(TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 3: // Inverted landscape
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
}
@@ -1,65 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#ifndef TFT_WIDTH
#define TFT_WIDTH 128
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 160
#endif
#if (TFT_HEIGHT == 128) && (TFT_WIDTH == 128)
#define CGRAM_OFFSET
#endif
// Color definitions for backwards compatibility with old sketches
// use colour definitions like TFT_BLACK to make sketches more portable
#define ILI9163_BLACK 0x0000 /* 0, 0, 0 */
#define ILI9163_NAVY 0x000F /* 0, 0, 128 */
#define ILI9163_DARKGREEN 0x03E0 /* 0, 128, 0 */
#define ILI9163_DARKCYAN 0x03EF /* 0, 128, 128 */
#define ILI9163_MAROON 0x7800 /* 128, 0, 0 */
#define ILI9163_PURPLE 0x780F /* 128, 0, 128 */
#define ILI9163_OLIVE 0x7BE0 /* 128, 128, 0 */
#define ILI9163_LIGHTGREY 0xC618 /* 192, 192, 192 */
#define ILI9163_DARKGREY 0x7BEF /* 128, 128, 128 */
#define ILI9163_BLUE 0x001F /* 0, 0, 255 */
#define ILI9163_GREEN 0x07E0 /* 0, 255, 0 */
#define ILI9163_CYAN 0x07FF /* 0, 255, 255 */
#define ILI9163_RED 0xF800 /* 255, 0, 0 */
#define ILI9163_MAGENTA 0xF81F /* 255, 0, 255 */
#define ILI9163_YELLOW 0xFFE0 /* 255, 255, 0 */
#define ILI9163_WHITE 0xFFFF /* 255, 255, 255 */
#define ILI9163_ORANGE 0xFD20 /* 255, 165, 0 */
#define ILI9163_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
#define ILI9163_PINK 0xF81F
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_RGB 0x00
-41
View File
@@ -1,41 +0,0 @@
// This is the command sequence that initialises the ILI9163 driver
//
// This setup information is in a format accecpted by the commandList() function
// which reduces FLASH space, but on an ESP8266 there is plenty available!
//
// See ILI9341_Setup.h file for an alternative simpler format
{
// Initialization commands for ILI9163 screens
static const uint8_t ILI9163_cmds[] PROGMEM =
{
17, // 17 commands follow
0x01, 0 + TFT_INIT_DELAY, 120, // Software reset
0x11, 0 + TFT_INIT_DELAY, 5, // Exit sleep mode
0x3A, 1, 0x05, // Set pixel format
0x26, 1, 0x04, // Set Gamma curve 3
0xF2, 1, 0x01, // Gamma adjustment enabled
0xE0, 15, 0x3F, 0x25, 0x1C, 0x1E, 0x20, 0x12, 0x2A, 0x90,
0x24, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, // Positive Gamma
0xE1, 15, 0x20, 0x20, 0x20, 0x20, 0x05, 0x00, 0x15,0xA7,
0x3D, 0x18, 0x25, 0x2A, 0x2B, 0x2B, 0x3A, // Negative Gamma
0xB1, 2, 0x08, 0x08, // Frame rate control 1
0xB4, 1, 0x07, // Display inversion
0xC0, 2, 0x0A, 0x02, // Power control 1
0xC1, 1, 0x02, // Power control 2
0xC5, 2, 0x50, 0x5B, // Vcom control 1
0xC7, 1, 0x40, // Vcom offset
0x2A, 4, 0x00, 0x00, 0x00, 0x7F, // Set column address
0x2B, 4 + TFT_INIT_DELAY, 0x00, 0x00, 0x00, 0x9F, 250, // Set page address
0x36, 1, 0xC8, // Set address mode
0x29, 0, // Set display on
};
commandList(ILI9163_cmds);
#ifdef CGRAM_OFFSET
colstart = 0;
rowstart = 0;
#endif
}
@@ -1,44 +0,0 @@
// This is the command sequence that rotates the ILI9163 driver coordinate frame
rotation = m % 4;
writecommand(TFT_MADCTL);
switch (rotation) {
case 0:
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
#ifdef CGRAM_OFFSET
colstart = 0;
rowstart = 0;
#endif
break;
case 1:
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
_width = _init_height;
_height = _init_width;
#ifdef CGRAM_OFFSET
colstart = 0;
rowstart = 0;
#endif
break;
case 2:
writedata(TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
#ifdef CGRAM_OFFSET
colstart = 0;
rowstart = 32;
#endif
break;
case 3:
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
_width = _init_height;
_height = _init_width;
#ifdef CGRAM_OFFSET
colstart = 32;
rowstart = 0;
#endif
break;
}
@@ -1,84 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 176
#define TFT_HEIGHT 220
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x28
#define TFT_CASET 0
#define TFT_PASET 0
#define TFT_CASET1 ILI9225_HORIZONTAL_WINDOW_ADDR2
#define TFT_CASET2 ILI9225_HORIZONTAL_WINDOW_ADDR1
#define TFT_PASET1 ILI9225_VERTICAL_WINDOW_ADDR2
#define TFT_PASET2 ILI9225_VERTICAL_WINDOW_ADDR1
#define TFT_RAM_ADDR1 ILI9225_RAM_ADDR_SET1
#define TFT_RAM_ADDR2 ILI9225_RAM_ADDR_SET2
#define TFT_RAMWR ILI9225_GRAM_DATA_REG
#define TFT_MAD_BGR 0x10
#define TFT_MAD_RGB 0x00
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
// Not used
#define TFT_INVOFF 0x00
#define TFT_INVON 0x00
#define TFT_RAMRD 0x00
#define TFT_IDXRD 0x00
/* ILI9225 Registers */
#define ILI9225_DRIVER_OUTPUT_CTRL 0x01 // Driver Output Control
#define ILI9225_LCD_AC_DRIVING_CTRL 0x02 // LCD AC Driving Control
#define ILI9225_ENTRY_MODE 0x03 // Entry Mode
#define ILI9225_DISP_CTRL1 0x07 // Display Control 1
#define ILI9225_BLANK_PERIOD_CTRL1 0x08 // Blank Period Control
#define ILI9225_FRAME_CYCLE_CTRL 0x0B // Frame Cycle Control
#define ILI9225_INTERFACE_CTRL 0x0C // Interface Control
#define ILI9225_OSC_CTRL 0x0F // Osc Control
#define ILI9225_POWER_CTRL1 0x10 // Power Control 1
#define ILI9225_POWER_CTRL2 0x11 // Power Control 2
#define ILI9225_POWER_CTRL3 0x12 // Power Control 3
#define ILI9225_POWER_CTRL4 0x13 // Power Control 4
#define ILI9225_POWER_CTRL5 0x14 // Power Control 5
#define ILI9225_VCI_RECYCLING 0x15 // VCI Recycling
#define ILI9225_RAM_ADDR_SET1 0x20 // Horizontal GRAM Address Set
#define ILI9225_RAM_ADDR_SET2 0x21 // Vertical GRAM Address Set
#define ILI9225_GRAM_DATA_REG 0x22 // GRAM Data Register
#define ILI9225_GATE_SCAN_CTRL 0x30 // Gate Scan Control Register
#define ILI9225_VERTICAL_SCROLL_CTRL1 0x31 // Vertical Scroll Control 1 Register
#define ILI9225_VERTICAL_SCROLL_CTRL2 0x32 // Vertical Scroll Control 2 Register
#define ILI9225_VERTICAL_SCROLL_CTRL3 0x33 // Vertical Scroll Control 3 Register
#define ILI9225_PARTIAL_DRIVING_POS1 0x34 // Partial Driving Position 1 Register
#define ILI9225_PARTIAL_DRIVING_POS2 0x35 // Partial Driving Position 2 Register
#define ILI9225_HORIZONTAL_WINDOW_ADDR1 0x36 // Horizontal Address Start Position
#define ILI9225_HORIZONTAL_WINDOW_ADDR2 0x37 // Horizontal Address End Position
#define ILI9225_VERTICAL_WINDOW_ADDR1 0x38 // Vertical Address Start Position
#define ILI9225_VERTICAL_WINDOW_ADDR2 0x39 // Vertical Address End Position
#define ILI9225_GAMMA_CTRL1 0x50 // Gamma Control 1
#define ILI9225_GAMMA_CTRL2 0x51 // Gamma Control 2
#define ILI9225_GAMMA_CTRL3 0x52 // Gamma Control 3
#define ILI9225_GAMMA_CTRL4 0x53 // Gamma Control 4
#define ILI9225_GAMMA_CTRL5 0x54 // Gamma Control 5
#define ILI9225_GAMMA_CTRL6 0x55 // Gamma Control 6
#define ILI9225_GAMMA_CTRL7 0x56 // Gamma Control 7
#define ILI9225_GAMMA_CTRL8 0x57 // Gamma Control 8
#define ILI9225_GAMMA_CTRL9 0x58 // Gamma Control 9
#define ILI9225_GAMMA_CTRL10 0x59 // Gamma Control 10
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x00 // Not used unless commandlist invoked
-105
View File
@@ -1,105 +0,0 @@
// This is the command sequence that initialises the ILI9225 driver
{
writecommand(ILI9225_POWER_CTRL1);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_POWER_CTRL2);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_POWER_CTRL3);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_POWER_CTRL4);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_POWER_CTRL5);
writedata(0x00);writedata(0x00);
delay(40);
writecommand(ILI9225_POWER_CTRL2);
writedata(0x00);writedata(0x18);
writecommand(ILI9225_POWER_CTRL3);
writedata(0x61);writedata(0x21);
writecommand(ILI9225_POWER_CTRL4);
writedata(0x00);writedata(0x6F);
writecommand(ILI9225_POWER_CTRL5);
writedata(0x49);writedata(0x5F);
writecommand(ILI9225_POWER_CTRL1);
writedata(0x08);writedata(0x00);
delay(10);
writecommand(ILI9225_POWER_CTRL2);
writedata(0x10);writedata(0x3B);
delay(50);
writecommand(ILI9225_LCD_AC_DRIVING_CTRL);
writedata(0x01);writedata(0x00);
writecommand(ILI9225_DISP_CTRL1);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_BLANK_PERIOD_CTRL1);
writedata(0x08);writedata(0x08);
writecommand(ILI9225_FRAME_CYCLE_CTRL);
writedata(0x11);writedata(0x00);
writecommand(ILI9225_INTERFACE_CTRL);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_OSC_CTRL);
writedata(0x0D);writedata(0x01);
writecommand(ILI9225_VCI_RECYCLING);
writedata(0x00);writedata(0x20);
writecommand(ILI9225_RAM_ADDR_SET1);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_RAM_ADDR_SET2);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_GATE_SCAN_CTRL);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_VERTICAL_SCROLL_CTRL1);
writedata(0x00);writedata(0xDB);
writecommand(ILI9225_VERTICAL_SCROLL_CTRL2);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_VERTICAL_SCROLL_CTRL3);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_PARTIAL_DRIVING_POS1);
writedata(0x00);writedata(0xDB);
writecommand(ILI9225_PARTIAL_DRIVING_POS2);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_HORIZONTAL_WINDOW_ADDR1);
writedata(0x00);writedata(0xAF);
writecommand(ILI9225_HORIZONTAL_WINDOW_ADDR2);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_VERTICAL_WINDOW_ADDR1);
writedata(0x00);writedata(0xDB);
writecommand(ILI9225_VERTICAL_WINDOW_ADDR2);
writedata(0x00);writedata(0x00);
/* Set GAMMA curve */
writecommand(ILI9225_GAMMA_CTRL1);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_GAMMA_CTRL2);
writedata(0x08);writedata(0x08);
writecommand(ILI9225_GAMMA_CTRL3);
writedata(0x08);writedata(0x0A);
writecommand(ILI9225_GAMMA_CTRL4);
writedata(0x00);writedata(0x0A);
writecommand(ILI9225_GAMMA_CTRL5);
writedata(0x0A);writedata(0x08);
writecommand(ILI9225_GAMMA_CTRL6);
writedata(0x08);writedata(0x08);
writecommand(ILI9225_GAMMA_CTRL7);
writedata(0x00);writedata(0x00);
writecommand(ILI9225_GAMMA_CTRL8);
writedata(0x0A);writedata(0x00);
writecommand(ILI9225_GAMMA_CTRL9);
writedata(0x07);writedata(0x10);
writecommand(ILI9225_GAMMA_CTRL10);
writedata(0x07);writedata(0x10);
writecommand(ILI9225_DISP_CTRL1);
writedata(0x00);writedata(0x12);
delay(50);
writecommand(ILI9225_DISP_CTRL1);
writedata(0x10);writedata(0x17);
}
@@ -1,39 +0,0 @@
// This is the command sequence that rotates the ILI9225 driver coordinate frame
rotation = m % 4; // Limit the range of values to 0-3
switch (rotation) {
case 0:
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
writedata(0x01);writedata(0x1C);
writecommand(ILI9225_ENTRY_MODE);
writedata(TFT_MAD_COLOR_ORDER);writedata(0x30);
_width = _init_width;
_height = _init_height;
break;
case 1:
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
writedata(0x00);writedata(0x1C);
writecommand(ILI9225_ENTRY_MODE);
writedata(TFT_MAD_COLOR_ORDER);writedata(0x38);
_width = _init_height;
_height = _init_width;
break;
case 2:
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
writedata(0x02);writedata(0x1C);
writecommand(ILI9225_ENTRY_MODE);
writedata(TFT_MAD_COLOR_ORDER);writedata(0x30);
_width = _init_width;
_height = _init_height;
break;
case 3:
writecommand(ILI9225_DRIVER_OUTPUT_CTRL);
writedata(0x03);writedata(0x1C);
writecommand(ILI9225_ENTRY_MODE);
writedata(TFT_MAD_COLOR_ORDER);writedata(0x38);
_width = _init_height;
_height = _init_width;
break;
}
@@ -1,64 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
// For Raspberry Pi ILI9486 only with a modified board to add a write strobe:
#if defined (TFT_WR) && defined (RPI_ILI9486_DRIVER)
#define RPI_WRITE_STROBE
#endif
// Color definitions for backwards compatibility with old sketches
// use colour definitions like TFT_BLACK to make sketches more portable
#define ILI9486_BLACK 0x0000 /* 0, 0, 0 */
#define ILI9486_NAVY 0x000F /* 0, 0, 128 */
#define ILI9486_DARKGREEN 0x03E0 /* 0, 128, 0 */
#define ILI9486_DARKCYAN 0x03EF /* 0, 128, 128 */
#define ILI9486_MAROON 0x7800 /* 128, 0, 0 */
#define ILI9486_PURPLE 0x780F /* 128, 0, 128 */
#define ILI9486_OLIVE 0x7BE0 /* 128, 128, 0 */
#define ILI9486_LIGHTGREY 0xC618 /* 192, 192, 192 */
#define ILI9486_DARKGREY 0x7BEF /* 128, 128, 128 */
#define ILI9486_BLUE 0x001F /* 0, 0, 255 */
#define ILI9486_GREEN 0x07E0 /* 0, 255, 0 */
#define ILI9486_CYAN 0x07FF /* 0, 255, 255 */
#define ILI9486_RED 0xF800 /* 255, 0, 0 */
#define ILI9486_MAGENTA 0xF81F /* 255, 0, 255 */
#define ILI9486_YELLOW 0xFFE0 /* 255, 255, 0 */
#define ILI9486_WHITE 0xFFFF /* 255, 255, 255 */
#define ILI9486_ORANGE 0xFD20 /* 255, 165, 0 */
#define ILI9486_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
#define ILI9486_PINK 0xF81F
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#define TFT_MAD_RGB 0x00
-84
View File
@@ -1,84 +0,0 @@
// This is the command sequence that initialises the ILI9486 driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
{
// From https://github.com/notro/fbtft/blob/master/fb_ili9486.c
writecommand(0x01); // SW reset
delay(120);
writecommand(0x11); // Sleep out, also SW reset
delay(120);
writecommand(0x3A);
#if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
writedata(0x55); // 16-bit colour interface
#else
writedata(0x66); // 18-bit colour interface
#endif
writecommand(0xC0); // 1100.0000 Power Control 1
writedata(0x0E); // 0001.0111 ... VRH1
writedata(0x0E); // 0001.0101 ... VRH2
writecommand(0xC1); // 1100.0001 Power Control 2
writedata(0x41); // 0100.0001 . SAP BT
writedata(0x00); // 0000.0000 ..... VC
writecommand(0xC2); // 1100.0010 Power Control 3
writedata(0x55); // nb. was 0x44 0101.0101 . DCA1 . DCA0
writecommand(0xC5);
writedata(0x00);
writedata(0x00);
writedata(0x00);
writedata(0x00);
writecommand(0xE0);
writedata(0x0F);
writedata(0x1F);
writedata(0x1C);
writedata(0x0C);
writedata(0x0F);
writedata(0x08);
writedata(0x48);
writedata(0x98);
writedata(0x37);
writedata(0x0A);
writedata(0x13);
writedata(0x04);
writedata(0x11);
writedata(0x0D);
writedata(0x00);
writecommand(0xE1);
writedata(0x0F);
writedata(0x32);
writedata(0x2E);
writedata(0x0B);
writedata(0x0D);
writedata(0x05);
writedata(0x47);
writedata(0x75);
writedata(0x37);
writedata(0x06);
writedata(0x10);
writedata(0x03);
writedata(0x24);
writedata(0x20);
writedata(0x00);
#if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
writecommand(TFT_INVOFF);
#else
writecommand(TFT_INVON);
#endif
writecommand(0x36);
writedata(0x48);
writecommand(0x29); // display on
delay(150);
}
@@ -1,47 +0,0 @@
// This is the command sequence that rotates the ILI9486 driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 8;
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_BGR | TFT_MAD_MX);
_width = _init_width;
_height = _init_height;
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_BGR | TFT_MAD_MV);
_width = _init_height;
_height = _init_width;
break;
case 2: // Inverter portrait
writedata( TFT_MAD_BGR | TFT_MAD_MY);
_width = _init_width;
_height = _init_height;
break;
case 3: // Inverted landscape
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
_width = _init_height;
_height = _init_width;
break;
case 4: // Portrait
writedata(TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_MY);
_width = _init_width;
_height = _init_height;
break;
case 5: // Landscape (Portrait + 90)
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX);
_width = _init_height;
_height = _init_width;
break;
case 6: // Inverter portrait
writedata( TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
break;
case 7: // Inverted landscape
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MY);
_width = _init_height;
_height = _init_width;
break;
}
@@ -1,42 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
-99
View File
@@ -1,99 +0,0 @@
// This is the command sequence that initialises the ILI9488 driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
// Configure ILI9488 display
writecommand(0xE0); // Positive Gamma Control
writedata(0x00);
writedata(0x03);
writedata(0x09);
writedata(0x08);
writedata(0x16);
writedata(0x0A);
writedata(0x3F);
writedata(0x78);
writedata(0x4C);
writedata(0x09);
writedata(0x0A);
writedata(0x08);
writedata(0x16);
writedata(0x1A);
writedata(0x0F);
writecommand(0XE1); // Negative Gamma Control
writedata(0x00);
writedata(0x16);
writedata(0x19);
writedata(0x03);
writedata(0x0F);
writedata(0x05);
writedata(0x32);
writedata(0x45);
writedata(0x46);
writedata(0x04);
writedata(0x0E);
writedata(0x0D);
writedata(0x35);
writedata(0x37);
writedata(0x0F);
writecommand(0XC0); // Power Control 1
writedata(0x17);
writedata(0x15);
writecommand(0xC1); // Power Control 2
writedata(0x41);
writecommand(0xC5); // VCOM Control
writedata(0x00);
writedata(0x12);
writedata(0x80);
writecommand(TFT_MADCTL); // Memory Access Control
writedata(0x48); // MX, BGR
writecommand(0x3A); // Pixel Interface Format
#if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
writedata(0x55); // 16-bit colour for parallel
#else
writedata(0x66); // 18-bit colour for SPI
#endif
writecommand(0xB0); // Interface Mode Control
writedata(0x00);
writecommand(0xB1); // Frame Rate Control
writedata(0xA0);
writecommand(0xB4); // Display Inversion Control
writedata(0x02);
writecommand(0xB6); // Display Function Control
writedata(0x02);
writedata(0x02);
writedata(0x3B);
writecommand(0xB7); // Entry Mode Set
writedata(0xC6);
writecommand(0xF7); // Adjust Control 3
writedata(0xA9);
writedata(0x51);
writedata(0x2C);
writedata(0x82);
writecommand(TFT_SLPOUT); //Exit Sleep
delay(120);
writecommand(TFT_DISPON); //Display on
delay(25);
// End of ILI9488 display configuration
@@ -1,27 +0,0 @@
// This is the command sequence that rotates the ILI9488 driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 4;
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_MX | TFT_MAD_BGR);
_width = TFT_WIDTH;
_height = TFT_HEIGHT;
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_MV | TFT_MAD_BGR);
_width = TFT_HEIGHT;
_height = TFT_WIDTH;
break;
case 2: // Inverter portrait
writedata(TFT_MAD_MY | TFT_MAD_BGR);
_width = TFT_WIDTH;
_height = TFT_HEIGHT;
break;
case 3: // Inverted landscape
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_BGR);
_width = TFT_HEIGHT;
_height = TFT_WIDTH;
break;
}
-42
View File
@@ -1,42 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
-80
View File
@@ -1,80 +0,0 @@
// This is the command sequence that initialises the R61581 driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
// Configure R61581 display
writecommand(TFT_SLPOUT);
delay(20);
writecommand(0xB0);
writedata(0x00);
writecommand(0xD0);
writedata(0x07);
writedata(0x42);
writedata(0x18);
writecommand(0xD1);
writedata(0x00);
writedata(0x07);
writedata(0x10);
writecommand(0xD2);
writedata(0x01);
writedata(0x02);
writecommand(0xC0);
writedata(0x12);
writedata(0x3B);
writedata(0x00);
writedata(0x02);
writedata(0x11);
writecommand(0xC5);
writedata(0x03);
writecommand(0xC8);
writedata(0x00);
writedata(0x32);
writedata(0x36);
writedata(0x45);
writedata(0x06);
writedata(0x16);
writedata(0x37);
writedata(0x75);
writedata(0x77);
writedata(0x54);
writedata(0x0C);
writedata(0x00);
writecommand(TFT_MADCTL);
writedata(0x0A);
writecommand(0x3A);
writedata(0x55);
writecommand(TFT_CASET);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0x3F);
writecommand(TFT_PASET);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0xDF);
delay(120);
writecommand(TFT_DISPON);
delay(25);
// End of R61581 display configuration
@@ -1,27 +0,0 @@
// This is the command sequence that rotates the R61581 driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 4;
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_BGR | TFT_MAD_MX);
_width = TFT_WIDTH;
_height = TFT_HEIGHT;
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_MV | TFT_MAD_BGR);
_width = TFT_HEIGHT;
_height = TFT_WIDTH;
break;
case 2: // Inverter portrait
writedata(TFT_MAD_BGR | TFT_MAD_GS);
_width = TFT_WIDTH;
_height = TFT_HEIGHT;
break;
case 3: // Inverted landscape
writedata(TFT_MAD_MV | TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_GS);
_width = TFT_HEIGHT;
_height = TFT_WIDTH;
break;
}
@@ -1,52 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
// RM68120_DRIVER
#define TFT_WIDTH 480
#define TFT_HEIGHT 800
//Set driver type common to all TBD initialisation options
#ifndef RM68120_DRIVER
#define RM68120_DRIVER
#endif
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x0000
#define TFT_SWRST 0x0100
#define TFT_INVOFF 0x2000
#define TFT_INVON 0x2100
#define TFT_DISPOFF 0x2800
#define TFT_DISPON 0x2900
#define TFT_CASET 0x2A00
#define TFT_PASET 0x2B00
#define TFT_RAMWR 0x2C00
#define TFT_RAMRD 0x2E00
#define TFT_IDXRD 0xDD00 // ILI9341 only, indexed control register read
#define TFT_MADCTL 0x3600
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_RGB 0x00
#define TFT_MAD_MH 0x04
#define TFT_MAD_H_FLIP 0x02
#define TFT_MAD_V_FLIP 0x01
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#endif
-269
View File
@@ -1,269 +0,0 @@
// Initialisation for RM68120
//ENABLE PAGE 1
writeRegister8(0xF000, 0x55);
writeRegister8(0xF001, 0xAA);
writeRegister8(0xF002, 0x52);
writeRegister8(0xF003, 0x08);
writeRegister8(0xF004, 0x01);
//GAMMA SETING RED
writeRegister8(0xD400, 0x00);
writeRegister8(0xD401, 0x00);
writeRegister8(0xD402, 0x1b);
writeRegister8(0xD403, 0x44);
writeRegister8(0xD404, 0x62);
writeRegister8(0xD405, 0x00);
writeRegister8(0xD406, 0x7b);
writeRegister8(0xD407, 0xa1);
writeRegister8(0xD408, 0xc0);
writeRegister8(0xD409, 0xee);
writeRegister8(0xD40A, 0x55);
writeRegister8(0xD40B, 0x10);
writeRegister8(0xD40C, 0x2c);
writeRegister8(0xD40D, 0x43);
writeRegister8(0xD40E, 0x57);
writeRegister8(0xD40F, 0x55);
writeRegister8(0xD410, 0x68);
writeRegister8(0xD411, 0x78);
writeRegister8(0xD412, 0x87);
writeRegister8(0xD413, 0x94);
writeRegister8(0xD414, 0x55);
writeRegister8(0xD415, 0xa0);
writeRegister8(0xD416, 0xac);
writeRegister8(0xD417, 0xb6);
writeRegister8(0xD418, 0xc1);
writeRegister8(0xD419, 0x55);
writeRegister8(0xD41A, 0xcb);
writeRegister8(0xD41B, 0xcd);
writeRegister8(0xD41C, 0xd6);
writeRegister8(0xD41D, 0xdf);
writeRegister8(0xD41E, 0x95);
writeRegister8(0xD41F, 0xe8);
writeRegister8(0xD420, 0xf1);
writeRegister8(0xD421, 0xfa);
writeRegister8(0xD422, 0x02);
writeRegister8(0xD423, 0xaa);
writeRegister8(0xD424, 0x0b);
writeRegister8(0xD425, 0x13);
writeRegister8(0xD426, 0x1d);
writeRegister8(0xD427, 0x26);
writeRegister8(0xD428, 0xaa);
writeRegister8(0xD429, 0x30);
writeRegister8(0xD42A, 0x3c);
writeRegister8(0xD42B, 0x4A);
writeRegister8(0xD42C, 0x63);
writeRegister8(0xD42D, 0xea);
writeRegister8(0xD42E, 0x79);
writeRegister8(0xD42F, 0xa6);
writeRegister8(0xD430, 0xd0);
writeRegister8(0xD431, 0x20);
writeRegister8(0xD432, 0x0f);
writeRegister8(0xD433, 0x8e);
writeRegister8(0xD434, 0xff);
//GAMMA SETING GREEN
writeRegister8(0xD500, 0x00);
writeRegister8(0xD501, 0x00);
writeRegister8(0xD502, 0x1b);
writeRegister8(0xD503, 0x44);
writeRegister8(0xD504, 0x62);
writeRegister8(0xD505, 0x00);
writeRegister8(0xD506, 0x7b);
writeRegister8(0xD507, 0xa1);
writeRegister8(0xD508, 0xc0);
writeRegister8(0xD509, 0xee);
writeRegister8(0xD50A, 0x55);
writeRegister8(0xD50B, 0x10);
writeRegister8(0xD50C, 0x2c);
writeRegister8(0xD50D, 0x43);
writeRegister8(0xD50E, 0x57);
writeRegister8(0xD50F, 0x55);
writeRegister8(0xD510, 0x68);
writeRegister8(0xD511, 0x78);
writeRegister8(0xD512, 0x87);
writeRegister8(0xD513, 0x94);
writeRegister8(0xD514, 0x55);
writeRegister8(0xD515, 0xa0);
writeRegister8(0xD516, 0xac);
writeRegister8(0xD517, 0xb6);
writeRegister8(0xD518, 0xc1);
writeRegister8(0xD519, 0x55);
writeRegister8(0xD51A, 0xcb);
writeRegister8(0xD51B, 0xcd);
writeRegister8(0xD51C, 0xd6);
writeRegister8(0xD51D, 0xdf);
writeRegister8(0xD51E, 0x95);
writeRegister8(0xD51F, 0xe8);
writeRegister8(0xD520, 0xf1);
writeRegister8(0xD521, 0xfa);
writeRegister8(0xD522, 0x02);
writeRegister8(0xD523, 0xaa);
writeRegister8(0xD524, 0x0b);
writeRegister8(0xD525, 0x13);
writeRegister8(0xD526, 0x1d);
writeRegister8(0xD527, 0x26);
writeRegister8(0xD528, 0xaa);
writeRegister8(0xD529, 0x30);
writeRegister8(0xD52A, 0x3c);
writeRegister8(0xD52B, 0x4a);
writeRegister8(0xD52C, 0x63);
writeRegister8(0xD52D, 0xea);
writeRegister8(0xD52E, 0x79);
writeRegister8(0xD52F, 0xa6);
writeRegister8(0xD530, 0xd0);
writeRegister8(0xD531, 0x20);
writeRegister8(0xD532, 0x0f);
writeRegister8(0xD533, 0x8e);
writeRegister8(0xD534, 0xff);
//GAMMA SETING BLUE
writeRegister8(0xD600, 0x00);
writeRegister8(0xD601, 0x00);
writeRegister8(0xD602, 0x1b);
writeRegister8(0xD603, 0x44);
writeRegister8(0xD604, 0x62);
writeRegister8(0xD605, 0x00);
writeRegister8(0xD606, 0x7b);
writeRegister8(0xD607, 0xa1);
writeRegister8(0xD608, 0xc0);
writeRegister8(0xD609, 0xee);
writeRegister8(0xD60A, 0x55);
writeRegister8(0xD60B, 0x10);
writeRegister8(0xD60C, 0x2c);
writeRegister8(0xD60D, 0x43);
writeRegister8(0xD60E, 0x57);
writeRegister8(0xD60F, 0x55);
writeRegister8(0xD610, 0x68);
writeRegister8(0xD611, 0x78);
writeRegister8(0xD612, 0x87);
writeRegister8(0xD613, 0x94);
writeRegister8(0xD614, 0x55);
writeRegister8(0xD615, 0xa0);
writeRegister8(0xD616, 0xac);
writeRegister8(0xD617, 0xb6);
writeRegister8(0xD618, 0xc1);
writeRegister8(0xD619, 0x55);
writeRegister8(0xD61A, 0xcb);
writeRegister8(0xD61B, 0xcd);
writeRegister8(0xD61C, 0xd6);
writeRegister8(0xD61D, 0xdf);
writeRegister8(0xD61E, 0x95);
writeRegister8(0xD61F, 0xe8);
writeRegister8(0xD620, 0xf1);
writeRegister8(0xD621, 0xfa);
writeRegister8(0xD622, 0x02);
writeRegister8(0xD623, 0xaa);
writeRegister8(0xD624, 0x0b);
writeRegister8(0xD625, 0x13);
writeRegister8(0xD626, 0x1d);
writeRegister8(0xD627, 0x26);
writeRegister8(0xD628, 0xaa);
writeRegister8(0xD629, 0x30);
writeRegister8(0xD62A, 0x3c);
writeRegister8(0xD62B, 0x4A);
writeRegister8(0xD62C, 0x63);
writeRegister8(0xD62D, 0xea);
writeRegister8(0xD62E, 0x79);
writeRegister8(0xD62F, 0xa6);
writeRegister8(0xD630, 0xd0);
writeRegister8(0xD631, 0x20);
writeRegister8(0xD632, 0x0f);
writeRegister8(0xD633, 0x8e);
writeRegister8(0xD634, 0xff);
//AVDD VOLTAGE SETTING
writeRegister8(0xB000, 0x05);
writeRegister8(0xB001, 0x05);
writeRegister8(0xB002, 0x05);
//AVEE VOLTAGE SETTING
writeRegister8(0xB100, 0x05);
writeRegister8(0xB101, 0x05);
writeRegister8(0xB102, 0x05);
//AVDD Boosting
writeRegister8(0xB600, 0x34);
writeRegister8(0xB601, 0x34);
writeRegister8(0xB603, 0x34);
//AVEE Boosting
writeRegister8(0xB700, 0x24);
writeRegister8(0xB701, 0x24);
writeRegister8(0xB702, 0x24);
//VCL Boosting
writeRegister8(0xB800, 0x24);
writeRegister8(0xB801, 0x24);
writeRegister8(0xB802, 0x24);
//VGLX VOLTAGE SETTING
writeRegister8(0xBA00, 0x14);
writeRegister8(0xBA01, 0x14);
writeRegister8(0xBA02, 0x14);
//VCL Boosting
writeRegister8(0xB900, 0x24);
writeRegister8(0xB901, 0x24);
writeRegister8(0xB902, 0x24);
//Gamma Voltage
writeRegister8(0xBc00, 0x00);
writeRegister8(0xBc01, 0xa0);//vgmp=5.0
writeRegister8(0xBc02, 0x00);
writeRegister8(0xBd00, 0x00);
writeRegister8(0xBd01, 0xa0);//vgmn=5.0
writeRegister8(0xBd02, 0x00);
//VCOM Setting
writeRegister8(0xBe01, 0x3d);//3
//ENABLE PAGE 0
writeRegister8(0xF000, 0x55);
writeRegister8(0xF001, 0xAA);
writeRegister8(0xF002, 0x52);
writeRegister8(0xF003, 0x08);
writeRegister8(0xF004, 0x00);
//Vivid Color Function Control
writeRegister8(0xB400, 0x10);
//Z-INVERSION
writeRegister8(0xBC00, 0x05);
writeRegister8(0xBC01, 0x05);
writeRegister8(0xBC02, 0x05);
//*************** add on 20111021**********************//
writeRegister8(0xB700, 0x22);//GATE EQ CONTROL
writeRegister8(0xB701, 0x22);//GATE EQ CONTROL
writeRegister8(0xC80B, 0x2A);//DISPLAY TIMING CONTROL
writeRegister8(0xC80C, 0x2A);//DISPLAY TIMING CONTROL
writeRegister8(0xC80F, 0x2A);//DISPLAY TIMING CONTROL
writeRegister8(0xC810, 0x2A);//DISPLAY TIMING CONTROL
//*************** add on 20111021**********************//
//PWM_ENH_OE =1
writeRegister8(0xd000, 0x01);
//DM_SEL =1
writeRegister8(0xb300, 0x10);
//VBPDA=07h
writeRegister8(0xBd02, 0x07);
//VBPDb=07h
writeRegister8(0xBe02, 0x07);
//VBPDc=07h
writeRegister8(0xBf02, 0x07);
//ENABLE PAGE 2
writeRegister8(0xF000, 0x55);
writeRegister8(0xF001, 0xAA);
writeRegister8(0xF002, 0x52);
writeRegister8(0xF003, 0x08);
writeRegister8(0xF004, 0x02);
//SDREG0 =0
writeRegister8(0xc301, 0xa9);
//DS=14
writeRegister8(0xfe01, 0x94);
//OSC =60h
writeRegister8(0xf600, 0x60);
//TE ON
writeRegister8(0x3500, 0x00);
writeRegister8(0xFFFF, 0xFF);
//SLEEP OUT
writecommand(0x1100);
delay(100);
//DISPLY ON
writecommand(0x2900);
delay(100);
writeRegister16(0x3A00, 0x55);
writeRegister8(0x3600, TFT_MAD_COLOR_ORDER);
@@ -1,29 +0,0 @@
// This is the command sequence that rotates the RM68120 driver coordinate frame
rotation = m % 4; // Limit the range of values to 0-3
uint8_t reg = 0;
switch (rotation) {
case 0:
reg = TFT_MAD_COLOR_ORDER;
_width = _init_width;
_height = _init_height;
break;
case 1:
reg = TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_COLOR_ORDER;
_width = _init_height;
_height = _init_width;
break;
case 2:
reg = TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER;
_width = _init_width;
_height = _init_height;
break;
case 3:
reg = TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER;
_width = _init_height;
_height = _init_width;
break;
}
writeRegister16(TFT_MADCTL, reg);
@@ -1,42 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
-77
View File
@@ -1,77 +0,0 @@
// This is the command sequence that initialises the RM68140 driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
// Configure RM68140 display
writecommand(TFT_SLPOUT);
delay(20);
writecommand(0xD0);
writedata(0x07);
writedata(0x42);
writedata(0x18);
writecommand(0xD1);
writedata(0x00);
writedata(0x07);
writedata(0x10);
writecommand(0xD2);
writedata(0x01);
writedata(0x02);
writecommand(0xC0);
writedata(0x10);
writedata(0x3B);
writedata(0x00);
writedata(0x02);
writedata(0x11);
writecommand(0xC5);
writedata(0x03);
writecommand(0xC8);
writedata(0x00);
writedata(0x32);
writedata(0x36);
writedata(0x45);
writedata(0x06);
writedata(0x16);
writedata(0x37);
writedata(0x75);
writedata(0x77);
writedata(0x54);
writedata(0x0C);
writedata(0x00);
writecommand(TFT_MADCTL);
writedata(0x0A);
writecommand(0x3A);
writedata(0x55);
writecommand(TFT_CASET);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0x3F);
writecommand(TFT_PASET);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0xDF);
delay(120);
writecommand(TFT_DISPON);
delay(25);
// End of RM68140 display configuration
@@ -1,44 +0,0 @@
// This is the command sequence that rotates the RM68140 driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 4;
switch (rotation) {
case 0: // Portrait
writedata(TFT_MAD_BGR);
writecommand(0xB6);
writedata(0);
writedata(0x22);
writedata(0x3B);
_width = TFT_WIDTH;
_height = TFT_HEIGHT;
break;
case 1: // Landscape (Portrait + 90)
writedata(TFT_MAD_MV | TFT_MAD_BGR);
writecommand(0xB6);
writedata(0);
writedata(0x02);
writedata(0x3B);
_width = TFT_HEIGHT;
_height = TFT_WIDTH;
break;
case 2: // Inverter portrait
writedata(TFT_MAD_BGR);
writecommand(0xB6);
writedata(0);
writedata(0x42);
writedata(0x3B);
_width = TFT_WIDTH;
_height = TFT_HEIGHT;
break;
case 3: // Inverted landscape
writedata(TFT_MAD_MV | TFT_MAD_BGR);
writecommand(0xB6);
writedata(0);
writedata(0x62);
writedata(0x3B);
_width = TFT_HEIGHT;
_height = TFT_WIDTH;
break;
}
@@ -1,58 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define TFT_WIDTH 128
#define TFT_HEIGHT 160
// Color definitions for backwards compatibility with old sketches
// use colour definitions like TFT_BLACK to make sketches more portable
#define S6D02A1_BLACK 0x0000 /* 0, 0, 0 */
#define S6D02A1_NAVY 0x000F /* 0, 0, 128 */
#define S6D02A1_DARKGREEN 0x03E0 /* 0, 128, 0 */
#define S6D02A1_DARKCYAN 0x03EF /* 0, 128, 128 */
#define S6D02A1_MAROON 0x7800 /* 128, 0, 0 */
#define S6D02A1_PURPLE 0x780F /* 128, 0, 128 */
#define S6D02A1_OLIVE 0x7BE0 /* 128, 128, 0 */
#define S6D02A1_LIGHTGREY 0xC618 /* 192, 192, 192 */
#define S6D02A1_DARKGREY 0x7BEF /* 128, 128, 128 */
#define S6D02A1_BLUE 0x001F /* 0, 0, 255 */
#define S6D02A1_GREEN 0x07E0 /* 0, 255, 0 */
#define S6D02A1_CYAN 0x07FF /* 0, 255, 255 */
#define S6D02A1_RED 0xF800 /* 255, 0, 0 */
#define S6D02A1_MAGENTA 0xF81F /* 255, 0, 255 */
#define S6D02A1_YELLOW 0xFFE0 /* 255, 255, 0 */
#define S6D02A1_WHITE 0xFFFF /* 255, 255, 255 */
#define S6D02A1_ORANGE 0xFD20 /* 255, 165, 0 */
#define S6D02A1_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
#define S6D02A1_PINK 0xF81F
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_RGB 0x00
-47
View File
@@ -1,47 +0,0 @@
// This is the command sequence that initialises the S6D02A1 driver
//
// This setup information is in a format accecpted by the commandList() function
// which reduces FLASH space, but on an ESP8266 there is plenty available!
//
// See ILI9341_Setup.h file for an alternative simpler format
{
// Initialization commands for S6D02A1 screens
static const uint8_t S6D02A1_cmds[] PROGMEM =
{
29,
0xf0, 2, 0x5a, 0x5a, // Excommand2
0xfc, 2, 0x5a, 0x5a, // Excommand3
0x26, 1, 0x01, // Gamma set
0xfa, 15, 0x02, 0x1f, 0x00, 0x10, 0x22, 0x30, 0x38, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3d, 0x02, 0x01, // Positive gamma control
0xfb, 15, 0x21, 0x00, 0x02, 0x04, 0x07, 0x0a, 0x0b, 0x0c, 0x0c, 0x16, 0x1e, 0x30, 0x3f, 0x01, 0x02, // Negative gamma control
0xfd, 11, 0x00, 0x00, 0x00, 0x17, 0x10, 0x00, 0x01, 0x01, 0x00, 0x1f, 0x1f, // Analog parameter control
0xf4, 15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, // Power control
0xf5, 13, 0x00, 0x70, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x66, 0x06, // VCOM control
0xf6, 11, 0x02, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x01, 0x00, // Source control
0xf2, 17, 0x00, 0x01, 0x03, 0x08, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x08, 0x08, //Display control
0xf8, 1, 0x11, // Gate control
0xf7, 4, 0xc8, 0x20, 0x00, 0x00, // Interface control
0xf3, 2, 0x00, 0x00, // Power sequence control
0x11, TFT_INIT_DELAY, 50, // Wake
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x01, 50, // Power sequence control
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x03, 50, // Power sequence control
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x07, 50, // Power sequence control
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x0f, 50, // Power sequence control
0xf4, 15+TFT_INIT_DELAY, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, 50, // Power control
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x1f, 50, // Power sequence control
0xf3, 2+TFT_INIT_DELAY, 0x00, 0x7f, 50, // Power sequence control
0xf3, 2+TFT_INIT_DELAY, 0x00, 0xff, 50, // Power sequence control
0xfd, 11, 0x00, 0x00, 0x00, 0x17, 0x10, 0x00, 0x00, 0x01, 0x00, 0x16, 0x16, // Analog parameter control
0xf4, 15, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x07, 0x00, 0x3C, 0x36, 0x00, 0x3C, 0x36, 0x00, // Power control
0x36, 1, 0xC8, // Memory access data control
0x35, 1, 0x00, // Tearing effect line on
0x3a, 1+TFT_INIT_DELAY, 0x05, 150, // Interface pixel control
0x29, 0, // Display on
0x2c, 0 // Memory write
};
commandList(S6D02A1_cmds);
}
@@ -1,28 +0,0 @@
// This is the command sequence that rotates the S6D02A1 driver coordinate frame
rotation = m % 4;
writecommand(TFT_MADCTL);
switch (rotation) {
case 0:
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
break;
case 1:
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
_width = _init_height;
_height = _init_width;
break;
case 2:
writedata(TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
break;
case 3:
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
_width = _init_height;
_height = _init_width;
break;
}
@@ -1,20 +0,0 @@
#ifndef TFT_WIDTH
#define TFT_WIDTH 128
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 128
#endif
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST TFT_NOP
#define TFT_CASET 0x15 // SETCOLUMN
#define TFT_PASET 0x75 // SETROW
#define TFT_RAMWR 0x5C // WRITERAM
#define TFT_RAMRD 0x5D // READRAM
#define TFT_IDXRD TFT_NOP
#define TFT_INVOFF 0xA6 // NORMALDISPLAY
#define TFT_INVON 0xA7 // INVERTDISPLAY
-35
View File
@@ -1,35 +0,0 @@
{
writecommand(0xFD); // COMMANDLOCK
writedata(0x12);
writecommand(0xFD); // COMMANDLOCK
writedata(0xB1);
writecommand(0xAE); // DISPLAYOFF
writecommand(0xB3); // CLOCKDIV
writedata(0xF1);
writecommand(0xCA); // MUXRATIO
writedata(127);
writecommand(0xA2); // DISPLAYOFFSET
writedata(0x00);
writecommand(0xB5); // SETGPIO
writedata(0x00);
writecommand(0xAB); // FUNCTIONSELECT
writedata(0x01);
writecommand(0xB1); // PRECHARGE
writedata(0x32);
writecommand(0xBE); // VCOMH
writedata(0x05);
writecommand(0xA6); // NORMALDISPLAY
writecommand(0xC1); // CONTRASTABC
writedata(0xC8);
writedata(0x80);
writedata(0xC8);
writecommand(0xC7); // CONTRASTMASTER
writedata(0x0F);
writecommand(0xB4); // SETVSL
writedata(0xA0);
writedata(0xB5);
writedata(0x55);
writecommand(0xB6); // PRECHARGE2
writedata(0x01);
writecommand(0xAF); // DISPLAYON
}
@@ -1,34 +0,0 @@
// This is the command sequence that rotates the SSD1351 driver coordinate frame
rotation = m % 4; // Limit the range of values to 0-3
uint8_t madctl = 0x64;
switch (rotation) {
case 0:
madctl |= 0x10;
_width = _init_width;
_height = _init_height;
break;
case 1:
madctl |= 0x13;
_width = _init_height;
_height = _init_width;
break;
case 2:
madctl |= 0x02;
_width = _init_width;
_height = _init_height;
break;
case 3:
madctl |= 0x01;
_width = _init_height;
_height = _init_width;
break;
}
writecommand(0xA0); // SETREMAP
writedata(madctl);
writecommand(0xA1); // STARTLINE
writedata(rotation < 2 ? TFT_HEIGHT : 0);
@@ -1,59 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#if defined (SSD1963_480_DRIVER)
#define TFT_WIDTH 272
#define TFT_HEIGHT 480
#elif defined (SSD1963_800_DRIVER)
#define TFT_WIDTH 480
#define TFT_HEIGHT 800
#elif defined (SSD1963_800ALT_DRIVER)
#define TFT_WIDTH 480
#define TFT_HEIGHT 800
#elif defined (SSD1963_800BD_DRIVER)
#define TFT_WIDTH 480
#define TFT_HEIGHT 800
#endif
//Set driver type common to all initialisation options
#ifndef SSD1963_DRIVER
#define SSD1963_DRIVER
#endif
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_IDXRD 0xDD // ILI9341 only, indexed control register read
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_RGB 0x00
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
-398
View File
@@ -1,398 +0,0 @@
#if defined (SSD1963_480_DRIVER)
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
writedata(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
writedata(0x02);
writedata(0x54);
writecommand(0xE0); // PLL enable
writedata(0x01);
delay(10);
writecommand(0xE0);
writedata(0x03);
delay(10);
writecommand(0x01); // software reset
delay(100);
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
writedata(0x01);
writedata(0x1F);
writedata(0xFF);
writecommand(0xB0); //LCD SPECIFICATION
writedata(0x20);
writedata(0x00);
writedata(0x01); //Set HDP 479
writedata(0xDF);
writedata(0x01); //Set VDP 271
writedata(0x0F);
writedata(0x00);
writecommand(0xB4); //HSYNC
writedata(0x02); //Set HT 531
writedata(0x13);
writedata(0x00); //Set HPS 8
writedata(0x08);
writedata(0x2B); //Set HPW 43
writedata(0x00); //Set LPS 2
writedata(0x02);
writedata(0x00);
writecommand(0xB6); //VSYNC
writedata(0x01); //Set VT 288
writedata(0x20);
writedata(0x00); //Set VPS 4
writedata(0x04);
writedata(0x0c); //Set VPW 12
writedata(0x00); //Set FPS 2
writedata(0x02);
writecommand(0xBA);
writedata(0x0F); //GPIO[3:0] out 1
writecommand(0xB8);
writedata(0x07); //GPIO3=input, GPIO[2:0]=output
writedata(0x01); //GPIO0 normal
writecommand(0x36); //rotation
writedata(0x21 | TFT_MAD_COLOR_ORDER);
writecommand(0xF0); //pixel data interface
writedata(0x00); //8-bit bus
delay(1);
writecommand(0xB8);
writedata(0x0f); //GPIO is controlled by host GPIO[3:0]=output GPIO[0]=1 LCD ON GPIO[0]=1 LCD OFF
writedata(0x01); //GPIO0 normal
writecommand(0xBA);
writedata(0x01); //GPIO[0] out 1 --- LCD display on/off control PIN
writecommand(0x2A);
writedata(0);
writedata(0);
writedata((271 & 0xFF00)>>8);
writedata(271 & 0xFF);
writecommand(0x2B);
writedata(0);
writedata(0);
writedata((479 & 0xFF00)>>8);
writedata(479 & 0xFF);
writecommand(0x2C);
writecommand(0x29); //display on
writecommand(0xBE); //set PWM for B/L
writedata(0x06);
writedata(0xf0);
writedata(0x01);
writedata(0xf0);
writedata(0x00);
writedata(0x00);
writecommand(0xd0);
writedata(0x0d);
writecommand(0x2C);
#elif defined (SSD1963_800_DRIVER)
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
writedata(0x1E); //N=0x36 for 6.5M, 0x23 for 10M crystal
writedata(0x02);
writedata(0x54);
writecommand(0xE0); // PLL enable
writedata(0x01);
delay(10);
writecommand(0xE0);
writedata(0x03);
delay(10);
writecommand(0x01); // software reset
delay(100);
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
writedata(0x03);
writedata(0xFF);
writedata(0xFF);
writecommand(0xB0); //LCD SPECIFICATION
writedata(0x20);
writedata(0x00);
writedata(0x03); //Set HDP 799
writedata(0x1F);
writedata(0x01); //Set VDP 479
writedata(0xDF);
writedata(0x00);
writecommand(0xB4); //HSYNC
writedata(0x03); //Set HT 928
writedata(0xA0);
writedata(0x00); //Set HPS 46
writedata(0x2E);
writedata(0x30); //Set HPW 48
writedata(0x00); //Set LPS 15
writedata(0x0F);
writedata(0x00);
writecommand(0xB6); //VSYNC
writedata(0x02); //Set VT 525
writedata(0x0D);
writedata(0x00); //Set VPS 16
writedata(0x10);
writedata(0x10); //Set VPW 16
writedata(0x00); //Set FPS 8
writedata(0x08);
writecommand(0xBA);
writedata(0x0F); //GPIO[3:0] out 1
writecommand(0xB8);
writedata(0x07); //GPIO3=input, GPIO[2:0]=output
writedata(0x01); //GPIO0 normal
writecommand(0x36); //rotation
writedata(0x21 | TFT_MAD_COLOR_ORDER);
writecommand(0xF0); //pixel data interface
writedata(0x00); //8-bit bus
delay(1);
writecommand(0xB8);
writedata(0x0f); //GPIO is controlled by host GPIO[3:0]=output GPIO[0]=1 LCD ON GPIO[0]=1 LCD OFF
writedata(0x01); //GPIO0 normal
writecommand(0xBA);
writedata(0x01); //GPIO[0] out 1 --- LCD display on/off control PIN
writecommand(0x2A);
writedata(0);
writedata(0);
writedata((479 & 0xFF00)>>8);
writedata(479 & 0xFF);
writecommand(0x2B);
writedata(0);
writedata(0);
writedata((799 & 0xFF00)>>8);
writedata(799 & 0xFF);
writecommand(0x2C);
writecommand(0x29); //display on
writecommand(0xBE); //set PWM for B/L
writedata(0x06);
writedata(0xf0);
writedata(0x01);
writedata(0xf0);
writedata(0x00);
writedata(0x00);
writecommand(0xd0);
writedata(0x0d);
writecommand(0x2C);
#elif defined (SSD1963_800ALT_DRIVER)
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
writedata(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
writedata(0x02);
writedata(0x04);
writecommand(0xE0); // PLL enable
writedata(0x01);
delay(10);
writecommand(0xE0);
writedata(0x03);
delay(10);
writecommand(0x01); // software reset
delay(100);
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
writedata(0x04);
writedata(0x93);
writedata(0xE0);
writecommand(0xB0); //LCD SPECIFICATION
writedata(0x00); // 0x24
writedata(0x00);
writedata(0x03); //Set HDP 799
writedata(0x1F);
writedata(0x01); //Set VDP 479
writedata(0xDF);
writedata(0x00);
writecommand(0xB4); //HSYNC
writedata(0x03); //Set HT 928
writedata(0xA0);
writedata(0x00); //Set HPS 46
writedata(0x2E);
writedata(0x30); //Set HPW 48
writedata(0x00); //Set LPS 15
writedata(0x0F);
writedata(0x00);
writecommand(0xB6); //VSYNC
writedata(0x02); //Set VT 525
writedata(0x0D);
writedata(0x00); //Set VPS 16
writedata(0x10);
writedata(0x10); //Set VPW 16
writedata(0x00); //Set FPS 8
writedata(0x08);
writecommand(0xBA);
writedata(0x05); //GPIO[3:0] out 1
writecommand(0xB8);
writedata(0x07); //GPIO3=input, GPIO[2:0]=output
writedata(0x01); //GPIO0 normal
writecommand(0x36); //rotation
writedata(0x21 | TFT_MAD_COLOR_ORDER); // -- Set rotation
writecommand(0xF0); //pixel data interface
writedata(0x00); //8-bit bus
delay(10);
writecommand(0x2A);
writedata(0);
writedata(0);
writedata((479 & 0xFF00)>>8);
writedata(479 & 0xFF);
writecommand(0x2B);
writedata(0);
writedata(0);
writedata((799 & 0xFF00)>>8);
writedata(799 & 0xFF);
writecommand(0x2C);
writecommand(0x29); //display on
writecommand(0xBE); //set PWM for B/L
writedata(0x06);
writedata(0xF0);
writedata(0x01);
writedata(0xF0);
writedata(0x00);
writedata(0x00);
writecommand(0xD0);
writedata(0x0D);
writecommand(0x2C);
#elif defined (SSD1963_800BD_DRIVER) // Copied from Buy Display code
writecommand(0xE2); //PLL multiplier, set PLL clock to 120M
writedata(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
writedata(0x02);
writedata(0x54);
writecommand(0xE0); // PLL enable
writedata(0x01);
delay(10);
writecommand(0xE0);
writedata(0x03);
delay(10);
writecommand(0x01); // software reset
delay(100);
writecommand(0xE6); //PLL setting for PCLK, depends on resolution
writedata(0x03);
writedata(0x33);
writedata(0x33);
writecommand(0xB0); //LCD SPECIFICATION
writedata(0x20);
writedata(0x00);
writedata(799 >> 8); //Set HDP 799
writedata(799 & 0xFF);
writedata(479 >> 8); //Set VDP 479
writedata(479 & 0xFF);
writedata(0x00);
writecommand(0xB4); //HSYNC
writedata(0x04); //Set HT
writedata(0x1F);
writedata(0x00); //Set HPS
writedata(0xD2);
writedata(0x00); //Set HPW
writedata(0x00); //Set LPS
writedata(0x00);
writedata(0x00);
writecommand(0xB6); //VSYNC
writedata(0x02); //Set VT
writedata(0x0C);
writedata(0x00); //Set VPS
writedata(0x22);
writedata(0x00); //Set VPW
writedata(0x00); //Set FPS
writedata(0x00);
writecommand(0xB8);
writedata(0x0F); //GPIO3=input, GPIO[2:0]=output
writedata(0x01); //GPIO0 normal
writecommand(0xBA);
writedata(0x01); //GPIO[0] out 1 --- LCD display on/off control PIN
writecommand(0x36); //rotation
writedata(0x21 | TFT_MAD_COLOR_ORDER); //set to rotate
//writecommand(0x003A); //Set the current pixel format for RGB image data
//writedata(0x0050); //16-bit/pixel
writecommand(0xF0); //pixel data interface
writedata(0x00); //000 = 8-bit bus, 011 = 16-bit, 110 = 9-bit
writecommand(0xBC);
writedata(0x40); //contrast value
writedata(0x80); //brightness value
writedata(0x40); //saturation value
writedata(0x01); //Post Processor Enable
delay(10);
writecommand(0x29); //display on
writecommand(0xBE); //set PWM for B/L
writedata(0x06);
writedata(0x80);
writedata(0x01);
writedata(0xF0);
writedata(0x00);
writedata(0x00);
writecommand(0xD0);
writedata(0x0D);
#endif
@@ -1,29 +0,0 @@
// This is the command sequence that rotates the SSD1963 driver coordinate frame
rotation = m % 4; // Limit the range of values to 0-3
writecommand(TFT_MADCTL);
switch (rotation) {
case 0:
writedata(0x21 | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 1:
writedata(0x00 | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
case 2:
writedata(0x22 | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 3:
writedata(0x03 | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
}
-179
View File
@@ -1,179 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#ifndef TFT_WIDTH
#define TFT_WIDTH 128
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 160
#endif
// Enumerate the different configurations
#define INITR_GREENTAB 0x0
#define INITR_REDTAB 0x1
#define INITR_BLACKTAB 0x2 // Display with no offsets
#define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display
#define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen
#define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1
#define INITR_GREENTAB160x80 0x6 // Use if you only get part of 128x128 screen in rotation 0 & 1
#define INITR_REDTAB160x80 0x7 // Added for https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html
#define INITR_ROBOTLCD 0x8
#define INITB 0xB
// Setup the tab color that will be used by the library setRotation() and setup command list
#if defined (ST7735_INITB)
#define TAB_COLOUR INITB
#elif defined (ST7735_GREENTAB)
#define TAB_COLOUR INITR_GREENTAB
#define CGRAM_OFFSET
#elif defined (ST7735_GREENTAB2)
#define TAB_COLOUR INITR_GREENTAB2
#define CGRAM_OFFSET
#elif defined (ST7735_GREENTAB3)
#define TAB_COLOUR INITR_GREENTAB3
#define CGRAM_OFFSET
#elif defined (ST7735_GREENTAB128)
#define TAB_COLOUR INITR_GREENTAB128
#define CGRAM_OFFSET
#elif defined (ST7735_GREENTAB160x80)
#define TAB_COLOUR INITR_GREENTAB160x80
#define CGRAM_OFFSET
#elif defined (ST7735_ROBOTLCD)
#define TAB_COLOUR INITR_ROBOTLCD
#define CGRAM_OFFSET
#elif defined (ST7735_REDTAB160x80)
#define TAB_COLOUR INITR_REDTAB160x80
#define CGRAM_OFFSET
#elif defined (ST7735_REDTAB)
#define TAB_COLOUR INITR_REDTAB
#elif defined (ST7735_BLACKTAB)
#define TAB_COLOUR INITR_BLACKTAB
#else // Make sure it is not undefined
#define TAB_COLOUR INITR_BLACKTAB
#endif
// Color definitions for backwards compatibility with old sketches
// use colour definitions like TFT_BLACK to make sketches more portable
#define ST7735_BLACK 0x0000 /* 0, 0, 0 */
#define ST7735_NAVY 0x000F /* 0, 0, 128 */
#define ST7735_DARKGREEN 0x03E0 /* 0, 128, 0 */
#define ST7735_DARKCYAN 0x03EF /* 0, 128, 128 */
#define ST7735_MAROON 0x7800 /* 128, 0, 0 */
#define ST7735_PURPLE 0x780F /* 128, 0, 128 */
#define ST7735_OLIVE 0x7BE0 /* 128, 128, 0 */
#define ST7735_LIGHTGREY 0xC618 /* 192, 192, 192 */
#define ST7735_DARKGREY 0x7BEF /* 128, 128, 128 */
#define ST7735_BLUE 0x001F /* 0, 0, 255 */
#define ST7735_GREEN 0x07E0 /* 0, 255, 0 */
#define ST7735_CYAN 0x07FF /* 0, 255, 255 */
#define ST7735_RED 0xF800 /* 255, 0, 0 */
#define ST7735_MAGENTA 0xF81F /* 255, 0, 255 */
#define ST7735_YELLOW 0xFFE0 /* 255, 255, 0 */
#define ST7735_WHITE 0xFFFF /* 255, 255, 255 */
#define ST7735_ORANGE 0xFD20 /* 255, 165, 0 */
#define ST7735_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
#define ST7735_PINK 0xF81F
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_RGB 0x00
#ifndef TFT_RGB_ORDER
#if defined(ST7735_BLACKTAB) || defined(ST7735_GREENTAB2) || defined(ST7735_INITB)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#endif
// ST7735 specific commands used in init
#define ST7735_NOP 0x00
#define ST7735_SWRESET 0x01
#define ST7735_RDDID 0x04
#define ST7735_RDDST 0x09
#define ST7735_SLPIN 0x10
#define ST7735_SLPOUT 0x11
#define ST7735_PTLON 0x12
#define ST7735_NORON 0x13
#define ST7735_INVOFF 0x20
#define ST7735_INVON 0x21
#define ST7735_DISPOFF 0x28
#define ST7735_DISPON 0x29
#define ST7735_CASET 0x2A
#define ST7735_RASET 0x2B // PASET
#define ST7735_RAMWR 0x2C
#define ST7735_RAMRD 0x2E
#define ST7735_PTLAR 0x30
#define ST7735_COLMOD 0x3A
#define ST7735_MADCTL 0x36
#define ST7735_FRMCTR1 0xB1
#define ST7735_FRMCTR2 0xB2
#define ST7735_FRMCTR3 0xB3
#define ST7735_INVCTR 0xB4
#define ST7735_DISSET5 0xB6
#define ST7735_PWCTR1 0xC0
#define ST7735_PWCTR2 0xC1
#define ST7735_PWCTR3 0xC2
#define ST7735_PWCTR4 0xC3
#define ST7735_PWCTR5 0xC4
#define ST7735_VMCTR1 0xC5
#define ST7735_RDID1 0xDA
#define ST7735_RDID2 0xDB
#define ST7735_RDID3 0xDC
#define ST7735_RDID4 0xDD
#define ST7735_PWCTR6 0xFC
#define ST7735_GMCTRP1 0xE0
#define ST7735_GMCTRN1 0xE1
-218
View File
@@ -1,218 +0,0 @@
// This is the command sequence that initialises the ST7735 driver
//
// This setup information is in a format accepted by the commandList() function
// which reduces FLASH space, but on an ESP8266 there is plenty available!
//
// See ILI9341_Setup.h file for an alternative simpler format
{
// Initialization commands for ST7735 screens
static const uint8_t PROGMEM
Bcmd[] = { // Initialization commands for 7735B screens
18, // 18 commands in list:
ST7735_SWRESET, TFT_INIT_DELAY, // 1: Software reset, no args, w/delay
50, // 50 ms delay
ST7735_SLPOUT , TFT_INIT_DELAY, // 2: Out of sleep mode, no args, w/delay
255, // 255 = 500 ms delay
ST7735_COLMOD , 1+TFT_INIT_DELAY, // 3: Set color mode, 1 arg + delay:
0x05, // 16-bit color
10, // 10 ms delay
ST7735_FRMCTR1, 3+TFT_INIT_DELAY, // 4: Frame rate control, 3 args + delay:
0x00, // fastest refresh
0x06, // 6 lines front porch
0x03, // 3 lines back porch
10, // 10 ms delay
ST7735_MADCTL , 1 , // 5: Memory access ctrl (directions), 1 arg:
0x40 | TFT_MAD_COLOR_ORDER, // Row addr/col addr, bottom to top refresh
ST7735_DISSET5, 2 , // 6: Display settings #5, 2 args, no delay:
0x15, // 1 clk cycle nonoverlap, 2 cycle gate
// rise, 3 cycle osc equalize
0x02, // Fix on VTL
ST7735_INVCTR , 1 , // 7: Display inversion control, 1 arg:
0x0, // Line inversion
ST7735_PWCTR1 , 2+TFT_INIT_DELAY, // 8: Power control, 2 args + delay:
0x02, // GVDD = 4.7V
0x70, // 1.0uA
10, // 10 ms delay
ST7735_PWCTR2 , 1 , // 9: Power control, 1 arg, no delay:
0x05, // VGH = 14.7V, VGL = -7.35V
ST7735_PWCTR3 , 2 , // 10: Power control, 2 args, no delay:
0x01, // Opamp current small
0x02, // Boost frequency
ST7735_VMCTR1 , 2+TFT_INIT_DELAY, // 11: Power control, 2 args + delay:
0x3C, // VCOMH = 4V
0x38, // VCOML = -1.1V
10, // 10 ms delay
ST7735_PWCTR6 , 2 , // 12: Power control, 2 args, no delay:
0x11, 0x15,
ST7735_GMCTRP1,16 , // 13: Magical unicorn dust, 16 args, no delay:
0x09, 0x16, 0x09, 0x20, // (seriously though, not sure what
0x21, 0x1B, 0x13, 0x19, // these config values represent)
0x17, 0x15, 0x1E, 0x2B,
0x04, 0x05, 0x02, 0x0E,
ST7735_GMCTRN1,16+TFT_INIT_DELAY, // 14: Sparkles and rainbows, 16 args + delay:
0x0B, 0x14, 0x08, 0x1E, // (ditto)
0x22, 0x1D, 0x18, 0x1E,
0x1B, 0x1A, 0x24, 0x2B,
0x06, 0x06, 0x02, 0x0F,
10, // 10 ms delay
ST7735_CASET , 4 , // 15: Column addr set, 4 args, no delay:
0x00, 0x02, // XSTART = 2
0x00, 0x81, // XEND = 129
ST7735_RASET , 4 , // 16: Row addr set, 4 args, no delay:
0x00, 0x02, // XSTART = 1
0x00, 0x81, // XEND = 160
ST7735_NORON , TFT_INIT_DELAY, // 17: Normal display on, no args, w/delay
10, // 10 ms delay
ST7735_DISPON , TFT_INIT_DELAY, // 18: Main screen turn on, no args, w/delay
255 }, // 255 = 500 ms delay
Rcmd1[] = { // Init for 7735R, part 1 (red or green tab)
15, // 15 commands in list:
ST7735_SWRESET, TFT_INIT_DELAY, // 1: Software reset, 0 args, w/delay
150, // 150 ms delay
ST7735_SLPOUT , TFT_INIT_DELAY, // 2: Out of sleep mode, 0 args, w/delay
255, // 500 ms delay
ST7735_FRMCTR1, 3 , // 3: Frame rate ctrl - normal mode, 3 args:
0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
ST7735_FRMCTR2, 3 , // 4: Frame rate control - idle mode, 3 args:
0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
ST7735_FRMCTR3, 6 , // 5: Frame rate ctrl - partial mode, 6 args:
0x01, 0x2C, 0x2D, // Dot inversion mode
0x01, 0x2C, 0x2D, // Line inversion mode
ST7735_INVCTR , 1 , // 6: Display inversion ctrl, 1 arg, no delay:
0x07, // No inversion
ST7735_PWCTR1 , 3 , // 7: Power control, 3 args, no delay:
0xA2,
0x02, // -4.6V
0x84, // AUTO mode
ST7735_PWCTR2 , 1 , // 8: Power control, 1 arg, no delay:
0xC5, // VGH25 = 2.4C VGSEL = -10 VGH = 3 * AVDD
ST7735_PWCTR3 , 2 , // 9: Power control, 2 args, no delay:
0x0A, // Opamp current small
0x00, // Boost frequency
ST7735_PWCTR4 , 2 , // 10: Power control, 2 args, no delay:
0x8A, // BCLK/2, Opamp current small & Medium low
0x2A,
ST7735_PWCTR5 , 2 , // 11: Power control, 2 args, no delay:
0x8A, 0xEE,
ST7735_VMCTR1 , 1 , // 12: Power control, 1 arg, no delay:
0x0E,
ST7735_INVOFF , 0 , // 13: Don't invert display, no args, no delay
ST7735_MADCTL , 1 , // 14: Memory access control (directions), 1 arg:
0xC0 | TFT_MAD_COLOR_ORDER, // row addr/col addr, bottom to top refresh
ST7735_COLMOD , 1 , // 15: set color mode, 1 arg, no delay:
0x05 }, // 16-bit color
Rcmd2green[] = { // Init for 7735R, part 2 (green tab only)
2, // 2 commands in list:
ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay:
0x00, 0x02, // XSTART = 0
0x00, 0x7F+0x02, // XEND = 127
ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay:
0x00, 0x01, // XSTART = 0
0x00, 0x9F+0x01 }, // XEND = 159
Rcmd2red[] = { // Init for 7735R, part 2 (red tab only)
2, // 2 commands in list:
ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay:
0x00, 0x00, // XSTART = 0
0x00, 0x7F, // XEND = 127
ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay:
0x00, 0x00, // XSTART = 0
0x00, 0x9F }, // XEND = 159
// Frame control init for RobotLCD, taken from https://github.com/arduino-libraries/TFT, Adafruit_ST7735.cpp l. 263, commit 61b8a7e
Rcmd3RobotLCD[] = {
3,
ST7735_FRMCTR1, 2 , // 1: Frame rate ctrl - normal mode, 2 args
0x0B, 0x14,
ST7735_FRMCTR2, 2 , // 2: Frame rate ctrl - idle mode, 2 args
0x0B, 0x14,
ST7735_FRMCTR3, 4 , // 3: Frame rate ctrl - partial mode, 4 args
0x0B, 0x14,
0x0B, 0x14 },
Rcmd3[] = { // Init for 7735R, part 3 (red or green tab)
4, // 4 commands in list:
ST7735_GMCTRP1, 16 , // 1: 16 args, no delay:
0x02, 0x1c, 0x07, 0x12,
0x37, 0x32, 0x29, 0x2d,
0x29, 0x25, 0x2B, 0x39,
0x00, 0x01, 0x03, 0x10,
ST7735_GMCTRN1, 16 , // 2: 16 args, no delay:
0x03, 0x1d, 0x07, 0x06,
0x2E, 0x2C, 0x29, 0x2D,
0x2E, 0x2E, 0x37, 0x3F,
0x00, 0x00, 0x02, 0x10,
ST7735_NORON , TFT_INIT_DELAY, // 3: Normal display on, no args, w/delay
10, // 10 ms delay
ST7735_DISPON , TFT_INIT_DELAY, // 4: Main screen turn on, no args w/delay
100 }; // 100 ms delay
if (tabcolor == INITB)
{
commandList(Bcmd);
}
else
{
commandList(Rcmd1);
if (tabcolor == INITR_GREENTAB)
{
commandList(Rcmd2green);
colstart = 2;
rowstart = 1;
}
else if (tabcolor == INITR_GREENTAB2)
{
commandList(Rcmd2green);
writecommand(ST7735_MADCTL);
writedata(0xC0 | TFT_MAD_COLOR_ORDER);
colstart = 2;
rowstart = 1;
}
else if (tabcolor == INITR_GREENTAB3)
{
commandList(Rcmd2green);
colstart = 2;
rowstart = 3;
}
else if (tabcolor == INITR_GREENTAB128)
{
commandList(Rcmd2green);
colstart = 0;
rowstart = 32;
}
else if (tabcolor == INITR_GREENTAB160x80)
{
commandList(Rcmd2green);
writecommand(TFT_INVON);
colstart = 26;
rowstart = 1;
}
else if (tabcolor == INITR_ROBOTLCD)
{
commandList(Rcmd2green);
commandList(Rcmd3RobotLCD);
}
else if (tabcolor == INITR_REDTAB160x80)
{
commandList(Rcmd2green);
colstart = 24;
rowstart = 0;
}
else if (tabcolor == INITR_REDTAB)
{
commandList(Rcmd2red);
}
else if (tabcolor == INITR_BLACKTAB)
{
writecommand(ST7735_MADCTL);
writedata(0xC0 | TFT_MAD_COLOR_ORDER);
}
commandList(Rcmd3);
}
}
-132
View File
@@ -1,132 +0,0 @@
// This is the command sequence that rotates the ST7735 driver coordinate frame
rotation = m % 4; // Limit the range of values to 0-3
writecommand(TFT_MADCTL);
switch (rotation) {
case 0:
if (tabcolor == INITR_BLACKTAB) {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
} else if(tabcolor == INITR_GREENTAB2) {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
colstart = 2;
rowstart = 1;
} else if(tabcolor == INITR_GREENTAB3) {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
colstart = 2;
rowstart = 3;
} else if(tabcolor == INITR_GREENTAB128) {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_COLOR_ORDER);
colstart = 0;
rowstart = 32;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_COLOR_ORDER);
colstart = 26;
rowstart = 1;
} else if(tabcolor == INITR_REDTAB160x80) {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_COLOR_ORDER);
colstart = 24;
rowstart = 0;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MX | TFT_MAD_COLOR_ORDER);
} else {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
}
_width = _init_width;
_height = _init_height;
break;
case 1:
if (tabcolor == INITR_BLACKTAB) {
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
} else if(tabcolor == INITR_GREENTAB2) {
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
colstart = 1;
rowstart = 2;
} else if(tabcolor == INITR_GREENTAB3) {
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
colstart = 3;
rowstart = 2;
} else if(tabcolor == INITR_GREENTAB128) {
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
colstart = 32;
rowstart = 0;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
colstart = 1;
rowstart = 26;
} else if(tabcolor == INITR_REDTAB160x80) {
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
colstart = 0;
rowstart = 24;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
} else {
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
}
_width = _init_height;
_height = _init_width;
break;
case 2:
if (tabcolor == INITR_BLACKTAB) {
writedata(TFT_MAD_COLOR_ORDER);
} else if(tabcolor == INITR_GREENTAB2) {
writedata(TFT_MAD_COLOR_ORDER);
colstart = 2;
rowstart = 1;
} else if(tabcolor == INITR_GREENTAB3) {
writedata(TFT_MAD_COLOR_ORDER);
colstart = 2;
rowstart = 1;
} else if(tabcolor == INITR_GREENTAB128) {
writedata(TFT_MAD_COLOR_ORDER);
colstart = 0;
rowstart = 0;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_COLOR_ORDER);
colstart = 26;
rowstart = 1;
} else if(tabcolor == INITR_REDTAB160x80) {
writedata(TFT_MAD_COLOR_ORDER);
colstart = 24;
rowstart = 0;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
} else {
writedata(TFT_MAD_COLOR_ORDER);
}
_width = _init_width;
_height = _init_height;
break;
case 3:
if (tabcolor == INITR_BLACKTAB) {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
} else if(tabcolor == INITR_GREENTAB2) {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
colstart = 1;
rowstart = 2;
} else if(tabcolor == INITR_GREENTAB3) {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
colstart = 1;
rowstart = 2;
} else if(tabcolor == INITR_GREENTAB128) {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
colstart = 0;
rowstart = 0;
} else if(tabcolor == INITR_GREENTAB160x80) {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
colstart = 1;
rowstart = 26;
} else if(tabcolor == INITR_REDTAB160x80) {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
colstart = 0;
rowstart = 24;
} else if(tabcolor == INITB) {
writedata(TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
} else {
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
}
_width = _init_height;
_height = _init_width;
break;
}
-178
View File
@@ -1,178 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 240)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// Adafruit 1.44 TFT support
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 135)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// Adafruit 1.69 round corner TFT support
#if (TFT_HEIGHT == 280) && (TFT_WIDTH == 240)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// 1.47" 172x320 Round Rectangle Color IPS TFT Display
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 172)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 170)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
#if (TFT_HEIGHT == 300) && (TFT_WIDTH == 240)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_NORON 0x13
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_COLMOD 0x3A
// Flags for TFT_MADCTL
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#ifdef CGRAM_OFFSET
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#endif
#endif
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
#define ST_CMD_DELAY 0x80 // special signifier for command lists
#define ST7789_240x240_XSTART 0
#define ST7789_240x240_YSTART 0
// ST7789 specific commands used in init
#define ST7789_NOP 0x00
#define ST7789_SWRESET 0x01
#define ST7789_RDDID 0x04
#define ST7789_RDDST 0x09
#define ST7789_RDDPM 0x0A // Read display power mode
#define ST7789_RDD_MADCTL 0x0B // Read display MADCTL
#define ST7789_RDD_COLMOD 0x0C // Read display pixel format
#define ST7789_RDDIM 0x0D // Read display image mode
#define ST7789_RDDSM 0x0E // Read display signal mode
#define ST7789_RDDSR 0x0F // Read display self-diagnostic result (ST7789V)
#define ST7789_SLPIN 0x10
#define ST7789_SLPOUT 0x11
#define ST7789_PTLON 0x12
#define ST7789_NORON 0x13
#define ST7789_INVOFF 0x20
#define ST7789_INVON 0x21
#define ST7789_GAMSET 0x26 // Gamma set
#define ST7789_DISPOFF 0x28
#define ST7789_DISPON 0x29
#define ST7789_CASET 0x2A
#define ST7789_RASET 0x2B
#define ST7789_RAMWR 0x2C
#define ST7789_RGBSET 0x2D // Color setting for 4096, 64K and 262K colors
#define ST7789_RAMRD 0x2E
#define ST7789_PTLAR 0x30
#define ST7789_VSCRDEF 0x33 // Vertical scrolling definition (ST7789V)
#define ST7789_TEOFF 0x34 // Tearing effect line off
#define ST7789_TEON 0x35 // Tearing effect line on
#define ST7789_MADCTL 0x36 // Memory data access control
#define ST7789_IDMOFF 0x38 // Idle mode off
#define ST7789_IDMON 0x39 // Idle mode on
#define ST7789_RAMWRC 0x3C // Memory write continue (ST7789V)
#define ST7789_RAMRDC 0x3E // Memory read continue (ST7789V)
#define ST7789_COLMOD 0x3A
#define ST7789_RAMCTRL 0xB0 // RAM control
#define ST7789_RGBCTRL 0xB1 // RGB control
#define ST7789_PORCTRL 0xB2 // Porch control
#define ST7789_FRCTRL1 0xB3 // Frame rate control
#define ST7789_PARCTRL 0xB5 // Partial mode control
#define ST7789_GCTRL 0xB7 // Gate control
#define ST7789_GTADJ 0xB8 // Gate on timing adjustment
#define ST7789_DGMEN 0xBA // Digital gamma enable
#define ST7789_VCOMS 0xBB // VCOMS setting
#define ST7789_LCMCTRL 0xC0 // LCM control
#define ST7789_IDSET 0xC1 // ID setting
#define ST7789_VDVVRHEN 0xC2 // VDV and VRH command enable
#define ST7789_VRHS 0xC3 // VRH set
#define ST7789_VDVSET 0xC4 // VDV setting
#define ST7789_VCMOFSET 0xC5 // VCOMS offset set
#define ST7789_FRCTR2 0xC6 // FR Control 2
#define ST7789_CABCCTRL 0xC7 // CABC control
#define ST7789_REGSEL1 0xC8 // Register value section 1
#define ST7789_REGSEL2 0xCA // Register value section 2
#define ST7789_PWMFRSEL 0xCC // PWM frequency selection
#define ST7789_PWCTRL1 0xD0 // Power control 1
#define ST7789_VAPVANEN 0xD2 // Enable VAP/VAN signal output
#define ST7789_CMD2EN 0xDF // Command 2 enable
#define ST7789_PVGAMCTRL 0xE0 // Positive voltage gamma control
#define ST7789_NVGAMCTRL 0xE1 // Negative voltage gamma control
#define ST7789_DGMLUTR 0xE2 // Digital gamma look-up table for red
#define ST7789_DGMLUTB 0xE3 // Digital gamma look-up table for blue
#define ST7789_GATECTRL 0xE4 // Gate control
#define ST7789_SPI2EN 0xE7 // SPI2 enable
#define ST7789_PWCTRL2 0xE8 // Power control 2
#define ST7789_EQCTRL 0xE9 // Equalize time control
#define ST7789_PROMCTRL 0xEC // Program control
#define ST7789_PROMEN 0xFA // Program mode enable
#define ST7789_NVMSET 0xFC // NVM setting
#define ST7789_PROMACT 0xFE // Program action
-22
View File
@@ -1,22 +0,0 @@
// This is the command sequence that initialises the ST7789 driver
// Configure ST7789 display
{
static const uint8_t PROGMEM
st7789[] = {
8,
TFT_SLPOUT, TFT_INIT_DELAY, 255,
TFT_COLMOD, 1+TFT_INIT_DELAY, 0x55, 10,
TFT_MADCTL, 1, 0x00,
TFT_CASET, 4, 0x00, 0x00, 0x00, 0xF0,
TFT_PASET, 4, 0x00, 0x00, 0x00, 0xF0,
TFT_INVON, TFT_INIT_DELAY, 10,
TFT_NORON, TFT_INIT_DELAY, 10,
TFT_DISPON, TFT_INIT_DELAY, 255
};
commandList(st7789);
}
// End of ST7789 display configuration
@@ -1,140 +0,0 @@
// This is the command sequence that rotates the ST7789 driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 4;
switch (rotation) {
case 0: // Portrait
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 52;
rowstart = 40;
}
else if(_init_height == 280)
{
colstart = 0;
rowstart = 20;
}
else if(_init_width == 172)
{
colstart = 34;
rowstart = 0;
}
else if(_init_width == 170)
{
colstart = 35;
rowstart = 0;
}
else
{
colstart = 0;
rowstart = 0;
}
#endif
writedata(TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 1: // Landscape (Portrait + 90)
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 40;
rowstart = 53;
}
else if(_init_height == 280)
{
colstart = 20;
rowstart = 0;
}
else if(_init_width == 172)
{
colstart = 0;
rowstart = 34;
}
else if(_init_width == 170)
{
colstart = 0;
rowstart = 35;
}
else
{
colstart = 0;
rowstart = 0;
}
#endif
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
case 2: // Inverter portrait
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 53;
rowstart = 40;
}
else if(_init_height == 280)
{
colstart = 0;
rowstart = 20;
}
else if(_init_width == 172)
{
colstart = 34;
rowstart = 0;
}
else if(_init_width == 170)
{
colstart = 35;
rowstart = 0;
}
else
{
colstart = 0;
rowstart = 80;
}
#endif
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 3: // Inverted landscape
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 40;
rowstart = 52;
}
else if(_init_height == 280)
{
colstart = 20;
rowstart = 0;
}
else if(_init_width == 172)
{
colstart = 0;
rowstart = 34;
}
else if(_init_width == 170)
{
colstart = 0;
rowstart = 35;
}
else
{
colstart = 80;
rowstart = 0;
}
#endif
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
}
-175
View File
@@ -1,175 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 240)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// Adafruit 1.44 TFT support
#if (TFT_HEIGHT == 240) && (TFT_WIDTH == 135)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// Adafruit 1.69 round corner TFT support
#if (TFT_HEIGHT == 280) && (TFT_WIDTH == 240)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// 1.47" 172x320 Round Rectangle Color IPS TFT Display
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 172)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
#if (TFT_HEIGHT == 320) && (TFT_WIDTH == 170)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
#if (TFT_HEIGHT == 300) && (TFT_WIDTH == 240)
#ifndef CGRAM_OFFSET
#define CGRAM_OFFSET
#endif
#endif
// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_SLPIN 0x10
#define TFT_SLPOUT 0x11
#define TFT_NORON 0x13
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_COLMOD 0x3A
// Flags for TFT_MADCTL
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_RGB 0x00
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_SS 0x02
#define TFT_MAD_GS 0x01
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#ifdef CGRAM_OFFSET
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#endif
#endif
#define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read
// ST7789 specific commands used in init
#define ST7789_NOP 0x00
#define ST7789_SWRESET 0x01
#define ST7789_RDDID 0x04
#define ST7789_RDDST 0x09
#define ST7789_RDDPM 0x0A // Read display power mode
#define ST7789_RDD_MADCTL 0x0B // Read display MADCTL
#define ST7789_RDD_COLMOD 0x0C // Read display pixel format
#define ST7789_RDDIM 0x0D // Read display image mode
#define ST7789_RDDSM 0x0E // Read display signal mode
#define ST7789_RDDSR 0x0F // Read display self-diagnostic result (ST7789V)
#define ST7789_SLPIN 0x10
#define ST7789_SLPOUT 0x11
#define ST7789_PTLON 0x12
#define ST7789_NORON 0x13
#define ST7789_INVOFF 0x20
#define ST7789_INVON 0x21
#define ST7789_GAMSET 0x26 // Gamma set
#define ST7789_DISPOFF 0x28
#define ST7789_DISPON 0x29
#define ST7789_CASET 0x2A
#define ST7789_RASET 0x2B
#define ST7789_RAMWR 0x2C
#define ST7789_RGBSET 0x2D // Color setting for 4096, 64K and 262K colors
#define ST7789_RAMRD 0x2E
#define ST7789_PTLAR 0x30
#define ST7789_VSCRDEF 0x33 // Vertical scrolling definition (ST7789V)
#define ST7789_TEOFF 0x34 // Tearing effect line off
#define ST7789_TEON 0x35 // Tearing effect line on
#define ST7789_MADCTL 0x36 // Memory data access control
#define ST7789_VSCRSADD 0x37 // Vertical screoll address
#define ST7789_IDMOFF 0x38 // Idle mode off
#define ST7789_IDMON 0x39 // Idle mode on
#define ST7789_RAMWRC 0x3C // Memory write continue (ST7789V)
#define ST7789_RAMRDC 0x3E // Memory read continue (ST7789V)
#define ST7789_COLMOD 0x3A
#define ST7789_RAMCTRL 0xB0 // RAM control
#define ST7789_RGBCTRL 0xB1 // RGB control
#define ST7789_PORCTRL 0xB2 // Porch control
#define ST7789_FRCTRL1 0xB3 // Frame rate control
#define ST7789_PARCTRL 0xB5 // Partial mode control
#define ST7789_GCTRL 0xB7 // Gate control
#define ST7789_GTADJ 0xB8 // Gate on timing adjustment
#define ST7789_DGMEN 0xBA // Digital gamma enable
#define ST7789_VCOMS 0xBB // VCOMS setting
#define ST7789_LCMCTRL 0xC0 // LCM control
#define ST7789_IDSET 0xC1 // ID setting
#define ST7789_VDVVRHEN 0xC2 // VDV and VRH command enable
#define ST7789_VRHS 0xC3 // VRH set
#define ST7789_VDVSET 0xC4 // VDV setting
#define ST7789_VCMOFSET 0xC5 // VCOMS offset set
#define ST7789_FRCTR2 0xC6 // FR Control 2
#define ST7789_CABCCTRL 0xC7 // CABC control
#define ST7789_REGSEL1 0xC8 // Register value section 1
#define ST7789_REGSEL2 0xCA // Register value section 2
#define ST7789_PWMFRSEL 0xCC // PWM frequency selection
#define ST7789_PWCTRL1 0xD0 // Power control 1
#define ST7789_VAPVANEN 0xD2 // Enable VAP/VAN signal output
#define ST7789_CMD2EN 0xDF // Command 2 enable
#define ST7789_PVGAMCTRL 0xE0 // Positive voltage gamma control
#define ST7789_NVGAMCTRL 0xE1 // Negative voltage gamma control
#define ST7789_DGMLUTR 0xE2 // Digital gamma look-up table for red
#define ST7789_DGMLUTB 0xE3 // Digital gamma look-up table for blue
#define ST7789_GATECTRL 0xE4 // Gate control
#define ST7789_SPI2EN 0xE7 // SPI2 enable
#define ST7789_PWCTRL2 0xE8 // Power control 2
#define ST7789_EQCTRL 0xE9 // Equalize time control
#define ST7789_PROMCTRL 0xEC // Program control
#define ST7789_PROMEN 0xFA // Program mode enable
#define ST7789_NVMSET 0xFC // NVM setting
#define ST7789_PROMACT 0xFE // Program action
-238
View File
@@ -1,238 +0,0 @@
// This is the command sequence that initialises the ST7789 driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
#ifndef INIT_SEQUENCE_3
{
fillScreen(TFT_RED);
writecommand(ST7789_SLPOUT); // Sleep out
delay(120);
writecommand(ST7789_NORON); // Normal display mode on
//------------------------------display and color format setting--------------------------------//
writecommand(ST7789_MADCTL);
//writedata(0x00);
writedata(TFT_MAD_COLOR_ORDER);
// JLX240 display datasheet
writecommand(0xB6);
writedata(0x0A);
writedata(0x82);
writecommand(ST7789_RAMCTRL);
writedata(0x00);
writedata(0xE0); // 5 to 6-bit conversion: r0 = r5, b0 = b5
writecommand(ST7789_COLMOD);
writedata(0x55);
delay(10);
//--------------------------------ST7789V Frame rate setting----------------------------------//
writecommand(ST7789_PORCTRL);
writedata(0x0c);
writedata(0x0c);
writedata(0x00);
writedata(0x33);
writedata(0x33);
writecommand(ST7789_GCTRL); // Voltages: VGH / VGL
writedata(0x35);
//---------------------------------ST7789V Power setting--------------------------------------//
writecommand(ST7789_VCOMS);
writedata(0x28); // JLX240 display datasheet
writecommand(ST7789_LCMCTRL);
writedata(0x0C);
writecommand(ST7789_VDVVRHEN);
writedata(0x01);
writedata(0xFF);
writecommand(ST7789_VRHS); // voltage VRHS
writedata(0x10);
writecommand(ST7789_VDVSET);
writedata(0x20);
writecommand(ST7789_FRCTR2);
writedata(0x0f);
writecommand(ST7789_PWCTRL1);
writedata(0xa4);
writedata(0xa1);
//--------------------------------ST7789V gamma setting---------------------------------------//
writecommand(ST7789_PVGAMCTRL);
writedata(0xd0);
writedata(0x00);
writedata(0x02);
writedata(0x07);
writedata(0x0a);
writedata(0x28);
writedata(0x32);
writedata(0x44);
writedata(0x42);
writedata(0x06);
writedata(0x0e);
writedata(0x12);
writedata(0x14);
writedata(0x17);
writecommand(ST7789_NVGAMCTRL);
writedata(0xd0);
writedata(0x00);
writedata(0x02);
writedata(0x07);
writedata(0x0a);
writedata(0x28);
writedata(0x31);
writedata(0x54);
writedata(0x47);
writedata(0x0e);
writedata(0x1c);
writedata(0x17);
writedata(0x1b);
writedata(0x1e);
writecommand(ST7789_INVON);
writecommand(ST7789_CASET); // Column address set
writedata(0x00);
writedata(0x00);
writedata(0x00);
writedata(0xEF); // 239
writecommand(ST7789_RASET); // Row address set
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0x3F); // 319
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end_tft_write();
delay(120);
begin_tft_write();
writecommand(ST7789_DISPON); //Display on
delay(120);
#ifdef TFT_BL
// Turn on the back-light LED
digitalWrite(TFT_BL, HIGH);
pinMode(TFT_BL, OUTPUT);
#endif
}
#else
// TTGO ESP32 S3 T-Display
{
writecommand(ST7789_SLPOUT); // Sleep out
delay(120);
writecommand(ST7789_NORON); // Normal display mode on
//------------------------------display and color format setting--------------------------------//
writecommand(ST7789_MADCTL);
writedata(TFT_MAD_COLOR_ORDER);
// writecommand(ST7789_RAMCTRL);
// writedata(0x00);
// writedata(0xE0); // 5 to 6-bit conversion: r0 = r5, b0 = b5
writecommand(ST7789_COLMOD);
writedata(0x55);
delay(10);
//--------------------------------ST7789V Frame rate setting----------------------------------//
writecommand(ST7789_PORCTRL);
writedata(0x0b);
writedata(0x0b);
writedata(0x00);
writedata(0x33);
writedata(0x33);
writecommand(ST7789_GCTRL); // Voltages: VGH / VGL
writedata(0x75);
//---------------------------------ST7789V Power setting--------------------------------------//
writecommand(ST7789_VCOMS);
writedata(0x28); // JLX240 display datasheet
writecommand(ST7789_LCMCTRL);
writedata(0x2C);
writecommand(ST7789_VDVVRHEN);
writedata(0x01);
writecommand(ST7789_VRHS); // voltage VRHS
writedata(0x1F);
writecommand(ST7789_FRCTR2);
writedata(0x13);
writecommand(ST7789_PWCTRL1);
writedata(0xa7);
writecommand(ST7789_PWCTRL1);
writedata(0xa4);
writedata(0xa1);
writecommand(0xD6);
writedata(0xa1);
//--------------------------------ST7789V gamma setting---------------------------------------//
writecommand(ST7789_PVGAMCTRL);
writedata(0xf0);
writedata(0x05);
writedata(0x0a);
writedata(0x06);
writedata(0x06);
writedata(0x03);
writedata(0x2b);
writedata(0x32);
writedata(0x43);
writedata(0x36);
writedata(0x11);
writedata(0x10);
writedata(0x2b);
writedata(0x32);
writecommand(ST7789_NVGAMCTRL);
writedata(0xf0);
writedata(0x08);
writedata(0x0c);
writedata(0x0b);
writedata(0x09);
writedata(0x24);
writedata(0x2b);
writedata(0x22);
writedata(0x43);
writedata(0x38);
writedata(0x15);
writedata(0x16);
writedata(0x2f);
writedata(0x37);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end_tft_write();
delay(120);
begin_tft_write();
writecommand(ST7789_DISPON); //Display on
delay(120);
#ifdef TFT_BL
// Turn on the back-light LED
digitalWrite(TFT_BL, HIGH);
pinMode(TFT_BL, OUTPUT);
#endif
}
#endif
-140
View File
@@ -1,140 +0,0 @@
// This is the command sequence that rotates the ST7789 driver coordinate frame
writecommand(TFT_MADCTL);
rotation = m % 4;
switch (rotation) {
case 0: // Portrait
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 52;
rowstart = 40;
}
else if(_init_height == 280)
{
colstart = 0;
rowstart = 20;
}
else if(_init_width == 172)
{
colstart = 34;
rowstart = 0;
}
else if(_init_width == 170)
{
colstart = 35;
rowstart = 0;
}
else
{
colstart = 0;
rowstart = 0;
}
#endif
writedata(TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 1: // Landscape (Portrait + 90)
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 40;
rowstart = 53;
}
else if(_init_height == 280)
{
colstart = 20;
rowstart = 0;
}
else if(_init_width == 172)
{
colstart = 0;
rowstart = 34;
}
else if(_init_width == 170)
{
colstart = 0;
rowstart = 35;
}
else
{
colstart = 0;
rowstart = 0;
}
#endif
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
case 2: // Inverter portrait
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 53;
rowstart = 40;
}
else if(_init_height == 280)
{
colstart = 0;
rowstart = 20;
}
else if(_init_width == 172)
{
colstart = 34;
rowstart = 0;
}
else if(_init_width == 170)
{
colstart = 35;
rowstart = 0;
}
else
{
colstart = 0;
rowstart = 80;
}
#endif
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 3: // Inverted landscape
#ifdef CGRAM_OFFSET
if (_init_width == 135)
{
colstart = 40;
rowstart = 52;
}
else if(_init_height == 280)
{
colstart = 20;
rowstart = 0;
}
else if(_init_width == 172)
{
colstart = 0;
rowstart = 34;
}
else if(_init_width == 170)
{
colstart = 0;
rowstart = 35;
}
else
{
colstart = 80;
rowstart = 0;
}
#endif
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
}
-107
View File
@@ -1,107 +0,0 @@
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#ifndef TFT_WIDTH
#define TFT_WIDTH 320
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 480
#endif
// Generic commands used by TFT_eSPI.cpp
#define TFT_NOP 0x00
#define TFT_SWRST 0x01
#define TFT_INVOFF 0x20
#define TFT_INVON 0x21
#define TFT_DISPOFF 0x28
#define TFT_DISPON 0x29
#define TFT_CASET 0x2A
#define TFT_PASET 0x2B
#define TFT_RAMWR 0x2C
#define TFT_RAMRD 0x2E
#define TFT_MADCTL 0x36
#define TFT_MAD_MY 0x80
#define TFT_MAD_MX 0x40
#define TFT_MAD_MV 0x20
#define TFT_MAD_ML 0x10
#define TFT_MAD_BGR 0x08
#define TFT_MAD_MH 0x04
#define TFT_MAD_RGB 0x00
#ifdef TFT_RGB_ORDER
#if (TFT_RGB_ORDER == 1)
#define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
#else
#define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
#endif
// ST7796 specific commands
#define ST7796_NOP 0x00
#define ST7796_SWRESET 0x01
#define ST7796_RDDID 0x04
#define ST7796_RDDST 0x09
#define ST7796_SLPIN 0x10
#define ST7796_SLPOUT 0x11
#define ST7796_PTLON 0x12
#define ST7796_NORON 0x13
#define ST7796_RDMODE 0x0A
#define ST7796_RDMADCTL 0x0B
#define ST7796_RDPIXFMT 0x0C
#define ST7796_RDIMGFMT 0x0A
#define ST7796_RDSELFDIAG 0x0F
#define ST7796_INVOFF 0x20
#define ST7796_INVON 0x21
#define ST7796_DISPOFF 0x28
#define ST7796_DISPON 0x29
#define ST7796_CASET 0x2A
#define ST7796_PASET 0x2B
#define ST7796_RAMWR 0x2C
#define ST7796_RAMRD 0x2E
#define ST7796_PTLAR 0x30
#define ST7796_VSCRDEF 0x33
#define ST7796_MADCTL 0x36
#define ST7796_VSCRSADD 0x37
#define ST7796_PIXFMT 0x3A
#define ST7796_WRDISBV 0x51
#define ST7796_RDDISBV 0x52
#define ST7796_WRCTRLD 0x53
#define ST7796_FRMCTR1 0xB1
#define ST7796_FRMCTR2 0xB2
#define ST7796_FRMCTR3 0xB3
#define ST7796_INVCTR 0xB4
#define ST7796_DFUNCTR 0xB6
#define ST7796_PWCTR1 0xC0
#define ST7796_PWCTR2 0xC1
#define ST7796_PWCTR3 0xC2
#define ST7796_VMCTR1 0xC5
#define ST7796_VMCOFF 0xC6
#define ST7796_RDID4 0xD3
#define ST7796_GMCTRP1 0xE0
#define ST7796_GMCTRN1 0xE1
#define ST7796_MADCTL_MY 0x80
#define ST7796_MADCTL_MX 0x40
#define ST7796_MADCTL_MV 0x20
#define ST7796_MADCTL_ML 0x10
#define ST7796_MADCTL_RGB 0x00
#define ST7796_MADCTL_BGR 0x08
#define ST7796_MADCTL_MH 0x04
-107
View File
@@ -1,107 +0,0 @@
// This is the command sequence that initialises the ST7796 driver
//
// This setup information uses simple 8-bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
#define TFT_INIT_DELAY 0
{
delay(120);
writecommand(0x01); //Software reset
delay(120);
writecommand(0x11); //Sleep exit
delay(120);
writecommand(0xF0); //Command Set control
writedata(0xC3); //Enable extension command 2 partI
writecommand(0xF0); //Command Set control
writedata(0x96); //Enable extension command 2 partII
writecommand(0x36); //Memory Data Access Control MX, MY, RGB mode
writedata(0x48); //X-Mirror, Top-Left to right-Buttom, RGB
writecommand(0x3A); //Interface Pixel Format
writedata(0x55); //Control interface color format set to 16
writecommand(0xB4); //Column inversion
writedata(0x01); //1-dot inversion
writecommand(0xB6); //Display Function Control
writedata(0x80); //Bypass
writedata(0x02); //Source Output Scan from S1 to S960, Gate Output scan from G1 to G480, scan cycle=2
writedata(0x3B); //LCD Drive Line=8*(59+1)
writecommand(0xE8); //Display Output Ctrl Adjust
writedata(0x40);
writedata(0x8A);
writedata(0x00);
writedata(0x00);
writedata(0x29); //Source eqaulizing period time= 22.5 us
writedata(0x19); //Timing for "Gate start"=25 (Tclk)
writedata(0xA5); //Timing for "Gate End"=37 (Tclk), Gate driver EQ function ON
writedata(0x33);
writecommand(0xC1); //Power control2
writedata(0x06); //VAP(GVDD)=3.85+( vcom+vcom offset), VAN(GVCL)=-3.85+( vcom+vcom offset)
writecommand(0xC2); //Power control 3
writedata(0xA7); //Source driving current level=low, Gamma driving current level=High
writecommand(0xC5); //VCOM Control
writedata(0x18); //VCOM=0.9
delay(120);
//ST7796 Gamma Sequence
writecommand(0xE0); //Gamma"+"
writedata(0xF0);
writedata(0x09);
writedata(0x0b);
writedata(0x06);
writedata(0x04);
writedata(0x15);
writedata(0x2F);
writedata(0x54);
writedata(0x42);
writedata(0x3C);
writedata(0x17);
writedata(0x14);
writedata(0x18);
writedata(0x1B);
writecommand(0xE1); //Gamma"-"
writedata(0xE0);
writedata(0x09);
writedata(0x0B);
writedata(0x06);
writedata(0x04);
writedata(0x03);
writedata(0x2B);
writedata(0x43);
writedata(0x42);
writedata(0x3B);
writedata(0x16);
writedata(0x14);
writedata(0x17);
writedata(0x1B);
delay(120);
writecommand(0xF0); //Command Set control
writedata(0x3C); //Disable extension command 2 partI
writecommand(0xF0); //Command Set control
writedata(0x69); //Disable extension command 2 partII
end_tft_write();
delay(120);
begin_tft_write();
writecommand(0x29); //Display on
}
@@ -1,78 +0,0 @@
// This is the command sequence that rotates the ST7796 driver coordinate frame
rotation = m % 8; // Limit the range of values to 0-7
writecommand(TFT_MADCTL);
switch (rotation) {
case 0:
writedata(TFT_MAD_MX | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
#ifdef CGRAM_OFFSET
if (_init_width == 222)
{
colstart = 49;
rowstart = 0;
}
#endif
break;
case 1:
writedata(TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
#ifdef CGRAM_OFFSET
if (_init_width == 222)
{
colstart = 0;
rowstart = 49;
}
#endif
break;
case 2:
writedata(TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
#ifdef CGRAM_OFFSET
if (_init_width == 222)
{
colstart = 49;
rowstart = 0;
}
#endif
break;
case 3:
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
#ifdef CGRAM_OFFSET
if (_init_width == 222)
{
colstart = 0;
rowstart = 49;
}
#endif
break;
// These next rotations are for bottom up BMP drawing
case 4:
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 5:
writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
case 6:
writedata(TFT_MAD_COLOR_ORDER);
_width = _init_width;
_height = _init_height;
break;
case 7:
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
_width = _init_height;
_height = _init_width;
break;
}
@@ -1,570 +0,0 @@
// This is a Processing sketch, see https://processing.org/ to download the IDE
// Select the font, size and character ranges in the user configuration section
// of this sketch, which starts at line 120. Instructions start at line 50.
/*
Software License Agreement (FreeBSD License)
Copyright (c) 2018 Bodmer (https://github.com/Bodmer)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
////////////////////////////////////////////////////////////////////////////////////////////////
// This is a processing sketch to create font files for the TFT_eSPI library:
// https://github.com/Bodmer/TFT_eSPI
// Coded by Bodmer January 2018, updated 10/2/19
// Version 0.8
// >>>>>>>>>>>>>>>>>>>> INSTRUCTIONS <<<<<<<<<<<<<<<<<<<<
// See comments below in code for specifying the font parameters (point size,
// unicode blocks to include etc.). Ranges of characters (glyphs) and specific
// individual glyphs can be included in the created "*.vlw" font file.
// Created fonts are saved in the sketches "FontFiles" folder. Press Ctrl+K to
// see that folder location.
// 16-bit Unicode point codes in the range 0x0000 - 0xFFFF are supported.
// Codes 0-31 are control codes such as "tab" and "carraige return" etc.
// and 32 is a "space", these should NOT be included.
// The sketch will convert True Type (a .ttf or .otf file) file stored in the
// sketches "Data" folder as well as your computers' system fonts.
// To maximise rendering performance and the memory consumed only include the characters
// you will use. Characters at the start of the file will render faster than those at
// the end due to the buffering and file seeking overhead.
// The inclusion of "non-existant" characters in a font may give unpredicatable results
// when rendering with the TFT_eSPI library. The Processing sketch window that pops up
// to show the font characters will print "boxes" (also known as Tofu!) for non existant
// characters.
// Once created the files must be loaded into the ESP32 or ESP8266 SPIFFS memory
// using the Arduino IDE plugin detailed here:
// https://github.com/esp8266/arduino-esp8266fs-plugin
// https://github.com/me-no-dev/arduino-esp32fs-plugin
// When the sketch is run it will generate a file called "System_Font_List.txt" in the
// sketch "FontFiles" folder, press Ctrl+K to see it. Open the file in a text editor to
// view it. This list provides the font reference number needed below to locate that
// font on your system.
// The sketch also lists all the available system fonts to the console, you can increase
// the console line count (in preferences.txt) to stop some fonts scrolling out of view.
// See link in File>Preferences to locate "preferences.txt" file. You must close
// Processing then edit the file lines. If Processing is not closed first then the
// edits will be overwritten by defaults! Edit "preferences.txt" as follows for
// 3000 lines, then save, then run Processing again:
// console.length=3000; // Line 4 in file
// console.scrollback.lines=3000; // Line 7 in file
// Useful links:
/*
https://en.wikipedia.org/wiki/Unicode_font
https://www.gnu.org/software/freefont/
https://www.gnu.org/software/freefont/sources/
https://www.gnu.org/software/freefont/ranges/
http://savannah.gnu.org/projects/freefont/
http://www.google.com/get/noto/
https://github.com/Bodmer/TFT_eSPI
https://github.com/esp8266/arduino-esp8266fs-plugin
https://github.com/me-no-dev/arduino-esp32fs-plugin
>>>>>>>>>>>>>>>>>>>> END OF INSTRUCTIONS <<<<<<<<<<<<<<<<<<<< */
import java.awt.Desktop; // Required to allow sketch to open file windows
////////////////////////////////////////////////////////////////////////////////////////////////
// >>>>>>>>>> USER CONFIGURED PARAMETERS START HERE <<<<<<<<<<
// Use font number or name, -1 for fontNumber means use fontName below, a value >=0 means use system font number from list.
// When the sketch is run it will generate a file called "systemFontList.txt" in the sketch folder, press Ctrl+K to see it.
// Open the "systemFontList.txt" in a text editor to view the font files and reference numbers for your system.
int fontNumber = -1; // << Use [Number] in brackets from the fonts listed.
// OR use font name for ttf files placed in the "Data" folder or the font number seen in IDE Console for system fonts
// the font numbers are listed when the sketch is run.
// | 1 2 | Maximum filename size for SPIFFS is 31 including leading /
// 1234567890123456789012345 and added point size and .vlw extension, so max is 25
String fontName = "Final-Frontier"; // Manually crop the filename length later after creation if needed
// Note: SPIFFS does NOT accept underscore in a filename!
String fontType = ".ttf";
//String fontType = ".otf";
// Define the font size in points for the TFT_eSPI font file
int fontSize = 28;
// Font size to use in the Processing sketch display window that pops up (can be different to above)
int displayFontSize = 28;
// Create a C header (.h file) ready to be used or copied in your sketch folder
boolean createHeaderFile = true;
// Automaticely open the folder with created files when done
boolean openFolder = true;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Next we specify which unicode blocks from the the Basic Multilingual Plane (BMP) are included in the final font file. //
// Note: The ttf/otf font file MAY NOT contain all possible Unicode characters, refer to the fonts online documentation. //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static final int[] unicodeBlocks = {
// The list below has been created from the table here: https://en.wikipedia.org/wiki/Unicode_block
// Remove // at start of lines below to include that unicode block, different code ranges can also be specified by
// editing the start and end-of-range values. Multiple lines from the list below can be included, limited only by
// the final font file size!
// Block range, //Block name, Code points, Assigned characters, Scripts
// First, last, //Range is inclusive of first and last codes
0x0021, 0x007E, //Basic Latin, 128, 128, Latin (52 characters), Common (76 characters)
//0x0080, 0x00FF, //Latin-1 Supplement, 128, 128, Latin (64 characters), Common (64 characters)
//0x0100, 0x017F, //Latin Extended-A, 128, 128, Latin
//0x0180, 0x024F, //Latin Extended-B, 208, 208, Latin
//0x0250, 0x02AF, //IPA Extensions, 96, 96, Latin
//0x02B0, 0x02FF, //Spacing Modifier Letters, 80, 80, Bopomofo (2 characters), Latin (14 characters), Common (64 characters)
//0x0300, 0x036F, //Combining Diacritical Marks, 112, 112, Inherited
//0x0370, 0x03FF, //Greek and Coptic, 144, 135, Coptic (14 characters), Greek (117 characters), Common (4 characters)
//0x0400, 0x04FF, //Cyrillic, 256, 256, Cyrillic (254 characters), Inherited (2 characters)
//0x0500, 0x052F, //Cyrillic Supplement, 48, 48, Cyrillic
//0x0530, 0x058F, //Armenian, 96, 89, Armenian (88 characters), Common (1 character)
//0x0590, 0x05FF, //Hebrew, 112, 87, Hebrew
//0x0600, 0x06FF, //Arabic, 256, 255, Arabic (237 characters), Common (6 characters), Inherited (12 characters)
//0x0700, 0x074F, //Syriac, 80, 77, Syriac
//0x0750, 0x077F, //Arabic Supplement, 48, 48, Arabic
//0x0780, 0x07BF, //Thaana, 64, 50, Thaana
//0x07C0, 0x07FF, //NKo, 64, 59, Nko
//0x0800, 0x083F, //Samaritan, 64, 61, Samaritan
//0x0840, 0x085F, //Mandaic, 32, 29, Mandaic
//0x0860, 0x086F, //Syriac Supplement, 16, 11, Syriac
//0x08A0, 0x08FF, //Arabic Extended-A, 96, 73, Arabic (72 characters), Common (1 character)
//0x0900, 0x097F, //Devanagari, 128, 128, Devanagari (124 characters), Common (2 characters), Inherited (2 characters)
//0x0980, 0x09FF, //Bengali, 128, 95, Bengali
//0x0A00, 0x0A7F, //Gurmukhi, 128, 79, Gurmukhi
//0x0A80, 0x0AFF, //Gujarati, 128, 91, Gujarati
//0x0B00, 0x0B7F, //Oriya, 128, 90, Oriya
//0x0B80, 0x0BFF, //Tamil, 128, 72, Tamil
//0x0C00, 0x0C7F, //Telugu, 128, 96, Telugu
//0x0C80, 0x0CFF, //Kannada, 128, 88, Kannada
//0x0D00, 0x0D7F, //Malayalam, 128, 117, Malayalam
//0x0D80, 0x0DFF, //Sinhala, 128, 90, Sinhala
//0x0E00, 0x0E7F, //Thai, 128, 87, Thai (86 characters), Common (1 character)
//0x0E80, 0x0EFF, //Lao, 128, 67, Lao
//0x0F00, 0x0FFF, //Tibetan, 256, 211, Tibetan (207 characters), Common (4 characters)
//0x1000, 0x109F, //Myanmar, 160, 160, Myanmar
//0x10A0, 0x10FF, //Georgian, 96, 88, Georgian (87 characters), Common (1 character)
//0x1100, 0x11FF, //Hangul Jamo, 256, 256, Hangul
//0x1200, 0x137F, //Ethiopic, 384, 358, Ethiopic
//0x1380, 0x139F, //Ethiopic Supplement, 32, 26, Ethiopic
//0x13A0, 0x13FF, //Cherokee, 96, 92, Cherokee
//0x1400, 0x167F, //Unified Canadian Aboriginal Syllabics, 640, 640, Canadian Aboriginal
//0x1680, 0x169F, //Ogham, 32, 29, Ogham
//0x16A0, 0x16FF, //Runic, 96, 89, Runic (86 characters), Common (3 characters)
//0x1700, 0x171F, //Tagalog, 32, 20, Tagalog
//0x1720, 0x173F, //Hanunoo, 32, 23, Hanunoo (21 characters), Common (2 characters)
//0x1740, 0x175F, //Buhid, 32, 20, Buhid
//0x1760, 0x177F, //Tagbanwa, 32, 18, Tagbanwa
//0x1780, 0x17FF, //Khmer, 128, 114, Khmer
//0x1800, 0x18AF, //Mongolian, 176, 156, Mongolian (153 characters), Common (3 characters)
//0x18B0, 0x18FF, //Unified Canadian Aboriginal Syllabics Extended, 80, 70, Canadian Aboriginal
//0x1900, 0x194F, //Limbu, 80, 68, Limbu
//0x1950, 0x197F, //Tai Le, 48, 35, Tai Le
//0x1980, 0x19DF, //New Tai Lue, 96, 83, New Tai Lue
//0x19E0, 0x19FF, //Khmer Symbols, 32, 32, Khmer
//0x1A00, 0x1A1F, //Buginese, 32, 30, Buginese
//0x1A20, 0x1AAF, //Tai Tham, 144, 127, Tai Tham
//0x1AB0, 0x1AFF, //Combining Diacritical Marks Extended, 80, 15, Inherited
//0x1B00, 0x1B7F, //Balinese, 128, 121, Balinese
//0x1B80, 0x1BBF, //Sundanese, 64, 64, Sundanese
//0x1BC0, 0x1BFF, //Batak, 64, 56, Batak
//0x1C00, 0x1C4F, //Lepcha, 80, 74, Lepcha
//0x1C50, 0x1C7F, //Ol Chiki, 48, 48, Ol Chiki
//0x1C80, 0x1C8F, //Cyrillic Extended-C, 16, 9, Cyrillic
//0x1CC0, 0x1CCF, //Sundanese Supplement, 16, 8, Sundanese
//0x1CD0, 0x1CFF, //Vedic Extensions, 48, 42, Common (15 characters), Inherited (27 characters)
//0x1D00, 0x1D7F, //Phonetic Extensions, 128, 128, Cyrillic (2 characters), Greek (15 characters), Latin (111 characters)
//0x1D80, 0x1DBF, //Phonetic Extensions Supplement, 64, 64, Greek (1 character), Latin (63 characters)
//0x1DC0, 0x1DFF, //Combining Diacritical Marks Supplement, 64, 63, Inherited
//0x1E00, 0x1EFF, //Latin Extended Additional, 256, 256, Latin
//0x1F00, 0x1FFF, //Greek Extended, 256, 233, Greek
//0x2000, 0x206F, //General Punctuation, 112, 111, Common (109 characters), Inherited (2 characters)
//0x2070, 0x209F, //Superscripts and Subscripts, 48, 42, Latin (15 characters), Common (27 characters)
//0x20A0, 0x20CF, //Currency Symbols, 48, 32, Common
//0x20D0, 0x20FF, //Combining Diacritical Marks for Symbols, 48, 33, Inherited
//0x2100, 0x214F, //Letterlike Symbols, 80, 80, Greek (1 character), Latin (4 characters), Common (75 characters)
//0x2150, 0x218F, //Number Forms, 64, 60, Latin (41 characters), Common (19 characters)
//0x2190, 0x21FF, //Arrows, 112, 112, Common
//0x2200, 0x22FF, //Mathematical Operators, 256, 256, Common
//0x2300, 0x23FF, //Miscellaneous Technical, 256, 256, Common
//0x2400, 0x243F, //Control Pictures, 64, 39, Common
//0x2440, 0x245F, //Optical Character Recognition, 32, 11, Common
//0x2460, 0x24FF, //Enclosed Alphanumerics, 160, 160, Common
//0x2500, 0x257F, //Box Drawing, 128, 128, Common
//0x2580, 0x259F, //Block Elements, 32, 32, Common
//0x25A0, 0x25FF, //Geometric Shapes, 96, 96, Common
//0x2600, 0x26FF, //Miscellaneous Symbols, 256, 256, Common
//0x2700, 0x27BF, //Dingbats, 192, 192, Common
//0x27C0, 0x27EF, //Miscellaneous Mathematical Symbols-A, 48, 48, Common
//0x27F0, 0x27FF, //Supplemental Arrows-A, 16, 16, Common
//0x2800, 0x28FF, //Braille Patterns, 256, 256, Braille
//0x2900, 0x297F, //Supplemental Arrows-B, 128, 128, Common
//0x2980, 0x29FF, //Miscellaneous Mathematical Symbols-B, 128, 128, Common
//0x2A00, 0x2AFF, //Supplemental Mathematical Operators, 256, 256, Common
//0x2B00, 0x2BFF, //Miscellaneous Symbols and Arrows, 256, 207, Common
//0x2C00, 0x2C5F, //Glagolitic, 96, 94, Glagolitic
//0x2C60, 0x2C7F, //Latin Extended-C, 32, 32, Latin
//0x2C80, 0x2CFF, //Coptic, 128, 123, Coptic
//0x2D00, 0x2D2F, //Georgian Supplement, 48, 40, Georgian
//0x2D30, 0x2D7F, //Tifinagh, 80, 59, Tifinagh
//0x2D80, 0x2DDF, //Ethiopic Extended, 96, 79, Ethiopic
//0x2DE0, 0x2DFF, //Cyrillic Extended-A, 32, 32, Cyrillic
//0x2E00, 0x2E7F, //Supplemental Punctuation, 128, 74, Common
//0x2E80, 0x2EFF, //CJK Radicals Supplement, 128, 115, Han
//0x2F00, 0x2FDF, //Kangxi Radicals, 224, 214, Han
//0x2FF0, 0x2FFF, //Ideographic Description Characters, 16, 12, Common
//0x3000, 0x303F, //CJK Symbols and Punctuation, 64, 64, Han (15 characters), Hangul (2 characters), Common (43 characters), Inherited (4 characters)
//0x3040, 0x309F, //Hiragana, 96, 93, Hiragana (89 characters), Common (2 characters), Inherited (2 characters)
//0x30A0, 0x30FF, //Katakana, 96, 96, Katakana (93 characters), Common (3 characters)
//0x3100, 0x312F, //Bopomofo, 48, 42, Bopomofo
//0x3130, 0x318F, //Hangul Compatibility Jamo, 96, 94, Hangul
//0x3190, 0x319F, //Kanbun, 16, 16, Common
//0x31A0, 0x31BF, //Bopomofo Extended, 32, 27, Bopomofo
//0x31C0, 0x31EF, //CJK Strokes, 48, 36, Common
//0x31F0, 0x31FF, //Katakana Phonetic Extensions, 16, 16, Katakana
//0x3200, 0x32FF, //Enclosed CJK Letters and Months, 256, 254, Hangul (62 characters), Katakana (47 characters), Common (145 characters)
//0x3300, 0x33FF, //CJK Compatibility, 256, 256, Katakana (88 characters), Common (168 characters)
//0x3400, 0x4DBF, //CJK Unified Ideographs Extension A, 6,592, 6,582, Han
//0x4DC0, 0x4DFF, //Yijing Hexagram Symbols, 64, 64, Common
//0x4E00, 0x9FFF, //CJK Unified Ideographs, 20,992, 20,971, Han
//0xA000, 0xA48F, //Yi Syllables, 1,168, 1,165, Yi
//0xA490, 0xA4CF, //Yi Radicals, 64, 55, Yi
//0xA4D0, 0xA4FF, //Lisu, 48, 48, Lisu
//0xA500, 0xA63F, //Vai, 320, 300, Vai
//0xA640, 0xA69F, //Cyrillic Extended-B, 96, 96, Cyrillic
//0xA6A0, 0xA6FF, //Bamum, 96, 88, Bamum
//0xA700, 0xA71F, //Modifier Tone Letters, 32, 32, Common
//0xA720, 0xA7FF, //Latin Extended-D, 224, 160, Latin (155 characters), Common (5 characters)
//0xA800, 0xA82F, //Syloti Nagri, 48, 44, Syloti Nagri
//0xA830, 0xA83F, //Common Indic Number Forms, 16, 10, Common
//0xA840, 0xA87F, //Phags-pa, 64, 56, Phags Pa
//0xA880, 0xA8DF, //Saurashtra, 96, 82, Saurashtra
//0xA8E0, 0xA8FF, //Devanagari Extended, 32, 30, Devanagari
//0xA900, 0xA92F, //Kayah Li, 48, 48, Kayah Li (47 characters), Common (1 character)
//0xA930, 0xA95F, //Rejang, 48, 37, Rejang
//0xA960, 0xA97F, //Hangul Jamo Extended-A, 32, 29, Hangul
//0xA980, 0xA9DF, //Javanese, 96, 91, Javanese (90 characters), Common (1 character)
//0xA9E0, 0xA9FF, //Myanmar Extended-B, 32, 31, Myanmar
//0xAA00, 0xAA5F, //Cham, 96, 83, Cham
//0xAA60, 0xAA7F, //Myanmar Extended-A, 32, 32, Myanmar
//0xAA80, 0xAADF, //Tai Viet, 96, 72, Tai Viet
//0xAAE0, 0xAAFF, //Meetei Mayek Extensions, 32, 23, Meetei Mayek
//0xAB00, 0xAB2F, //Ethiopic Extended-A, 48, 32, Ethiopic
//0xAB30, 0xAB6F, //Latin Extended-E, 64, 54, Latin (52 characters), Greek (1 character), Common (1 character)
//0xAB70, 0xABBF, //Cherokee Supplement, 80, 80, Cherokee
//0xABC0, 0xABFF, //Meetei Mayek, 64, 56, Meetei Mayek
//0xAC00, 0xD7AF, //Hangul Syllables, 11,184, 11,172, Hangul
//0xD7B0, 0xD7FF, //Hangul Jamo Extended-B, 80, 72, Hangul
//0xD800, 0xDB7F, //High Surrogates, 896, 0, Unknown
//0xDB80, 0xDBFF, //High Private Use Surrogates, 128, 0, Unknown
//0xDC00, 0xDFFF, //Low Surrogates, 1,024, 0, Unknown
//0xE000, 0xF8FF, //Private Use Area, 6,400, 6,400, Unknown
//0xF900, 0xFAFF, //CJK Compatibility Ideographs, 512, 472, Han
//0xFB00, 0xFB4F, //Alphabetic Presentation Forms, 80, 58, Armenian (5 characters), Hebrew (46 characters), Latin (7 characters)
//0xFB50, 0xFDFF, //Arabic Presentation Forms-A, 688, 611, Arabic (609 characters), Common (2 characters)
//0xFE00, 0xFE0F, //Variation Selectors, 16, 16, Inherited
//0xFE10, 0xFE1F, //Vertical Forms, 16, 10, Common
//0xFE20, 0xFE2F, //Combining Half Marks, 16, 16, Cyrillic (2 characters), Inherited (14 characters)
//0xFE30, 0xFE4F, //CJK Compatibility Forms, 32, 32, Common
//0xFE50, 0xFE6F, //Small Form Variants, 32, 26, Common
//0xFE70, 0xFEFF, //Arabic Presentation Forms-B, 144, 141, Arabic (140 characters), Common (1 character)
//0xFF00, 0xFFEF, //Halfwidth and Fullwidth Forms, 240, 225, Hangul (52 characters), Katakana (55 characters), Latin (52 characters), Common (66 characters)
//0xFFF0, 0xFFFF, //Specials, 16, 5, Common
//0x0030, 0x0039, //Example custom range (numbers 0-9)
//0x0041, 0x005A, //Example custom range (Upper case A-Z)
//0x0061, 0x007A, //Example custom range (Lower case a-z)
};
// Here we specify particular individual Unicodes to be included (appended at end of selected range)
static final int[] specificUnicodes = {
// Commonly used codes, add or remove // in next line
// 0x00A3, 0x00B0, 0x00B5, 0x03A9, 0x20AC, // £ ° µ Ω €
// Numbers and characters for showing time, change next line to //* to use
/*
0x002B, 0x002D, 0x002E, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, // - + . 0 1 2 3 4
0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x0061, 0x006D, // 5 6 7 8 9 : a m
0x0070, // p
//*/
// More characters for TFT_eSPI test sketches, change next line to //* to use
/*
0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x010C, 0x010D,
0x010E, 0x010F, 0x0110, 0x0111, 0x0118, 0x0119, 0x011A, 0x011B,
0x0131, 0x0139, 0x013A, 0x013D, 0x013E, 0x0141, 0x0142, 0x0143,
0x0144, 0x0147, 0x0148, 0x0150, 0x0151, 0x0152, 0x0153, 0x0154,
0x0155, 0x0158, 0x0159, 0x015A, 0x015B, 0x015E, 0x015F, 0x0160,
0x0161, 0x0162, 0x0163, 0x0164, 0x0165, 0x016E, 0x016F, 0x0170,
0x0171, 0x0178, 0x0179, 0x017A, 0x017B, 0x017C, 0x017D, 0x017E,
0x0192,
0x02C6, 0x02C7, 0x02D8, 0x02D9, 0x02DA, 0x02DB, 0x02DC, 0x02DD,
0x03A9, 0x03C0, 0x2013, 0x2014, 0x2018, 0x2019, 0x201A, 0x201C,
0x201D, 0x201E, 0x2020, 0x2021, 0x2022, 0x2026, 0x2030, 0x2039,
0x203A, 0x2044, 0x20AC,
0x2122, 0x2202, 0x2206, 0x220F,
0x2211, 0x221A, 0x221E, 0x222B, 0x2248, 0x2260, 0x2264, 0x2265,
0x25CA,
0xF8FF, 0xFB01, 0xFB02,
//*/
};
// >>>>>>>>>> USER CONFIGURED PARAMETERS END HERE <<<<<<<<<<
////////////////////////////////////////////////////////////////////////////////////////////////
// Variable to hold the inclusive Unicode range (16-bit values only for this sketch)
int firstUnicode = 0;
int lastUnicode = 0;
PFont myFont;
PrintWriter logOutput;
void setup() {
logOutput = createWriter("FontFiles/System_Font_List.txt");
size(1000, 800);
// Print the available fonts to the console as a list:
String[] fontList = PFont.list();
printArray(fontList);
// Save font list to file
for (int x = 0; x < fontList.length; x++)
{
logOutput.print("[" + x + "] ");
logOutput.println(fontList[x]);
}
logOutput.flush(); // Writes the remaining data to the file
logOutput.close(); // Finishes the file
// Set the fontName from the array number or the defined fontName
if (fontNumber >= 0)
{
// fontName = fontList[fontNumber];
fontType = "";
}
char[] charset;
int index = 0, count = 0;
int blockCount = unicodeBlocks.length;
for (int i = 0; i < blockCount; i+=2) {
firstUnicode = unicodeBlocks[i];
lastUnicode = unicodeBlocks[i+1];
if (lastUnicode < firstUnicode) {
delay(100);
System.err.println("ERROR: Bad Unicode range secified, last < first!");
System.err.print("first in range = 0x" + hex(firstUnicode, 4));
System.err.println(", last in range = 0x" + hex(lastUnicode, 4));
while (true);
}
// calculate the number of characters
count += (lastUnicode - firstUnicode + 1);
}
count += specificUnicodes.length;
println();
println("=====================");
println("Creating font file...");
println("Unicode blocks included = " + (blockCount/2));
println("Specific unicodes included = " + specificUnicodes.length);
println("Total number of characters = " + count);
if (count == 0) {
delay(100);
System.err.println("ERROR: No Unicode range or specific codes have been defined!");
while (true);
}
// allocate memory
charset = new char[count];
for (int i = 0; i < blockCount; i+=2) {
firstUnicode = unicodeBlocks[i];
lastUnicode = unicodeBlocks[i+1];
// loading the range specified
for (int code = firstUnicode; code <= lastUnicode; code++) {
charset[index] = Character.toChars(code)[0];
index++;
}
}
// loading the specific point codes
for (int i = 0; i < specificUnicodes.length; i++) {
charset[index] = Character.toChars(specificUnicodes[i])[0];
index++;
}
// Make font smooth (anti-aliased)
boolean smooth = true;
// Create the font in memory
myFont = createFont(fontName+fontType, displayFontSize, smooth, charset);
// Print characters to the sketch window
fill(0, 0, 0);
textFont(myFont);
// Set the left and top margin
int margin = displayFontSize;
translate(margin/2, margin);
int gapx = displayFontSize*10/8;
int gapy = displayFontSize*10/8;
index = 0;
fill(0);
textSize(displayFontSize);
for (int y = 0; y < height-gapy; y += gapy) {
int x = 0;
while (x < width) {
int unicode = charset[index];
float cwidth = textWidth((char)unicode) + 2;
if ( (x + cwidth) > (width - gapx) ) break;
// Draw the glyph to the screen
text(new String(Character.toChars(unicode)), x, y);
// Move cursor
x += cwidth;
// Increment the counter
index++;
if (index >= count) break;
}
if (index >= count) break;
}
// creating font to save as a file
PFont font;
font = createFont(fontName+fontType, fontSize, smooth, charset);
println("Created font " + fontName + str(fontSize) + ".vlw");
String fontFileName = "FontFiles/" + fontName + str(fontSize) + ".vlw";
// creating file
try {
print("Saving to sketch FontFiles folder... ");
OutputStream output = createOutput(fontFileName);
font.save(output);
output.close();
println("OK!");
delay(100);
// Open up the FontFiles folder to access the saved file
String path = sketchPath();
if(openFolder){
Desktop.getDesktop().open(new File(path+"/FontFiles"));
}
System.err.println("All done! Note: Rectangles are displayed for non-existant characters.");
}
catch(IOException e) {
println("Doh! Failed to create the file");
}
if(!createHeaderFile) return;
// Now creating header file if the option was specified.
try{
print("saving header file to FontFile folder...");
InputStream input = createInputRaw(fontFileName);
PrintWriter output = createWriter("FontFiles/" + fontName + str(fontSize) + ".h");
output.println("#include <pgmspace.h>");
output.println();
output.println("const uint8_t " + fontName + str(fontSize) + "[] PROGMEM = {");
int i = 0;
int data = input.read();
while(data != -1){
output.print("0x");
output.print(hex(data, 2));
if(i++ < 15){
output.print(", ");
} else {
output.println(",");
i = 0;
}
data = input.read();
}
// font.save(output);
output.println("\n};");
output.close();
input.close();
println("C header file created.");
} catch(IOException e){
println("Failed to create C header file");
}
}
File diff suppressed because it is too large Load Diff
@@ -1,525 +0,0 @@
// This is a Processing sketch, see https://processing.org/ to download the IDE
// The sketch is a client that requests TFT screenshots from an Arduino board.
// The Arduino must call a screenshot server function to respond with pixels.
// It has been created to work with the TFT_eSPI library here:
// https://github.com/Bodmer/TFT_eSPI
// The sketch must only be run when the designated serial port is available and enumerated
// otherwise the screenshot window may freeze and that process will need to be terminated
// This is a limitation of the Processing environment and not the sketch.
// If anyone knows how to determine if a serial port is available at start up the PM me
// on (Bodmer) the Arduino forum.
// The block below contains variables that the user may need to change for a particular setup
// As a minimum set the serial port and baud rate must be defined. The capture window is
// automatically resized for landscape, portrait and different TFT resolutions.
// Captured images are stored in the sketch folder, use the Processing IDE "Sketch" menu
// option "Show Sketch Folder" or press Ctrl+K
// Created by: Bodmer 5/3/17
// Updated by: Bodmer 12/3/17
// Version: 0.07
// MIT licence applies, all text above must be included in derivative works
// ###########################################################################################
// # These are the values to change for a particular setup #
// #
int serial_port = 0; // Use enumerated value from list provided when sketch is run #
// #
// On an Arduino Due Programming Port use a baud rate of:115200) #
// On an Arduino Due Native USB Port use a baud rate of any value #
int serial_baud_rate = 921600; // #
// #
// Change the image file type saved here, comment out all but one #
//String image_type = ".jpg"; // #
String image_type = ".png"; // Lossless compression #
//String image_type = ".bmp"; // #
//String image_type = ".tif"; // #
// #
boolean save_border = true; // Save the image with a border #
int border = 5; // Border pixel width #
boolean fade = false; // Fade out image after saving #
// #
int max_images = 100; // Maximum of numbered file images before over-writing files #
// #
int max_allowed = 1000; // Maximum number of save images allowed before a restart #
// #
// # End of the values to change for a particular setup #
// ###########################################################################################
// These are default values, this sketch obtains the actual values from the Arduino board
int tft_width = 480; // default TFT width (automatic - sent by Arduino)
int tft_height = 480; // default TFT height (automatic - sent by Arduino)
int color_bytes = 2; // 2 for 16-bit, 3 for three RGB bytes (automatic - sent by Arduino)
import processing.serial.*;
Serial serial; // Create an instance called serial
int serialCount = 0; // Count of colour bytes arriving
// Stage window graded background colours
color bgcolor1 = color(0, 100, 104); // Arduino IDE style background color 1
color bgcolor2 = color(77, 183, 187); // Arduino IDE style background color 2
//color bgcolor2 = color(255, 255, 255); // White
// TFT image frame greyscale value (dark grey)
color frameColor = 42;
color buttonStopped = color(255, 0, 0);
color buttonRunning = color(128, 204, 206);
color buttonDimmed = color(180, 0, 0);
boolean dimmed = false;
boolean running = true;
boolean mouseClick = false;
int[] rgb = new int[3]; // Buffer for the colour bytes
int indexRed = 0; // Colour byte index in the array
int indexGreen = 1;
int indexBlue = 2;
int n = 0;
int x_offset = (500 - tft_width) /2; // Image offsets in the window
int y_offset = 20;
int xpos = 0, ypos = 0; // Current pixel position
int beginTime = 0;
int pixelWaitTime = 1000; // Maximum 1000ms wait for image pixels to arrive
int lastPixelTime = 0; // Time that "image send" command was sent
int requestTime = 0;
int requestCount = 0;
int state = 0; // State machine current state
int progress_bar = 0; // Console progress bar dot count
int pixel_count = 0; // Number of pixels read for 1 screen
float percentage = 0; // Percentage of pixels received
int saved_image_count = 0; // Stats - number of images processed
int bad_image_count = 0; // Stats - number of images that had lost pixels
String filename = "";
int drawLoopCount = 0; // Used for the fade out
void setup() {
size(500, 540); // Stage size, can handle 480 pixels wide screen
noStroke(); // No border on the next thing drawn
noSmooth(); // No anti-aliasing to avoid adjacent pixel colour merging
// Graded background and title
drawWindow();
frameRate(2000); // High frame rate so draw() loops fast
// Print a list of the available serial ports
println("-----------------------");
println("Available Serial Ports:");
println("-----------------------");
printArray(Serial.list());
println("-----------------------");
print("Port currently used: [");
print(serial_port);
println("]");
String portName = Serial.list()[serial_port];
serial = new Serial(this, portName, serial_baud_rate);
state = 99;
}
void draw() {
if (mouseClick) buttonClicked();
switch(state) {
case 0: // Init varaibles, send start request
if (running) {
tint(0, 0, 0, 255);
flushBuffer();
println("");
print("Ready: ");
xpos = 0;
ypos = 0;
serialCount = 0;
progress_bar = 0;
pixel_count = 0;
percentage = 0;
drawLoopCount = frameCount;
lastPixelTime = millis() + 1000;
state = 1;
} else {
if (millis() > beginTime) {
beginTime = millis() + 500;
dimmed = !dimmed;
if (dimmed) drawButton(buttonDimmed);
else drawButton(buttonStopped);
}
}
break;
case 1: // Console message, give server some time
print("requesting image ");
serial.write("S");
delay(10);
beginTime = millis();
requestTime = millis() + 1000;
requestCount = 1;
state = 2;
break;
case 2: // Get size and set start time for rendering duration report
if (millis() > requestTime) {
requestCount++;
print("*");
serial.clear();
serial.write("S");
if (requestCount > 32) {
requestCount = 0;
System.err.println(" - no response!");
state = 0;
}
requestTime = millis() + 1000;
}
if ( getSize() == true ) { // Go to next state when we have the size and bits per pixel
getFilename();
flushBuffer(); // Precaution in case image header size increases in later versions
lastPixelTime = millis() + 1000;
beginTime = millis();
state = 3;
}
break;
case 3: // Request pixels and render returned RGB values
state = renderPixels(); // State will change when all pixels are rendered
// Request more pixels, changing the number requested allows the average transfer rate to be controlled
// The pixel transfer rate is dependant on four things:
// 1. The frame rate defined in this Processing sketch in setup()
// 2. The baud rate of the serial link (~10 bit periods per byte)
// 3. The number of request bytes 'R' sent in the lines below
// 4. The number of pixels sent in a burst by the server sketch (defined via NPIXELS)
//serial.write("RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"); // 32 x NPIXELS more
serial.write("RRRRRRRRRRRRRRRR"); // 16 x NPIXELS more
//serial.write("RRRRRRRR"); // 8 x NPIXELS more
//serial.write("RRRR"); // 4 x NPIXELS more
//serial.write("RR"); // 2 x NPIXELS more
//serial.write("R"); // 1 x NPIXELS more
if (!running) state = 4;
break;
case 4: // Pixel receive time-out, flush serial buffer
flushBuffer();
state = 6;
break;
case 5: // Save the image to the sketch folder (Ctrl+K to access)
saveScreenshot();
saved_image_count++;
println("Saved image count = " + saved_image_count);
if (bad_image_count > 0) System.err.println(" Bad image count = " + bad_image_count);
drawLoopCount = frameCount; // Reset value ready for counting in step 6
state = 6;
break;
case 6: // Fade the old image if enabled
if ( fadedImage() == true ) state = 0; // Go to next state when image has faded
break;
case 99: // Draw image viewer window
drawWindow();
delay(50); // Delay here seems to be required for the IDE console to get ready
state = 0;
break;
default:
println("");
System.err.println("Error state reached - check sketch!");
break;
}
}
void drawWindow()
{
// Graded background in Arduino colours
for (int i = 0; i < height - 25; i++) {
float inter = map(i, 0, height - 25, 0, 1);
color c = lerpColor(bgcolor1, bgcolor2, inter);
stroke(c);
line(0, i, 500, i);
}
fill(bgcolor2);
rect( 0, height-25, width-1, 24);
textAlign(CENTER);
textSize(20);
fill(0);
text("Bodmer's TFT image viewer", width/2, height-6);
if (running) drawButton(buttonRunning);
else drawButton(buttonStopped);
}
void flushBuffer()
{
//println("Clearing serial pipe after a time-out");
int clearTime = millis() + 50;
while ( millis() < clearTime ) serial.clear();
}
boolean getSize()
{
if ( serial.available() > 6 ) {
println();
char code = (char)serial.read();
if (code == 'W') {
tft_width = serial.read()<<8 | serial.read();
}
code = (char)serial.read();
if (code == 'H') {
tft_height = serial.read()<<8 | serial.read();
}
code = (char)serial.read();
if (code == 'Y') {
int bits_per_pixel = (char)serial.read();
if (bits_per_pixel == 24) color_bytes = 3;
else color_bytes = 2;
}
code = (char)serial.read();
if (code == '?') {
drawWindow();
x_offset = (500 - tft_width) /2;
tint(0, 0, 0, 255);
noStroke();
fill(frameColor);
rect((width - tft_width)/2 - border, y_offset - border, tft_width + 2 * border, tft_height + 2 * border);
return true;
}
}
return false;
}
void saveScreenshot()
{
println();
if (saved_image_count < max_allowed)
{
if (filename == "") filename = "tft_screen_" + (n++);
filename = filename + image_type;
println("Saving image as \"" + filename + "\"");
if (save_border)
{
PImage partialSave = get(x_offset - border, y_offset - border, tft_width + 2*border, tft_height + 2*border);
partialSave.save(filename);
} else {
PImage partialSave = get(x_offset, y_offset, tft_width, tft_height);
partialSave.save(filename);
}
if (n>=max_images) n = 0;
}
else
{
System.err.println(max_allowed + " saved image count exceeded, restart the sketch");
}
}
void getFilename()
{
int readTime = millis() + 20;
int inByte = 0;
filename = "";
while ( serial.available() > 0 && millis() < readTime && inByte != '.')
{
inByte = serial.read();
if (inByte == ' ') inByte = '_';
if ( unicodeCheck(inByte) ) filename += (char)inByte;
}
inByte = serial.read();
if (inByte == '@') filename += "_" + timeCode();
else if (inByte == '#') filename += "_" + saved_image_count%100;
else if (inByte == '%') filename += "_" + millis();
else if (inByte != '*') filename = "";
inByte = serial.read();
if (inByte == 'j') image_type =".jpg";
else if (inByte == 'b') image_type =".bmp";
else if (inByte == 'p') image_type =".png";
else if (inByte == 't') image_type =".tif";
}
boolean unicodeCheck(int unicode)
{
if ( unicode >= '0' && unicode <= '9' ) return true;
if ( (unicode >= 'A' && unicode <= 'Z' ) || (unicode >= 'a' && unicode <= 'z')) return true;
if ( unicode == '_' || unicode == '/' ) return true;
return false;
}
String timeCode()
{
String timeCode = (int)year() + "_" + (int)month() + "_" + (int)day() + "_";
timeCode += (int)hour() + "_" + (int)minute() + "_" + (int)second();
return timeCode;
}
int renderPixels()
{
if ( serial.available() > 0 ) {
// Add the latest byte from the serial port to array:
while (serial.available()>0)
{
rgb[serialCount++] = serial.read();
// If we have 3 colour bytes:
if ( serialCount >= color_bytes ) {
serialCount = 0;
pixel_count++;
if (color_bytes == 3)
{
stroke(rgb[indexRed], rgb[indexGreen], rgb[indexBlue], 1000);
} else
{ // Can cater for various byte orders
//stroke( (rgb[0] & 0x1F)<<3, (rgb[0] & 0xE0)>>3 | (rgb[1] & 0x07)<<5, (rgb[1] & 0xF8));
//stroke( (rgb[1] & 0x1F)<<3, (rgb[1] & 0xE0)>>3 | (rgb[0] & 0x07)<<5, (rgb[0] & 0xF8));
stroke( (rgb[0] & 0xF8), (rgb[1] & 0xE0)>>3 | (rgb[0] & 0x07)<<5, (rgb[1] & 0x1F)<<3);
//stroke( (rgb[1] & 0xF8), (rgb[0] & 0xE0)>>3 | (rgb[1] & 0x07)<<5, (rgb[0] & 0x1F)<<3);
}
// We get some pixel merge aliasing if smooth() is defined, so draw pixel twice
point(xpos + x_offset, ypos + y_offset);
//point(xpos + x_offset, ypos + y_offset);
lastPixelTime = millis();
xpos++;
if (xpos >= tft_width) {
xpos = 0;
progressBar();
ypos++;
if (ypos>=tft_height) {
ypos = 0;
if ((int)percentage <100) {
while (progress_bar++ < 64) print(" ");
percent(100);
}
println("Image fetch time = " + (millis()-beginTime)/1000.0 + " s");
return 5;
}
}
}
}
} else
{
if (millis() > (lastPixelTime + pixelWaitTime))
{
println("");
System.err.println(pixelWaitTime + "ms time-out for pixels exceeded...");
if (pixel_count > 0) {
bad_image_count++;
System.err.print("Pixels missing = " + (tft_width * tft_height - pixel_count));
System.err.println(", corrupted image not saved");
System.err.println("Good image count = " + saved_image_count);
System.err.println(" Bad image count = " + bad_image_count);
}
return 4;
}
}
return 3;
}
void progressBar()
{
progress_bar++;
print(".");
if (progress_bar >63)
{
progress_bar = 0;
percentage = 0.5 + 100 * pixel_count/(0.001 + tft_width * tft_height);
percent(percentage);
}
}
void percent(float percentage)
{
if (percentage > 100) percentage = 100;
println(" [ " + (int)percentage + "% ]");
textAlign(LEFT);
textSize(16);
noStroke();
fill(bgcolor2);
rect(10, height - 25, 70, 20);
fill(0);
text(" [ " + (int)percentage + "% ]", 10, height-8);
}
boolean fadedImage()
{
int opacity = frameCount - drawLoopCount; // So we get increasing fade
if (fade)
{
tint(255, opacity);
//image(tft_img, x_offset, y_offset);
noStroke();
fill(50, 50, 50, opacity);
rect( (width - tft_width)/2, y_offset, tft_width, tft_height);
delay(10);
}
if (opacity > 50) // End fade after 50 cycles
{
return true;
}
return false;
}
void drawButton(color buttonColor)
{
stroke(0);
fill(buttonColor);
rect(500 - 100, 540 - 26, 80, 24);
textAlign(CENTER);
textSize(20);
fill(0);
if (running) text(" Pause ", 500 - 60, height-7);
else text(" Run ", 500 - 60, height-7);
}
void buttonClicked()
{
mouseClick = false;
if (running) {
running = false;
drawButton(buttonStopped);
System.err.println("");
System.err.println("Stopped - click 'Run' button: ");
//noStroke();
//fill(50);
//rect( (width - tft_width)/2, y_offset, tft_width, tft_height);
beginTime = millis() + 500;
dimmed = false;
state = 4;
} else {
running = true;
drawButton(buttonRunning);
}
}
void mousePressed() {
if (mouseX > (500 - 100) && mouseX < (500 - 20) && mouseY > (540 - 26) && mouseY < (540 - 2)) {
mouseClick = true;
}
}
@@ -1,26 +0,0 @@
## bmp2array4bit
bmp2array4bit.py reads a bmp file, and creates C (or C++) code that contains two arrays for adding images to four-bit sprites. See [Sprite_image_4bit](../../examples/Sprite/Sprite_image_4bit) for an example.
It is loosely based on Spark Fun's bmp2array script, https://github.com/sparkfun/BMPtoArray/blob/master/bmp2array.py. The bmp file format is documented in https://en.wikipedia.org/wiki/BMP_file_format.
You'll need python 3.6 (the original uses Python 2.7)
`usage: python bmp2array4bit.py [-v] star.bmp [-o myfile.c]`
Create the bmp file in Gimp (www.gimp.org) from any image as follows:
* Remove the alpha channel (if it has one)
Layer -> Transparency -> Remove Alpha Channel
* Set the mode to indexed.
Image -> Mode -> Indexed...
* Select Generate optimum palette with 16 colors (max)
* Export the file with a .bmp extension. Do **NOT** select options:
* Run-Length Encoded
* Compatibility Options: "Do not write color space information"
* There are no Advanced Options available with these settings
(There are other tools that will produce bmp files, and these should work provided you don't use run-length encoding or other advanced features).
The first array produced is the palette for the image.
The second is the image itself.
@@ -1,251 +0,0 @@
'''
This script takes in a bitmap and outputs a text file that is a
byte array used in Arduino files.
It is loosely based on Spark Fun's bmp2array script.
You'll need python 3.6 (the original use Python 2.7)
usage: python fourbitbmp2array.py [-v] star.bmp [-o myfile.c]
Create the bmp file in Gimp by :
. Remove the alpha channel (if it has one) Layer -> Transparency -> Remove Alpha Channel
. Set the mode to indexed. Image -> Mode -> Indexed...
. Select Generate optimum palette with 16 colors (max)
. Export the file with a .bmp extension. Options are:
. Run-Length Encoded: not selected
. Compatibility Options: "Do not write color space information" not selected
. There are no Advanced Options available with these settings
'''
import sys
import struct
import math
import argparse
import os
debug = None
def debugOut(s):
if debug:
print(s)
# look at arguments
parser = argparse.ArgumentParser(description="Convert bmp file to C array")
parser.add_argument("-v", "--verbose", help="debug output", action="store_true")
parser.add_argument("input", help="input file name")
parser.add_argument("-o", "--output", help="output file name")
args = parser.parse_args()
if not os.path.exists(args.input):
parser.print_help()
print("The input file {} does not exist".format(args.input))
sys.exit(1)
if args.output == None:
output = os.path.basename(args.input).replace(".bmp", ".c")
else:
output = args.output
debug = args.verbose
try:
#Open our input file which is defined by the first commandline argument
#then dump it into a list of bytes
infile = open(args.input,"rb") #b is for binary
contents = bytearray(infile.read())
infile.close()
except:
print("could not read input file {}".format(args.input))
sys.exit(1)
# first two bytes should be "BM"
upto = 2
#Get the size of this image
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
fileSize = struct.unpack("I", bytearray(data))
upto += 4
# four bytes are reserved
upto += 4
debugOut("Size of file: {}".format(fileSize[0]))
#Get the header offset amount
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
offset = struct.unpack("I", bytearray(data))
debugOut("Offset: {}".format(offset[0]))
upto += 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
headersize = struct.unpack("I", bytearray(data))
headerLength = headersize[0]
startOfDefinitions = headerLength + upto
debugOut("header size: {}, up to {}, startOfDefinitions {}".format(headersize[0], upto, startOfDefinitions))
upto += 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("width: {}".format(t[0]))
width = t[0]
upto += 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("height: {}".format(t[0]))
height = t[0]
# 26
upto += 4
data = struct.pack("BB", contents[upto], contents[upto+1])
t = struct.unpack("H", bytearray(data))
debugOut("planes: {}".format(t[0]))
upto = upto + 2
data = struct.pack("BB", contents[upto], contents[upto+1])
t = struct.unpack("H", bytearray(data))
debugOut("bits per pixel: {}".format(t[0]))
bitsPerPixel = t[0]
upto = upto + 2
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("biCompression: {}".format(t[0]))
upto = upto + 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("biSizeImage: {}".format(t[0]))
upto = upto + 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("biXPelsPerMeter: {}".format(t[0]))
upto = upto + 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("biYPelsPerMeter: {}".format(t[0]))
upto = upto + 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("biClrUsed: {}".format(t[0]))
colorsUsed = t
upto = upto + 4
data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
t = struct.unpack("I", bytearray(data))
debugOut("biClrImportant: {}".format(t[0]))
upto += 4
debugOut("Upto: {} Number of colors used: {} definitions start at: {}".format(upto, colorsUsed[0], startOfDefinitions))
#Create color definition array and init the array of color values
colorIndex = [] #(colorsUsed[0])
for i in range(colorsUsed[0]):
colorIndex.append(0)
#Assign the colors to the array. upto = 54
# startOfDefinitions = upto
for i in range(colorsUsed[0]):
upto = startOfDefinitions + (i * 4)
blue = contents[upto]
green = contents[upto + 1]
red = contents[upto + 2]
# ignore the alpha channel.
# data = struct.pack("BBBB", contents[upto], contents[upto+1], contents[upto+2], contents[upto+3])
# t = struct.unpack("I", bytearray(data))
# colorIndex[i] = t[0]
colorIndex[i] = (((red & 0xf8)<<8) + ((green & 0xfc)<<3)+(blue>>3))
debugOut("color at index {0} is {1:04x}, (r,g,b,a) = ({2:02x}, {3:02x}, {4:02x}, {5:02x})".format(i, colorIndex[i], red, green, blue, contents[upto+3]))
#debugOut(the color definitions
# for i in range(colorsUsed[0]):
# print hex(colorIndex[i])
# perfect, except upside down.
#Make a string to hold the output of our script
arraySize = (len(contents) - offset[0])
outputString = "/* This was generated using a script based on the SparkFun BMPtoArray python script" + '\n'
outputString += " See https://github.com/sparkfun/BMPtoArray for more info */" + '\n\n'
outputString += "static const uint16_t palette[" + str(colorsUsed[0]) + "] = {";
for i in range(colorsUsed[0]):
# print hexlify(colorIndex[i])
if i % 4 == 0:
outputString += "\n\t"
outputString += "0x{:04x}, ".format(colorIndex[i])
outputString = outputString[:-2]
outputString += "\n};\n\n"
outputString += "// width is " + str(width) + ", height is " + str(height) + "\n"
outputString += "static const uint8_t myGraphic[" + str(arraySize) + "] PROGMEM = {" + '\n'
if bitsPerPixel != 4:
print("Expected 4 bits per pixel; found {}".format(bitsPerPixel))
sys.exit(1)
#Start converting spots to values
#Start at the offset and go to the end of the file
dropLastNumber = True #(width % 4) == 2 or (width % 4) == 1
paddedWidth = int(math.ceil(bitsPerPixel * width / 32.0) * 4)
debugOut("array range is {} {} len(contents) is {} paddedWidth is {} width is {}".format(offset[0], fileSize[0], len(contents), paddedWidth, width))
r = 0
width = int(width / 2)
#for i in range(offset[0], fileSize[0]): # close but image is upside down. Each row is correct but need to swap columns.
#for i in range(fileSize[0], offset[0], -1):
for col in range(height-1, -1, -1):
i = 0
for row in range(width):
colorCode1 = contents[row + col*paddedWidth + offset[0]]
if r > 0 and r % width == 0:
i = 0
outputString += '\n\n'
elif (i + 1) % 12 == 0 :
outputString += '\n'
i = 0
#debugOut("cell ({0}, {1})".format(row, col)
r = r + 1
i = i + 1
outputString += "0x{:02x}, ".format(colorCode1)
#Once we've reached the end of our input string, pull the last two
#characters off (the last comma and space) since we don't need
#them. Top it off with a closing bracket and a semicolon.
outputString = outputString[:-2]
outputString += "};"
try:
#Write the output string to our output file
outfile = open(output, "w")
outfile.write(outputString)
outfile.close()
except:
print("could not write output to file {}".format(output))
sys.exit(1)
debugOut("{} complete".format(output))
debugOut("Copy and paste this array into a image.h or other header file")
if not debug:
print("Completed; the output is in {}".format(output))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

+1 -2
View File
@@ -1,5 +1,4 @@
//#define ARS // uncomment for BGR type display (ARS version)
#define DEEPELEC_DP_66X // uncomment for DEEPELEC Portable DP-66X build
#pragma once
#define ILI9341_DRIVER
#define TFT_DMA_SUPPORT
+3 -260
View File
@@ -15,271 +15,14 @@
// Example User_Setup files are stored in the "User_Setups" folder. These can be used
// unmodified or adapted for a particular hardware configuration.
#ifndef USER_SETUP_LOADED // Lets PlatformIO users define settings in
// platformio.ini, see notes in "Tools" folder.
///////////////////////////////////////////////////////
// User configuration selection lines are below //
///////////////////////////////////////////////////////
// Only ONE line below should be uncommented to define your setup. Add extra lines and files as needed.
#include <User_Setup.h> // Default setup is root library folder
//#include <User_Setups/Setup1_ILI9341.h> // Setup file for ESP8266 configured for my ILI9341
//#include <User_Setups/Setup2_ST7735.h> // Setup file for ESP8266 configured for my ST7735
//#include <User_Setups/Setup3_ILI9163.h> // Setup file for ESP8266 configured for my ILI9163
//#include <User_Setups/Setup4_S6D02A1.h> // Setup file for ESP8266 configured for my S6D02A1
//#include <User_Setups/Setup5_RPi_ILI9486.h> // Setup file for ESP8266 configured for my stock RPi TFT
//#include <User_Setups/Setup6_RPi_Wr_ILI9486.h> // Setup file for ESP8266 configured for my modified RPi TFT
//#include <User_Setups/Setup7_ST7735_128x128.h> // Setup file for ESP8266 configured for my ST7735 128x128 display
//#include <User_Setups/Setup8_ILI9163_128x128.h> // Setup file for ESP8266 configured for my ILI9163 128x128 display
//#include <User_Setups/Setup9_ST7735_Overlap.h> // Setup file for ESP8266 configured for my ST7735
//#include <User_Setups/Setup10_RPi_touch_ILI9486.h> // Setup file for ESP8266 configured for ESP8266 and RPi TFT with touch
//#include <User_Setups/Setup11_RPi_touch_ILI9486.h> // Setup file configured for ESP32 and RPi TFT with touch
//#include <User_Setups/Setup12_M5Stack_Basic_Core.h>// Setup file for the ESP32 based M5Stack (Basic Core only)
//#include <User_Setups/Setup13_ILI9481_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
//#include <User_Setups/Setup14_ILI9341_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
//#include <User_Setups/Setup15_HX8357D.h> // Setup file for ESP8266 configured for HX8357D
//#include <User_Setups/Setup16_ILI9488_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
//#include <User_Setups/Setup17_ePaper.h> // Setup file for ESP8266 and any Waveshare ePaper display
//#include <User_Setups/Setup18_ST7789.h> // Setup file for ESP8266 configured for ST7789
//#include <User_Setups/Setup19_RM68140_Parallel.h> // Setup file configured for RM68140 with parallel bus
//#include <User_Setups/Setup20_ILI9488.h> // Setup file for ESP8266 and ILI9488 SPI bus TFT
//#include <User_Setups/Setup21_ILI9488.h> // Setup file for ESP32 and ILI9488 SPI bus TFT
//#include <User_Setups/Setup22_TTGO_T4.h> // Setup file for ESP32 and TTGO T4 version 1.2
//#include <User_Setups/Setup22_TTGO_T4_v1.3.h> // Setup file for ESP32 and TTGO T4 version 1.3
//#include <User_Setups/Setup23_TTGO_TM.h> // Setup file for ESP32 and TTGO TM ST7789 SPI bus TFT
//#include <User_Setups/Setup24_ST7789.h> // Setup file for DSTIKE/ESP32/ESP8266 configured for ST7789 240 x 240
//#include <User_Setups/Setup25_TTGO_T_Display.h> // Setup file for ESP32 and TTGO T-Display ST7789V SPI bus TFT
//#include <User_Setups/Setup26_TTGO_T_Wristband.h> // Setup file for ESP32 and TTGO T-Wristband ST7735 SPI bus TFT
//#include <User_Setups/Setup27_RPi_ST7796_ESP32.h> // ESP32 RPi MHS-4.0 inch Display-B
//#include <User_Setups/Setup28_RPi_ST7796_ESP8266.h> // ESP8266 RPi MHS-4.0 inch Display-B
//#include <User_Setups/Setup29_ILI9341_STM32.h> // Setup for Nucleo board
//#include <User_Setups/Setup30_ILI9341_Parallel_STM32.h> // Setup for Nucleo board and parallel display
//#include <User_Setups/Setup31_ST7796_Parallel_STM32.h> // Setup for Nucleo board and parallel display
//#include <User_Setups/Setup32_ILI9341_STM32F103.h> // Setup for "Blue/Black Pill"
//#include <User_Setups/Setup33_RPi_ILI9486_STM32.h> // Setup for Nucleo board
//#include <User_Setups/Setup34_ILI9481_Parallel_STM32.h> // Setup for Nucleo board and parallel display
//#include <User_Setups/Setup35_ILI9341_STM32_Port_Bus.h> // Setup for STM32 port A parallel display
//#include <User_Setups/Setup36_RPi_touch_ST7796.h> // Setup file configured for ESP32 and RPi ST7796 TFT with touch
//#include <User_Setups/Setup42_ILI9341_ESP32.h> // Setup file for ESP32 and SPI ILI9341 240x320
//#include <User_Setups/Setup43_ST7735.h> // Setup file for ESP8266 & ESP32 configured for my ST7735S 80x160
//#include <User_Setups/Setup44_TTGO_CameraPlus.h> // Setup file for ESP32 and TTGO T-CameraPlus ST7789 SPI bus TFT 240x240
//#include <User_Setups/Setup45_TTGO_T_Watch.h> // Setup file for ESP32 and TTGO T-Watch ST7789 SPI bus TFT 240x240
//#include <User_Setups/Setup46_GC9A01_ESP32.h> // Setup file for ESP32 and GC9A01 SPI bus TFT 240x240
//#include <User_Setups/Setup47_ST7735.h> // Setup file for ESP32 configured for ST7735 128 x 128 animated eyes
//#include <User_Setups/Setup50_SSD1963_Parallel.h> // Setup file for ESP32 and SSD1963 TFT display
//#include <User_Setups/Setup51_LilyPi_ILI9481.h> // Setup file for LilyGo LilyPi with ILI9481 display
//#include <User_Setups/Setup52_LilyPi_ST7796.h> // Setup file for LilyGo LilyPi with ST7796 display
//#include <User_Setups/Setup60_RP2040_ILI9341.h> // Setup file for RP2040 with SPI ILI9341
//#include <User_Setups/Setup61_RP2040_ILI9341_PIO_SPI.h> // Setup file for RP2040 with PIO SPI ILI9341
//#include <User_Setups/Setup62_RP2040_Nano_Connect_ILI9341.h> // Setup file for RP2040 with SPI ILI9341
//#include <User_Setups/Setup66_Seeed_XIAO_Round.h> // Setup file for Seeed XIAO with GC9A01 240x240
//#include <User_Setups/Setup70_ESP32_S2_ILI9341.h> // Setup file for ESP32 S2 with SPI ILI9341
//#include <User_Setups/Setup70b_ESP32_S3_ILI9341.h> // Setup file for ESP32 S3 with SPI ILI9341
//#include <User_Setups/Setup70c_ESP32_C3_ILI9341.h> // Setup file for ESP32 C3 with SPI ILI9341
//#include <User_Setups/Setup70d_ILI9488_S3_Parallel.h> // Setup file for ESP32 S3 with SPI ILI9488
//#include <User_Setups/Setup71_ESP32_S2_ST7789.h> // Setup file for ESP32 S2 with ST7789
//#include <User_Setups/Setup72_ESP32_ST7789_172x320.h> // Setup file for ESP32 with ST7789 1.47" 172x320
//#include <User_Setups/Setup100_RP2040_ILI9488_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9488
//#include <User_Setups/Setup101_RP2040_ILI9481_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9481
//#include <User_Setups/Setup102_RP2040_ILI9341_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9341
//#include <User_Setups/Setup103_RP2040_ILI9486_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9486
//#include <User_Setups/Setup104_RP2040_ST7796_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ST7796
//#include <User_Setups/Setup105_RP2040_ST7796_16bit_parallel.h> // Setup file for RP2040 16-bit parallel display
//#include <User_Setups/Setup106_RP2040_ILI9481_16bit_parallel.h> // Setup file for RP2040 16-bit parallel display
//#include <User_Setups/Setup107_RP2040_ILI9341_16bit_parallel.h> // Setup file for RP2040 16-bit parallel display
//#include <User_Setups/Setup108_RP2040_ST7735.h> // Setup file for Waveshare RP2040 board with onboard ST7735 0.96" 160x80 display
//#include <User_Setups/Setup135_ST7789.h> // Setup file for ESP8266 and ST7789 135 x 240 TFT
//#include <User_Setups/Setup136_LilyGo_TTV.h> // Setup file for ESP32 and Lilygo TTV ST7789 SPI bus TFT 135x240
//#include <User_Setups/Setup137_LilyGo_TDisplay_RP2040.h> // Setup file for Lilygo T-Display RP2040 (ST7789 on SPI bus with 135x240 TFT)
//#include <User_Setups/Setup138_Pico_Explorer_Base_RP2040_ST7789.h> // Setup file for Pico Explorer Base by Pimoroni for RP2040 (ST7789 on SPI bus with 240x240 TFT)
//#include <User_Setups/Setup200_GC9A01.h> // Setup file for ESP32 and GC9A01 240 x 240 TFT
//#include <User_Setups/Setup201_WT32_SC01.h> // Setup file for ESP32 based WT32_SC01 from Seeed
//#include <User_Setups/Setup202_SSD1351_128.h> // Setup file for ESP32/ESP8266 based SSD1351 128x128 1.5inch OLED display
//#include <User_Setups/Setup203_ST7789.h> // Setup file for ESP32/ESP8266 based ST7789 240X280 1.69inch TFT
//#include <User_Setups/Setup204_ESP32_TouchDown.h> // Setup file for the ESP32 TouchDown based on ILI9488 480 x 320 TFT
//#include <User_Setups/Setup205_ESP32_TouchDown_S3.h> // Setup file for the ESP32 TouchDown S3 based on ILI9488 480 x 320 TFT
//#include <User_Setups/Setup206_LilyGo_T_Display_S3.h> // For the LilyGo T-Display S3 based ESP32S3 with ST7789 170 x 320 TFT
//#include <User_Setups/Setup207_LilyGo_T_HMI.h> // For the LilyGo T-HMI S3 based ESP32S3 with ST7789 240 x 320 TFT
//#include <User_Setups/Setup209_LilyGo_T_Dongle_S3.h> // For the LilyGo T-Dongle S3 based ESP32 with ST7735 80 x 160 TFT
//#include <User_Setups/Setup210_LilyGo_T_Embed_S3.h> // For the LilyGo T-Embed S3 based ESP32S3 with ST7789 170 x 320 TFT
//#include <User_Setups/Setup211_LilyGo_T_QT_Pro_S3.h> // For the LilyGo T-QT Pro S3 based ESP32S3 with GC9A01 128 x 128 TFT
// #include <User_Setups/Setup212_LilyGo_T_PicoPro.h> // For the LilyGo T-PICO-Pro with ST7796 222 x 480 TFT
// #include <User_Setups/Setup213_LilyGo_T_Beam_Shield.h> // For the LilyGo T-BEAM V1.x with ST7796 222 x 480 TFT
//#include <User_Setups/Setup250_ESP32_S3_Box_Lite.h> // For the ESP32 S3 Box Lite
//#include <User_Setups/Setup251_ESP32_S3_Box.h> // For the ESP32 S3 Box
//#include <User_Setups/Setup301_BW16_ST7735.h> // Setup file for Bw16-based boards with ST7735 160 x 80 TFT
//#include <User_Setups/Setup302_Waveshare_ESP32S3_GC9A01.h> // Setup file for Waveshare ESP32-S3-Touch-LCD-1.28 board with GC9A01 240*240 TFT
//#include <User_Setups/SetupX_Template.h> // Template file for a setup
//#include <User_Setups/Dustin_ILI9488.h> // Setup file for Dustin Watts PCB with ILI9488
//#include <User_Setups/Dustin_ST7796.h> // Setup file for Dustin Watts PCB with ST7796
//#include <User_Setups/Dustin_ILI9488_Pico.h> // Setup file for Dustin Watts Pico PCB with ST7796
//#include <User_Setups/Dustin_ST7789_Pico.h> // Setup file for Dustin Watts PCB with ST7789 240 x 240 on 3.3V adapter board
//#include <User_Setups/Dustin_GC9A01_Pico.h> // Setup file for Dustin Watts PCB with GC9A01 240 x 240 on 3.3V adapter board
//#include <User_Setups/Dustin_GC9A01_ESP32.h> // Setup file for Dustin Watts PCB with GC9A01 240 x 240 on 3.3V adapter board
//#include <User_Setups/Dustin_STT7789_ESP32.h> // Setup file for Dustin Watts PCB with ST7789 240 x 240 on 3.3V adapter board
//#include <User_Setups/Dustin_ILI9341_ESP32.h> // Setup file for Dustin Watts PCB with ILI9341
//#include <User_Setups/ILI9225.h>
#endif // USER_SETUP_LOADED
/////////////////////////////////////////////////////////////////////////////////////
// //
// DON'T TINKER WITH ANY OF THE FOLLOWING LINES, THESE ADD THE TFT DRIVERS //
// AND ESP8266 PIN DEFINITONS, THEY ARE HERE FOR BODMER'S CONVENIENCE! //
// //
/////////////////////////////////////////////////////////////////////////////////////
#include <User_Setup.h>
// Identical looking TFT displays may have a different colour ordering in the 16-bit colour
#define TFT_BGR 0 // Colour order Blue-Green-Red
#define TFT_RGB 1 // Colour order Red-Green-Blue
// Legacy setup support, RPI_DISPLAY_TYPE replaces RPI_DRIVER
#if defined (RPI_DRIVER)
#if !defined (RPI_DISPLAY_TYPE)
#define RPI_DISPLAY_TYPE
#endif
#endif
// Legacy setup support, RPI_ILI9486_DRIVER form is deprecated
// Instead define RPI_DISPLAY_TYPE and also define driver (e.g. ILI9486_DRIVER)
#if defined (RPI_ILI9486_DRIVER)
#if !defined (ILI9486_DRIVER)
#define ILI9486_DRIVER
#endif
#if !defined (RPI_DISPLAY_TYPE)
#define RPI_DISPLAY_TYPE
#endif
#endif
// Invoke 18-bit colour for selected displays
#if !defined (RPI_DISPLAY_TYPE) && !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) && !defined (ESP32_PARALLEL)
#if defined (ILI9481_DRIVER) || defined (ILI9486_DRIVER) || defined (ILI9488_DRIVER)
#define SPI_18BIT_DRIVER
#endif
#endif
// Load the right driver definition - do not tinker here !
#if defined (ILI9341_DRIVER) || defined(ILI9341_2_DRIVER) || defined (ILI9342_DRIVER)
#include <TFT_Drivers/ILI9341_Defines.h>
#define TFT_DRIVER 0x9341
#elif defined (ST7735_DRIVER)
#include <TFT_Drivers/ST7735_Defines.h>
#define TFT_DRIVER 0x7735
#elif defined (ILI9163_DRIVER)
#include <TFT_Drivers/ILI9163_Defines.h>
#define TFT_DRIVER 0x9163
#elif defined (S6D02A1_DRIVER)
#include <TFT_Drivers/S6D02A1_Defines.h>
#define TFT_DRIVER 0x6D02
#elif defined (ST7796_DRIVER)
#include "TFT_Drivers/ST7796_Defines.h"
#define TFT_DRIVER 0x7796
#elif defined (ILI9486_DRIVER)
#include <TFT_Drivers/ILI9486_Defines.h>
#define TFT_DRIVER 0x9486
#elif defined (ILI9481_DRIVER)
#include <TFT_Drivers/ILI9481_Defines.h>
#define TFT_DRIVER 0x9481
#elif defined (ILI9488_DRIVER)
#include <TFT_Drivers/ILI9488_Defines.h>
#define TFT_DRIVER 0x9488
#elif defined (HX8357D_DRIVER)
#include "TFT_Drivers/HX8357D_Defines.h"
#define TFT_DRIVER 0x8357
#elif defined (EPD_DRIVER)
#include "TFT_Drivers/EPD_Defines.h"
#define TFT_DRIVER 0xE9D
#elif defined (ST7789_DRIVER)
#include "TFT_Drivers/ST7789_Defines.h"
#define TFT_DRIVER 0x7789
#elif defined (R61581_DRIVER)
#include "TFT_Drivers/R61581_Defines.h"
#define TFT_DRIVER 0x6158
#elif defined (ST7789_2_DRIVER)
#include "TFT_Drivers/ST7789_2_Defines.h"
#define TFT_DRIVER 0x778B
#elif defined (RM68140_DRIVER)
#include "TFT_Drivers/RM68140_Defines.h"
#define TFT_DRIVER 0x6814
#elif defined (SSD1351_DRIVER)
#include "TFT_Drivers/SSD1351_Defines.h"
#define TFT_DRIVER 0x1351
#elif defined (SSD1963_480_DRIVER)
#include "TFT_Drivers/SSD1963_Defines.h"
#define TFT_DRIVER 0x1963
#elif defined (SSD1963_800_DRIVER)
#include "TFT_Drivers/SSD1963_Defines.h"
#define TFT_DRIVER 0x1963
#elif defined (SSD1963_800ALT_DRIVER)
#include "TFT_Drivers/SSD1963_Defines.h"
#define TFT_DRIVER 0x1963
#elif defined (SSD1963_800BD_DRIVER)
#include "TFT_Drivers/SSD1963_Defines.h"
#define TFT_DRIVER 0x1963
#elif defined (GC9A01_DRIVER)
#include "TFT_Drivers/GC9A01_Defines.h"
#define TFT_DRIVER 0x9A01
#elif defined (ILI9225_DRIVER)
#include "TFT_Drivers/ILI9225_Defines.h"
#define TFT_DRIVER 0x9225
#elif defined (RM68120_DRIVER)
#include "TFT_Drivers/RM68120_Defines.h"
#define TFT_DRIVER 0x6812
#elif defined (HX8357B_DRIVER)
#include "TFT_Drivers/HX8357B_Defines.h"
#define TFT_DRIVER 0x835B
#elif defined (HX8357C_DRIVER)
#include "TFT_Drivers/HX8357C_Defines.h"
#define TFT_DRIVER 0x835C
// <<<<<<<<<<<<<<<<<<<<<<<< ADD NEW DRIVER HERE
// XYZZY_init.h and XYZZY_rotation.h must also be added in TFT_eSPI.cpp
#elif defined (XYZZY_DRIVER)
#include "TFT_Drivers/XYZZY_Defines.h"
#define TFT_DRIVER 0x0000
#else
#define TFT_DRIVER 0x0000
#endif
#include <TFT_Drivers/ILI9341_Defines.h>
#define TFT_DRIVER 0x9341
// These are the pins for ESP8266 boards
// Name GPIO NodeMCU Function
@@ -1,54 +0,0 @@
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 100
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
#define TFT_PARALLEL_8_BIT
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ILI9488_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
// These pins can be moved and are controlled directly by the library software
#define TFT_DC 28 // Data Command control pin
#define TFT_RST 2 // Reset pin
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
// Note: All the following pins are PIO hardware configured and driven
#define TFT_WR 22
// PIO requires these to be sequentially increasing - do not change
#define TFT_D0 6
#define TFT_D1 7
#define TFT_D2 8
#define TFT_D3 9
#define TFT_D4 10
#define TFT_D5 11
#define TFT_D6 12
#define TFT_D7 13
//*/
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,54 +0,0 @@
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 101
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
#define TFT_PARALLEL_8_BIT
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ILI9481_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
// These pins can be moved and are controlled directly by the library software
#define TFT_DC 28 // Data Command control pin
#define TFT_RST 2 // Reset pin
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
// Note: All the following pins are PIO hardware configured and driven
#define TFT_WR 22
// PIO requires these to be sequentially increasing - do not change
#define TFT_D0 6
#define TFT_D1 7
#define TFT_D2 8
#define TFT_D3 9
#define TFT_D4 10
#define TFT_D5 11
#define TFT_D6 12
#define TFT_D7 13
//*/
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,54 +0,0 @@
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 102
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
#define TFT_PARALLEL_8_BIT
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ILI9341_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
// These pins can be moved and are controlled directly by the library software
#define TFT_DC 28 // Data Command control pin
#define TFT_RST 2 // Reset pin
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
// Note: All the following pins are PIO hardware configured and driven
#define TFT_WR 22
// PIO requires these to be sequentially increasing - do not change
#define TFT_D0 6
#define TFT_D1 7
#define TFT_D2 8
#define TFT_D3 9
#define TFT_D4 10
#define TFT_D5 11
#define TFT_D6 12
#define TFT_D7 13
//*/
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,54 +0,0 @@
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 103
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
#define TFT_PARALLEL_8_BIT
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ILI9486_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
// These pins can be moved and are controlled directly by the library software
#define TFT_DC 28 // Data Command control pin
#define TFT_RST 2 // Reset pin
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
// Note: All the following pins are PIO hardware configured and driven
#define TFT_WR 22
// PIO requires these to be sequentially increasing - do not change
#define TFT_D0 6
#define TFT_D1 7
#define TFT_D2 8
#define TFT_D3 9
#define TFT_D4 10
#define TFT_D5 11
#define TFT_D6 12
#define TFT_D7 13
//*/
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,54 +0,0 @@
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 104
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
#define TFT_PARALLEL_8_BIT
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ST7796_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
// These pins can be moved and are controlled directly by the library software
#define TFT_DC 28 // Data Command control pin
#define TFT_RST 2 // Reset pin
//#define TFT_RD -1 // Do not define, read pin permanently connected to 3V3
// Note: All the following pins are PIO hardware configured and driven
#define TFT_WR 22
// PIO requires these to be sequentially increasing - do not change
#define TFT_D0 6
#define TFT_D1 7
#define TFT_D2 8
#define TFT_D3 9
#define TFT_D4 10
#define TFT_D5 11
#define TFT_D6 12
#define TFT_D7 13
//*/
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,60 +0,0 @@
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 105
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
#define TFT_PARALLEL_16_BIT
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ST7796_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_CS -1 // Do not define, chip select control pin permanently connected to 0V
// These pins can be moved and are controlled directly by the library software
#define TFT_DC 3 // Data Command control pin
#define TFT_RST 2 // Reset pin
//#define TFT_RD -1 // Do not define, read pin must be permanently connected to 3V3
#define TFT_WR 4
// PIO requires these to be sequentially increasing GPIO with no gaps
#define TFT_D0 6
#define TFT_D1 7
#define TFT_D2 8
#define TFT_D3 9
#define TFT_D4 10
#define TFT_D5 11
#define TFT_D6 12
#define TFT_D7 13
#define TFT_D8 14
#define TFT_D9 15
#define TFT_D10 16
#define TFT_D11 17
#define TFT_D12 18
#define TFT_D13 19
#define TFT_D14 20
#define TFT_D15 21
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,77 +0,0 @@
// This setup is for the RP2040 processor when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 106
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_PARALLEL_8_BIT
#define TFT_PARALLEL_16_BIT
// The parallel interface write cycle period is derived from a division of the CPU clock
// speed so scales with the processor clock. This means that the divider ratio may need
// to be increased when overclocking. I may also need to be adjusted dependant on the
// display controller type (ILI94341, HX8357C etc.). If RP2040_PIO_CLK_DIV is not defined
// the library will set default values which may not suit your display.
// The display controller data sheet will specify the minimum write cycle period. The
// controllers often work reliably for shorter periods, however if the period is too short
// the display may not initialise or graphics will become corrupted.
// PIO write cycle frequency = (CPU clock/(4 * RP2040_PIO_CLK_DIV))
//#define RP2040_PIO_CLK_DIV 1 // 32ns write cycle at 125MHz CPU clock
//#define RP2040_PIO_CLK_DIV 2 // 64ns write cycle at 125MHz CPU clock
//#define RP2040_PIO_CLK_DIV 3 // 96ns write cycle at 125MHz CPU clock
//#define RP2040_PIO_CLK_DIV 4 // 96ns write cycle at 125MHz CPU clock
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ILI9481_DRIVER
//#define HX8357B_DRIVER
//#define HX8357C_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
// These pins can be moved and are controlled directly by the library software
#define TFT_RST 18 // Reset pin
#define TFT_CS 19 // Do not define if chip select control pin permanently connected to 0V
//#define TFT_RD -1 // Do not define, read pin must be permanently connected to 3V3
// Note: All the following pins are PIO hardware configured and driven
#define TFT_WR 16 // Write strobe pin
#define TFT_DC 17 // Data Command control pin
// PIO requires these to be sequentially increasing
#define TFT_D0 0
#define TFT_D1 1
#define TFT_D2 2
#define TFT_D3 3
#define TFT_D4 4
#define TFT_D5 5
#define TFT_D6 6
#define TFT_D7 7
#define TFT_D8 8
#define TFT_D9 9
#define TFT_D10 10
#define TFT_D11 11
#define TFT_D12 12
#define TFT_D13 13
#define TFT_D14 14
#define TFT_D15 15
//*/
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,65 +0,0 @@
// This setup is for the RP2040 processor only when used with 8-bit parallel displays
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 107
////////////////////////////////////////////////////////////////////////////////////////////
// Interface
////////////////////////////////////////////////////////////////////////////////////////////
//#define TFT_PARALLEL_8_BIT
#define TFT_PARALLEL_16_BIT
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ILI9341_DRIVER
//#define ILI9481_DRIVER // Tested
//#define HX8357B_DRIVER // Tested
//#define HX8357C_DRIVER // Tested
//#define SSD1963_800_DRIVER
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 pins used
////////////////////////////////////////////////////////////////////////////////////////////
// These pins can be moved and are controlled directly by the library software
#define TFT_RST 18 // Reset pin
#define TFT_CS 19 // Do not define if chip select control pin permanently connected to 0V
//#define TFT_RD -1 // Do not define, read pin must be permanently connected to 3V3
// Note: All the following pins are PIO hardware configured and driven
#define TFT_WR 16 // Write strobe pin
#define TFT_DC 17 // Data Command control pin
// PIO requires these to be sequentially increasing
#define TFT_D0 0
#define TFT_D1 1
#define TFT_D2 2
#define TFT_D3 3
#define TFT_D4 4
#define TFT_D5 5
#define TFT_D6 6
#define TFT_D7 7
#define TFT_D8 8
#define TFT_D9 9
#define TFT_D10 10
#define TFT_D11 11
#define TFT_D12 12
#define TFT_D13 13
#define TFT_D14 14
#define TFT_D15 15
//*/
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,44 +0,0 @@
// This setup is for the Waveshare RP2040-LCD-0.96 board
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 108
////////////////////////////////////////////////////////////////////////////////////////////
// Display driver type
////////////////////////////////////////////////////////////////////////////////////////////
#define ST7735_DRIVER
#define ST7735_GREENTAB160x80
////////////////////////////////////////////////////////////////////////////////////////////
// Display params
////////////////////////////////////////////////////////////////////////////////////////////
#define TFT_WIDTH 80
#define TFT_HEIGHT 160
#define TFT_INVERSION_ON
////////////////////////////////////////////////////////////////////////////////////////////
// RP2040 config and pins
////////////////////////////////////////////////////////////////////////////////////////////
#define SPI_FREQUENCY 27000000
#define RP2040_PIO_CLK_DIV 1
#define TFT_SPI_PORT 1
#define TFT_MOSI 11
#define TFT_SCLK 10
#define TFT_CS 9
#define TFT_DC 8
#define TFT_RST 12
////////////////////////////////////////////////////////////////////////////////////////////
// Fonts to be available
////////////////////////////////////////////////////////////////////////////////////////////
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,33 +0,0 @@
// For ESP8266
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 10
#define RPI_DISPLAY_TYPE
#define ILI9486_DRIVER
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
#define TFT_CS PIN_D2 // Chip select control pin D2
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
#define TOUCH_CS PIN_D1 // Chip select pin (T_CS) of touch screen
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
#define SPI_FREQUENCY 16000000 // Some displays will operate at higher frequencies
#define SPI_TOUCH_FREQUENCY 2500000
// #define SUPPORT_TRANSACTIONS

Some files were not shown because too many files have changed in this diff Show More