Main, E.4 digital i/o sample program – AAEON TKS-G50-QM77 User Manual
Page 114

E m b e d d e d B o x
T K S - G 5 0 - Q M 7 7
AppendixE Digital I/O Ports
E - 5
E.4 Digital I/O Sample Program
**************************************************************************
// SuperIO relative definition (Please reference to Table 2)
#define SIOIndex 0x2E
#define SIOData 0x2F
#define DIOLDN 0x07
IOWriteByte(byte IOPort, byte Value);
IOReadByte(byte IOPort);
// DIO relative definition (Please reference to Table 3)
#define DirReg1 0xCE // GPIO1-GPIO4
#define DirReg2 0xCF // GPIO5-GPIO8
#define InputPin 0x00
#define OutputPin 0x01
#define StatusReg1 0xA06 // GPIO1-GPIO4
#define StatusReg2 0xA07 // GPIO5-GPIO8
#define PinLow 0x00
#define PinHigh 0x01
#define Pin1Bit 0x00
#define Pin2Bit 0x01
#define Pin3Bit 0x02
#define Pin4Bit 0x03
#define Pin5Bit 0x04
#define Pin6Bit 0x05
#define Pin7Bit 0x06
#define Pin8Bit 0x07
**************************************************************************
**************************************************************************
VOID
Main
(){
Boolean PinStatus ;
// Procedure : AaeonReadPinStatus
// Input :
//
Example, Read Digital I/O Pin 3 status
// Output :