emWin & SHARP LS027B7DH01 LCD

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

emWin & SHARP LS027B7DH01 LCD

910 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Andrew on Tue Jul 23 01:33:49 MST 2013
Hi there,

   I am using the monochrome low power LCD in one of my projects. I implemented a frame buffer to which I can write (draw pixels) and which I can flush to the LCD through SPI interface & DMA and it works fine.
   I decided to try emWin GUI library, because it offers a lot of widgets and other cool stuff. Modified GUIConf & LCDConf configuration files to use GUIDRV_LIN_1 driver and GUICC_1 colour conversion, changed resolution and other settings. It compiled and runs fine. The only problem I have is bits order. Because the display is connected through the LPC1758 SSP interface which transmits MSB (most significant bit) first and the display is expecting LSB first I organised the frame buffer in the way where bits of all bytes swapped. So that I don't need to do swapping every time before I flush the buffer and my SetPixel is aware of that and handles it properly.
   The questions is how to configure the GUIDRV_LIN_1 driver or emWin so that they write to the frame buffer properly? I found in the documentation LCD_ENDIAN_BIG setting, changed it from 0 to 1 but it didn't make any difference.
   It seems to me that I need to write my own driver to handle it. They mention GUIDRV_Template in the emWin documentation but I have only the header file in the library I downloaded from the site. Does any one know if according to the licence agreement we are allowed to implement our own drivers?
   If we are, where can I find more information about the driver development on emWin?


    Bits order I need   7 6 5 4 3 2 1 0     7 6 5 4 3 2 1 0  ... ... ..
    Bits order emWin   0 1 2 3 4 5 6 7     0 1 2 3 4 5 6 7  ... ... ..


Thank you

Cheers,
Andrew
Labels (1)
0 Kudos
2 Replies

633 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Andrew on Tue Jul 23 23:54:28 MST 2013
The display I am using is a monochrome LCD. So, basically each pixel is represented by one bit such as: 0 - is white colour, 1 is black colour. At the same time I am using LPC1758 MCU which doesn't have a LCD controller.
If you imagine a 16x2 display, when the screen is cleared (all pixels are white) your memory frame buffer will look like:

00000000 00000000
00000000 00000000

Now, if we want to set a (black colour) pixel at position x = 0, y = 1, the frame buffer will look as follows:

00000000 00000000
10000000 00000000

What I need instead is, as follows:

00000000 00000000
00000001 00000000

Basically, order of bits in any given byte in the frame buffer are swapped.

Cheers
0 Kudos

633 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Martin84 on Tue Jul 23 03:59:56 MST 2013
Hi there's a register where you can swap red and blue. For the 18xx it is the "LPC_LCD->CTRL = (1 << BGR)". For emWin you should look in the manual for "BGR". I think there is a "M" within the driver.For example GUICC_565 and GUICC_M565.

Look at the LCDconf.c at this line: #define COLOR_CONVERSION  GUICC_M565

Regards,

Martin
0 Kudos