pashamray Posted July 2, 2014 Report Share Posted July 2, 2014 Hi, I want to connect the display of Nokia (PCF8812). If it writes bytes directly through SPI, then everything is OK. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 2, 2014 Report Share Posted July 2, 2014 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 Link to comment Share on other sites More sharing options...
pashamray Posted July 2, 2014 Author Report Share Posted July 2, 2014 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. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 2, 2014 Report Share Posted July 2, 2014 No reason to be ashamed of yourself. We all do make mistakes I'll be more than happy to include the driver in the official repository once I find some time.~ Tectu Link to comment Share on other sites More sharing options...
pashamray Posted July 3, 2014 Author Report Share Posted July 3, 2014 Thank you. I'm happy. That would be fine. There are still problems. I will try to solve them soon. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 3, 2014 Report Share Posted July 3, 2014 Sure, let us know when you need any help.~ Tectu Link to comment Share on other sites More sharing options...
pashamray Posted July 3, 2014 Author Report Share Posted July 3, 2014 Hi 1. Problems with orientation of 90 degrees and 270 degrees 2. The display 102x65 pixels (102 * 65) / 8 = 828.75 that's what I want to solve first. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 4, 2014 Report Share Posted July 4, 2014 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 Link to comment Share on other sites More sharing options...
pashamray Posted July 4, 2014 Author Report Share Posted July 4, 2014 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. Link to comment Share on other sites More sharing options...
pashamray Posted July 6, 2014 Author Report Share Posted July 6, 2014 Hi, I fixed the problem with the last line. Screen controller is addressing 102x72 pixels, and the screen is 96x65 pixels. One of these days will correct orientation. It will be possible to use this driver. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 6, 2014 Report Share Posted July 6, 2014 Thank you very much for the update. I'm glad that you're making progress with display.~ Tectu Link to comment Share on other sites More sharing options...
pashamray Posted July 6, 2014 Author Report Share Posted July 6, 2014 Hi, thank you. Just poured fix orientations. Now I will complete management power. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 6, 2014 Report Share Posted July 6, 2014 Wow, looks like you're doing really good progress. Like that the driver will be part of the official repository in no time ~ Tectu Link to comment Share on other sites More sharing options...
pashamray Posted July 9, 2014 Author Report Share Posted July 9, 2014 Hi. I finished writing the driver. Contrast is adjusted automatically, a feature of the controller. :roll: Create a pull request?https://bitbucket.org/pashamray/ugfxbrach - pcf8812 Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 9, 2014 Report Share Posted July 9, 2014 Looks good to me! Good work!Pull-request whenever you feel for it ~ Tectu Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 9, 2014 Report Share Posted July 9, 2014 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 Link to comment Share on other sites More sharing options...
pashamray Posted July 10, 2014 Author Report Share Posted July 10, 2014 How will the house, fix it. Sorry. :roll: Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 10, 2014 Report Share Posted July 10, 2014 How will the house, fix it. I'm not entirely sure what this means.Sorry. :roll:No reason to be sorry at all :-)~ Tectu Link to comment Share on other sites More sharing options...
pashamray Posted July 10, 2014 Author Report Share Posted July 10, 2014 I'm not entirely sure what this means.Sorry for my english. I use the Google translator. This meant that when I come home. I fixed in the examples SPI. I can not make the parcel more than one byte. :shock: Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 11, 2014 Report Share Posted July 11, 2014 I can not make the parcel more than one byte. :shock:Can you please show us your code (both the part in the driver and the board file) and tell us what problem you're experiencing?~ Tectu Link to comment Share on other sites More sharing options...
pashamray Posted July 12, 2014 Author Report Share Posted July 12, 2014 Already found and corrected the error. Who will create a pull request. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 12, 2014 Report Share Posted July 12, 2014 Thanks, it's merged.~ Tectu Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now