File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ fmt-check:
20
20
21
21
TARGET = build/examples_epd.hex \
22
22
build/examples_hub75.hex \
23
+ build/examples_displays_gopher-badge.hex \
23
24
build/examples_displays_pybadge.hex \
24
25
build/examples_displays_pyportal.hex \
25
26
build/examples_displays_wioterminal.hex \
@@ -38,6 +39,10 @@ build/examples_hub75.hex:
38
39
$(TINYGO ) build -size short -o $@ -target=pybadge ./examples/hub75
39
40
@$(MD5SUM ) $@
40
41
42
+ build/examples_displays_gopher-badge.hex :
43
+ $(TINYGO ) build -size short -o $@ -target=gopher-badge ./examples/displays
44
+ @$(MD5SUM ) $@
45
+
41
46
build/examples_displays_pybadge.hex :
42
47
$(TINYGO ) build -size short -o $@ -target=pybadge ./examples/displays
43
48
@$(MD5SUM ) $@
Original file line number Diff line number Diff line change
1
+ //go:build gopher_badge
2
+
3
+ package initdisplay
4
+
5
+ import (
6
+ "image/color"
7
+ "machine"
8
+
9
+ "tinygo.org/x/drivers"
10
+ "tinygo.org/x/drivers/st7789"
11
+ )
12
+
13
+ // InitDisplay initializes the display of each board.
14
+ func InitDisplay () drivers.Displayer {
15
+ machine .SPI0 .Configure (machine.SPIConfig {
16
+ Frequency : 8000000 ,
17
+ Mode : 0 ,
18
+ })
19
+
20
+ d := st7789 .New (machine .SPI0 ,
21
+ machine .TFT_RST , // TFT_RESET
22
+ machine .TFT_WRX , // TFT_DC
23
+ machine .TFT_CS , // TFT_CS
24
+ machine .TFT_BACKLIGHT ) // TFT_LITE
25
+
26
+ d .Configure (st7789.Config {
27
+ Rotation : st7789 .NO_ROTATION ,
28
+ Height : 320 ,
29
+ })
30
+ d .FillScreen (color.RGBA {255 , 255 , 255 , 255 })
31
+
32
+ return & d
33
+ }
You can’t perform that action at this time.
0 commit comments