4、读取UID的代码
4.1、头文件
#ifndef _UID_H
#define _UID_H
#include "stm32f0xx.h"
//定义STM32 MCU的类型
typedef enum{
STM32F0,
STM32F1,
STM32F2,
STM32F3,
STM32F4,
STM32F7,
STM32L0,
STM32L1,
STM32L4,
STM32H7,
}MCUTypedef;
//获取MCU的唯一ID
void GetSTM32MCUID(uint32_t *id,MCUTypedef type);
//获取芯片的32位唯一ID
uint32_t HK32F0_uid32_get(void);
#endif
|