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

📄 io.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: 71M65xx POWER METER - IO Routines.
// 
//  AUTHOR:  MTF
//
//  HISTORY: See end of file
//**************************************************************************
// File: IO.H
//               
// IO subroutines for use by CLI.
//
#ifndef IO_H
#define IO_H

bool cmd_pending (void);

int32_t  get_long (void);              // Convert ascii decimal (or hex) long  to binary number.
int32_t  get_long_decimal (uint8_t c); // Convert ascii decimal long  to binary number.
uint32_t get_long_hex (void);         // Convert ascii hexdecimal long  to binary number.

int16_t  get_short (void);             // Convert ascii decimal (or hex) short to binary number.
int16_t  get_short_decimal (void);     // Convert ascii decimal short to binary number.
uint16_t get_short_hex (void);        // Convert ascii hexdecimal short to binary number.

int8_t  get_num (void);               // Convert ascii decimal (or hex) number to binary number.
int8_t  get_num_decimal (void);       // Convert ascii decimal byte to binary number.
uint8_t get_num_hex (void);          // Convert ascii hexdecimal byte to binary number.

uint8_t get_digit (uint8_t idata *d);  // Get next decimal (or hex) digit from CLI buffer.   
uint8_t get_char_d (uint8_t idata *d); // Get next character from CLI buffer and allow unget.
uint8_t get_char (void);               // Get next character from CLI buffer.
#if  CAL_LDR && !CLI
uint8_t getc (void) small reentrant;    // character input from serial driver
#else
uint8_t getc (void);       // character input from serial driver
#endif
uint8_t rcv_hex (void);    // Convert ascii byte from serial driver to binary 
uint8_t htoc (uint8_t c);			   // Convert hex digit to ASCII character.
void 	put_char (uint8_t idata *c);   // Put character into CLI buffer.

void send_long  (int32_t n);          // Send a [0, 9,999,999,999] value to DTE.
void send_short (int16_t n);          // Send a [0, 99,999] value to DTE.
void send_byte  (int8_t n);           // Send a [0, 255] byte to DTE.
void send_byte_hex (uint8_t c);
void send_num   (int32_t n, uint8_t size);

void send_long_hex  (uint32_t n);     // Send a [0, FFFFFFFF] value to DTE.
void send_short_hex (uint16_t n);     // Send a [0, FFFF] value to DTE.
void send_hex       (uint8_t n);      // Send byte out in HEX.
#define snd_hex(_x_) send_hex(_x_)

void send_digit (uint8_t c);          // Send single ASCII hex or decimal digit out to SERIAL0.
#if  CAL_LDR && !CLI
void send_char (uint8_t c) small reentrant;
#else
void send_char (uint8_t c);
#endif
#define putc(_x_) send_char(_x_)

#if  CAL_LDR && !CLI
void send_crlf (void) small reentrant; 	  // Send <CR><LF> out PC UART.
#else
void send_crlf (void);            	  // Send <CR><LF> out PC UART.
#endif
#define snd_crlf() send_crlf()
#if  CAL_LDR && !CLI
// Send ROM string out PC UART.
void start_tx_rslt (uint8r_t *c) small reentrant;
#else
void start_tx_rslt (uint8r_t *c);     // Send ROM string out PC UART.
#endif
void start_tx_ram (uint8x_t *c);      // Send RAM string out PC UART.

extern uint8x_t txbuffer[];
extern uint16x_t txlen;
extern uint8d_t *txstatus;
extern bool echo;
extern bool io_timeout;  // set when 30 seconds or more passed with no IO

/***************************************************************************
 * History:
 * $Log: io.h,v $
 * Revision 1.11  2006/09/09 01:08:26  gmikef
 * *** empty log message ***
 *
 * Revision 1.10  2006/07/25 00:26:35  tvander
 * *** empty log message ***
 *
 * Revision 1.9  2006/07/07 00:52:30  tvander
 * Integrated reentrant cal loader
 *
 * Revision 1.8  2006/06/23 20:46:04  tvander
 * Removed wait-for-io; it slowed response in brownout mode, and caused
 * hangs. The cure was definitely worse than the disease: a few clobbered characters after certain commands.
 *
 * Revision 1.7  2006/06/15 19:56:04  tvander
 * Fixed misc. serial errors.
 *
 * Revision 1.6  2006/05/30 17:16:20  tvander
 * Integrated new code to support the calibration loader
 *
 * Revision 1.5  2006/01/16 20:11:20  tvander
 * Clean Keil build, all versions
 *
 * Revision 1.4  2006/01/10 03:54:49  gmikef
 * Added PDATA support for CE Outputs.
 *
 * Revision 1.2  2005/10/18 02:17:08  tvander
 * Access CLI in brownout by pressing reset.
 * Debugged serial 1 usage from CLI.
 * Implemented scrolling display as M17
 *
 * Revision 1.1  2005/08/28 02:24:23  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 /* io.h */

⌨️ 快捷键说明

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