- 60 -
Appendix
Appendix D: 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-i91M0
Page 1: ...EmETXe i91M0 COM Express Basic Type 6 CPU Module User s Manual Version 1 0 2019 06 ...
Page 2: ...Revision History Version Date Description 1 0 2019 06 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 2 4 4 76 117 87 95 4 87 125 Ø 2 7 Ø 6 5 9 2 Unit mm ...
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 62: ... 54 This page is intentionally left blank ...
Page 63: ... 55 Appendix Appendix ...