Zephyr: drivers: ssd1306: When 128x32 is used, only half of the screen is output.

Created on 25 Feb 2019  路  5Comments  路  Source: zephyrproject-rtos/zephyr

I have a 128x32 SSD1306 module.
SSD1306 Module(128x32): Adafruit PiOLED - 128x32 Monochrome OLED Add-on for Raspberry Pi

There is height in dts of SSD1306.

height:
  type: int
  category: required
  description: Height in pixel of the panel driven by the controller
  generation: define

So I put 32 in the height as shown below.
However, only half of the screen is printed.

ssd1306@3c {
        compatible = "solomon,ssd1306fb";
        reg = <0x3c>;
        label = "SSD1306";
        width = <128>;
        height = <32>;
        segment-offset = <0>;
        page-offset = <0>;
        display-offset = <0>;
        segment-remap;
        com-invdir;
        prechargep = <0x22>;
};

Below is the output of the screen according to the height value.
I tested it with cfb_shell.

cfb init
cfb print 0 0 1234567890

| height = <64> | height = <32> |
| --------------| ------------- |
| image | image |

I tried to modify it as below.
The results are slightly different, but still half the output.

diff --git a/drivers/display/ssd1306.c b/drivers/display/ssd1306.c
index 3c91e3d812..b354d6e4e3 100644
--- a/drivers/display/ssd1306.c
+++ b/drivers/display/ssd1306.c
@@ -32,7 +32,7 @@ LOG_MODULE_REGISTER(ssd1306);
 #define SSD1306_PANEL_NUMOF_PAGES      (DT_SOLOMON_SSD1306FB_0_HEIGHT / 8)
 #define SSD1306_CLOCK_DIV_RATIO                0x0
 #define SSD1306_CLOCK_FREQUENCY                0x8
-#define SSD1306_PANEL_MUX_RATIO                63
+#define SSD1306_PANEL_MUX_RATIO                (DT_SOLOMON_SSD1306FB_0_HEIGHT  - 1)
 #define SSD1306_PANEL_VCOM_DESEL_LEVEL 0x20
 #define SSD1306_PANEL_PUMP_VOLTAGE     SSD1306_SET_PUMP_VOLTAGE_90

image

Am I using dts incorrectly?
Or is it a driver bug?

Display Drivers bug low

Most helpful comment

@jfischer-phytec-iot I checked using lvgl. Works fine. :smile:
KakaoTalk_20190916_170705556

All 5 comments

@KwonTae-young please check #19073

@jfischer-phytec-iot
I am currently in holiday season.
I'll check it next Monday. :)

@jfischer-phytec-iot
It works fine.
image

@KwonTae-young :+1: maybe you would like to try samples/gui/lvgl, lvgl is more sophisticated as cfg

@jfischer-phytec-iot I checked using lvgl. Works fine. :smile:
KakaoTalk_20190916_170705556

Was this page helpful?
0 / 5 - 0 ratings