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.

65 lines
1.2 KiB

4 years ago
////////////////////////////////////////////////////////////////////////////
///@copyright Copyright (c) 2018, 传控科技 All rights reserved.
///-------------------------------------------------------------------------
/// @file msp_eeprom.c
/// @brief msp @ driver config
///-------------------------------------------------------------------------
/// @version 1.0
/// @author CC
/// @date 20190106
/// @note cc_AS_stc02 由stc-isp v6.0860
//////////////////////////////////////////////////////////////////////////////
#include "chipid.h"
#include "../bsp/bsp_config.h"
#include "../app/app_config.h"
4 years ago
// #define MSP_ID_LEN 7
4 years ago
void L0_id_get(U8 *id)
{
U8 i = 0;
char *ID = (char idata *)0xf1;
for(i=0;i<MSP_ID_LEN;i++)
{
id[i] = ID[i];
}
}
void L0_id_get_rom(U8 *id)
{
U8 i = 0;
char *ID = (char code *)(D_MCU_SPEC_PARAM_ID_IN_ROM);
4 years ago
for(i=0;i<MSP_ID_LEN;i++)
{
id[i] = ID[i];
}
}
void L0_id_get_chipid()
{
U8 i = 0;
//使能访问XFR
P_SW2 |= 0x80;
for(i=0;i<MSP_ID_LEN;i++)
{
G.mcu_id[i] = ID_ADDR_IN_CHIPID[i];
}
}
4 years ago
#if 1
void L0_id_main(void)
{
U8 i,id[MSP_ID_LEN];
L0_id_get_rom(id);
for(i=0;i<MSP_ID_LEN;i++)
{
L0_uart0_uchex(id[i]);
}
while(1);
}
#endif