Jump to content

SSD1322 Driver


Andrey_13

Recommended Posts

Adding a driver for the SSD1322 display controller is currently not on our ToDo list. However, adding such a driver is very easy and doesn't take a lot of time. The reason we don't have it is because we simply never got our hands on an SSD1322 display controller.

We can encourage you writing that driver yourself. It is very easy and the existing examples such as the SSD1306 should help you a lot. Please don't hesitate to ask if you have any questions. We are happy to help where ever we can.

Link to comment
Share on other sites

  • 2 weeks later...

Hello. I wrote a driver SSD1322, but ran into some problems.Please, see picture:

1.write 2 lines into display (used gdispFillString procedure)

lcd_norm.jpg

and see code:

    font2 = gdispOpenFont("ubuntu30_b");

        sprintf(str,"Temper. -27.3°C");
//        gdispDrawStringBox(0, 0,250,30, str, font2, 0x02,justifyLeft);
//        gdispDrawStringBox(0, 30,250,60, str, font2, 0x02,justifyLeft);
        gdispFillString(0, 30, str, font2, 0x02, 0x00);
        gdispFillString(0, 0, str, font2, 0x02, 0x00);


.

2. If I used gdispDrawStringBox procedure? i get this picture:

lcd_slide.jpg

and see code 

    font2 = gdispOpenFont("ubuntu30_b");

        sprintf(str,"Temper. -27.3°C");
        gdispDrawStringBox(0, 0,250,30, str, font2, 0x02,justifyLeft);
        gdispDrawStringBox(0, 30,250,60, str, font2, 0x02,justifyLeft);
//        gdispFillString(0, 30, str, font2, 0x02, 0x00);
//        gdispFillString(0, 0, str, font2, 0x02, 0x00);


 

Questions:

1. Why gdispDrawStringBox it is not working (text slide down)?

2.I refresh full display (send ram = RAM(g) with DMA). If I update the display window, the text is not displayed.

And what do the parameters g->p.x1,g->p.x2,g->p.y1,g->p.x2 (if g->p.x, g->p.y, g->p.cx, g->p.cy is related to the size of the updated window)

sorry by my english.

Thank You.

Link to comment
Share on other sites

Hello Andrey,

I'm glad to hear that you successfully managed to write a driver for the SSD1322 display controller - great work!

 

1 hour ago, Andrey_13 said:

1. Why gdispDrawStringBox it is not working (text slide down)?

The reason for this is because the string is vertically centered in the box that you define with the first four parameters. In your code, you set the height of the second box to 60 instead of 30. If the height of the box is 60, the text will be drawn in a fashion that it's vertically centered and that is what you are experiencing. To fix the problem, simply use a height of 30 for the second string box as well:

gdispDrawStringBox(0, 0, 250, 30, str, font2, 0x02, justifyLeft);
gdispDrawStringBox(0, 30, 250, 30, str, font2, 0x02, justifyLeft);

That should definitely fix your problem :) 
Basically you want the same box/rectangle for both texts, it's just that one is 30 pixels below the other one.

 

2 hours ago, Andrey_13 said:

I refresh full display (send ram = RAM(g) with DMA). If I update the display window, the text is not displayed.

If you clear/refresh the display the old content will be gone. The all the GDISP drawing functions directly modify the content of the framebuffer when you call them, they don't retain any state. Hence, if you clear/refresh the display the content that you wrote previously to the framebuffer will be gone. To have persistent items on the display you need a window manager. That is actually what the GWIN module provides. Theoretically you could simply use the label widget instead and the window manager will take care of redrawing the text when it needs to be redrawn. However, with your display that is way overkill. It's better if you simply write your own update() or refresh() function that redraws the stuff that needs to be redrawn.

 

2 hours ago, Andrey_13 said:

And what do the parameters g->p.x1,g->p.x2,g->p.y1,g->p.x2 (if g->p.x, g->p.y, g->p.cx, g->p.cy is related to the size of the updated window)

These parameters change the meaning depending on the function that receives them. Those are only used internally by the GDISP module - you must not touch them at any time.

 

I'm sorry in case of I misunderstood any of your questions. Please feel free to complain if your questions didn't get answered properly :) 

Link to comment
Share on other sites

Hello Joe Bodenmann. Thank You.

22 hours ago, Joel Bodenmann said:

 


gdispDrawStringBox(0, 0, 250, 30, str, font2, 0x02, justifyLeft);
gdispDrawStringBox(0, 30, 250, 30, str, font2, 0x02, justifyLeft);

That should definitely fix your problem :) 
Basically you want the same box/rectangle for both texts, it's just that one is 30 pixels below the other one.

Oop. Very stupid MY mistake :-).

 

Quote

 

If you clear/refresh the display the old content will be gone. The all the GDISP drawing functions directly modify the content of the framebuffer when you call them, they don't >>retain any state. Hence, if you clear/refresh the display the content that you wrote previously to the framebuffer will be gone. To have persistent items on the display you >>need a window manager. That is actually what the GWIN module provides. Theoretically you could simply use the label widget instead and the window manager will take >>care of redrawing the text when it needs to be redrawn. However, with your display that is way overkill. It's better if you simply write your own update() or refresh() function >>that redraws the stuff that needs to be redrawn.

These parameters change the meaning depending on the function that receives them. Those are only used internally by the GDISP module - you must not touch them at any time.

I'm sorry in case of I misunderstood any of your questions. Please feel free to complain if your questions didn't get answered properly :) 

 

I still work in this direction.

Thank You very much.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...