source: drsdaq/VME/struck/sis1100/V2.04/examples/sis3100_control/sis3100_control_write.c@ 23

Last change on this file since 23 was 22, checked in by ogrimm, 16 years ago
First commit of drsdaq program
  • Property svn:executable set to *
File size: 953 bytes
Line 
1#define _GNU_SOURCE
2#include <stdio.h>
3#include <errno.h>
4#include <string.h>
5#include <sys/types.h>
6#include <unistd.h>
7#include <stdlib.h>
8#include <fcntl.h>
9#include <sys/ioctl.h>
10
11
12
13#include "dev/pci/sis1100_var.h"
14#include "sis3100_vme_calls.h"
15
16
17
18
19/****************************************************************************/
20/****************************************************************************/
21int main(int argc, char* argv[])
22{
23
24int p;
25
26u_int32_t offset ;
27u_int32_t data ;
28
29int return_code ;
30
31if (argc<4)
32 {
33 fprintf(stderr, "usage: %s path addr data \n", argv[0]);
34 return 1;
35 }
36
37if ((p=open(argv[1], O_RDWR, 0))<0) {
38 perror("open");
39 return 1;
40}
41
42offset = strtoul(argv[2],NULL,0) ;
43data = strtoul(argv[3],NULL,0) ;
44
45 return_code = s3100_control_write(p, offset, data) ;
46 printf("s3100_control_write: return_code = 0x%08x\n", return_code );
47
48
49
50close(p);
51return 0;
52}
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Note: See TracBrowser for help on using the repository browser.