From 09abe484ba2bd1893c61d9007d70d80c33b5a613 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 22 Dec 2018 17:32:31 +0100 Subject: [PATCH] drivers: add generic interface types --- interfaces.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 interfaces.go diff --git a/interfaces.go b/interfaces.go new file mode 100644 index 0000000..20163ab --- /dev/null +++ b/interfaces.go @@ -0,0 +1,14 @@ +package drivers + +import ( + "image/color" +) + +// LEDArray is an array of RGB LEDs. It may have any shape, but in general it is +// a strip of daisy-chained LEDs. +type LEDArray interface { + // WriteColors updates all LEDs in the LED strip to the given RGB color. It + // depends on the protocol what happens when you do not provide a + // correctly-sized slice of colors. + WriteColors(buf []color.RGBA) error +}