Jetway Computer NC9T Installation User Manual
Page 6
Sample code in C language
#define GPIOBASE 0x500
< GPIO5 Select Enable >
Value32= ReadDword(GPIOBASE + 0x00);
Value32 |= ((0x01) << 5);
WriteDword(GPIOBASE + 0x00, Value32);
< GPIO45/GPIO46 Select Enable >
Value32= ReadDword(GPIOBASE + 0x30);
Value32 |= ((0x01) << (45 - 32));
Value32 |= ((0x01) << (46 - 32));
WriteDword(GPIOBASE + 0x30, Value32);
< GPIO5 Select Input >
Value32= ReadDword(GPIOBASE + 0x04);
Value32 |= ((0x01) << 5);
WriteDword(GPIOBASE + 0x04, Value32);
< GPIO45/GPIO46 Select Output >
Value32= ReadDword(GPIOBASE + 0x34);
Value32 &= ~((0x01) << (45 - 32));
Value32 &= ~((0x01) << (46 - 32));
WriteDword(GPIOBASE + 0x34, Value32);
< Set Drawer Open >
Value32= ReadDword(GPIOBASE + 0x38);
Value32 |= ((0x01) << (45 - 32));
WriteDword(GPIOBASE + 0x38, Value32);
Sleep(100);
Value32 &= ~((0x01) << (45 - 32));
WriteDword(GPIOBASE + 0x38, Value32);
< Get Drawer Status >
Value32= ReadDword(GPIOBASE + 0x0C);
Value32 = Value32 >> 5;
Value32 &= 0x01;