mirror of
https://github.com/YuzuZensai/MCUFRIEND_kbv.git
synced 2026-01-06 04:32:38 +00:00
add mega1280
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
#define INVERT_RGB (1<<11)
|
||||
#define REV_SCREEN (1<<12)
|
||||
|
||||
#if (defined(__AVR_ATmega2560__) || defined(__SAM3X8E__))\
|
||||
#if (defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) || defined(__SAM3X8E__))\
|
||||
&& (defined(USE_MEGA_16BIT_SHIELD) || defined(USE_DUE_16BIT_SHIELD))
|
||||
#define USING_16BIT_BUS 1
|
||||
#else
|
||||
@@ -1103,6 +1103,7 @@ void MCUFRIEND_kbv::begin(uint16_t ID)
|
||||
case 0x4747: //HX8347-D
|
||||
_lcd_capable = REV_SCREEN | MIPI_DCS_REV1 | MV_AXIS | INVERT_SS;
|
||||
goto common_8347DGI;
|
||||
case 0x7575: //HX8347-G
|
||||
case 0x9595: //HX8347-I
|
||||
_lcd_capable = REV_SCREEN | MIPI_DCS_REV1 | MV_AXIS;
|
||||
common_8347DGI:
|
||||
@@ -1587,6 +1588,7 @@ void MCUFRIEND_kbv::begin(uint16_t ID)
|
||||
0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, //Power Control A [39 2C 00 34 02]
|
||||
0xF7, 1, 0x20, //Pump Ratio [10]
|
||||
0xEA, 2, 0x00, 0x00, //Driver Timing B [66 00]
|
||||
0xB0, 1, 0x00, //RGB Signal [00]
|
||||
0xB1, 2, 0x00, 0x1B, //Frame Control [00 1B]
|
||||
// 0xB6, 2, 0x0A, 0xA2, 0x27, //Display Function [0A 82 27 XX] .kbv SS=1
|
||||
0xB4, 1, 0x00, //Inversion Control [02] .kbv NLA=1, NLB=1, NLC=1
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define HX8357_YELLOW 0xFFE0
|
||||
#define HX8357_WHITE 0xFFFF
|
||||
|
||||
#include <Adafruit_GFX.h> // Core graphics library
|
||||
//#include <Adafruit_GFX.h> // Core graphics library
|
||||
#include <MCUFRIEND_kbv.h> // Hardware-specific library
|
||||
|
||||
#include <Fonts/FreeSans9pt7b.h>
|
||||
@@ -63,7 +63,7 @@ class TFT_HX8357GLUE : public MCUFRIEND_kbv
|
||||
MCUFRIEND_kbv::reset();
|
||||
_ID = MCUFRIEND_kbv::readID();
|
||||
if (_ID == 0x00D3 || _ID == 0xD3D3)
|
||||
_ID = 0x9481;
|
||||
_ID = 0x9486;
|
||||
MCUFRIEND_kbv::begin(_ID);
|
||||
MCUFRIEND_kbv::setRotation(1);
|
||||
_first = true;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#define PIN_HIGH(p, b) (p) |= (1<<(b))
|
||||
#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b))
|
||||
|
||||
#elif defined(__AVR_ATmega2560__) //regular UNO shield on MEGA2560
|
||||
#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) //regular UNO shield on MEGA2560
|
||||
#define RD_PORT PORTF
|
||||
#define RD_PIN 0
|
||||
#define WR_PORT PORTF
|
||||
@@ -171,7 +171,8 @@
|
||||
PMC->PMC_PCER0 = (1 << ID_PIOB)|(1 << ID_PIOC);\
|
||||
PIOB->PIO_ODR = BMASK; PIOC->PIO_ODR = CMASK;\
|
||||
}
|
||||
#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; WR_IDLE; }
|
||||
#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; }
|
||||
//#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; WR_IDLE; }
|
||||
#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); }
|
||||
#define READ_8(dst) { RD_STROBE; RD_ACTIVE; dst = read_8(); RD_IDLE; RD_IDLE; }
|
||||
#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); }
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
//#define USE_SSD1289_SHIELD_MEGA
|
||||
//#define USE_SSD1289_SHIELD_DUE
|
||||
//#define USE_MEGA_8BIT_PROTOSHIELD
|
||||
//#define USE_MEGA_16BIT_SHIELD //RD on PL6 (D43)
|
||||
#define USE_MEGA_16BIT_SHIELD //RD on PL6 (D43)
|
||||
//#define USE_BLD_BST_MEGA32U4
|
||||
//#define USE_BLD_BST_MEGA2560
|
||||
//#define USE_DUE_8BIT_PROTOSHIELD
|
||||
#define USE_DUE_16BIT_SHIELD //RD on PA15 (D24)
|
||||
//#define USE_DUE_16BIT_SHIELD //RD on PA15 (D24)
|
||||
|
||||
#if 0
|
||||
#elif defined(__AVR_ATmega328P__) && defined(USE_SSD1289_SHIELD_UNO) //on UNO
|
||||
|
||||
Reference in New Issue
Block a user