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

📄 constants.h

📁 Yet Another MP3 Player source code. It can be usefull as reference source for any project.
💻 H
字号:
/*
  Written by:	Nikolai Vorontsov <nickviz@mail.be>

  Idea by :		Jesper Hansen <jesperh@telia.com>

  This file is part of the yampp system.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, 
  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/


#ifndef __CONST_H__
#define __CONST_H__

// Here is some constants are defined.


//
// CPU
//
// Define F_CPU constant according to your CPU clock in Hz.
// Note that MHz is equal 1000000Hz!
// #define F_CPU	8000000						/* 8MHz quartz */
#define F_CPU		7372800						/* 7,3728MHz quartz */


//
// VS1001
//
// Define F_VS1001 constant according to your VS1001 clock divided by 2000.
// Add 0x8000 if you use clock doubler.
//#define F_VS1001	(12000 + 0x0000)			/* 24MHz */
#define F_VS1001	(6144 + 0x8000)				/* 12,288MHz x2 */


//
// LCD
//
// In case you have attached LCD - uncomment the following line:
#define ENABLE_LCD
// Define amount of LCD's lines.
#define LCD_LINES	2
// In case you need LCDHome command - uncomment the following line:
// #define ENABLE_LCD_HOME_COMMAND


//
// ATA & FAT
//
// In case you need debug ATA command - uncomment the following line:
// #define DEBUG_ATA
// In case you need dump sectors via serial interface - uncomment the
//  following line:
// #define HEXDUMP
// In case you need check memory and ATA read functions - uncomment the
// following line:
// #define ENABLE_CRC 
//
//
// Define here cluster size in bytes of the used disk.
// It can be 2048, 4096, ... 65536
//#define CLUSTER_SIZE 32768
#define CLUSTER_SIZE 4096

//
// In case you need letter navigation - uncomment the following line:
#define ENABLE_NAV


//
// IR
//
// Infra-red remote control selection
//#define REC80
//#define NEC80
//#define PANASONIC
#define CREATIVE_RM900


//
// UART
//
// In case you need serial interface - uncomment the following string:
#define ENABLE_SERIAL

// In case you need asyncronous transmit - uncomment the following string:
//#define UART_TX_ASYNC
// In fact this is not true async transmit - we do not have a dedicated
// buffer, and due to this have to wait when make a second UART call. But
// for a practical use, if using only single call, it's acceptable.


//
// WATCHDOG
//
// In case you need watchdog timer - uncomment the following string:
#define ENABLE_WATCHDOG

#ifdef ENABLE_WATCHDOG
#define WDR asm volatile ("wdr")
#else
#define WDR ;
#endif


// 
// APPLICATION
//
// This constant defines minimum volume level - to decrease unnessesary
// steps in volume control
// note that 0 is max volume and 0xff is minimum volume
#define MIN_VOLUME 		0x60

// number of volume steps 
#define NUM_VOL_STEPS	32

#define VOL_STEP	( (MIN_VOLUME + 1) / NUM_VOL_STEPS )


//
//
//
//
// Some checks
//
#if F_CPU < 4000000 || F_CPU > 12000000
#error Invalid F_CPU!
#endif

#if F_VS1001 < 10000 || F_VS1001 > 65536
#error Invalid F_VS1001!
#endif

#if CLUSTER_SIZE != 2048 && CLUSTER_SIZE != 4096 && CLUSTER_SIZE != 8192 \
&& CLUSTER_SIZE != 16384 && CLUSTER_SIZE != 32768 && CLUSTER_SIZE != 65536 
#error Invalid CLUSTER_SIZE!
#endif

#endif // __CONST_H__

⌨️ 快捷键说明

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