50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/*
|
|
* inflash.h
|
|
*
|
|
* Created on: 2024年6月24日
|
|
* Author: psx
|
|
*/
|
|
|
|
#ifndef APP_INC_INFLASH_H_
|
|
#define APP_INC_INFLASH_H_
|
|
|
|
#include "debug.h"
|
|
|
|
#pragma pack(push,1)
|
|
typedef struct _config_info{
|
|
uint8_t start_Flag[2]; /* 起始标志 */
|
|
uint8_t address[7]; /* 地址 */
|
|
uint8_t end_Flag; /* 结束标志 */
|
|
uint16_t Access_Node_Type; /* 接入节点类型 */
|
|
uint16_t Communication_Methods; /* 通信方式 */
|
|
uint32_t bat485_Baud; /* 串口波特率 */
|
|
uint32_t gw485_Baud; /* 串口波特率 */
|
|
}config_info;
|
|
#define CONFIG_INFO_SIZE (sizeof(config_info))
|
|
#pragma pack(pop)
|
|
|
|
/* 接入节点类型 */
|
|
typedef enum
|
|
{
|
|
POWERBOX = 1, /* 电源箱子 */
|
|
MICROMETEOROLOGY = 2, /* 微气象 */
|
|
}SL_ACCESSNODETYPE;
|
|
|
|
/* 通信方式 */
|
|
typedef enum
|
|
{
|
|
RS485 = 1,
|
|
RJ45 = 2,
|
|
}SL_COMMUNICATIONMETHODS;
|
|
|
|
extern config_info g_slConfigInfo;
|
|
|
|
#define FLASH_SAVE_ADDR_BEGIN (0x00)
|
|
#define FLASH_SAVE_ADDR_END (0x00 + CONFIG_INFO_SIZE)
|
|
|
|
void save_config_info(config_info save_config_info);
|
|
uint8_t read_config_info(void);
|
|
|
|
|
|
#endif /* APP_INC_INFLASH_H_ */
|