/*H**************************************************************************
* NAME: mem_task.h
*----------------------------------------------------------------------------
* Copyright (c) 2003 Atmel.
*----------------------------------------------------------------------------
* RELEASE: snd1c-refd-nf-4_0_3
* REVISION: 1.8
*----------------------------------------------------------------------------
* 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 status -----*/
#define MEM_BUSY ((Byte)0)
#define MEM_READY ((Byte)1)
#define MEM_FORMAT ((Byte)2)
#define MEM_NO_CARD ((Byte)3)
#define MEM_BSY 0
#define MEM_OK 1
#define MEM_KO 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_INIT ((Byte)18)
#define MEM_CHIP_INIT ((Byte)0)
#define MEM_CHIP_IDLE ((Byte)1)
#define MEM_CHIP_ERR_FMT ((Byte)2)
#define MEM_CHIP_ERR ((Byte)3)
#define MEM_CARD_INIT ((Byte)4)
#define MEM_CARD_IDLE ((Byte)5)
#define MEM_CARD_ERR_FMT ((Byte)6)
#define MEM_CARD_ERR ((Byte)7)
#define MEM_CARD_NO_CARD ((Byte)8)
#define MEM_CARD_1 ((bit)0)
#define MEM_CARD_2 ((bit)1)
/*_____ 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_ */