📄 sysgpio.h
字号:
/* sysGpio.h - system GPIO interface definition */
/* Copyright Copyright 2002-2005 Founder Communications, Inc. */
/*
modification history
--------------------
01a,24jan05,fhchen written
*/
/*
DESCRIPTION
This file contain constants, routins definition for manipulating on board
GPIO pins.
*/
#ifndef __INCsysGpioh
#define __INCsysGpioh
#ifdef __cplusplus
extern "C" {
#endif
/* includes */
#include <vxWorks.h>
#include "m8260IOPort.h"
/* pin direction */
#define DIR_IN 0
#define DIR_OUT 1
/* logic level */
#define LOGIC_LOW 0
#define LOGIC_HIGH 1
/* I/O ports */
#define PORT_A 0
#define PORT_B 1
#define PORT_C 2
#define PORT_D 3
/* pin bit definition */
#define PIN31 (0x00000001)
#define PIN30 (0x00000002)
#define PIN29 (0x00000004)
#define PIN28 (0x00000008)
#define PIN27 (0x00000010)
#define PIN26 (0x00000020)
#define PIN25 (0x00000040)
#define PIN24 (0x00000080)
#define PIN23 (0x00000100)
#define PIN22 (0x00000200)
#define PIN21 (0x00000400)
#define PIN20 (0x00000800)
#define PIN19 (0x00001000)
#define PIN18 (0x00002000)
#define PIN17 (0x00004000)
#define PIN16 (0x00008000)
#define PIN15 (0x00010000)
#define PIN14 (0x00020000)
#define PIN13 (0x00040000)
#define PIN12 (0x00080000)
#define PIN11 (0x00100000)
#define PIN10 (0x00200000)
#define PIN9 (0x00400000)
#define PIN8 (0x00800000)
#define PIN7 (0x01000000)
#define PIN6 (0x02000000)
#define PIN5 (0x04000000)
#define PIN4 (0x08000000)
#define PIN3 (0x10000000)
#define PIN2 (0x20000000)
#define PIN1 (0x40000000)
#define PIN0 (0x80000000)
#define PIN0123 (PIN0 | PIN1 | PIN2 | PIN3)
/* interface */
extern void sysGpioInit(void);
/* extern int sysGpioRead(int port, int pin); */
/* extern void sysGpioWrite(int port, int pin, int level); */
/* extern STATUS sysGpioIntConnect(VOIDFUNCPTR *vector, VOIDFUNCPTR routine, int parameter); */
/* routine bindings for V100R001SCB board */
#define sysGpioRead(port, pin) (m8260IOPortRead(port, pin))
#define sysGpioWrite(port, pin, level) (m8260IOPortWrite(port, pin, level))
#define sysGpioIntConnect(vector, routine, parameter) (m8260IOPortIntConnect(vector, routine, parameter))
#ifdef __cplusplus
}
#endif
#endif /* __INCsysGpioh */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -