Files
RCU_C1P_Module/MCU_Driver/inc/rw_logging.h
caocong d2d8800788 feat:新建项目文件
BLV主机C1P模块
2025-12-06 13:49:01 +08:00

50 lines
1.1 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.
/*
* 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_ */