Files
RCU_C1P_Launcher/MCU_Driver/inc/rw_logging.h
caocong 094fd76a72 新增:首次提交
首次提交,上传Launcher工程
2026-01-05 09:40:42 +08:00

42 lines
1.0 KiB
C
Raw 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 Data_CheckSum(uint8_t* data,uint16_t len);
uint8_t Log_write_sram(uint8_t data_type,uint8_t *buff,uint16_t len);
#endif /* MCU_DRIVER_INC_RW_LOGGING_H_ */