-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestV262.cpp
75 lines (68 loc) · 1.77 KB
/
testV262.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <iostream>
#include "myV262.h"
// v262 xio(0x400000,"/Bit3/a24d16/1");
v262 xio(0x400000,"/V2718/cvA24_U_DATA/1");
v262 zio(0x400000,"/V2718/cvA24_U_DATA/1");
// v262 zio(0x400000,"/dev/vmedrvb24d16");
using namespace std;
int32_t main( int32_t argc, char** argv )
{
int16_t reg;
if (argc != 1)
{
reg = atoi(argv[1]);
if ((reg >= 0) && (reg <4))
{
zio.enableNIMOut(reg);
sleep(1);
zio.disableNIMOut(reg);
}
return 0;
}
do {
uint16_t w;
zio.read16phys(0xA, &w);
cout << hex << " V262CAEN " << w << endl;
uint16_t z;
sleep(1);
xio.read16phys(0xA, &z);
cout << hex << " V262 " << z << endl;
sleep(1);
zio.read16phys(0xA, &w);
cout << hex << " V262CAEN " << w << endl;
sleep(1);
xio.read16phys(0xA, &z);
cout << hex << " V262 " << z << endl;
sleep(1);
zio.read16phys(0xA, &w);
cout << hex << " V262CAEN " << w << endl;
sleep(1);
xio.read16phys(0xA, &z);
cout << hex << " V262 " << z << endl;
sleep(1);
uint16_t physT1T2 = zio.getNIMIn(0);
cout << hex << " V262CAEN physT1T2 " << physT1T2 << endl;
sleep(1);
uint16_t xphysT1T2 = xio.getNIMIn(0);
cout << hex << " V262 physT1T2 " << xphysT1T2 << endl;
sleep(1);
uint16_t busy = zio.getNIMIn(1);
cout << hex << " V262CAEN busy " << busy << endl;
sleep(1);
uint16_t xbusy = xio.getNIMIn(1);
cout << hex << " V262 busy " << xbusy << endl;
sleep(1);
uint16_t isSpill = zio.getNIMIn(2);
cout << hex << " V262CAEN isSpill " << isSpill << endl;
sleep(1);
uint16_t xisSpill = xio.getNIMIn(2);
cout << hex << " V262 isSpill " << xisSpill << endl;
sleep(1);
uint16_t ped = zio.getNIMIn(3);
cout << hex << " V262CAEN ped " << ped << endl;
sleep(1);
uint16_t xped = xio.getNIMIn(3);
cout << hex << " V262 ped " << xped << endl;
} while(1);
return 0;
}