获取设备唯一ID
unsigned int deviceID[3] = {0};
unsigned int idAddr = 0x1FFF7A10;
void get_deviceID(unsigned int idAddr, unsigned int* deviceID) {
deviceID[0] = *(volatile u32*)idAddr;
deviceID[1] = *(volatile u32*)(idAddr + 4);
deviceID[2] = *(volatile u32*)(idAddr + 8);
}
get_deviceID(idAddr, deviceID);
printf("deviceID[0]: %d", deviceID[0]);
printf("deviceID[1]: %d", deviceID[1]);
printf("deviceID[2]: %d", deviceID[2]);
本文来自博客园,作者:源世,转载请注明原文链接:https://www.cnblogs.com/jsxzhub/p/15948647.html