AlcapDAQ  1
A3818Upgrade.h
Go to the documentation of this file.
1 #ifndef _A3818UPGRADE_H_
2 #define _A3818UPGRADE_H_
3 
4 #ifdef LINUX
5 #include <inttypes.h>
6 #include <sys/time.h>
7 #include <unistd.h>
8 #endif
9 #include <stdlib.h>
10 #include <stdio.h>
11 
12 #include <math.h>
13 #include <time.h>
14 #include <sys/types.h>
15 #include <sys/timeb.h>
16 #include <string.h>
17 
18 #include <stdarg.h>
19 #include <CAENVMElib.h>
20 
21 #include <time.h>
22 
23 
24 #include "p30.h"
25 #include <a3818.h>
26 
27 #ifdef LINUX
28 
29 typedef long LONG;
30 typedef unsigned long ULONG;
31 typedef char CHAR;
32 typedef unsigned char UCHAR;
33 typedef unsigned char *PUCHAR;
34 typedef unsigned int BOOL;
35 
36 #endif
37 
38 
39 typedef enum A3818Upgrade_Mode {
40 /* Error Types */
45 
46 
47 // Expected BIN file size for A3818 with Virtex5 xc5vlx50t
48 #define BITSTREAM_BYTES 1756544
49 
50 // Define FIRMWARE regions into flash by using their start address (116-bit word address)
51 #define FIRST_FIRMWARE_PAGE_BASE_WORD_ADDRESS 0x000000
52 #define SECOND_FIRMWARE_PAGE_BASE_WORD_ADDRESS 0x200000
53 #define THIRD_FIRMWARE_PAGE_BASE_WORD_ADDRESS 0x400000
54 #define FOURTH_FIRMWARE_PAGE_BASE_WORD_ADDRESS 0x600000
55 
56 
57 int A3818UpgradeFromFile(int32_t A3818_handle, FILE * binfile, int fwcopy, A3818Upgrade_Mode mode);
58 int A3818UpgradeFromMem(int32_t A3818_handle, char* fwdata, int fwsize, int fwcopy, A3818Upgrade_Mode mode);
59 
60 #endif // _A3818UPGRADE_H_
61