ili9341: refactor examples/ili9341

This commit is contained in:
sago35
2021-09-27 20:33:51 +09:00
committed by Ron Evans
parent 4b38841f71
commit 49c8810432
17 changed files with 121 additions and 313 deletions
+34
View File
@@ -0,0 +1,34 @@
//go:build pyportal
// +build pyportal
package initdisplay
import (
"machine"
"tinygo.org/x/drivers/ili9341"
)
func InitDisplay() *ili9341.Device {
display := ili9341.NewParallel(
machine.LCD_DATA0,
machine.TFT_WR,
machine.TFT_DC,
machine.TFT_CS,
machine.TFT_RESET,
machine.TFT_RD,
)
// configure backlight
backlight := machine.TFT_BACKLIGHT
backlight.Configure(machine.PinConfig{machine.PinOutput})
// configure display
display.Configure(ili9341.Config{})
backlight.High()
display.SetRotation(ili9341.Rotation270)
return display
}