Lanner LEC-7900 User Manual Page 28

  • Download
  • Add to my manuals
  • Print
  • Page
    / 36
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 27
27
*****************************************************
if( strcmp(argv[1], "-wr") == 0 )
{
if( argc != 3 )
{
help();
return -1;
}
time = atoi(argv[2]);
printf("Setting Watchdog timer for System Reset...\n");
set_watchdog(time);
return 0;
}
else
{
help();
return -1;
}
return 0;
}
//;********************* set_watchdog
*****************************************************
int set_watchdog(int time)
{
int temp;
temp = time;
Enter_Configuation();
write_w83627UHG_reg(0x8, 0x30, 0x01); //;enable LDN8
write_w83627UHG_reg(0x8, 0xf6, temp); //LDN=8, CRF6, set watchdog
timer time-out value
Exit_Configuation();
return 0;
}
//;********************* Read SIO
*****************************************************
int read_w83627UHG_reg(int LDN, int reg)
{
outportb(INDEX_PORT, 0x07); //LDN register
delay(1);
outportb(DATA_PORT, LDN);
delay(1);
outportb(INDEX_PORT, reg);
delay(1);
return inportb(DATA_PORT);
}
//;********************* Write SIO
*****************************************************
int write_w83627UHG_reg(int LDN, int reg, int value)
{
outportb(INDEX_PORT, 0x07); //LDN register
delay(1);
outportb(DATA_PORT, LDN);
delay(1);
outportb(INDEX_PORT, reg);
delay(1);
outportb(DATA_PORT, value);
return 0;
}
//;********************* Enter SIO
*****************************************************
int Enter_Configuation()
{
outportb(INDEX_PORT, 0x87);
delay(1);
outportb(INDEX_PORT, 0x87);
Page view 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 34 35 36

Comments to this Manuals

No comments