System Installation
WADE-8041 User’s Manual
3-9
unsigned char Get_CFG2(unsigned char Addr2)
{
unsigned char d2;
outportb(0x2E, Addr2);
delay(2);
d2 = inportb(0x2E +1);
delay(2);
return(d2);
}
int main(void)
{
unsigned char d2;
enter_Superio2_CFG();
/* CR2A B7 = 1 selet GPIO Port 1*/
d2 = Get_CFG2(0x2A);
d2 = (d2 & 0x7F) | 0x80;
Set_CFG2(0x2A, d2);
/* IO test loop 1 */
/* Set GPIO Port 1 of Superio 2 Enable */
Set_CFG2(0x07, 0x07); /* Select logic device 07 of Superio2*/
Set_CFG2(0x30, 0x01); /* Enable GPIO Port 1 of Superio2*/
/* IO test loop 1 */
/* Set GPIO Port 1 of Superio2 Enable */
Set_CFG2(0x07, 0x07); /* Select logic device 07*/
Set_CFG2(0xF0, 0x0F); /* GPIO Port 1 of Superio2 is [ooooiiii], o: output, i:input
*/
Set_CFG2(0xF2, 0x00); /* GPIO Port 1 of Superio2 is non-inversed*/
Set_CFG2(0x07, 0x07); /* Select logic device 07*/
Set_CFG2(0xF1, 0xFF); /* Initial back all GPIO Port1 of Superio 2 to hi */
Set_CFG2(0x07, 0x07); /* Select logic device 07*/
Set_CFG2(0xF1, 0xEF); /* GP14 of Superio2 -> ~GP10 of Superio2 */
Set_CFG2(0x07, 0x07); /* Select logic device 07 of Superio2*/
d2 = Get_CFG2(0xF1); /* get GPIO Port 2 data */