sprdef.h

来自「epson usb2.0 控制芯片 S1R72V05 固件程序。」· C头文件 代码 · 共 115 行

H
115
字号
/*
 *	description : Sapporo coding rule
 *	Maker		: Michiru.Kagaya
 *	Copyright	: (C)2003,SEIKO EPSON Corp. All Rights Reserved.
 */

#ifndef SPRDEF_H
#define SPRDEF_H

#ifdef __cplusplus
	extern "C" {
#endif /* cplusplus */

#ifdef TOPPERS_C
	#include "kernel.h"
#endif

/* void */
typedef void			VOID;
typedef void *			PVOID;

/* 8bit */
typedef char			      CHAR;
typedef unsigned char	      UCHAR;
typedef CHAR *			PCHAR;
typedef UCHAR *			PUCHAR;
/* 16bit */
typedef short			SHORT;
typedef unsigned short	USHORT;
typedef SHORT*			PSHORT;
typedef USHORT*			PUSHORT;
/* 32bit */
typedef long			LONG;
typedef unsigned long	ULONG;
typedef long*			PLONG;
typedef ULONG*			PULONG;

typedef int*			PINT;
typedef unsigned int*	PUINT;

#ifndef ITRON_C
	typedef int				INT;
	typedef unsigned int	UINT;
#endif /* ITRON_C */

#ifndef ITRON_C

	typedef unsigned char BOOL;

#endif /* ITRON_C */

#ifndef FALSE
	#define FALSE 0
#endif	/* FALSE */

#ifndef TRUE
	#define TRUE 1
#endif	/* TRUE */

#ifndef NULL
	#ifdef __cplusplus	/* __cplusplus == Defined for C++ programs only. */
		#define NULL 0
	#else
		#define NULL ((void *)0)
	#endif /* __cpulusplus */
#endif /* NULL */


#define LOWORD( l ) 		((USHORT)(l))
#define HIWORD( l ) 		((USHORT)(((ULONG)(l) >> 16) & 0xFFFF ))
#define LOBYTE( w ) 		((UCHAR)((w) & 0xFF))
#define HIBYTE( w ) 		((UCHAR)(((USHORT)(w) >> 8 ) & 0xFF ))
#define MAKEWORD( a, b )	((USHORT)(((UCHAR)(a)) | ((USHORT)((UCHAR)(b))) << 8))
#define MAKEDWORD( a, b )	((ULONG)(((USHORT)(a)) | ((ULONG)((USHORT)(b))) << 16))
#define MAKEBTODW( a )		((ULONG)((((*(a)<<24)|(*((a)+1)<<16)) | (*((a)+2) << 8))|*((a)+3)))
#define MAKEDWTOB( a, b )	*(a)	 = (UCHAR)((b) >> 24) & 0xFF; \
							*((a)+1) = (UCHAR)((b) >> 16) & 0xFF; \
							*((a)+2) = (UCHAR)((b) >>  8) & 0xFF; \
							*((a)+3) = (UCHAR)(b) & 0xFF;


#define MAX( a, b )			(((a)>(b)) ? (a) : (b))
#define MIN( a, b )			(((a)<(b)) ? (a) : (b))


#define SWAP16( sw )		(((sw)>>8) & 0x00ff) | (((sw)<<8) & 0xff00)
#define SWAP32( sw )		(((sw)>>24) & 0x000000ff) | (((sw)>>8) & 0x0000ff00) |	\
							(((sw)<<24) & 0xff000000) | (((sw)<<8) & 0x00ff0000)



#ifndef IN
	#define IN
#endif /* IN */

#ifndef OUT
	#define OUT
#endif /* OUT */

/* Inline */
#ifndef TOPPERS_C
	#define	Inline		extern __inline
#endif

/* CALLBACK function */
typedef LONG ( *CALLBACK_PROC )( ULONG lParam0, ULONG lParam1, VOID *pParam );


#ifdef __cplusplus
	}
#endif /* cplusplus */

#endif /* SPRDEF_H */

⌨️ 快捷键说明

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