📄 wd.h
字号:
/***************************************************************************
* 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. *
* *
* Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved. *
***************************************************************************/
//**************************************************************************
//
// DESCRIPTION: 71M651x POWER METER - Prototypes and Definitions.
//
// AUTHOR: RGV
//
// HISTORY: see end of file
//
//**************************************************************************
// WD MANAGEMENT-- defines software watchdogs: all software watchdogs
// must be reset before the hardware watchdog can be reset.
// Watchdog code is active only for watchdogs that are defined.
// Currently only the main loop (main.c) and periodic interrupts
// (tmr0.c, tmr1.c, ce.c) have watchdog code to enable.
//**************************************************************************
#ifndef WDS_H
#define WDS_H 1
#if WATCHDOG
#if M6520
// Only define the ones that should be tested.
#define NUM_WDS 3
#define WD_MAIN_LOOP BIT0 // main loop ran
#define WD_XFER_BUSYZ BIT1 // EXT6, periodic, essential to meter
#define WD_RTC BIT2 // RTC, periodic, resets WD in brownout
#if 0 // These do not need to be tested
#define WD_CE_BUSYZ BIT3 // EXT3, a very time-consuming watchdog
#define WD_TMR0 BIT4 // TMR0, not periodic in this design
#define WD_TMR1 BIT5 // TMR1, not periodic in this design
#define WD_IO_INT0 BIT6 // EXT0, not periodic in this design
#define WD_IO_INT1 BIT7 // EXT1, not periodic in this design
#define WD_CE_UPDATE BIT8 // CE update ran
#define WD_FWCOL BIT9 // EXT2, not periodic
#define WD_PLL_OK BIT10 // EXT4, not periodic
#define WD_EEPROM BIT11 // EXT5, not periodic
#define WD_ES0 BIT12 // ES0, not periodic
#define WD_ES1 BIT13 // ES1, not periodic
#endif
#elif TRACE10 // experimental
// Only define the ones that should be tested.
#define NUM_WDS 3
#define WD_MAIN_LOOP BIT0 // main loop ran
#define WD_XFER_BUSYZ BIT1 // EXT6, periodic, essential to meter
#define WD_RTC BIT2 // RTC, periodic, resets WD in brownout
#if 0 // These do not need to be tested
#define WD_CE_BUSYZ BIT3 // EXT3, a very time consuming watchdog
#define WD_TMR0 BIT4 // TMR0, not periodic in this design
#define WD_TMR1 BIT5 // TMR1, not periodic in this design
#define WD_IO_INT0 BIT6 // EXT0, not periodic in this design
#define WD_IO_INT1 BIT7 // EXT1, not periodic in this design
#define WD_CE_UPDATE BIT8 // CE update ran
#define WD_CMP_FALLING BIT9 // EXT2, not periodic
#define WD_CMP_RISING BIT10 // EXT4, not periodic
#define WD_EEPROM BIT11 // EXT5, not periodic
#define WD_ES0 BIT12 // ES0, not periodic
#define WD_ES1 BIT13 // ES1, not periodic
#endif
#else
#error unknown device
#endif
#define WD_ALL UINT8_MAX // all bits set
void wd_reset (uint8_t wd) small reentrant; // resets a software watchdog
void wd_destroy (uint8_t wd); // destroy a software watchdog
void wd_create (uint8_t wd); // creates a software watchdog
#endif // watchdog
/***************************************************************************
* $Log: wd.h,v $
* Revision 1.7 2006/10/13 00:52:35 tvander
* Removed compile options for 6530, 6515;
* renamed 6511 and 6513 to trace11 and trace13;
* Binary verified unchanged from previous version.
*
* Revision 1.6 2006/09/09 01:16:09 gmikef
* *** empty log message ***
*
* Revision 1.5 2006/07/08 01:53:53 tvander
* Detects invalid configurations
*
* Revision 1.4 2006/03/03 11:31:56 Michael T. Fischer
* Prep for 6530 LCD, etc.
*
* Revision 1.2 2005/11/29 01:28:31 tvander
* Software watchdogs actually work now.
* Automatically enable software watchdogs by defining constant in wd.h
* Optimized software watchdogs so they work faster.
* Reset the watchdog is reset as soon as the enabling software watchdog is reset.
* Removed the software watchdog test routine.
*
* Revision 1.1 2005/10/08 04:41:33 tvander
* Fixed priority inversion.
* Rewrote watchdog to work in brownout, but of course it doesn't work.
* Watchdog can now be defeated by clearing watchdog option to 0.
* Reorganized watt hour modules (at last!).
* Disabled reading of STATUS in 6521_cli because the CE's status is always SAG.
* Tested with 6521_CLI; measurements seem to work.
* Fixed other builds.
*
* Revision 1.6 2005/09/22 23:45:25 tvander
* Clean build all models and unit tests, updated copyright to be fore Teridian
*
* Revision 1.5 2005/09/11 00:34:08 tvander
* Clean compiles
*
* Revision 1.4 2005/05/02 18:21:32 gmikef
* *** empty log message ***
*
* Revision 1.4 2005/04/30 01:57:38 gmikef
* *** empty log message ***
*
* Revision 1.2 2005/04/28 19:19:23 tvander
* Added 651x stuff, comments, events.c interface (?)
*
* Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved. *
* this program is fully protected by the United States copyright *
* laws and is the property of Teridian Semiconductor Corporation. *
***************************************************************************/
// wd.h
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -