FPGA registers access from Linux userspace on OPOS93 SP

From ArmadeusWiki
Revision as of 18:02, 9 October 2025 by KevinJ (talk | contribs) (→‎Setting address)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Introduction

The flexio_armabus kernel driver is mapping the FPGA address space in a file /dev/armabus. For further informations, see OPOS93_SP Interfaces description.

Setting address

Address should be set using the lseek() C function on the /dev/armabus file.

int fd = open("/dev/armabus", O_RDWR);
lseek(fd, 8, SEEK_SET); // Set address to 0x0008

Read/write

Access to the bus should be done using read() and write() functions. Write or read size should be multiple of 4.

write(fd, buf, 8); // Write 2 words of 32b
read(fd, buf, 4); // Read 1 word of 32b