Esempio n. 1
0
void display_menu(uint8_t line) {
  DEBUGP("display menu");
  
  screenmutex++;

  glcdClearScreen();
  
  //Dataman - Mode Menu Option
  //glcdSetAddress(0, 0);
  //glcdPutStr("Configuration Menu", NORMAL);
  glcdSetAddress(MENU_INDENT, 0);
  glcdPutStr("Mode:", NORMAL);
  print_style_setting(NORMAL);
 
  print_alarmline(SET_ALARM);
  
  print_time(time_h,time_m,time_s,SET_TIME);
  print_date(date_m,date_d,date_y,SET_DATE);
  print_region_setting(NORMAL);
  
#ifdef BACKLIGHT_ADJUST
  print_backlight(SET_BRIGHTNESS);

  if(displaymode == SET_BRIGHTNESS)
#else
  if(displaymode == SET_REGION)
#endif
  	  print_menu_exit();
  else
  	print_menu_advance();

  drawArrow(0, (line*8)+3, MENU_INDENT -1);
  screenmutex--;
}
Esempio n. 2
0
void initanim_abo(void){
 uint8_t k, b, line, eof;
 uint16_t ix, lineix;
 ix=0;
#ifdef DEATHCHRON
 glcdFillRectangle(0, 0, GLCD_XPIXELS, GLCD_YPIXELS, 1);
 death_blitsegs_rom(36,0,logo_p, 57, 64, 1);
 uint8_t i = (time_s + 5) % 60;
 while(i != time_s);
#endif
 while (1) {
  glcdClearScreen();
  for (eof=0, lineix=0, line=0; line<8; line++) {
   if (!eof) {
    b = eeprom_read_byte(&about[ix++]);
    if (b==255) {
     eof = 1;
     if (!line) {displaystyle = eeprom_read_byte(&EE_STYLE); initanim(); return;}
     continue;
    } 
    if (!line) {lineix = ix + b;}
    k = ((128 - (b * 6))/2)-1;
    if (k<0) {k=0;}
    glcdSetAddress(k,line);
    for(;b>0;b--) {
     glcdWriteChar(eeprom_read_byte(&about[ix++]),0);
    }
   }
  }
  ix = lineix;
  delay_ms(500);
 }
}
Esempio n. 3
0
void glcdInit()
{
	// initialize hardware
	glcdInitHW();
	// bring lcd out of reset
	glcdReset(FALSE);
	// Turn on LCD
	glcdControlWrite(0, GLCD_ON_CTRL | GLCD_ON_DISPLAY);
	glcdControlWrite(1, GLCD_ON_CTRL | GLCD_ON_DISPLAY);
	// clear lcd
	glcdClearScreen();
	// initialize positions
	glcdHome();
}
Esempio n. 4
0
void display_menu(void) {
  DEBUGP("display menu");
  
  screenmutex++;

  glcdClearScreen();
  
  glcdSetAddress(0, 0);
  glcdPutStr("Configuration Menu", NORMAL);
  
  glcdSetAddress(MENU_INDENT, 1);
  glcdPutStr("Set Alarm:  ", NORMAL);
  print_alarmhour(alarm_h, NORMAL);
  glcdWriteChar(':', NORMAL);
  printnumber(alarm_m, NORMAL);
  
  glcdSetAddress(MENU_INDENT, 2);
  glcdPutStr("Set Time: ", NORMAL);
  print_timehour(time_h, NORMAL);
  glcdWriteChar(':', NORMAL);
  printnumber(time_m, NORMAL);
  glcdWriteChar(':', NORMAL);
  printnumber(time_s, NORMAL);
  if (time_format == TIME_12H) {
    glcdWriteChar(' ', NORMAL);
    if (time_h >= 12) {
      glcdWriteChar('P', NORMAL);
    } else {
      glcdWriteChar('A', NORMAL);
    }
  }
  
  print_date(date_m,date_d,date_y,SET_DATE);
  print_region_setting(NORMAL);
  
#ifdef BACKLIGHT_ADJUST
  glcdSetAddress(MENU_INDENT, 5);
  glcdPutStr("Set Backlight: ", NORMAL);
  printnumber(OCR2B>>OCR2B_BITSHIFT,NORMAL);
#endif
  
  glcdSetAddress(0, 6);
  glcdPutStr("Press MENU to advance", NORMAL);
  glcdSetAddress(0, 7);
  glcdPutStr("Press SET to set", NORMAL);

  screenmutex--;
}
Esempio n. 5
0
void glcdInit()
{
	uint8_t i;
	// initialize hardware
	glcdInitHW();
	// bring lcd out of reset
	glcdReset(FALSE);
	// Turn on LCD
	for(i=0; i<GLCD_NUM_CONTROLLERS; i++)
	{
		glcdControlWrite(i, GLCD_ON_CTRL | GLCD_ON_DISPLAY);
	}
	// clear lcd
	glcdClearScreen();
	// initialize positions
	glcdHome();
}
Esempio n. 6
0
void oscope(void)
{
	u08 i=0;
	u08 oldbuffer[128];
	u08 newbuffer[128];
	
	glcdClearScreen();

	while(1)
	{
		for(i=0; i<128; i++)
			oldbuffer[i] = newbuffer[i];

		for(i=0; i<128; i++)
			newbuffer[i] = a2dConvert8bit(0);

		for(i=0; i<128; i++)
		{
			glcdClearDot(i,oldbuffer[i]>>2);
			glcdSetDot(i,newbuffer[i]>>2);
		}
	}
}
Esempio n. 7
0
void lcdtest(void)
{
	unsigned char key = 0;

	glcdClearScreen();

	glcdSetAddress(4,LINE2);
	glcdPutStr("Graphic LCD Test");
	glcdSetAddress(4,LINE3);
	glcdPutStr("HD61202/3 controller");
	glcdSetAddress(4,LINE4);
	glcdPutStr("KS0108/7 controller");
	glcdSetAddress(4,LINE5);
	glcdPutStr("Press buttons to");
	glcdSetAddress(4,LINE6);
	glcdPutStr("test functions...");
	glcdRectangle(0, 0, 64, 128);
  
	while(1)
	{
		timerPause(10);
		key = ~inb(PINA);
		glcdSetAddress(4,LINE7);
		rprintf("Button status: %x  ", key);

		if(key == KEY1)
		{
			unsigned char i ;
			glcdClearScreen();	
			for ( i=0; i<128; i+=3)
			{
				glcdSetDot(i,63 - i/2);
  				glcdDelay(0x5fff);
			}
			for ( i=0; i<128; i+=3)
			{
				glcdClearDot(i,63 - i/2);
  				glcdDelay(0x5fff);
			}
		}
		
		if(key == KEY2)
		{
			glcdClearScreen();	
  			glcdCircle(25,20,17);
  			glcdDelay(0xffff);
  			glcdCircle(90,30,15);
  			glcdDelay(0xffff);
  			glcdCircle(55,30,23);
  			glcdDelay(0xffff);
  			glcdCircle(100,48,15);
  			glcdDelay(0xffff);
  			glcdCircle(34,50,10);
  			glcdDelay(0xffff);
  			glcdCircle(60,55,8);
		}
      
		if(key == KEY3)
		{
			glcdClearScreen();	
			glcdRectangle(54, 41, 6 , 12);
  			glcdDelay(0xffff);
			glcdRectangle(34, 12, 32, 2);
  			glcdDelay(0xffff);
			glcdRectangle(23, 34, 17, 21);
  			glcdDelay(0xffff);
			glcdRectangle(62, 20, 42, 58);
  			glcdDelay(0xffff);
			glcdRectangle(4 , 30, 12, 12);
		}
		
		if(key == KEY4)
		{
			glcdClearScreen();	
			glcdSetAddress(0,LINE1);	
			glcdPutStr("LINE 1"); glcdDelay(0xffff);
			glcdSetAddress(5,LINE2);
			glcdPutStr("LINE 2"); glcdDelay(0xffff);
			glcdSetAddress(10,LINE3);
			glcdPutStr("LINE 3"); glcdDelay(0xffff);
			glcdSetAddress(15,LINE4);
			glcdPutStr("LINE 4"); glcdDelay(0xffff);
			glcdSetAddress(20,LINE5);
			glcdPutStr("LINE 5"); glcdDelay(0xffff);
			glcdSetAddress(25,LINE6);
			glcdPutStr("LINE 6"); glcdDelay(0xffff);
			glcdSetAddress(30,LINE7);
			glcdPutStr("LINE 7"); glcdDelay(0xffff);
			glcdSetAddress(35,LINE8);
			glcdPutStr("LINE 8"); glcdDelay(0xffff);
		}

		if(key == KEY5)
		{
			glcdClearScreen();	
			glcdSetAddress(0,LINE2);
  			glcdPutStr(" !");
  			glcdWriteChar('"');
  			glcdPutStr("#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ");
  			glcdPutStr("[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
		}
		
		if(key == KEY6)
		{
			unsigned char i;
			for (i=0; i<64; i++)
			{
				glcdStartLine(64- i - 1);
  				glcdDelay(0x5fff);
			}
		}
		
		if(key == KEY7)
		{
			unsigned char i;
			for (i=0; i<64; i++)
			{
				glcdStartLine(i + 1);
  				glcdDelay(0x5fff);
			}
		}
		
		if (key == KEY8)
		{
			//	glcdBackLight(OFF);	
			//	glcdBackLight(ON);	
		}   
	}
}
Esempio n. 8
0
//
// Function: analogInit
//
// Initialize the LCD display of an analog clock
//
void analogInit(u08 mode)
{
  s08 i, dxDot, dyDot;

  DEBUGP("Init Analog");

  if (mode == DRAW_INIT_FULL)
  {
    // Draw static clock layout
    glcdClearScreen(mcBgColor);
    glcdCircle2(ANA_X_START, ANA_Y_START, ANA_RADIUS, CIRCLE_FULL, mcFgColor);
    glcdDot(ANA_X_START, ANA_Y_START, mcFgColor);
    
    // Paint 5-minute and 15 minute markers in clock
    for (i = 0; i < 12; i++)
    {
      // The 5-minute markers
      dxDot = (s08)(sin(2L * M_PI / 12L * i) * ANA_DOT_RADIUS);
      dyDot = (s08)(-cos(2L * M_PI / 12L * i) * ANA_DOT_RADIUS);
      glcdDot(ANA_X_START + dxDot, ANA_Y_START + dyDot, mcFgColor);

      // The additional 15-minute markers
      if (i % 3 == 0)
      {
        if (i == 0)
          dyDot--;
        else if (i == 3)
          dxDot++;
        else if (i == 6)
          dyDot++;
        else
          dxDot--;
        glcdDot(ANA_X_START + dxDot, ANA_Y_START + dyDot, mcFgColor);
      }
    }

    // Init the arrow point position arrays with harmless values
    // inside the clock area
    for (i = 0; i < 6; i++)
    {
      posSec[i] = 40;
      posMin[i] = 40;
      posHour[i] = 40;
    }

    // The following inits force the seconds element to become a needle
    posSec[2] = ANA_X_START;
    posSec[3] = ANA_Y_START;

    // Force the alarm info area to init itself
    mcAlarmSwitch = ALARM_SWITCH_NONE;
    mcU8Util1 = GLCD_FALSE;
  }
  else if (anaSecShow == GLCD_FALSE)
  {
    // Assume this is a partial init from an analog HMS clock to an
    // analog HM clock. So, we should remove the seconds needle.
    analogElementDraw(posSec, mcBgColor);

    // Restore dot at center of clock
    glcdDot(ANA_X_START, ANA_Y_START, mcFgColor);
  }
}