Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
725 Views

how to use single byte offset in function IORW?

I found the offset is 4 bytes in IOWR, I want to know how to set the offset single byte? 

 

thanks.
0 Kudos
4 Replies
Highlighted
Valued Contributor III
4 Views

you can use the IOWR_xxDIRECT() macros instead of IOWR for byte addressing (xx being 8,16 or 32 depending on the access size). 

Using an odd address will only work with IOWR_8DIRECT() though, if I remember correctly.
0 Kudos
Highlighted
Valued Contributor III
4 Views

That's correct. This is the alignment you need to use for each: 

 

IOxx_8DIRECT --> any alignment 

IOxx_16DIRECT --> 2 byte alignment 

IOxx_32DIRECT --> 4 byte alignment
0 Kudos
Highlighted
Valued Contributor III
4 Views

Hi, 

 

Anyone knows about the IOWR function declaration/definition? 

 

I need to know how the IDE drivers the data to pins of my component in SoPC. 

For example, if I have a LED_PIO with widht 8 bits, I just write IOWR (LED_PIO_BASE, 0, DATA) and I think the DATA will be sent to pins. But, if I have a component as DM9000A Ethernet controller, with 38 pins, where some are data and some are control, how I can set the correct pins to write a word? 

 

And how can I see the information about the order of component pins in IDE?
0 Kudos
Highlighted
Valued Contributor III
4 Views

With components other than PIOs, you don't directly control the pins through the IOWR macro. You access registers. All the components have a driver with at least an include file that lists the registers and macros to read/write them. 

I don't have any design with a DM9000A but you should check all the include files that are added in your BSP. There must be one of them with a definition of the chip registers.
0 Kudos