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

📄 general.h

📁 dz3000_51.0.0.4.rar
💻 H
字号:
/*++

Copyright (c) 2001 Sunplus Technology Co., Ltd.

Module Name:

        general.h

Abstract:

        Header file related to general type definition

Environment:

        Keil C51 Compiler

Revision History:

        08/28/2001      Chi-Yeh Tsai    created                 

--*/

#define SIMULATE	0

// WWWW
#if SIMULATE
#undef NULL
#endif

//-----------------------------------------------------------------------------
// Data type
//-----------------------------------------------------------------------------
//1-bit
#define BIT             bit
#define PBIT            bit *

//8-bit
#define CHAR            signed char 
#define UCHAR           unsigned char
#define PCHAR           signed char *
#define PUCHAR          unsigned char *
#define BYTE            unsigned char

// 16-bit
#define SHORT           signed short
#define USHORT          unsigned short
#define PSHORT          signed short *
#define PUSHORT         unsigned short *
#define WORD            unsigned short

// 32-bit
#define LONG            signed long
#define ULONG           unsigned long
#define PLONG           signed long *
#define PULONG          unsigned long *
#define DOUBLEWORD      unsigned long

//boolean
#define FALSE           0
#define TRUE            1

//NULL
#define NULL            ((void *) 0L)

//-----------------------------------------------------------------------------
// Macro
//-----------------------------------------------------------------------------
#define M_BCDToHEX(x)           (((x) >> 4) & 0x0f) * 10 + ((x) & 0x0f)
#define M_HEXToBCD(x)           ((((x) / 10) << 4) | ((x) % 10))
#define M_HiByteOfWord(x)       (unsigned char) ((x) >> 8)
#define M_LoByteOfWord(x)       (unsigned char) (x)
#define M_ByteSwapOfWord(x)     (((x) >> 8) | ((x) << 8))
#define M_HiByteOfDword(x)      (unsigned char) ((x) >> 24)
#define M_MidHiByteOfDword(x)   (unsigned char) ((x) >> 16)
#define M_MidLoByteOfDword(x)   (unsigned char) ((x) >> 8)
#define M_LoByteOfDword(x)      (unsigned char) (x)
//richie@0117 modify
#define M_ByteSwapOfDword(x)    (((unsigned long)(x) << 24) | (((unsigned long)(x) & 0x0000ff00) << 8) | (((unsigned long)(x) & 0x00ff0000) >> 8) | ((unsigned long)(x) >> 24))
#define M_UCHARToULONG(x,y,u,v) (unsigned long) (((unsigned long)x)<<24)|(((unsigned long)y)<<16)|(((unsigned long)u)<<8)|((unsigned long)(v))
#define M_UCHARToUSHORT(x,y)	(unsigned short)  ((((unsigned short)x)<<8)|((unsigned short)y))

//-----------------------------------------------------------------------------
//Header file
//-----------------------------------------------------------------------------
#if ( SIMULATE == 1 )
#define USING_0
#define USING_1
#define USING_2
#define USING_3
#define INTERRUPT_0
#define INTERRUPT_1
#define INTERRUPT_3
#else
#define USING_0			using 0
#define USING_1			using 1
#define USING_2			using 2
#define USING_3			using 3
#define INTERRUPT_0		interrupt 0
#define INTERRUPT_1		interrupt 1
#define INTERRUPT_3		interrupt 3
#endif

#define DbgPrint                printf


//-----------------------------------------------------------------------------
//Header file
//-----------------------------------------------------------------------------
#if ( SIMULATE == 1 )
#else
#include <reg320.h>
#include <absacc.h>
#endif
#include <stdio.h>

#include "device.h"
#include "option.h"

// WWWW start
#include "chipopt.h"
#include "cardopt.h"

#if (K_CARD_TYPE & K_NANDF_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_NANDF
#elif (K_CARD_TYPE & K_NORF_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_NORF
#elif (K_CARD_TYPE & K_NEXTF_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_NEXTF
//patch4.2@richie@ds0509 begin
#elif (K_CARD_TYPE & K_DOSRAM_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_DOSRAM
//patch4.2@richie@ds0509 end
#elif (K_CARD_TYPE & K_SDF_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_SDF
#elif (K_CARD_TYPE & K_MMC_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_MMC
#elif (K_CARD_TYPE & K_SMC_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_SMC
#elif (K_CARD_TYPE & K_CFC_SUPPORTED)
#define K_MEDIA_BUILT_IN			K_MEDIA_CFC
#endif

// remark above if you are sure that the built in media is sdram
//#define K_MEDIA_BUILT_IN			K_MEDIA_NONE

#if (K_CARD_TYPE & K_CFC_SUPPORTED)
#define K_MEDIA_CARD				K_MEDIA_CFC
#elif (K_CARD_TYPE & K_SMC_SUPPORTED)
#define K_MEDIA_CARD				K_MEDIA_SMC
#elif (K_CARD_TYPE & K_SDF_SUPPORTED)		// wyeo@0509

//version4.0@ada@0513 for MMC
#define K_MEDIA_CARD				K_MEDIA_SDF
#elif (K_CARD_TYPE & K_MMC_SUPPORTED)
#define K_MEDIA_CARD				K_MEDIA_MMC

#elif (K_CARD_TYPE & K_NANDF_SUPPORTED)
#define K_MEDIA_CARD				K_MEDIA_NANDF
#elif (K_CARD_TYPE & K_NORF_SUPPORTED)
#define K_MEDIA_CARD				K_MEDIA_NORF
#elif (K_CARD_TYPE & K_NEXTF_SUPPORTED)
#define K_MEDIA_CARD				K_MEDIA_NEXTF
//patch4.2@richie@ds0509 begin
#elif (K_CARD_TYPE & K_DOSRAM_SUPPORTED)
#define K_MEDIA_CARD				K_MEDIA_DOSRAM
//patch4.2@richie@ds0509 end
#endif
// WWWW end

#include "l2.h"
#include "l2_supp.h"
#include "l1.h"
#include "app.h"

⌨️ 快捷键说明

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