Jump to content

Fede

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi all, there is a little error in LLDSPEC void gdisp_lld_control(GDisplay *g). the correct version is: LLDSPEC void gdisp_lld_control(GDisplay *g) { /* The hardware is capable of supporting... * GDISP_CONTROL_POWER - supported * GDISP_CONTROL_ORIENTATION - supported * GDISP_CONTROL_BACKLIGHT - unsupported * GDISP_CONTROL_CONTRAST - unsupported */ switch(g->p.x) { case GDISP_CONTROL_POWER: if (g->g.Powermode == (powermode_t)g->p.ptr) return; switch((powermode_t)g->p.ptr) { case powerOff: acquire_bus(g); write_index(g, SPFD54124B_CMD_SLPIN); release_bus(g); break; case powerOn: acquire_bus(g); write_index(g, SPFD54124B_CMD_SLPOUT); delayms(20); write_index(g, SPFD54124B_CMD_NORON); release_bus(g); break; case powerSleep: acquire_bus(g); write_index(g, SPFD54124B_CMD_SLPOUT); delayms(20); release_bus(g); break; default: return; } g->g.Powermode = (powermode_t)g->p.ptr; return; case GDISP_CONTROL_ORIENTATION: if (g->g.Orientation == (orientation_t)g->p.ptr) return; switch((orientation_t)g->p.ptr) { case GDISP_ROTATE_0: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x0100); //mod release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; case GDISP_ROTATE_90: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x01A0); //mod release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; case GDISP_ROTATE_180: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x01C0); //mod release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; case GDISP_ROTATE_270: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x0160); //mod release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; case GDISP_ROTATE_PORTRAIT: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x0100); //mod release_bus(g); g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Width = GDISP_SCREEN_WIDTH; break; case GDISP_ROTATE_LANDSCAPE: acquire_bus(g); write_index(g, SPFD54124B_CMD_MADCTR); write_index(g, 0x01A0); //mod release_bus(g); g->g.Height = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_HEIGHT; break; default: return; } g->g.Orientation = (orientation_t)g->p.ptr; return; } } I don't find any other error... Bye board_SPFD54124B_stm32f3.zip
  2. Goodmorning all! I don't know if it is useful to someone but this is the correct function that initialize the HD44780 in 8 bit mode: (file: ugfx/drivers/tdisp/hd44780/tdisp_lld.c) bool_t tdisp_lld_init(void) { /* initialise hardware */ init_board(); /* The first part is the initialing code. * In this part only the lower nibble of the * byte is written directly to the display, thus * without write_cmd, which sends both high and * low nibble. */ /* Give the LCD a little time to wake up */ gfxSleepMilliseconds(15); /* clear the RS-line to the display */ palClearPad(PORT_CTRL, PIN_RS); #if BUS_4BITS /* write three times 0x03 to display (4-bit mode only) * with RS = low. */ writeToLCD(0x03); // 1x gfxSleepMilliseconds(20); writeToLCD(0x03); // 2x writeToLCD(0x03); // 3x /* Put display in 4-bit mode by * write 0x02 to display. */ writeToLCD(0x02); // 4bit-modus #else /* 8-bit modus, 2 lines en 5x7 characters */ /* write three times 0x30 to display (8-bit mode only) * with RS = low. */ writeToLCD(0x30); // 1x gfxSleepMilliseconds(5); writeToLCD(0x30); // 2x writeToLCD(0x30); // 3x #endif /* From this point on, the LCD accepts * bytes sent with highnibbel first and than *the lownibble if working in 4-bit mode. * In 8-bit mode bytes are written in 1 action. */ #if BUS_4BITS /* 4-bit modus, 2 lines en 5x7 characters */ write_cmd(0x28); /* set display on, cursor off and no blinking */ write_cmd(0x0C); /* set cursor increase and direction */ write_cmd(0x06); #else /* 8-bit modus, 2 lines en 5x7 characters */ write_cmd(0x38); /* set display on, cursor off and no blinking */ write_cmd(0x0C); /* set cursor increase and direction */ write_cmd(0x06); #endif displaycontrol = TDISP_DISPLAY_ON; cursorcontrol = TDISP_CURSOR_INC; /* END OF INITIALISATION */ return TRUE; } bye, Fede
  3. I forgot to say that i need to use the GLCD with chibios and stm32F4 MCU? anything changes? steps: 1) Create a new folder under gdisp called KS108 using the SSD1306 as template and modify it... also updating the makefile 2) Create a gdisp_lld_board_stm32f4 using the tdisp_f4_discovery example as template 3) KS108 is a 8-bit parallel with WR/RD... I had found this project that maybe it will helpful http://en.radzio.dxp.pl/ks0108/ 4) get lucky? Thanks & Good Night
  4. hi all, as first thing I would like to say thanks to Tectu for the awesome works done in this project. congrats... Please could you say if are supported these driver KS108 or HD61202? If not, how much is difficult to add the KS108 to the project? what is the best way to do it? Thank you in advance for your help Fede
×
×
  • Create New...