ADLINK Technology cPCI-3920 Series Uživatelský manuál Strana 55

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 96
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 54
Watchdog Timer 41
AMC-1000
void write_config_data_byte(unsigned
char,unsigned char);
unsigned char read_config_data_byte(unsigned
char);
unsigned int read_wdt_io_base();
/* access wdt I/O registers routines */
void write_preload_val2_reg(unsigned long int);
void clear_preload_val1_reg();
void unlocking_reg();
/* Global parameter */
unsigned int wdt_io_base;
void main(void)
{
// unsigned int wdt_io_base;
unsigned long int time_out_val=0;
wdt_io_base=read_wdt_io_base();
printf("Intel 3100 Chipset Watch-Dog Timer
test utility.\n");
printf("Intel 3100 WDT IO Base Address ==
0x%x\n",wdt_io_base);
while(1)//
(time_out_val==0)||(time_out_val>1050))
{
//3sec printf("Please input the time to count
down (1-1050 sec): ");
//3sec scanf("%d",&time_out_val);
}
//3sectime_out_val=time_out_val*1000;//transfer
to msec unit.
time_out_val=time_out_val+3000; //3sec
clear_preload_val1_reg();//we don't need
preload_val1 caused internal interrupt.
write_preload_val2_reg(time_out_val);//
write preload_val2 ,it will cause external
interrupt.(WDT_TOUT#)
Zobrazit stránku 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 95 96

Komentáře k této Příručce

Žádné komentáře