piolib.h

来自「Vxworks的培训教程,大家分享下啊,」· C头文件 代码 · 共 56 行

H
56
字号
#include "daadioLib.h"#include "semLib.h"#include "msgQLib.h"/**************************************************		PUBLIC**************************************************/#define PIO_MAX_PORTS				6#define PIO_MAX_CHANNELS_PER_PORT	8#define ON							1#define OFF							0#define PORT_A	0#define PORT_B	1#define PORT_C	2#define PORT_D	3#define PORT_E	4#define PORT_F	5typedef struct	{	int port;	int channel;	BOOL state;	ULONG timeStamp;	} PIO_MSG_Q_DATA;/**************************************************		PRIVATE**************************************************/#define PIO_OFFSET					0x20#define PIO_OUTPUT_ENABLE_OFFSET	0x27#define PIO_PATTERN_REG_OFFSET		0x65#define PIO_PORT_A_OFFSET			0x21#define PIO_POLL_DELAY				1/* To obtain a port register offset we need to add PIO_OFFSET plus    the port number with bit 0 inverted.  This is due to each even numbered   port is at an address one higher than its odd brethern, i.e. Port A (0)   is at offset 0x21 while Port B (1) is at 0x20. */#define PIO_PORT_NUM_TO_OFF(port)	(PIO_OFFSET + (int)(((port) & ~1) + \									(((port) & 1) ^ 1)))typedef struct	{	MSG_Q_ID	intMsgQId;		SEM_ID		mutexSem;	BOOL		initialized;	} PIO;

⌨️ 快捷键说明

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