AlcapDAQ  1
CFASegment.h
Go to the documentation of this file.
1 #ifndef CFASEGMENT_H
2 
3 #include <stdint.h>
4 
5 #define CFA_SHEBANG 0x00414643
6 #define TYPE_2_HEADER_VERSIONS 99
7 
8 typedef enum {
12 
13 typedef struct CFAModelType1_t {
14  int32_t modelId;
15  int32_t numChecks;
16  struct { uint32_t address, value; } registerChecks[]; // Flexi member -- C99
18 
19 typedef struct CFAModelType2_t {
20  int32_t modelId;
22 
23 
24 typedef struct CFASegmentStub_t {
25  int32_t shebang;
26  char description[32];
27  int32_t segmentTypeId;
28  int32_t specsVersion;
29  int32_t headerSizeBytes;
30  int32_t numModels;
31  int32_t fwSizeBytes;
32  int32_t lastHeader;
34 
35 typedef struct CFASegmentType1_t {
36  int32_t shebang;
37  char description[32];
38  int32_t segmentTypeId;
39  int32_t specsVersion;
40  int32_t headerSizeBytes;
41  int32_t numModels;
42  int32_t fwSizeBytes;
43  int32_t lastHeader;
44 
45  int32_t accessType;
46  int32_t flashCsAddress;
47  int32_t flashCwAddress;
48  int32_t flashPageSize;
49  int32_t flashStdAddress;
50  int32_t flashBckAddress;
51  int32_t flashEnLevel;
52 
54  char* fwData;
56 
57 #define CFA_SEGMENT_T1_FAMILY_FIELDS_SIZE 28
58 
59 typedef struct CFASegmentType2_t {
60  int32_t shebang;
61  char description[32];
62  int32_t segmentTypeId;
63  int32_t specsVersion;
64  int32_t headerSizeBytes;
65  int32_t numModels;
66  int32_t fwSizeBytes;
67  int32_t lastHeader;
68 
70  void* fwData;
72 
73 
74 typedef void* CFASegmentPtr;
75 
76 CFASegmentPtr newSegment(FILE* fin, int* last);
77 void deleteSegment(CFASegmentPtr segm);
78 
80 
81 #define toStub(x) ((CFASegmentStub*)x)
82 #define toType1(x) ((CFASegmentType1*)x)
83 #define toType2(x) ((CFASegmentType2*)x)
84 
85 
86 #endif