![background image](http://html1.mh-extra.com/html/ibase-technology/mb837-d25/mb837-d25_user-manual_3252933060.webp)
APPENDIX
54
MB837-D25 / MB837-D25-R User’s Manual
File of the 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 "W627UHG.H"
//---------------------------------------------------------------------------
int main (void);
void Dio5Initial(void);
void Dio5SetOutput(unsigned char);
unsigned char Dio5GetInput(void);
void Dio5SetDirection(unsigned char);
unsigned char Dio5GetDirection(void);
//---------------------------------------------------------------------------
int main (void)
{
char SIO;
SIO = Init_W627UHG();
if (SIO == 0)
{
printf("Can not detect Winbond 83627UHG, program abort.\n");
return(1);
}
Dio5Initial();
//for GPIO50..57
Dio5SetDirection(0x0F); //GP50..53 = input, GP54..57=output
printf("Current DIO direction = 0x%X\n", Dio5GetDirection());
printf("Current DIO status = 0x%X\n", Dio5GetInput());
printf("Set DIO output to high\n");
Dio5SetOutput(0x0F);
printf("Set DIO output to low\n");
Dio5SetOutput(0x00);
return 0;
}
//---------------------------------------------------------------------------
void Dio5Initial(void)
{
unsigned char ucBuf;
Set_W627UHG_LD(0x08);
//switch to logic device 8
//enable the GP5 group
ucBuf = Get_W627UHG_Reg(0x30);
ucBuf |= 0x02;
Summary of Contents for MB837-D25
Page 1: ...MB837 D25 MB837 D25 R Intel Atom D2550 5 25 inch SBC USER S MANUAL Version 1 2...
Page 5: ...MB837 D25 User s Manual v This page is intentionally left blank...
Page 6: ......
Page 10: ...INSTALLATIONS 4 MB837 D25 MB837 D25 R User s Manual Board Dimensions...
Page 42: ...BIOS Setup 36 MB837 D25 MB837 D25 R User s Manual This page is intentionally left blank...
Page 52: ...APPENDIX 46 MB837 D25 MB837 D25 R User s Manual void Unlock_W627UHG void...