Custom Embedded Solutions
WIN Enterprises, Inc MB-80510 User Manual
44
3.1 GPIO Sample Program for DOS environment
//WIN GPIO Program for EM-6333(DOS Version)
#include <stdio.h>
#include <string.h>
#include <dos.h>
#include <stdlib.h>
#include <inlines/pc.h>
#define index_port 0x2E
#define data_port 0x2F
void help();
void Enter_SIO();
void Exit_SIO();
int main(int argc, char *argv[])
{
int data_rw8, val;
if (argc!=2){
help();
return;
}
Enter_SIO();
if(strcmp(argv[1], "-80h") == 0){
val = 0x01;
outportb(index_port, 0x89);
data_rw8 = inportb(data_port)&(~val);
data_rw8 |= val;
outportb(data_port, data_rw8);
printf("(Set GP80 to high)\n");
}
else if(strcmp(argv[1], "-80l") == 0){