waveshare213v2: Add named constants for display update flags

pull/41/head
Michael Hanselmann 4 years ago
parent 8ec566564c
commit ec4ee88266

@ -69,7 +69,10 @@ func configDisplayMode(ctrl controller, mode PartialUpdate, lut LUT) {
ctrl.sendData([]byte{0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00}) ctrl.sendData([]byte{0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00})
ctrl.sendCommand(displayUpdateControl2) ctrl.sendCommand(displayUpdateControl2)
ctrl.sendData([]byte{0xC0}) ctrl.sendData([]byte{
displayUpdateEnableClock |
displayUpdateEnableAnalog,
})
ctrl.sendCommand(masterActivation) ctrl.sendCommand(masterActivation)
} }
@ -89,7 +92,13 @@ func updateDisplay(ctrl controller, mode PartialUpdate) {
ctrl.sendData([]byte{displayUpdateFlags}) ctrl.sendData([]byte{displayUpdateFlags})
ctrl.sendCommand(displayUpdateControl2) ctrl.sendCommand(displayUpdateControl2)
ctrl.sendData([]byte{0xC7}) ctrl.sendData([]byte{
displayUpdateDisableClock |
displayUpdateDisableAnalog |
displayUpdateDisplay |
displayUpdateEnableClock |
displayUpdateEnableAnalog,
})
ctrl.sendCommand(masterActivation) ctrl.sendCommand(masterActivation)
ctrl.waitUntilIdle() ctrl.waitUntilIdle()

@ -54,6 +54,18 @@ const (
sourceDrivingVoltageVSL_neg15V = 0x32 sourceDrivingVoltageVSL_neg15V = 0x32
) )
// Flags for the displayUpdateControl2 command
const (
displayUpdateDisableClock byte = 1 << iota
displayUpdateDisableAnalog
displayUpdateDisplay
displayUpdateMode2
displayUpdateLoadLUTFromOTP
displayUpdateLoadTemperature
displayUpdateEnableClock
displayUpdateEnableAnalog
)
// Dev defines the handler which is used to access the display. // Dev defines the handler which is used to access the display.
type Dev struct { type Dev struct {
c conn.Conn c conn.Conn

Loading…
Cancel
Save