-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvf48_Detect.c
52 lines (36 loc) · 916 Bytes
/
vf48_Detect.c
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
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <sys/time.h>
#include <math.h>
#include "vf48.h"
int main(int argc, char* argv[])
{
DWORD vf48base=0xa00000;
MVME_INTERFACE* myvme;
int cmode;
DWORD fwrev;
if(argc!=2)
{
printf("./vf48_isPresent module_id\n");
exit(0);
}
vf48base+=atoi(argv[1])*0x10000;
// open under vmic
mvme_open(&myvme, 0);
mvme_get_dmode(myvme, &cmode);
mvme_set_dmode(myvme, MVME_DMODE_D32);
fwrev = vf48_RegisterRead(myvme, vf48base, VF48_FIRMWARE_R);
printf("\n----------------------> ");
if (fwrev == 0xFFFFFFFF)
printf("VF48 at VME A24 0x%06x not detected\n", vf48base);
else
printf("VF48 at VME A24 0x%06x detected\n", vf48base);
//close under vmic
mvme_close(myvme);
return 0;
}