1 // lcd-ex.cxx - description. -*- C++ -*-
3 // Copyright (C) 1999, 2000 Red Hat.
4 // This file is part of SID and is licensed under the GPL.
5 // See the file COPYING.SID for conditions for redistribution.
15 #define LCD_BASE 0x800040 // base address for LCD
17 char logo[] = { 0x3, 0x4, 0x9, 0xa, 0xa,
18 0xa, 0xa, 0x9, 0x4, 0x3, 0x0, 0x0, 0x0,
19 0x0, 0x0, 0x0, 0x18, 0x4, 0x13, 0x0b, 0x0,
20 0x0, 0xa, 0x13, 0x4, 0x18 };
23 main( int argc, char* argv[] ) {
25 volatile char *lcd = (volatile char*) LCD_BASE;
29 lcd[LCD_IR] = 0x38; // 2-lines, 5X8 font
30 lcd[LCD_IR] = 1; // clear display
31 lcd[LCD_IR] = 0x0c; // enable display
32 lcd[LCD_IR] = 0x43; // set AC to CGRAM char 0 line 3
34 for( i=0; i<26; i++ ) // create logo
35 lcd[LCD_DR] = logo[i];
37 lcd[LCD_IR] = 0x80; // select DDRAM address 0
39 lcd[LCD_DR] = 0; // write first line
45 lcd[LCD_IR] = 0xc0; // select start of second line
47 lcd[LCD_DR] = 1; // write second line
56 printf( "should see \"cygnus rules!\"\n" );