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

📄 config.h

📁 ATMEL公司AT89C51SND1为主控制器MP3源代码
💻 H
字号:
/*H**************************************************************************
* NAME:         config.h         
*----------------------------------------------------------------------------
* Copyright (c) 2003 Atmel.
*----------------------------------------------------------------------------
* RELEASE:      snd1c-refd-nf-4_0_3      
* REVISION:     1.21     
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the system configuration definition
*****************************************************************************/

#ifndef _CONFIG_H_
#define _CONFIG_H_


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

#include "lib_mcu\compiler.h"               /* compiler definitions */
#include "lib_mcu\regsnd1.h"                /* component declaration */
#include "lib_mcu\extsnd1.h"                /* component extended declaration */

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

/*----- Library Configuration -----*/

/* Player Mode */
#define PLAYER_PLAY_MODE      PLAY_DISK     /* _DIR or _DISK */
#define PLAYER_PLAY_START     START_STOP    /* _PLAY or _STOP */
#define PLAYER_PLAY_LOOP      PLAY_NO_LOOP  /* _LOOP or _NO_LOOP */

#define MEM_CHIP_FS     FS_FAT_12_16         /* _FAT_12_16  _FAT_32  _ISO _NONE     */
#define MEM_CARD_FS     FS_NONE              /* _FAT_12_16  _FAT_32  _ISO _NONE     */

#define MEM_RESERVED_SIZE     0           /* Reserved disk space in sector */
/* Storage Driver */
#define MEM_CHIP_TYPE         CHIP_NF       /* _DF, _NF, _HDD or _NONE */
#define MEM_CARD_TYPE         CARD_NONE     /* _MMC, _SD, _SMC, _CF, _CDR or _NONE */

/* Nand Flash Driver */
#define NF_1X_512B            0
#define NF_2X_512B            1
#define NF_1X_2KB             2
#define NF_2X_2KB             3

#define NF_CONFIG             NF_1X_512B    /* _1X_512B, _2X_512B, _1X_2KB or _2X_2KB */
#define NF_CAPACITY_AUTO_DETECT   TRUE
#define NF_FULL_CHIP_ERASE        FALSE

/* Timer Driver */
#define T0_X2                 TRUE          /* FT0_IN always Fosc/2 */
#define T1_X2                 TRUE          /* FT1_IN always Fosc/2 */

/* Keyboard Driver */
#define KBD_EXIT_PD           FALSE         /* Exit power down configuration */
#define LOCK_ROW              1             /* ROW of lock key */
#define KEY_LOCK              14            /* Keypad Locked */

/* Display driver */
#define LCD         0
#define LED         1
#define CONF_DISPLAY          LED

/* MP3 Driver */
#define MP3_CRC_SKIP          FALSE         /* CRC error configuration */

/* USB Driver */
#define USB_PU_CTRL           FALSE         /* no pull-up control */
#define VENDOR_ID             0xEB03        /* Atmel vendor ID = 03EBh */
#define PRODUCT_ID            0x0220        /* Atmel Product ID: 2002h */
#define RELEASE_NUMBER        0x0001

/* USB Mass Storage ! unicode char */
#define USB_MANUFACTURER_NAME {'A'<<8,'T'<<8,'M'<<8,'E'<<8,'L'<<8}
#define USB_MN_LENGTH         5

#define USB_PRODUCT_NAME      {'S'<<8,'N'<<8,'D'<<8,'1'<<8,' '<<8,'S'<<8,'t'<<8,\
                               'o'<<8,'r'<<8,'a'<<8,'g'<<8,'e'<<8}
#define USB_PN_LENGTH         12

#define USB_SERIAL_NUMBER     {'4'<<8,'7'<<8,'1'<<8,'0'<<8,'7'<<8,'6'<<8,'5'<<8,\
                               '0'<<8,'6'<<8,'6'<<8,'4'<<8,'5'<<8,'1'<<8}
#define USB_SN_LENGTH         13

/* SCSI Mass Storage */
#define SBC_VENDOR_ID         {'G','e','n','e','r','i','c',' '}
#define SBC_PRODUCT_ID        {'S','N','D','1',' ','M','P','3',' ','P','l','a','y','e','r',' '}
#define SBC_REVISION_ID       {'0','.','0','0'}

/* Start behaviour */
#define START_SKEEP_SPLASH_SCREEN TRUE
#define START_CHECK_CPU_VERSION   FALSE

/*----- System Definition -----*/

/* Clock */
#define X2_MODE                             /* X2 mode */
//#undef X2_MODE                              /* no X2 mode */

#define FOSC                  16000         /* oscillator frequency (KHz) */

#ifdef X2_MODE
    #define FPER              FOSC
#else
    #define FPER              FOSC/2
#endif

/* Scheduler Tick */
#define SCHEDULER_TICK        10            /* unit is ms */

/* ADC Frequency */
#define SAMPLING_PERIOD 0.125               /* unit is ms */
#define SECT_PER_SECOND (2/SAMPLING_PERIOD) /* 512 bytes sector size */

#define INACTIVITY            6000          // 45s //12000			/* 2mn */

/* ADC Frequency */
#define SAMPLING_PERIOD       0.125         /* unit is ms */

/* Interrupt Priorities */
#define EX0_PRIO              ((Byte)0)
#define T0_PRIO               ((Byte)3)
#define EX1_PRIO              ((Byte)0)
#define T1_PRIO               ((Byte)2)
#define MP3_PRIO              ((Byte)2)
#define AUD_PRIO              ((Byte)2)
#define MMC_PRIO              ((Byte)0)
#define I2C_PRIO              ((Byte)0)
#define SPI_PRIO              ((Byte)0)
#define ADC_PRIO              ((Byte)0)
#define KBD_PRIO              ((Byte)0)
#define USB_PRIO              ((Byte)1)


/*----- Firmware Definition -----*/
#define GL_BUF_SIZE           (256)

/* Mass Storage Configuration */
#define MS_MAX_LUN            (0)           /* number of logical unit - 1 */

/* Chip Version */
/* AT89C51SND1C = 0x84 */
#define CHIP_VERSION          ((Byte)0x84)

/* Firmware Version */
#define SYS_VERSION           "V4.0.2"


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

/* FAT Format Structure */
typedef struct  
{
  Uint16 nb_cylinder;
  Byte   nb_head;
  Byte   nb_sector;
  Byte   nb_hidden_sector;
  Byte   nb_sector_per_cluster;
} s_format;


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


#endif    /* _CONFIG_H_ */

⌨️ 快捷键说明

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