source: drsdaq/VME/struck/sis1100/V2.02/examples/camac_simple_routines/sis5100_ios.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: 904 bytes
Line 
1/**************************/
2/* SIS5100 flash user LED */
3/**************************/
4
5#define _GNU_SOURCE
6#include <stdio.h>
7#include <errno.h>
8#include <string.h>
9#include <sys/types.h>
10#include <unistd.h>
11#include <stdlib.h>
12#include <fcntl.h>
13#include <sys/ioctl.h>
14
15
16#include "dev/pci/sis1100_var.h"
17#include "sis5100_camac_calls.h"
18
19
20/****************************************************************************/
21int main(int argc, char* argv[])
22{
23
24int p;
25int res;
26
27
28if (argc<2) {
29 fprintf(stderr, "usage: %s path\n", argv[0]);
30 return 1;
31}
32
33if ((p=open(argv[1], O_RDWR, 0))<0) {
34 perror("open");
35 return 1;
36}
37
38
39while(1){
40 res=s5100_control_write(p,0x100,0x80);
41 if (res!=0) {
42 printf("error: %x\n",res);
43 }
44 sleep(1);
45 res=s5100_control_write(p,0x100,0x800000);
46 if (res!=0) {
47 printf("error: %x\n",res);
48 }
49 sleep(1);
50}
51
52close(p);
53return 0;
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
86
87
88
Note: See TracBrowser for help on using the repository browser.