Gast
#150160
Mit dem Display T6963 möchte ich eine Bitmap Grafik darstellen lassen.
Im Internet habe ich diesen C-Code gefunden.
Ich habe mir desshalb den Code heruntergeladen, weil dieser eine
Funktion zum Darstellen eines Bitmaps beinhaltet.
Jetzt weiss ich allerdings nicht welche Werte ich für cols und rows
geben muss. Mir ist nicht ganz klar warum ich cols und rows vorgeben
muss. Kann mir jemand dazu helfen?
void t6963_copy_bitmap(u16 lcd_adr, PGM_P bitmap, u08 cols, u08 rows,
u08 invert)
{
// lcd_adr = start adress in the display RAM
// bitmap = pointer to the bitmap in the flash
// cols = cols of the bitmap in bytes (pixel / 8)
// rows = rows of the bitmap in pixel (row = Reihe)
// invert = if > 0, then bitmap is inverted (maybe a bug in BMP2C)
u08 row, col, data;
u16 lcd_ptr;
for(row=0; row < rows; row++)
{
lcd_ptr = lcd_adr + (row * cols);
t6963_write_cmd2(CMD_SET_ADRESS_POINTER , lo8(lcd_ptr),
hi8(lcd_ptr));
for(col=0; col < cols; col++)
{
data = pgm_read_byte(bitmap + (row * cols) + col);
if(invert) data = ~data;
t6963_write_cmd1(CMD_DATA_WR_INC, data);
}
}
}