Skip to content

Commit 71da119

Browse files
committed
Swap LCD to use second SPI bus, correct color order, fix offset, fix rotation
1 parent 57809f9 commit 71da119

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "https://github.com/m5stack/M5AtomS3.git"
1212
},
13-
"version": "0.0.2",
13+
"version": "0.0.3",
1414
"frameworks": "arduino",
1515
"platforms": "espressif32",
1616
"headers": "M5AtomS3.h"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=M5AtomS3
2-
version=0.0.2
2+
version=0.0.3
33
author=M5Stack
44
maintainer=M5Stack
55
sentence=Library for M5AtomS3 Core development kit

src/M5AtomS3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class M5AtomS3 {
2626
Button Btn = Button(41, 25, true, true);
2727

2828
void begin(bool LCDEnable = true, bool SerialEnable = true,
29-
bool I2CEnable = true, bool LEDEnable = false);
29+
bool I2CEnable = false, bool LEDEnable = false);
3030
void update();
3131
};
3232

src/utility/In_eSPI_Drivers/ST7789_Rotation.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ switch (rotation) {
1818
colstart = 35;
1919
rowstart = 0;
2020
} else {
21-
colstart = 0;
22-
rowstart = 0;
21+
colstart = 2;
22+
rowstart = 1;
2323
}
2424
#endif
2525
writedata(TFT_MAD_COLOR_ORDER);
@@ -43,8 +43,8 @@ switch (rotation) {
4343
colstart = 0;
4444
rowstart = 35;
4545
} else {
46-
colstart = 0;
47-
rowstart = 0;
46+
colstart = 1;
47+
rowstart = 2;
4848
}
4949
#endif
5050
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
@@ -68,8 +68,8 @@ switch (rotation) {
6868
colstart = 35;
6969
rowstart = 0;
7070
} else {
71-
colstart = 0;
72-
rowstart = 80;
71+
colstart = 2;
72+
rowstart = 1;
7373
}
7474
#endif
7575
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
@@ -92,8 +92,8 @@ switch (rotation) {
9292
colstart = 0;
9393
rowstart = 35;
9494
} else {
95-
colstart = 80;
96-
rowstart = 0;
95+
colstart = 1;
96+
rowstart = 2;
9797
}
9898
#endif
9999
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);

src/utility/In_eSPI_Setup.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
#define TFT_RGB_ORDER 0 // Use the correct RGB order for the display
2+
3+
#define CGRAM_OFFSET // Display has an offset that needs to be corrected
4+
// Offset corrections in In_eSPI_Drivers\ST7789_Rotation.h
5+
6+
// Above values must be set before ST7789_Defines.h is included
7+
18
#include "In_eSPI_Drivers/ST7789_Defines.h"
29

310
#define ST7789_DRIVER // Full configuration option, define additional
411
// parameters below for this display
512

13+
#define USE_HSPI_PORT // Use the second SPI port for the display, keeping the
14+
// default SPI port free for use on the Atom expansion
15+
// port
16+
617
#define TFT_DRIVER 0x7789
7-
#define TFT_WIDTH 129
8-
#define TFT_HEIGHT 129
18+
#define TFT_WIDTH 128
19+
#define TFT_HEIGHT 128
920

1021
#define TFT_MISO -1
1122
#define TFT_MOSI 21
@@ -35,4 +46,4 @@
3546

3647
#define SPI_READ_FREQUENCY 20000000
3748

38-
#define SPI_TOUCH_FREQUENCY 2500000
49+
#define SPI_TOUCH_FREQUENCY 2500000

0 commit comments

Comments
 (0)