2014-12-31 12:10:54 -05:00
|
|
|
#include <interface.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2014-12-31 13:30:36 -05:00
|
|
|
int i;
|
|
|
|
int data;
|
|
|
|
|
2014-12-31 12:10:54 -05:00
|
|
|
if (argc != 2) {
|
|
|
|
fprintf(stderr, "Usage: %s <uio-dev-file>\n", argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (axis_init(argv[1]) != 0) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-12-31 13:30:36 -05:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2014-12-31 13:16:19 -05:00
|
|
|
if (axis_exit() != 0) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-12-31 12:10:54 -05:00
|
|
|
return 0;
|
|
|
|
}
|