IBT Technologies IB791 User Manual page 62

Via cle266 5.25” embedded board
Table of Contents

Advertisement

APPENDIX
{
unsigned char bBuf;
bBuf = Get_W697HF_Reg(0x29);
bBuf &= (~0x60);
bBuf |= 0x20;
Set_W697HF_Reg(0x29, bBuf);
Set_W697HF_LD(0x08);
bBuf = Get_W697HF_Reg(0xF3);
bBuf &= (~0x04);
Set_W697HF_Reg( 0xF3, bBuf);
Set_W697HF_Reg( 0xF4, interval);
Set_W697HF_Reg( 0x30, 0x01);
}
//===========================================================================
void DisableWDT(void)
{
Set_W697HF_LD(0x08);
Set_W697HF_Reg(0x30, 0x00);
Set_W697HF_Reg(0xF4, 0x00);
}
//===========================================================================
Filename:W697hf.cpp
//===========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
//===========================================================================
#include "W697HF.H"
#include <dos.h>
//===========================================================================
unsigned int W697HF_BASE;
void Unlock_W697HF (void);
void Lock_W697HF (void);
//===========================================================================
unsigned int Init_W697HF(void)
{
unsigned int result;
unsigned char ucDid;
W697HF_BASE = 0x2E;
result = W697HF_BASE;
ucDid = Get_W697HF_Reg(0x20);
if ( ucDid == 0x60)
{
goto Init_Finish;
W697HF_BASE = 0x4E;
result = W697HF_BASE;
ucDid = Get_W697HF_Reg(0x20);
if ( ucDid == 0x60)
{
goto Init_Finish;
W697HF_BASE = 0x00;
result = W697HF_BASE;
Init_Finish:
return (result);
}
//===========================================================================
void Unlock_W697HF (void)
{
outportb(W697HF_INDEX_PORT, W697HF_UNLOCK);
outportb(W697HF_INDEX_PORT, W697HF_UNLOCK);
}
//===========================================================================
58
}
}
IB791 User' s Manual
//enable WDTO
//switch to logic device 8
//count mode is second
//set timer
//enable timer
//switch to logic device 8
//watchdog disabled
//clear watchdog timer

Advertisement

Table of Contents
loading

Table of Contents