这两行代码非常重要,其实能把这些理解了也就和51没啥差别了,个人愚见 //打开内存空间 if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1){ DEBUGMSG(DEBUG_ERR, "gpio: Error opening /dev/mem
"); exit(-1); } //map 0xffff //获得AT91_SYS的虚拟地址 map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, AT91_SYS);//AT91_SYS = 0xffff f000 |