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

📄 cli.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: 71M651x POWER METER - Command Line Interface Definitions.
// 
//  AUTHOR:  MTF
//
//  HISTORY: see end of file
//**************************************************************************
// File:  CLI.H
//
#ifndef CLI_H
#define CLI_H

#define CLI_BASE 0

// Result code constants. (NOTE: these are indices, not result codes).
#define OK_ID            1
#define ERROR_ID         2
#define BAD_PARITY_ID    3
#define RATE_CHANGE_ID   4
#define NO_HELP_AVAIL_ID 5
#define OK_BROWNOUT_ID  6

// Definitions for various ASCII control characters
#define CASE_   0x20
#define BS      0x08     // BACKSPACE CHARACTER
#define LF      0x0A     // LINE FEED
#define CRET    0x0D     // CARRIAGE RETURN
#define TERMINATOR '~'   // command terminator
#define XON     0x11     // DC1
#define XOFF    0x13     // DC3
#define CTRL_X  0x18     // 'X' - 40h.
#define CTRL_Z  0x1A     // 'Z' - 40h.
#define SPACE   0x20     // SPACE CHARACTER
#define HAT     0x5E     // HAT IS THE ESCAPE Sequence CHAR

#if CLI

void cli (void);                        // Command Line Interpreter.
void cmd_ce (void);                     // 'C' (C)ompute Engine controls.
                                                                                // 'CE1/0'.     CE Enable/Disable.
                                                                                // 'CLB' Begin   Calibration.
                                                                                // 'CLS' Save    Calibration.
                                                                                // 'CLR' Restore Calibration.
                                                                                // 'CLD' Default Calibration.
                                                                                // 'CPC' Clear Pulse Counts.
                                                                                // 'CRn.n.n.n' Set RTM values.
                                                                                // 'CTn' Set TMUX.
void cmd_ce_code_access (void);         // '!' CE code access.
void cmd_ce_data_access (void);         // ']' CE data access.
void cmd_download (void);
void cmd_eeprom (void);                 // 'E' (E)Eprom controls.
void cmd_err_record (void);           // 'R' Error (R)ecording
void cmd_error (void);
void cmd_flash (void);                  // 'F' (F)lash controls.
void cmd_load (void);

void cmd_meter (void);                  // 'M' (M)eter controls.
void cmd_mpu_data_access (void);        // ')' MPU data access.
void cmd_power_save (void);             // 'PS' Power Save.
void cmd_profile (void);                // 'P' Meter Profile.
void cmd_rate (void);
void cmd_rtc (void);                    // 'RT' (R)eal (T)ime Clock controls.
void cmd_serial (void);
void cmd_sfr (void);                    // 'R' Special Function (R)egisters.
                                                                                // 'RI' IO SFRs.
void cmd_trim (void);                   // 'T' Trim     controls.
void cmd_width_parity (uint8_t bit_cnt);

bool done (uint8d_t *c);
void send_help (int8r_t * code *s);
void send_a_result (uint8_t c);
void send_result (void);
void send_rtc (void);
void send_copyright (void);

extern volatile uint8i_t cli_index;
extern          uint8i_t cli_result;
#define set_result(_c_) cli_result = _c_

/***************************************************************************
 * History:
 * $Log: cli.h,v $
 * Revision 1.17  2006/09/09 01:08:09  gmikef
 * *** empty log message ***
 *
 * Revision 1.16  2006/06/05 23:49:59  tvander
 * Added error recording commands
 *
 * Revision 1.15  2006/04/06 20:57:09  tvander
 * I command is the same as I0 now.
 *
 * Revision 1.14  2006/03/06 03:27:56  Michael T. Fischer
 * More 6530 prep.
 *
 * Revision 1.13  2006/03/02 19:50:27  tvander
 * Made control characters available so that ser0cli.c and ser1cli.c can be compiled without enabling cli
 *
 * Revision 1.12  2006/01/16 20:11:19  tvander
 * Clean Keil build, all versions
 *
 * Revision 1.11  2006/01/10 03:54:00  gmikef
 * Added PDATA support for CE Outputs.
 *
 * Revision 1.9  2005/11/10 22:51:31  tvander
 * 6520 has battery mode commands.
 * Brownout always has decimal point 7.
 * LCD Mode always has decimal points 7 and 6.
 * Sag detection is disabled.
 *
 * Revision 1.8  2005/11/09 02:21:14  tvander
 * Added code to display watt hours from brownout mode.
 * Added code to clear EEPROM (lapie command "EEE")
 *
 * Revision 1.7  2005/11/04 18:01:27  tnguyenl
 * Flash programmer prerelease 4-nov-2005
 *
 * Revision 1.6  2005/11/03 19:16:20  tvander
 * Added B> prompt for brownout
 *
 * Revision 1.5  2005/10/08 04:41:16  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.4  2005/09/28 20:54:01  tvander
 * V/I phase displays for all phases,
 * main edge count displays for both types,
 * rewrote setup from defaults to group related functions.
 *
 * Revision 1.3  2005/09/27 01:28:56  tvander
 * Moved CLI constants into global CLI .h file
 *
 * Revision 1.2  2005/08/31 05:51:26  gmikef
 * First version w/ LAPIE interface.
 *
 * Revision 1.1  2005/08/28 02:21:49  gmikef
 * *** empty log message ***
 *
 *

 * 2005 AUGUST 17; First Version. 
 * 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.         *
 ***************************************************************************/
#endif /* cli.h  */
#endif /* CLI */
void cmd_batmode (void);                // 'B' (B)attery modes

⌨️ 快捷键说明

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