IBASE Technology ASB200-918 Series User Manual page 68

Fanless system with 3.5" disk-size sbc system
Table of Contents

Advertisement

3. DIO Sample Code: The file MAIN.CPP
//---------------------------------------------------------------------------
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR
// PURPOSE.
//
//---------------------------------------------------------------------------
#include <dos.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include "F81846.H"
//---------------------------------------------------------------------------
void ClrKbBuf(void);
int main (int argc, char *argv[]);
//---------------------------------------------------------------------------
int main (int argc, char *argv[])
{
unsigned char result;
char SIO;
SIO = Init_F81846();
if (SIO == 0)
{
printf("Can not detect Fintek F81846, program abort.\n");
return(1);
}
Set_F81846_LD(0x06);
//switch to logic device 6
result = ((Get_F81846_Reg(0xE2)) & 0x04) ? 0x01 : 0x00;
Low / result = 0x01 GPI is High
return (result);
}
60
//result = 0x00 GPI is
ASB200-918 User Manual

Advertisement

Table of Contents
loading

Table of Contents