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

📄 disp.c

📁 单片机学习资料主要讲述MP3开发 适合初学者进行开发学习
💻 C
📖 第 1 页 / 共 3 页
字号:
/*C**************************************************************************
* NAME:         disp.c
*----------------------------------------------------------------------------
* Copyright (c) 2003 Atmel.
*----------------------------------------------------------------------------
* RELEASE:      snd1c-refd-nf-4_0_3      
* REVISION:     1.12     
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the high level display routines
*****************************************************************************/

/*_____ I N C L U D E S ____________________________________________________*/

#include "config.h"                 /* system configuration */
#include "lib_mcu\kbd\kbd_drv.h"    /* Keyboard driver definition */
#include "modules\song\song_drv.h"  /* song driver definition */
#include "modules\file\file.h"      /* file definition */
#include "disp_task.h"              /* display task definition */
#include "disp.h"                   /* display definition */
#if CONF_DISPLAY == LED
#include "modules\mem\mem_task.h"           /* memory task definition */
#include "modules\display\led.h"            /* led definition */
#endif

/*_____ M A C R O S ________________________________________________________*/


/*_____ D E F I N I T I O N ________________________________________________*/

#if CONF_DISPLAY == LCD
  extern  bdata   bit     gl_kbd_lock;   /* set to TRUE if keyboard locked */
  extern  bdata   bit     fs_memory;     /* selected file system */

#else
  extern  xdata Byte    func_timeout;
  extern  xdata Byte    func_state;
  extern  xdata Byte    ref_state;
  extern        bit     playing;
  extern        bit     recording;
  extern        bit     pause;
  extern        bit     bargraph;
  extern        Byte    song_sound;
  extern  xdata Byte    LED_ON;
  extern  xdata Byte    LED_FAST;
  extern  Byte    mem_state;                  /* task state */
#endif



/*_____ D E C L A R A T I O N ______________________________________________*/


/*F**************************************************************************
* NAME: print_init
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print initialization
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_init (void)
{
#if CONF_DISPLAY == LCD
     Lcd_Initial();
     Write_Command(0x80);
     
  //lcd_init ();                              /* lcd initialization */
 // lcd_cgram(CGRAM_SOUND, cgram_volume);     /* init volume icon */
  //lcd_cgram(CGRAM_REPEAT, cgram_repeat);    /* init repeat icon */
  //lcd_cgram(CGRAM_MODE, cgram_song);        /* init mode icon to song */
   Lcd_Display(0x84,0xb8,0xe8);//歌曲模式
   Lcd_Display(0x85,0xc7,0xfa);//
  //lcd_cgram(CGRAM_STATE, cgram_stop);       /* init state icon to stop */
  Lcd_Display(0x80,0xcd,0xa3);//停
  Lcd_Display(0x81,0xd6,0xb9);//止
  //print_kbd_lock();                         /* set lock icon or not */
#else
  led_task_init();
#endif
}


/*F**************************************************************************
* NAME: print_state_blank
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the blank icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_blank (void)
{
#if CONF_DISPLAY == LCD
   Lcd_Display(0x80,0xbf,0xd5);//空白
   Lcd_Display(0x81,0xb0,0xd7);//
  //lcd_cgram(CGRAM_STATE, cgram_blank);      /* select blank icon */
#endif
}


/*F**************************************************************************
* NAME: print_state_stop
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the stop icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_stop (void)
{
#if CONF_DISPLAY == LCD
  Lcd_Display(0x80,0xcd,0xa3);//停
  Lcd_Display(0x81,0xd6,0xb9);//止
  //lcd_cgram(CGRAM_STATE, cgram_stop);       /* select stop icon */
#else
  LED_FAST = 3;
#endif
}


/*F**************************************************************************
* NAME: print_state_play
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the play icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_play (void)
{
#if CONF_DISPLAY == LCD
  Lcd_Display(0x80,0xb2,0xa5);//播放
  Lcd_Display(0x81,0xb7,0xc5);//
//lcd_cgram(CGRAM_STATE, cgram_play);       /* select play icon */
#else
  LED_ON = (8 >> ref_state);
  LED_FAST = 1;
  func_state = 0;
  playing = TRUE;  
#endif
}


/*F**************************************************************************
* NAME: print_state_pause
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the pause icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_pause (void)
{
#if CONF_DISPLAY == LCD
   Lcd_Display(0x80,0xd4,0xdd);//暂停???????
   Lcd_Display(0x81,0xcd,0xa3);//
  //lcd_cgram(CGRAM_STATE, cgram_pause);      /* select pause icon */
#else
  LED_ON = (8 >> ref_state);
  if (recording) LED_FAST = 2;
  else LED_FAST = 3;
  func_state = 0;
  playing = FALSE;
  pause = TRUE;
#endif
}


/*F**************************************************************************
* NAME: print_state_record
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the record icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_record (void)
{
#if CONF_DISPLAY == LCD
  Lcd_Display(0x80,0xc2,0xbc);//录音???????
  Lcd_Display(0x81,0xd2,0xf4);//
  //lcd_cgram(CGRAM_STATE, cgram_rec);        /* select record icon */
#else
  LED_ON = 15 - (8 >> ref_state);
  LED_FAST = 1;
  playing = TRUE;
  pause = FALSE;
#endif
}



/*F**************************************************************************
* NAME: print_state_error
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the error icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_error (void)
{
#if CONF_DISPLAY == LCD
   Lcd_Display(0x80,0xb4,0xed);//错误???????
   Lcd_Display(0x81,0xce,0xf3);//
  //lcd_cgram(CGRAM_STATE, cgram_error);      /* select error icon */
#else
  if (mem_state == MEM_CHIP_ERR_FMT)
  {
    LED_VOL = 1; LED_TREEB=0;
    Fformat();
    if (mem_select_format() == OK) return;
  }
  LED_ON=15;
  LED_FAST=3;
#endif
}



/*F**************************************************************************
* NAME: print_mode_song
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the song icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_song (void)
{
#if CONF_DISPLAY == LCD
   Lcd_Display(0x84,0xb8,0xe8);//歌曲模式???????
   Lcd_Display(0x85,0xc7,0xfa);//
  //lcd_cgram(CGRAM_MODE, cgram_song);        /* select song icon */
#else
  LED_ON = (8 >> ref_state);
  LED_FAST = 3;
#endif
}


/*F**************************************************************************
* NAME: print_mode_voice
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the voice icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_voice (void)
{
#if CONF_DISPLAY == LCD
  Lcd_Display(0x84,0xd3,0xef);//语音模式???????
  Lcd_Display(0x85,0xd2,0xf4);//
  //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)

⌨️ 快捷键说明

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