50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/*
|
||
* rw_logging.h
|
||
*
|
||
* Created on: Jul 29, 2025
|
||
* Author: cc
|
||
*/
|
||
|
||
#ifndef MCU_DRIVER_INC_RW_LOGGING_H_
|
||
#define MCU_DRIVER_INC_RW_LOGGING_H_
|
||
|
||
#include "ch564.h"
|
||
#include <stdint.h>
|
||
|
||
#define APPFlag_UartUpgrade_Reset 0xBBC1 //APP串口升级标志位
|
||
|
||
//日志数据相关定义
|
||
#define LOG_Data_Hand 0xA5 //LOG数据头
|
||
#define Log_Data_End 0x5A //LOG数据尾
|
||
#define Log_Data_Len_MAX 512 //日志数据最长512Byte
|
||
|
||
/*日志保存的数据格式*/
|
||
typedef enum{
|
||
S_Log_Hand,
|
||
S_Log_SN, //日志每条数据增加序列号
|
||
S_Log_Len,
|
||
S_Log_Len_8,
|
||
S_Log_Check,
|
||
S_Log_Date_H, //年:5bit 月:5bit 日:5bit
|
||
S_Log_Date_L,
|
||
S_Log_Type,
|
||
S_Log_Time8B, //小时时间戳
|
||
S_Log_Time16B,
|
||
S_Log_Time24B,
|
||
S_Log_Time32B,
|
||
S_Log_Data,
|
||
}Sram_Log_Data_Format;
|
||
|
||
|
||
uint8_t Log_write_sram(uint8_t data_type,uint8_t *buff,uint16_t len);
|
||
void Retain_Flash_Register_Data(void);
|
||
void Read_Flash_Register_Data(void);
|
||
void LOG_Save_Global_Parameters(void);
|
||
uint8_t SRAM_PowerOn_Restore_ParaInfo(void);
|
||
|
||
|
||
|
||
|
||
|
||
#endif /* MCU_DRIVER_INC_RW_LOGGING_H_ */
|