想自己制作MP3的朋友下来看一下

源代码在线查看: df.h

软件大小: 18132 K
上传用户: hqbbsw
关键词: MP3
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*H**************************************************************************
				* $RCSfile: df.h,v $         
				*----------------------------------------------------------------------------
				* Copyright (c) 2002 Atmel.
				*----------------------------------------------------------------------------
				* RELEASE:      $Name: DEMO_FAT_1_9_9 $      
				* REVISION:     $Revision: 1.8 $     
				* FILE_CVSID:   $Id: df.h,v 1.8 2002/08/14 07:41:39 ffosse Exp $       
				*----------------------------------------------------------------------------
				* PURPOSE:
				* This file contains the dataflash definition
				*****************************************************************************/
				
				#ifndef _DF_H_
				#define _DF_H_
				
				/*_____ I N C L U D E S ____________________________________________________*/
				
				#include "..\..\lib_demob\board.h"          /* board definition */
				
				
				/*_____ M A C R O S ________________________________________________________*/
				
				
				/*----- DataFlash definition -----*/
				#define DF_MSK_DENSITY    ((Byte)0xB8)      /* status density mask */
				#define DF_MSK_BIT_BUSY   ((Byte)0x80)
				#define DF_MEM_BUSY       ((Byte)0x00)
				
				#define DF_RD_STATUS      ((Byte)0x57)      /* read status */
				#define DF_PG_ERASE       ((Byte)0x81)      /* page erase */
				#define DF_BK_ERASE       ((Byte)0x50)      /* block erase */
				
				#define DF_WR_BUF_1       ((Byte)0x84)      /* write buffer 1 */
				#define DF_WR_BUF_2       ((Byte)0x87)      /* write buffer 2 */
				#define DF_B1_MAIN        ((Byte)0x83)      /* buffer 1 to main program with erase */
				#define DF_B2_MAIN        ((Byte)0x86)      /* buffer 2 to main program with erase */
				
				#define DF_RD_MAIN        ((Byte)0x52)      /* read main memory */
				#define DF_TF_BUF_1       ((Byte)0x53)      /* main memory page to buffer 1 transfer */
				#define DF_TF_BUF_2       ((Byte)0x55)      /* main memory page to buffer 2 transfer */
				#define DF_RD_BUF_1       ((Byte)0x54)      /* read buffer 1 */
				#define DF_RD_BUF_2       ((Byte)0x56)      /* read buffer 2 */
				
				
				#ifdef DF_4_MB            /* AT45DB321 memories */
				  #define DF_DENSITY      ((Byte)0xB0)
				  #define DF_PG_BUF_1     ((Byte)0x82)      /* main memory program through buf1 */
				  #define DF_PG_BUF_2     ((Byte)0x85)      /* main memory program through buf2 */
				  #define DF_MEM_SIZE     ((Uint32)0x400000)
				  #define DF_NB_BLOCK     ((Uint16)1024)    /* block number */
				  #define DF_BLOCK_SIZE   ((Byte)8)         /* block length (in page) */
				  #define DF_PAGE_SIZE    (512)             /* page length */
				  #define DF_PAGE_MASK    ((Byte)0x01)      /* mask MSB page bits */
				  #define DF_MEM_MASKH    ((Byte)0x80)
				  #define DF_MEM_MASKL    ((Byte)0x40)
				  #define DF_MEM_BYTEH    ((Byte)1)
				  #define DF_MEM_BYTEL    ((Byte)1)
				  #define DF_SHFT_B1      (1)
				  #define DF_SHFT_B2      (7)
				  #define DF_NB_CYLINDER  ((Uint16)511)
				  #define DF_NB_HEAD      ((Byte)4)
				  #define DF_NB_SECTOR    ((Byte)16)
				  #define DF_DISK_SIZE    (Uint32)(32767)
				#endif
				
				#ifdef DF_8_MB             /* AT45DB642 memories */
				  #define DF_DENSITY      ((Byte)0xB8)
				  #define DF_PG_BUF_1     ((Byte)0x92)      /* fast main memory program through buf1 */
				  #define DF_PG_BUF_2     ((Byte)0x95)      /* fast main memory program through buf2 */
				  #define DF_MEM_SIZE     ((Uint32)0x800000)
				  #define DF_NB_BLOCK     ((Uint16)1024)    /* block number */
				  #define DF_BLOCK_SIZE   ((Byte)8)         /* block length (in page) */
				  #define DF_PAGE_SIZE    (1024)            /* page length */
				  #define DF_PAGE_MASK    ((Byte)0x03)      /* mask MSB page bits */
				  #define DF_MEM_MASKH    ((Byte)0x01)
				  #define DF_MEM_MASKL    ((Byte)0x80)
				  #define DF_MEM_BYTEH    ((Byte)0)
				  #define DF_MEM_BYTEL    ((Byte)1)
				  #define DF_SHFT_B1      (1)
				  #define DF_SHFT_B2      (7)
				  #define DF_NB_CYLINDER  ((Uint16)511)
				  #define DF_NB_HEAD      ((Byte)8)
				  #define DF_NB_SECTOR    ((Byte)16)
				  #define DF_DISK_SIZE    (Uint32)(65535)
				#endif
				
				
				/* Memory Size based on 512 bytes block size */
				#define DF_SIZE_16MB      ((Uint32)32768 - 1)
				#define DF_SIZE_32MB      ((Uint32)65536 - 1)
				
				#define DF_16MB           ((Byte)0)
				#define DF_32MB           ((Byte)1)
				
				
				/*_____ D E F I N I T I O N ________________________________________________*/
				
				
				/*_____ D E C L A R A T I O N ______________________________________________*/
				
				Byte    df_init (void);
				void    df_init_mem (void);
				bit     df_read_open (Uint32);
				void    df_read_close (void);
				bit     df_write_open (Uint32);
				void    df_write_close (void);
				Byte    df_read_byte (void);
				bit     df_read_sector (Uint16);
				bit     df_write_byte (Byte);
				bit     df_write_sector (Uint16);
				s_format  code * df_format (void);
				
				
				/* Disk size: number of block - 1 */
				#define Df_disk_size()            ((Uint32)(DF_DISK_SIZE))
				#define Df_disk_size_0()          ((Byte)(Df_disk_size() >> 24))
				#define Df_disk_size_1()          ((Byte)(Df_disk_size() >> 16))
				#define Df_disk_size_2()          ((Byte)(Df_disk_size() >> 8))
				#define Df_disk_size_3()          ((Byte)(Df_disk_size()))
				
				/* Block size: size of a block in byte */
				#define Df_block_size()           ((Uint32)512)
				#define Df_block_size_0()         ((Byte)(Df_block_size() >> 24))
				#define Df_block_size_1()         ((Byte)(Df_block_size() >> 16))
				#define Df_block_size_2()         ((Byte)(Df_block_size() >> 8))
				#define Df_block_size_3()         ((Byte)(Df_block_size()))
				
				
				#endif  /* _DF_H_ */
				
							

相关资源