获取设备唯一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]);
posted @ 2022-03-01 09:21  源世  阅读(105)  评论(0编辑  收藏  举报