- 52 -
Appendix
Appendix B: DIO Sample Code
/*---------------------------------------------------------------------------*/
#include “math.h”
#include “stdio.h”
#include “dos.h”
void GPIOMode(int iMode);
void GPIOData(int iData);
int GPIOStatus();
int main(void)
{
int iInput;
GPIOMode(0xF);
delay(10000);
GPIOData(0x0A);
delay(30000);
iInput = GPIOStatus();
printf(“ Data : %2x \n”,iInput);
GPIOData(0x05);
delay(30000);
iInput = GPIOStatus();
printf(“ Data : %2x \n”,iInput);
return 0;
}
void GPIOMode(int iMode)
{
outportb(0x66,0xEB);
/* Select DIO pin to output or input */
delay(2000);
outportb(0x62,iMode);
}
void GPIOData(int iData)
{
outportb(0x66,0xEA);
/* Set DIO output pin status */
delay(2000);
outportb(0x62,iData);
}
int GPIOStatus()
{
int iStatus;
outportb(0x66,0xEC);
/* Get DIO pin status */
delay(2000);
iStatus = inportb(0x62);
return iStatus;
}
Summary of Contents for EmETXe-i88U4-D1508
Page 1: ...EmETXe i88U4 COM Express Compact Type 6 CPU Module User s Manual Version 1 0 2020 07...
Page 2: ...Revision History Version Date Description 1 0 2020 07 Initial release...
Page 9: ...1 Introduction 1 Chapter 1 Introduction...
Page 14: ...6 This page is intentionally left blank...
Page 15: ...7 Board Overview 2 Chapter 2 Board Overview...
Page 17: ...9 Board Overview 2 2 Board Dimensions...
Page 22: ...14 This page is intentionally left blank...
Page 23: ...15 Installation Maintenance 3 Chapter 3 Installation Maintenance...
Page 26: ...18 This page is intentionally left blank...
Page 27: ...19 BIOS 4 Chapter 4 BIOS...
Page 57: ...49 Appendix Appendix...