EA-DOG-XL-240-7 wo ist der Befehl zum löschen?

#4975034
Lesenswert?

Hallo Freunde,

ich habe das oben beschriebene Display erfolgreich implementiert.

Jedoch wüsste ich gerne wie man das Display löschen kann und wie man 
einen Bereich löschen kann.

Die kleineren Displays haben meines Wissens einen Befehl dafür.

Muss man es wirklich " zu Fuß " machen und die BITS der Pixel löschen?
#4975406
Lesenswert?

Hallo,

//-----------------------------------------------------
//Func: ClrDisplay
//Desc: Clears entire Display content and set home pos
//-----------------------------------------------------

void ClrDisplay(void)
{
  WriteIns(0x01);
  SetPostion(LINE1);
}

so schaut das Original aus.

Initialisierungsbeispiele für EA DOGM204-A hier:

http://www.lcd-module.de/support/application-note.html


Gruß GG
#4975485
Lesenswert?

Hallo,

habe es so gelöst:

void lcd_clear()
{
  int i;
      move_to(0,0);

        for(i=0;i<4800;i++)
        {

          lcd_dat(0x00);

        }
      move_to(0,0);
}

void lcd_clear_char(char y, char x)
{
  move_to(y,x);

    lcd_dat(0x00);
    lcd_dat(0x00);
    lcd_dat(0x00);
    lcd_dat(0x00);
    lcd_dat(0x00);
    lcd_dat(0x00);


}


void lcd_clear_area(char y, char x, char cly, char clx)
{
  int i, j;

  move_to(y, x);

  for(j=0;j<cly;j++)
  {
    for(i=0;i<clx;i++)
  {
    lcd_dat(0x00);
  }

  y++;

  }



Klappt wunderbar.

Mein einziges Problem mit dem Display ist nun, dass die großen 
Schriftarten aus der DOGM Library  nicht klappen´.

Jemand ´Lust mir dabei zu helfen?
Gast #4975504
Lesenswert?

Hi

> for(i=0;i<4800;i++)

Wie kommst du auf '<4800'? Ein kompletter Screen hat 16x240=3840 Bytes. 
Das EA DOGXL240-7 hat ein integriertes RAM für 4 komplette 
Bildschirmseiten.

>void lcd_clear_area(char y, char x, char cly, char clx)

Der Displaycontroller UC1611 hat eine Windows Funktion. Damit kann man 
Ausgaben auf bestimmte Bereiche definieren.

>...dass die großen Schriftarten aus der DOGM Library  nicht klappen´.

Welche DOGM Library?

MfG spess
#4975837
Lesenswert?

Hallo,

oh hast recht 3840 muss dahin.

dann muss ich wohl nochmal mit der Window Funktion bekannt machen.

Das ist aber erstmal ein kleineres Problem mein kleines Skript klappt 
ja.

Hier aus dem Topic ist die Library mit den Fonts.

Beitrag "Library für EA-DOGM Grafikdisplays inkl. Font-Generator"

ich bin mir ziemlich sicher dass es an meiner lcd_put_char Funktion 
liegt.


************************************************************************ 
******
 * Outputs a character on the display, using the given font and style
 */
uint8_t lcd_put_char(FONT_P font, uint8_t style, char character) {
  uint16_t  i;
  uint8_t row  = 0;                             //current row of char
  #ifdef LCD_DOUBLE_PIXEL
    uint8_t hc   = 1;                           //height forced
  #else
    uint8_t hc   = (style & DOUBLE_HEIGHT)?1:0; //height changed
  #endif
  uint8_t wc   = (style & DOUBLE_WIDTH)?1:0;    //width changed
  uint8_t ul   = (style & UNDERLINE)?0x80:0x00; //underline
  uint8_t inv  = (style & INVERT)?0xFF:0;       //inverted
  uint8_t spc  = (style & SPACING)?3:1;         //spacing
  uint8_t tmp;

  //load information about character
   uint8_t char_width    = font_get_char_width(font,character);
   uint8_t font_height   = font_get_height_bytes(font);
   uint8_t free_space    = font_get_add_space(font,character)*spc;
   PGM_P   tableposition = font_get_char_position(font,character);

  //final size of character
  uint8_t char_final_width  = (uint8_t)(char_width+free_space) << wc;
  uint8_t char_final_height = (uint8_t)font_height << hc;

  /*//check for avail. space on display

  if ((style & WRAP) && (LCD_CURRENT_COL() + char_final_width > 
LCD_WIDTH)) {
    LCD_MOVE_TO(LCD_CURRENT_PAGE()+char_final_height,0);
    if (character == ' ') return 0;
    }
*/
  //write chracter
  do {
    for(i=(row>>hc); i<char_width*font_height; i+=font_height) {
      tmp = pgm_read_byte(tableposition+i);
      if(row == char_final_height-1)
        tmp |= ul;
      if(hc)
        tmp = double_bits((row&1),tmp);
      if(inv)
        tmp = ~tmp;
      lcd_dat(tmp);
      if(wc)
        lcd_dat(tmp);
      }
    if (free_space) {
      uint8_t c = inv;
      if(row == char_final_height-1) {
        c ^= ul;
        if(hc)
          c ^= ul>>1;
          }
      for(uint8_t x = free_space; x>0;x--) {
        lcd_dat(c);
        }
      }
  // move_yx(1,-char_final_width);
    } while (++row < char_final_height);

  //move cursor to upper right corner of character
  //move_yx(-char_final_height,char_final_width);
  return char_final_width;
  }

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren