⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 battest.h

📁 TDK 6521 SOC 芯片 DEMO程序
💻 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: 71M652x POWER METER - battery test code.
//  If BME, bit 6 of 0x2020, is set, then a load is applied and on the
//  next alternate conversion cycle, the battery voltage is measured.
//  Since this loads the battery, it should be as short as possible,
//  and done only rarely, e.g. once per day.
//  Therefore, the real-time logic is in the CE interrupts in ce.c
//  In xfer_busy, which starts the almux cycle to mesure temperature,
//  there's code to start a battery test.  In ce-busy, which runs
//  after every mux cycle, there's code to collect the battery test
//  data.
//  The code here commands the battery test, and then interprets it.
// 
//  AUTHOR:  RGV
//
//  HISTORY: See end of file.
//**************************************************************************
// File: BATTEST.C
//               
#if BATTERY_TEST
#ifndef BATTEST_H
#define BATTEST_H 1
                                                                              
// count down of samples not yet collected
extern uint8_t data bat_sample_cnt; // "data" so it's fast to check

void battest_start (void); // called from command line to start a battery test
void battest_run (void); // called from main to run the battery test
// display last battery voltage on the LCD; also commands another read
void battest_lcd (void); // there's only one battery; don't pass the volts!


/***************************************************************************
 * History
 * $Log: battest.h,v $
 * Revision 1.4  2006/06/14 02:41:26  tvander
 * New, derated battery test runs at 1/8 MPU speed, but uses 150x more battery
 * current.
 *
 * Revision 1.3  2006/06/06 03:57:33  tvander
 * Modified to run with hardware timers as well as software timers.
 *
 * Revision 1.2  2006/05/18 23:18:50  tvander
 * 16K and 32K
 * First cut at new requirements.
 * 32K 6521 is grossly tested.
 * All others have a clean compile with C51 8.02
 *
 * Revision 1.1  2006/05/17 19:07:59  tvander
 * Battery test works.
 * Power factor works for instantaneous value.  Periodic value compiles, but is
 * untested.
 *
 *
 * 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.         *
 ***************************************************************************/
/* battest.h */
#endif // defined
#endif // BATTERY_TEST

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -