![Quanmax KEEX-1760 Series User Manual Download Page 56](http://html1.mh-extra.com/html/quanmax/keex-1760-series/keex-1760-series_user-manual_3443132056.webp)
Appendix A
56
KEEX-1760 Series Use r’s Manual
Appendix A
DIO (Digital I/O) Sample Code
//***************************************************************//
//DIO sample code for KEEX-1760 //
//Please compile with Turbo C 3.0 to utilized the program //
//
//
//DIO GPIO pin define from SIO IT8783E
//
// DIO_0 : SOC S5_GPIO4
DIO_4 : SOC S5_GPIO22
//
// DIO_1 : SOC S5_GPIO5
DIO_5 : SOC S5_GPIO23 //
// DIO_2 : SOC S5_GPIO6
DIO_6 : SOC S5_GPIO24
//
// DIO_3 : SOC S5_GPIO7
DIO_7 : SOC S5_GPIO25
//
//
//
//***************************************************************//
#include <stdio.h>
#include <conio.h>
#include <dos.h>
typedef unsigned long DWORD;
#define GPIO_BASE 0x500
#define GPIO1_SEL 0x84
#define GPIO1_LVL 0x88
#define SET_IO32(IoAddr, dSet) outpd(IoAddr, inpd(IoAddr) | (dSet))
#define RESET_IO32(IoAddr, Rst) outpd(IoAddr, inpd(IoAddr) &~ (Rst))
#define READ_IO32(IoAddr) inpd(IoAddr)
DWORD inpd(int portid)
{
DWORD
dwRet;
asm mov dx, portid;
asm lea bx, dwRet;