09-19-2020 09:04 AM
I have connected a custom AXI-4 peripheral implemented on the PL part of a Zynq-7000 processor to the PS part. I need to send data from the PS part to the PL part and vice versa. To do that, I know I can employ the functions Xil_Out32(address, data) and Xil_In32(addr). For example, if I want to send a 3 to the PL from the PS part I'd write something like:
My question is: How can I instead send data in binary format? Is there anyway to do something like this Xil_Out32(my_addr, 100101010001001) ?
Thanks in advance.
09-19-2020 11:52 AM
09-19-2020 12:40 PM
0x is for hex in C... 0b is for binary - I think the latter was introduced in C++14 and isn't official C but there's a gcc page that says 0b is supported for a binary literal.
Though many would argue you should likely be able to write this in hex.
It is also worth noting your example below only had 15 bits... I'd specify all 32-bit to avoid ambiguity on justification/padding.
To be clear, i haven't tried 0b myself - I personally usually use 0x.