|
HPS_CONTROL_FPGA_LED 问题
[复制链接]
#define HW_REGS_BASE ( ALT_STM_OFST ) //STM基地址
#define HW_REGS_SPAN ( 0x04000000 ) //地址跨度
#define HW_REGS_MASK ( HW_REGS_SPAN - 1 )
virtual_base = mmap( NULL, HW_REGS_SPAN, ( PROT_READ | PROT_WRITE ), MAP_SHARED, fd, HW_REGS_BASE );//将L3外设的物理地址映射为虚拟地址,
h2p_lw_led_addr=virtual_base + ( ( unsigned long )( ALT_LWFPGASLVS_OFST + DATA_PIO_0_BASE ) & ( unsigned long)( HW_REGS_MASK ) ); //计算led的地址;
*(uint32_t*)h2p_lw_led_addr=0x8555;//控制LED
问题来了,查了头文件发现ALT_STM_OFST=0xFC000000,是STM模块地址,不是L3外设物理地址,
1)STM模块是什么?
2)为什么不映射L3的物理地址oxFF400000?
|
|