Emwin runtime orientation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Emwin runtime orientation

Jump to solution
1,543 Views
iann
Contributor III

Hi all,

I've got a successful implementation of the emwin libraries running on a LPC54608 hooked up to a ST7789 driven display (320x240, 18bits per pixel) working well displaying text and graphics and can set the orientation correctly as desired at compile time, but there's a requirement to change the orientation during running time if the product is tilted.

I've tried using the function, flag=GUI_SetOrientation(GUI_MIRROR_X |GUI_MIRROR_Y);

This is always returning 1 indicating an error.

I've increased the memory set aside from GUI_NUMBYTES 0x8000 to 0x16000 if memory was a problem but the issue remains.

Are there any other areas I should be looking at?

Any help would be greatly appreciated. 

Cheers

Ian

Labels (2)
0 Kudos
1 Solution
1,481 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello iann‌,

In the EMWIN reference manual mention that the size of your buffer should be according to the next equation:

Virtual xSize * Virtual ySize * BytesPerPixel

So I think the size of GUI_NUMBYTES should be around 0x2A300

Let me know if this helps you.

Best Regards,

Alexis Andalon

View solution in original post

0 Kudos
3 Replies
1,482 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello iann‌,

In the EMWIN reference manual mention that the size of your buffer should be according to the next equation:

Virtual xSize * Virtual ySize * BytesPerPixel

So I think the size of GUI_NUMBYTES should be around 0x2A300

Let me know if this helps you.

Best Regards,

Alexis Andalon

0 Kudos
1,481 Views
iann
Contributor III

Thanks Alexis,

That is too much sram for the eval board to cope with at the moment so just for a test I reduced the width and height of the lcd defines and I was able to rotate a quarter of the screen. In the final product this shouldn't be a problem as we'll have external sram but I'll look for a better solution.

Kind regards

Ian

0 Kudos
1,481 Views
iann
Contributor III

Since, I've found the driver we're using GUIDRV_FLEXCOLOR supports this directly so the function GUIDRV_FlexColor_SetOrientation can be called instead and doesn't require the extra memory to be allocated.

0 Kudos