Jump to content

Recommended Posts

Posted

Hello and welcome to the community!

If it writes bytes directly through SPI, then everything is OK.

Could you please point directly to the working code and the not working board file? When I understand you correctly you already have a working driver and just porting it to uGFX does not work?

~ Tectu

Posted

Thank you.

I found a bug, I'm ashamed.

I used to output data code:


unsigned int i;

for (i = 0; i < (GDISP_SCREEN_WIDTH * (GDISP_SCREEN_HEIGHT / 8)); i++) {
write_data(g, RAM(g) + i, 1);
}

as needed:


unsigned int i;

for (i = 0; i < (GDISP_SCREEN_WIDTH * (GDISP_SCREEN_HEIGHT / 8)); i++) {
write_data(g, RAM(g)[i], 1);
}

sorry.

uploaded working code repository.

Posted

Does your display controller provide a native orientation mode? As in: Can you tell him to flip 90°?

If not, it's just a matter of doing some calculations for the pixel positions. The following is a code snipped from the framebuffer driver:


LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
unsigned pos;

#if GDISP_NEED_CONTROL
switch(g->g.Orientation) {
case GDISP_ROTATE_0:
default:
pos = PIXIL_POS(g, g->p.x, g->p.y);
break;
case GDISP_ROTATE_90:
pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1);
break;
case GDISP_ROTATE_180:
pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1);
break;
case GDISP_ROTATE_270:
pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x);
break;
}
#else
pos = PIXIL_POS(g, g->p.x, g->p.y);
#endif
}

Sometimes it's also a good idea to take a look at already existing drivers.

~ Tectu

Posted

Hi, this display has a vertical and horizontal addressing, I will try it. Yes I saw framebuffer driver. try to use the code from it.

Thank you very much for the quick response and assistance.

Posted

Hi, I fixed the problem with the last line.

Screen controller is addressing 102x72 pixels, and the screen is 96x65 pixels.

lcd_mem.png

One of these days will correct orientation. It will be possible to use this driver.

Posted

There's one thing that inmarket and I recognized:

You are limiting the performance through the board file extremely. You're calling write_data(g, RAM(g), 1); in a for-loop but the function is actually meant to take the size of bytes so everything can be done in one call. The reason why this does/did not work for you is because in your board file you're using spiStartSend. However, that call is asynchronous so you have to wait for the completion of the transmission! You can use spiSend() instead as this is operation is synchronous.

Could you please try it this way so we can modify the driver to improve the performance?

~ Tectu

Posted
I'm not entirely sure what this means.

Sorry for my english. I use the Google translator. :D This meant that when I come home.

I fixed in the examples SPI.

I can not make the parcel more than one byte. :shock:

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...