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

📄 disp.c

📁 ATMEL公司AT89C51SND1为主控制器MP3源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
* REQUIREMENTS:
*****************************************************************************/
void print_mode_voice (void)
{
#if CONF_DISPLAY == LCD
  lcd_cgram(CGRAM_MODE, cgram_voice);       /* select voice icon */
#else
  LED_ON = (8 >> ref_state);
  LED_FAST = 3;
#endif
}


/*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
  lcd_cgram(CGRAM_MODE, cgram_mass);        /* select mass storage icon */
#else
  LED_ON = (8 >> ref_state);
  LED_FAST = 1;
#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
  lcd_cgram(CGRAM_MODE, cgram_tools);       /* select tool icon */
#else
  LED_ON = (8 >> ref_state);
  LED_FAST = 3;
#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
  lcd_cgram(CGRAM_MODE, cgram_blank);       /* 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:
    {
      lcd_cgram(CGRAM_SOUND, cgram_volume);
      break;
    }
    case SND_BASS:
    {
      lcd_cgram(CGRAM_SOUND, cgram_bass);
      break;
    }
    case SND_MEDIUM:
    {
      lcd_cgram(CGRAM_SOUND, cgram_medium);
      break;
    }
    case SND_TREBLE:
    {
      lcd_cgram(CGRAM_SOUND, cgram_treble);
      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);
#else
  Byte    volume;
  
    if (!bargraph) return;
    volume = song_get_level();
    if (func_state == 5)
      {
      LED_ON = 7;
      if (MP3CON & MSK_MPBBST) LED_FAST = 1;
      else LED_FAST = 2;
      return;
      }
    /* volume must be between 0 -> 31 */
    if      (volume < 7 ) LED_ON = 0;
    else if (volume < 14) LED_ON = 1;
    else if (volume < 20) LED_ON = 3;
    else if (volume < 26) LED_ON = 7;
    else                LED_ON = 15;
    LED_FAST = 3;
#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');
#else
  if (!bargraph) return;
  // volume must be between 0 -> 4
  LED_ON = (15 >> (4 - volume));
  LED_FAST = 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)
{
#if CONF_DISPLAY == LCD
  lcd_set_cur(POS_SECOND);
  print_decim(sec, FALSE);
#else
  if (func_timeout>2)
    {
    func_state = 0;
    bargraph = FALSE;
    LED_ON = (8 >> ref_state);
    if (recording) LED_ON = 15 - LED_ON;
    LED_FAST = 1;
    song_sound = SND_VOLUME;
    }
  else func_timeout++;
  if (sec);
#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)
{
#if CONF_DISPLAY == LCD
  lcd_set_cur(POS_MINUTE);
#endif
  print_decim(min, TRUE);
}


/*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
}

⌨️ 快捷键说明

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