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

📄 devmng.h

📁 一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上
💻 H
字号:
/****************************************************************
 *  Copyright (C) Asic Center. 2001
 *  All Rights Reserved
 *
 *  Filename : systask.c
 *  Function : System Task
 *  Revision :
 *         2002/3/20       Pessia       Modify design of Device Manage
 *****************************************************************/
#ifndef DEVICE_H
#define DEVICE_H

#include <asixdef.h>

#define DEVNUM				2	/* Number of devices used in system */

/* Define Devices ID */
#define	LCDSCREEN_ID		0x0003
#define	AT_ID				0x0004
#define	KEYBOARD_ID		0x0005
#define	TOUCHPANEL_ID		0x0006

#define	UART0_ID			0x0001
#define	UART1_ID			0x0002

// longn_qi 2002/8/22 added
// data process function
typedef	void (*DATAPROC)( unsigned short len );

/* Define Device Control Block */
typedef struct deviceusetbl
{
	CHAR *name;	/* device name */
	ID ownerid;		/* id of task who use the device */
	
	/* pessia2002/3/20: Use synchronization */
	ID semid_own;	/* Use the key to own this device for user task */
	ID semid_write;	/* Use the key to call write function of this device */
	ID flgid_wbuf;	/* Wait this eventflg to get enough writing-buffer */
	ID semid_read;	/* Use the key to call read function of this device  */
	ID flgid_rbuf;	/* Wait this eventflg to get enough reading-buffer */
	
	/* to be added here */
	// longn_qi 2002/8/22 added
	DATAPROC	func;	// data process function
} DEVUSETBL;

EXTERN	DEVUSETBL	gDevUseTbl[];

PUBLIC VOID SysDevTableInit(VOID);
PUBLIC STATUS SysOpenDev(ID devid, INT timeout);
PUBLIC STATUS SysCloseDev(ID devid);
PUBLIC INT SysWriteDev(ID devid, UCHAR* pData, INT byteCounts, INT timeout);
PUBLIC INT SysReadDev(ID devid, UCHAR* pData, INT byteCounts, INT timeout);

#endif /* DEVICE_H */

⌨️ 快捷键说明

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