-36- MBM-530NS User’s Manual
outportb(Index_Reg, Dev_Index);
//Choose Logical Dev. GPIO
outportb(Data_Reg, GPIO_Num);
//
outportb(Index_Reg, 0x30);
//Enable GPIO register access
outportb(Data_Reg, 0x01);
//
outportb(Index_Reg, 0x60);
//GPIO Base address MSB
mBAR = inportb(Data_Reg);
//
outportb(Index_Reg, 0x61);
//GPIO Base address LSB
lBAR = inportb(Data_Reg);
//
GPIOBAR = ((unsigned)mBAR <<8) + ((unsigned)lBAR);
/********************************************************/
/* Read from GPIO20 and check its status
*/
/********************************************************/
outportb(Index_Reg, 0x22);
//GPIO Bank select
port_Select = inportb(Data_Reg);
//
outportb(Index_Reg, 0x22);
//GPIO port2 select
outportb(Data_Reg, (port_Select & 0x7F)); //
outportb((G 0x05), 0x80);
//set port2 input direction
tmpData = inportb(G 0x04) & GPIO20;
if (tmpData == GPIO20) printf("GPIO20 is at HIGH state \n");
else printf("GPIO20 is at LOW state.\n");
}
Summary of Contents for MBM-530NS
Page 1: ...MBM 530NS User s Manual...
Page 4: ...4 MBM 530NS User s Manual...
Page 8: ......
Page 12: ......
Page 58: ......
Page 91: ...Web site www formosa21 com MBM 530NS User s Manual 91 when user tries to enter Setup utility...
Page 96: ......