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

📄 disp.c

📁 基于snd1c芯片的mp3播放器源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
/*C**************************************************************************
* NAME:         disp.c
*----------------------------------------------------------------------------
* Copyright (c) 2002 Atmel.
*----------------------------------------------------------------------------
* RELEASE:      snd1c-refd-nf-3_0_0      
* REVISION:     1.6.2.16     
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the high level display routines
*****************************************************************************/

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

#include "config.h"                         /* system configuration */
#include "modules\song\song_drv.h"          /* song driver definition */
#include "modules\file\file.h"              /* file definition */
#include "disp_task.h"                      /* display task definition */
#include "modules\mem\mem_task.h"
#include "disp.h"                           /* display definition */
#include "modules\song\song_drv.h"          /* song driver definition */
#include "modules\display\led.h"            /* led definition */


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


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

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;


/*_____ 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)
{
  led_task_init();
}


/*F**************************************************************************
* NAME: print_state_blank
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the blank icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_blank (void)
{
}


/*F**************************************************************************
* NAME: print_state_stop
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the stop icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_stop (void)
{
  LED_FAST = 3;
}


/*F**************************************************************************
* NAME: print_state_play
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the play icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_play (void)
{
  LED_ON = (8 >> ref_state);
  LED_FAST = 1;
  func_state = 0;
  playing = TRUE;
}


/*F**************************************************************************
* NAME: print_state_pause
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the pause icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_pause (void)
{
  LED_ON = (8 >> ref_state);
  if (recording) LED_FAST = 2;
  else LED_FAST = 3;
  func_state = 0;
  playing = FALSE;
  pause = TRUE;
}


/*F**************************************************************************
* NAME: print_state_record
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the record icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_state_record (void)
{
  LED_ON = 15 - (8 >> ref_state);
  LED_FAST = 1;
  playing = TRUE;
  pause = FALSE;
}



/*F**************************************************************************
* NAME: print_state_error
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the error icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
extern  Byte    mem_state;                  /* task state */

void print_state_error (void)
{
  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;
}



/*F**************************************************************************
* NAME: print_mode_song
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the song icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_song (void)
{
  LED_ON = (8 >> ref_state);
  LED_FAST = 3;
}


/*F**************************************************************************
* NAME: print_mode_voice
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the voice icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_voice (void)
{
  LED_ON = (8 >> ref_state);
  LED_FAST = 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)
{
  LED_ON = (8 >> ref_state);
  LED_FAST = 1;
}


/*F**************************************************************************
* NAME: print_mode_tool
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the tool icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_tool (void)
{
  LED_ON = (8 >> ref_state);
  LED_FAST = 3;
}


/*F**************************************************************************
* NAME: print_mode_blank
*----------------------------------------------------------------------------
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the blank mode icon on the LCD
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_mode_blank (void)
{
}


/*F**************************************************************************
* NAME: print_sound
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Print the sound icon
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void print_sound (void)
{
}


/*F**************************************************************************
* NAME: print_sound_level
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:

⌨️ 快捷键说明

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