MP3播放器详细设计方案
源代码在线查看: mem_task.h
/*H**************************************************************************
* $RCSfile: mem_task.h,v $
*----------------------------------------------------------------------------
* Copyright (c) 2002 Atmel.
*----------------------------------------------------------------------------
* RELEASE: $Name: DEMO_FAT_1_9_9 $
* REVISION: $Revision: 1.6 $
* FILE_CVSID: $Id: mem_task.h,v 1.6 2002/06/07 15:46:17 ffosse Exp $
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the memory task definition
*****************************************************************************/
#ifndef _MEM_TASK_H_
#define _MEM_TASK_H_
/*_____ I N C L U D E S ____________________________________________________*/
/*_____ M A C R O S ________________________________________________________*/
/*----- Memory type -----*/
#define MEM_DF ((bit)0)
#define MEM_MMC ((bit)1)
#define MEM_MMC1 ((Byte)1)
#define MEM_MMC2 ((Byte)2)
#define MEM_MISC ((Byte)3)
/*----- Memory status -----*/
#define MEM_BUSY ((Byte)0)
#define MEM_READY ((Byte)1)
#define MEM_FORMAT ((Byte)2)
/*----- Memory delay -----*/
#define MEM_FUNCT_TIME ((Byte)0x00)
#define MEM_WRITE_TIME ((Byte)0xFD) /* 2 ticks min time_out */
#define MEM_DELAY_TIME ((Byte)0x01) /* 1 tick min time_out */
#define MEM_TIME_OUT ((Byte)0x00)
/*----- Task states -----*/
#define MEM_DF_INIT ((Byte)0)
#define MEM_DF_IDLE ((Byte)1)
#define MEM_MMC1_INIT ((Byte)2)
#define MEM_MMC1_ACQ ((Byte)3)
#define MEM_MMC1_SETUP ((Byte)4)
#define MEM_MMC1_IDLE ((Byte)5)
#define MEM_MMC2_STACK_INIT ((Byte)6)
#define MEM_MMC2_MMC1_ACQ ((Byte)7)
#define MEM_MMC2_MMC1_SETUP ((Byte)8)
#define MEM_MMC2_INIT ((Byte)9)
#define MEM_MMC2_ACQ ((Byte)10)
#define MEM_MMC2_SETUP ((Byte)11)
#define MEM_MMC2_IDLE ((Byte)12)
#define MEM_MMC1_ERROR ((Byte)13)
#define MEM_MMC2_ERROR ((Byte)14)
#define MEM_DF_ERR_FMT ((Byte)15)
#define MEM_MMC1_ERR_FMT ((Byte)16)
#define MEM_MMC2_ERR_FMT ((Byte)17)
#define MEM_INIT ((Byte)18)
/*_____ D E F I N I T I O N ________________________________________________*/
/*_____ D E C L A R A T I O N ______________________________________________*/
void mem_task_init (void);
void mem_task (void);
Byte mem_status (void);
bit mem_check_card (void);
void mem_card_select (bit);
void mem_select_next (void);
bit mem_select_format (void);
#endif /* _MEM_TASK_H_ */