I'm having what are probably very basic knowledge difficulties. I want to load strings 32bits wide (by strings I mean the binary ascii values of 4 chars grouped together so for example "AB!@"). The issue is I'm not sure how to use allwrite for this, beyond changing the length to 4 (from 1 in the example).
What does work for me is if I use on "strtoul" and hex numbers:
- Code: Select all
unsigned char *buf[1]={ "A5CB2C1D", "AFCB1CBD"};
data = (unsigned char *) strtoul(buf[0], NULL, 10);
allwrite(fd, &data, 4);
This does give me the expected result, the FPGA at the location written to returns "A5CB2C1D" etc. when I use allread.
However, I don't know how to transfer ascii values, and not use strtoul for this, since I want to transfer a string that is 4 bytes long, rather than a number.
How can I approach this?
Thank you.