Forum Discussion
Altera_Forum
Honored Contributor
20 years agoaddress
How can I access "my own component" I/O ports in Nios IDE? What I should write in file "*_regs.h"? How address and offset calculates? eg: //#define IOADDR_PDIUSBD12_DATA(base) __IO...
Altera_Forum
Honored Contributor
20 years ago --- Quote Start --- originally posted by nwpu_zhf2004@Apr 11 2006, 06:17 AM how can i access "my own component" i/o ports in nios ide?
what i should write in file "*_regs.h"?
how address and offset calculates?
eg:
//#define ioaddr_pdiusbd12_data(base) __io_calc_address_native(base, 0)# define iord_usb_usb_data(base) iord(base, 0) # define iowr_usb_usb_data(base, data) iowr(base, 0, data)
//#define ioaddr_pdiusbd12_command(base) __io_calc_address_native(base, 1)# define iord_usb_usb_command(base) iord(base, 1) # define iowr_usb_usb_command(base, data) iowr(base, 1, data)
---why the offset iord_usb_usb_data is "0",iord_usb_usb_command is "1"
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14238)
--- quote end ---
--- Quote End --- Address offset is defined in hardware register file which translates low level software I/O call to corresponding hardware addressing calls.