You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.5 KiB

1 year ago
////////////////////////////////////////////////////////////////////////////
///@copyright Copyright (c) 2022, 传控科技 All rights reserved.
///-------------------------------------------------------------------------
/// @file app_save.h
/// @brief @ app save
///-------------------------------------------------------------------------
/// @version 1.0
/// @author CC
/// @date 20220120
/// @note cc_AS_stc02
//////////////////////////////////////////////////////////////////////////////
#ifndef _ASP_EEPROM_H
#define _ASP_EEPROM_H
#include "TTSS_task.h"
#include "c_lib.h"
#include "../bsp/bsp_config.h"
#include "msp_uart0.h"
/////cc 20220127 和cup息息相关 应该和标识牌_config进行匹配
/// 16k =16 1024 = 32 512 =
//// 16 1024 =16384 =0x4000
#define EEP_SECTOR_SIZE 0x200 ///512
#define EEP_PARAM_ADDR (EEP_SECTOR_SIZE * 1)
#define EEP_ENC_ADDR (EEP_SECTOR_SIZE * 0)//// 加密信息
/**
* EEPROM
*/
#define EEPROM_PARAM_DATA_MAX 90
#define EEPROM_PARAM_FILTER 0xAA
typedef struct
{
U8 filter;
U8 len;
U8 buf[EEPROM_PARAM_DATA_MAX];
U8 crc[2];
}TS_eeprom_param_;
#define MCU_ID_LEN 7
#define MCU_ID_KEY_LEN 4
#define EEPROM_ENC_DATA_MAX 64
#define EEPROM_ENC_FILTER 0xAA
typedef struct ts_eeprom_enc
{
U8 enc_key[MCU_ID_KEY_LEN];
U8 enc_val[MCU_ID_LEN];
U8 crc[2];
}TS_EEPROM_ENC_;
U8 L1_para_read(U8 *buf,U8 *len);
U8 L1_para_write(U8 *buf, U8 len);
#endif // #ifndef _APP_TASK_ADC_H