X1UWaterWmbusISK/app/UWater_DebugPrint.h

64 lines
1.8 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __UWater_DEBUG_PRINT_H
#define __UWater_DEBUG_PRINT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "type.h"
#define PRINT_BUF_SIZE 1024
typedef struct {
u16 saved_data_len; //存入数据的长度
u16 printf_data_len; //已打印的数据长度
u16 print_one_time_len;//单次打印长度
u8 send_msg;
u8 buf_overflow; //缓冲区溢出
} PRINT_STRUCT;
typedef enum {
PRINT_DATA_S0 = 0,
PRINT_DATA_S1,
PRINT_DATA_S2,
PRINT_DATA_S3,
PRINT_DATA_S4,
PRINT_DATA_S5,
PRINT_DATA_DEFAULT
} PRINT_DATA;
//启动NB数据打印
void OpenPrintNbDataSwitch(void);
//关闭NB数据打印
void ClosePrintNbDataSwitch(void);
u8 GetPrintNbDataSwitch(void);
//启动程序数据打印
void OpenPrintProgramDataSwitch(void);
//关闭程序数据打印
void ClosePrintProgramDataSwitch(void);
/***********************启动打印数据********************************
Function: void PrintNbData (u8 *data_src, u16 len)
Description: 打印数据
Input: data_src 数据来源指针 len 数据长度
****************************************************************/
void PrintNbData(u8 *data_src, u16 len);
/***********************启动打印数据********************************
Function: void PrintProgramData (u8 *data_src, u16 len)
Description: 打印数据
Input: data_src 数据来源指针 len 数据长度
****************************************************************/
void PrintProgramData(u8 *data_src, u16 len);
//打印状态机是否空闲
u8 PrintDataMachineIfIdle(void);
/*******************************打印数据状态机******************************
Function: void PrintDataMachine(void)
Description: 打印数据状态机
***************************************************************************/
void PrintDataMachine(void);
#endif