60
Utilities
Sample Code
The sample program written in C shown below offers an interac-
tive way to test the Watchdog Timer under DOS.
#include<stdio.h>
#include<dos.h>
static unsigned int W83627UHG_ioPort = 0x2e;
void Enter_W83627UHG_Config(unsigned int flag)
{
if(flag) W83627UHG_ioPort = 0x4e;
outportb(W83627UHG_ioPort, 0x87);
outportb(W83627UHG_ioPort, 0x87);
}
void Get_W83627UHG_ID(unsigned int &ID1, unsigned int
&ID2)
{
outportb(W83627UHG_ioPort, 0x20);
ID1 = inportb(W83627UHG1);
outportb(W83627UHG_ioPort, 0x21);
ID2 = inportb(W83627UHG1);
}
void W83627UHG_WDT_Run(unsigned int count_value, unsigned
int PLEDflag)
{
unsigned int tempCount, registerValue;
outportb(W83627UHG_ioPort, 0x07);
outportb(W83627UHG1, 8); // CR07 set Logical
Device 8
if(count_value >= 60)
{
outportb(W83627UHG_ioPort, 0xf5);
registerValue = inportb(W83627UHG1);
registerValue |= 0x04;
outportb(W83627UHG1, registerValue); /
/ set Minute mode
Содержание cPCI-6520
Страница 8: ...viii List of Figures This page intentionally left blank ...
Страница 10: ...x List of Tables This page intentionally left blank ...
Страница 18: ...8 Introduction This page intentionally left blank ...
Страница 30: ...20 Functional Description This page intentionally left blank ...
Страница 52: ...42 Board Interfaces This page intentionally left blank ...
Страница 65: ...Getting Started 55 cPCI 6520 5 5 Secure the CFast adapter with two screws as shown below ...
Страница 66: ...56 Getting Started This page intentionally left blank ...
Страница 74: ...64 Utilities This page intentionally left blank ...