diff --git a/inky/doc.go b/inky/doc.go index 4b5d6d9..ac841c4 100644 --- a/inky/doc.go +++ b/inky/doc.go @@ -2,7 +2,7 @@ // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. -// Package inky drives an Inky pHAT or wHAT E ink display. +// Package inky drives an Inky pHAT, pHAT v2 or wHAT E ink display. // // Datasheet // diff --git a/inky/inky.go b/inky/inky.go index f18c129..86960f0 100644 --- a/inky/inky.go +++ b/inky/inky.go @@ -69,12 +69,15 @@ type Model int const ( PHAT Model = iota WHAT + PHAT2 ) func (m *Model) String() string { switch *m { case PHAT: return "PHAT" + case PHAT2: + return "PHAT2" case WHAT: return "WHAT" default: @@ -87,6 +90,8 @@ func (m *Model) Set(s string) error { switch s { case "PHAT": *m = PHAT + case "PHAT2": + *m = PHAT2 case "WHAT": *m = WHAT default: @@ -148,6 +153,9 @@ func New(p spi.Port, dc gpio.PinOut, reset gpio.PinOut, busy gpio.PinIn, o *Opts case PHAT: d.bounds = image.Rect(0, 0, 104, 212) d.flipVertically = true + case PHAT2: + d.bounds = image.Rect(0, 0, 122, 250) + d.flipVertically = true case WHAT: d.bounds = image.Rect(0, 0, 400, 300) }