beautypg.com

AAEON EMB-H61B User Manual

Page 81

background image

I n d u s t r i a l M o t h e r b o a r d

E M B - H 6 1 B

Appendix C Electrical Specifications for I/O Ports

C-9

************************************************************************************

Boolean

SIOBitRead(byte LDN, byte Register, byte BitNum)

{

Byte TmpValue;

SIOEnterMBPnPMode();

SIOSelectLDN(LDN);

IOWriteByte(SIOIndex, Register);

TmpValue = IOReadByte(SIOData);

TmpValue &= (1 << BitNum);

SIOExitMBPnPMode();

If(TmpValue == 0)

Return 0;

Return 1;

}

VOID

ConfigToOutputMode(byte LDN, byte Register, byte BitNum)

{

Byte TmpValue, OutputEnableReg;

OutputEnableReg = Register-1;

SIOEnterMBPnPMode();

SIOSelectLDN(LDN);

IOWriteByte(SIOIndex, OutputEnableReg);

TmpValue = IOReadByte(SIOData);

TmpValue |= (1 << BitNum);

IOWriteByte(SIOData, OutputEnableReg);

SIOExitMBPnPMode();

}

************************************************************************************