Web site: www.formosa21.com
MBM-530NS User’s Manual -103-
void main(int argc, char* argv[]) {
int i,count;
int setting[8]={2,4,8,16,20,24,28,32};
unsigned char
mBAR,lBAR,PM_Index_Reg,PM_Data_Reg,GPIO_En,port_Select,CFG
DAT;
unsigned PMBAR,GPIOBAR;
if ((argc<2)||(atoi(argv[1])<1)) count=2;
//Default setting
else count= (int)(atoi(argv[1]));
for(i=0; i<8; i++) {
if (count == setting[i]) break;
}
if (i==8) {
printf("WDT530 [count] (count = 2, 4, 8, 16, 20, 24, 28, 32)\n");
exit(-1);
}
outportb(Index_Reg, Dev_ Index);
//Choose Logical Dev. PM
outportb(Data_Reg, PM_Num);
//
outportb(Index_Reg, 0x30);
//Enable PM register access
outportb(Data_Reg, 0x01);
//
outportb(Index_Reg, 0x60);
//PM Base address MSB
mBAR = inportb(Data_Reg);
//
outportb(Index_Reg, 0x61);
//PM Base address LSB
lBAR = inportb(Data_Reg);
//
PMBAR = ((unsigned)mBAR <<8) + ((unsigned)lBAR);
PM_Index_Reg = inportb(PMBAR + 0x00);
//GPIO ports function
enable
PM_Data_Reg = inportb(PMBAR + 0x01); //
outportb(PM_Index_Reg, 0x01);
//
GPIO_En = inportb(PM_Data_Reg); //
outportb(PM_Index_Reg, 0x01);
//
outportb(PM_Data_Reg, (GPIO_En | 0x80));//
outportb(Index_Reg, Dev_Index);
//Choose Logical Dev. GPIO
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: ......