/* atmtest2.c */ /* This program reads one register from the SAP reg set */ #include #include #include "atmuser.h" int iobuf[1024]; void main( int argc, char **argv) { int fd; int regid; fd = open("/dev/ape25", O_RDWR); if (fd < 0) { printf("Device /dev/ape25 could not be opened. \n"); exit(1); } if (argc < 2) { printf("This program reads one SAP set register \n"); printf("You must supply its address in hex as parm 1. \n"); exit(1); } sscanf(argv[1], "%x", iobuf + 0); /* Id of reg to read */ ioctl(fd, AIO_RDSREG, iobuf); printf("Value of SAP reg %x is %x \n", iobuf[0], iobuf[1]); printf("Value of intcount is %d \n", iobuf[2]); }