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

87 lines
3.1 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.
/*
* log_api.h
*
* Created on: Jul 29, 2025
* Author: cc
*/
#ifndef _LOG_API_H_
#define _LOG_API_H_
#include "ch564.h"
#include <stdint.h>
#define LogType_Enable 1 //LOG使能
/*日志存储类型定义*/
#define LogType_Launcher 0x01 //Launcher信息记录
#define LogType_SYS_Record 0x02 //系统运行信息记录
#define LogType_Device_COMM 0x03 //设备通讯记录
#define LogType_Device_Online 0x04 //设备通讯状态记录
#define LogType_Global_Parameters 0x05 //所有设备状态定期记录
#define LogType_Net_COMM 0x06 //网络通讯记录
#define LogType_Logic_Record 0x07 //逻辑处理记录
/*日志存储开关 - 初始状态*/
#define LogType_Launcher_SWITCH 1
#define LogType_SYS_Record_SWITCH 1
#define LogType_Device_COMM_SWITCH 1
#define LogType_Device_Online_SWITCH 1
#define LogType_Global_Parameters_SWITCH 1
#define LogType_Net_COMM_SWITCH 1
#define LogType_Logic_Record_SWITCH 1
/*日志存储控制位*/
#define LogType_Launcher_bit 0
#define LogType_SYS_Record_bit 1
#define LogType_Device_COMM_bit 2
#define LogType_Device_Online_bit 3
#define LogType_Global_Parameters_bit 4
#define LogType_Net_COMM_bit 5
#define LogType_Logic_Record_bit 6
/*日志相关参数*/
#define LogInfo_Device_Online 0x01 //设备在线
#define LogInfo_Device_Offline 0x02 //设备离线
typedef enum{
LLauncher_App_Check = 0x01, //校验APP
LLauncher_Read_App, //读取APP并将APP数据写入到MCU FLash中
LLauncher_Write_Flash, //写Flash
LLauncher_Factory_Reset, //恢复出厂设置
LLauncher_Reset_Source, //复位源
LLauncher_RCUKey_State, //RCU按键事件记录
}LOGTYPE_Launcher_E;
typedef enum {
LSYS_PHY_Change = 0x01, //PHY状态变化记录
LSYS_DevInfo_Error, //设备链表信息错误
LSYS_API_State, //升级状态
LSYS_NET_ARGC, //网络初始化参数
LSYS_MQTT_ARGC, //MQTT参数
LSYS_Server_Comm_State, //云端通讯状态记录
LSYS_NET_DefaultARGC, //网络默认参数
LSYS_RCUKey_State, //RCU按键事件记录
}LOGTYPR_SYSRecord;
typedef enum{
LCOMM_ASK_TO_Reply = 0x01, //轮询回复数据
LCOMM_Send_Control, //RCU下发控制数据
LCOMM_Control_Reply, //RCU控制回复数据
LCOMM_Adjust_Baud, //设备调整波特率
}LOGTYPE_DEV_COMM;
typedef enum{
LGlobal_Para = 0x01, //参数数据
LGlobal_Dev, //设备数据
}LOGTYPE_Global_E;
void LOG_Launcher_APP_Check_Record(uint8_t state);
void LOG_Launcher_Read_App_Record(uint8_t state);
void LOG_Launcher_Write_Flash_Record(uint32_t addr,uint16_t len);
void LOG_Launcher_Factory_Reset_Record(uint8_t state);
void LOG_Launcher_Reset_Source_Record(uint8_t sour);
void LOG_Launcher_RCU_Key_State_Record(uint8_t state);
#endif /* MCU_DRIVER_INC_LOG_API_H_ */