MityDSP Documentation Index
tcDspDisplay

Introduction

The tcDspDisplay class allows the user to draw, erase, write text and bitmaps on a simple memory mapped display interface. Support is provided for multiple display screens, including virtual screens that are not mapped directly to the hardware. Any of the hardware-mapped pages may be made visible. ScreenXOR, ScreenOR, and ScreenAND functions are provided to combine screens.

The constructor for the tcDspDisplay class takes as arguments the width, height, and bit depth of the screens, and a number of "screens" of the specified size are created at the provided memory addresses. A default font for text display is also required.

See also:
MityDSP::tcDspDisplay Class Reference
DspDisplay.h

Example

This is a simple example of tcDspDisplay creation and usage:

#define NUM_LCD_SCREENS 2
#define LCD_COMMAND_ADDR 0xA0000800
#define SCR1_ADDR 0xA0000000
#define SCR2_ADDR 0xA0000400
#define SCR_WIDTH 128
#define SCR_HEIGHT 64
#define SCR_DEPTH 1
{
unsigned char *lcd_screens[NUM_LCD_SCREENS] = { (unsigned char *)SCR1_ADDR,
(unsigned char *)SCR2_ADDR };
tcDspFont *lpNarrowFont;
tcDspDisplay *lpLCD;
// create fonts to use on display
lpNarrowFont = new tcDspFont(/* see tcDspFont for details */);
// create the display interface
lpLCD = new DSP_Display(SCR_WIDTH, SCR_HEIGHT, SCR_DEPTH,
NUM_LCD_SCREENS,
(void *)LCD_COMMAND_ADDR,
(void **)lcd_screens, lpNarrowFont);
tcDspDisplay::screenCoords_t new_pos;
// clear screen memory
mpLCD->clearScreen(tcDspDisplay::screen_1);
mpLCD->clearScreen(tcDspDisplay::screen_2);
// make screen_2 visible while we draw on screen_1
mpLCD->setActiveScreen(tcDspDisplay::screen_1);
mpLCD->setVisibleScreen(tcDspDisplay::screen_2);
// say hi!
new_pos = mpLCD->putString("Hello World!", 7, 0);
new_pos = mpLCD->putString(" MityDSP here!", new_pos);
// draw a logo bitmap
int myColor = 1;
mpLCD->drawBitmap(16, 11, LOGO_WIDTH, LOGO_HEIGHT, Logo, myColor);
// make screen_1 visible, and now draw on screen_2
mpLCD->setVisibleScreen(screen_1);
...
}

  
Generated on Mon Apr 22 2013 11:33:02 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.