drivers: display: ssd1306: Invert colors at runtime
This allows to invert the display at runtime using the function
`ssd1306_set_pixel_format`. The current format is stored in the data
struct.
Also adjusted `ssd1306_get_capabilities` to return both supported
formats and the current one.
From the ssd1306 doc: 'In normal display a RAM data of 1 indicates an
"ON" pixel while in inverse display a RAM data of 0 indicates an "ON"
pixel.' Thus `PIXEL_FORMAT_MONO01 == SSD1306_SET_NORMAL_DISPLAY`.
Signed-off-by: Greter Raffael <rgreter@baumer.com>
diff --git a/drivers/display/ssd1306_regs.h b/drivers/display/ssd1306_regs.h
index 33961e1..04092a8 100644
--- a/drivers/display/ssd1306_regs.h
+++ b/drivers/display/ssd1306_regs.h
@@ -28,7 +28,9 @@
#define SSD1306_SET_ENTIRE_DISPLAY_OFF 0xa4
#define SSD1306_SET_ENTIRE_DISPLAY_ON 0xa5
+/* RAM data of 1 indicates an "ON" pixel */
#define SSD1306_SET_NORMAL_DISPLAY 0xa6
+/* RAM data of 0 indicates an "ON" pixel */
#define SSD1306_SET_REVERSE_DISPLAY 0xa7
#define SSD1306_DISPLAY_OFF 0xae