⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 disp.c

📁 单片机开发程序原码,仅供个人学习参考. 各原码详细功能见压缩包及代码注释.
💻 C
📖 第 1 页 / 共 3 页
字号:


/*F**************************************************************************
* NAME: print_mode_mass
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the mass storage icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_mass (void)
{
#if CONF_DISPLAY == LCD
  LcdWriteCH(0x94,MASS[0],MASS[1]);
  LcdWriteCH(0x95,MASS[2],MASS[3]); /* select mass storage icon */

#endif
}


/*F**************************************************************************
* NAME: print_mode_tool
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the tool icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_tool (void)
{
#if CONF_DISPLAY == LCD
  LcdWriteCH(0x94,TOOL[0],TOOL[1]);
  LcdWriteCH(0x95,TOOL[2],TOOL[3]);   /* select tool icon */

#endif
}


/*F**************************************************************************
* NAME: print_mode_blank
*----------------------------------------------------------------------------
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the blank mode icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_blank (void)
{
#if CONF_DISPLAY == LCD
 LcdWriteCH(0x94,DISABLE[0],DISABLE[1]);
 LcdWriteCH(0x95,DISABLE[2],DISABLE[3]); /* select blank icon */
#endif
}


/*F**************************************************************************
* NAME: print_sound
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the sound icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_sound (void)
{
#if CONF_DISPLAY == LCD
  switch (song_get_sound())
  {
    case SND_VOLUME:
    {
      LcdWriteCH(0x96,VOL[0],VOL[1]);
	  LcdWriteCH(0x97,VOL[2],VOL[3]);
      break;
    }
    case SND_BASS:
    {
      LcdWriteCH(0x96,BASS[0],BASS[1]);
	  LcdWriteCH(0x97,BASS[2],BASS[3]);
      break;
    }
    case SND_MEDIUM:
    {
      LcdWriteCH(0x96,MEDIUM[0],MEDIUM[1]);
	  LcdWriteCH(0x97,MEDIUM[2],MEDIUM[3]);
      break;
    }
    case SND_TREBLE:
    {
      LcdWriteCH(0x96,TREBLE[0],TREBLE[1]);
	  LcdWriteCH(0x97,TREBLE[2],TREBLE[3]);
      break;
    }
  }
#endif
}


/*F**************************************************************************
* NAME: print_sound_level
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the sound level
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_sound_level (void)
{
//#if CONF_DISPLAY == LCD
//  lcd_set_cur(POS_SOUND_LVL);
//  print_decim(song_get_level(), FALSE);

//#endif
}


/*F**************************************************************************
* NAME: print_voice_vol
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the voice volume
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_voice_vol (char volume)
{
#if CONF_DISPLAY == LCD
//  lcd_set_cur(POS_SOUND_LVL);
//  lcd_putchar(volume + '0');
 LcdWriteCH(0x83,TREBLE[2],TREBLE[3]);

#endif
}


/*F**************************************************************************
* NAME: print_time
*----------------------------------------------------------------------------
* PARAMS:
*   - min: minute to display
*   - sec: second to display
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print time on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_time (Byte min, Byte sec)
{
//#if CONF_DISPLAY == LCD
//  lcd_set_cur(POS_TIME);
//#endif
//  print_decim(min, TRUE);
//#if CONF_DISPLAY == LCD
//  lcd_putchar(':');
//#endif
//  print_decim(sec, FALSE);
}


/*F**************************************************************************
* NAME: print_sec
*----------------------------------------------------------------------------
* PARAMS:
*   - sec: second to display
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print second of time on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_sec (Byte sec)
{uchar SEC[2];
#if CONF_DISPLAY == LCD
  {SEC[0] = (uchar)(sec/10);
   SEC[1] = (uchar)(sec-10*SEC[0]);
   LcdWriteCH(0x92,FIG[SEC[0]],FIG[SEC[1]]);
  }

#endif
}


/*F**************************************************************************
* NAME: print_min
*----------------------------------------------------------------------------
* PARAMS:
*   - min: minute to display
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print minute of time on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_min (Byte min)
{uchar MIN[3];
#if CONF_DISPLAY == LCD
  {MIN[0] = (uchar)(min/100);
   MIN[1] = (uchar)(min-100*MIN[0]);
   MIN[2] = min-100*MIN[0]-10*MIN[1];
   LcdWriteCH(0x90,FIG[MIN[0]],FIG[MIN[1]]);
   LcdWriteCH(0x91,FIG[MIN[2]],FIG[16]);
  }
#endif
 
}


/*F**************************************************************************
* NAME: print_kbd_lock
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the lock status
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_kbd_lock (void)
{
//#if CONF_DISPLAY == LCD
//    lcd_cgram(CGRAM_LOCK, cgram_lock);      /* init lock icon to locked */
//#endif
}

/*F**************************************************************************
* NAME: print_kbd_lock
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the unlock status
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_kbd_unlock (void)
{
//#if CONF_DISPLAY == LCD
//  lcd_cgram(CGRAM_LOCK, cgram_blank);     /* init lock icon to unlocked */
//#endif
}

/*F**************************************************************************
* NAME: print_mem
*----------------------------------------------------------------------------
* PARAMS:
*   - mem_type  SYMB_CHIP
*               SYMB_CARD
*               SYMB_CARD2
*               SYMB_NO_MEM
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the memory type on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -