beautypg.com

Aplex Technology AHM-6086A User Manual

Page 59

background image

AHM-6XX6A User Manual

58

//Select the logical device 9, GP2

SELETDEV(9)

//Read GPIO Value

outportb(INDEXP, 0xE5);

cGP2 = inportb(DATAP);

cGP2 = cGP2 & 0xF;

//Exit the super I/O chip programming

EXITPRG

return cGP2;

}

//Write GPIO Port6

int WriteGP6(unsigned char cGP6) {

//Start the super I/O chip programming

ENTERPRG

//Select the logical device 8, GP6

SELETDEV(8)

//Write GP1 value

WRITEREG(0xE5, cGP6)

//Exit the super I/O chip programming

EXITPRG

return 0;

}

int main() {

unsigned char cGP;

//Initialize the GPIO port

InitGP2();

This manual is related to the following products: