1
0
mirror of https://github.com/bmartini/zynq-axis.git synced 2024-09-05 19:19:27 +08:00
zynq-axis/app/test-cfg.c
Berin Martini c943552e52 Add cfg bus read/write function to interface lib
Test new functions in test-cfg application.
2014-12-31 13:30:36 -05:00

35 lines
492 B
C

#include <interface.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int i;
int data;
if (argc != 2) {
fprintf(stderr, "Usage: %s <uio-dev-file>\n", argv[0]);
exit(1);
}
if (axis_init(argv[1]) != 0) {
return 1;
}
for (i = 0; i < REGISTER_NB; i++) {
cfg_write(i, ((i * 2) + 1));
}
for (i = 0; i < REGISTER_NB; i++) {
data = cfg_read(i);
printf("reg %d: %d: %x\n", i, data, data);
}
if (axis_exit() != 0) {
return 1;
}
return 0;
}