SDC C-Project CF Review 프로그램
kojingeun
2023-07-14 f77e8008cac062596058fca2aeddda62b80bedbf
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/******************************************************************************
 *    
 *    (C) Copyright WDI 2012
 *    
 ******************************************************************************
 *
 *    FILE:        atf_def.h
 *
 *    PROJECT:    AFT Sensors
 *
 *    SUBPROJECT:    .
 *
 *    Description: ATF related definitions
 *    
 ******************************************************************************
 *    
 *    Change Activity
 *    Defect  Date       Developer        Description
 *    Number  DD/MM/YYYY Name
 *    ======= ========== ================ =======================================
 *          19/04/2012 Chris O.        Initial version
 *                                     
 *****************************************************************************/
 
#pragma once
 
#ifdef __cplusplus
    extern "C" {
#endif
 
// data type
typedef enum 
{
    DtNoDataEnm                    = 0x00,
    DtByteEnm                    = 0x10,
    DtWordEnm                    = 0x20,
    DtDwordEnm                    = 0x30,
    DtDataType                    = 0x30,
    DtArrayEnm                    = 0x40,
    DtOffsetEnm                    = 0x80,
    DtSignedEnm                    = 0x80,
    DtLastDataEnm                = 0x80,
} EppDataType;
 
// sensor status packed data
typedef struct 
{
    unsigned short  miv : 1;
    unsigned short  in_focus : 1;
    unsigned short  sync : 1;
    unsigned short  laser_enabled : 1;
    unsigned short  invalid_data : 1;
             short  position : 11; 
} RsData, *RsDataPtr;
// sensor position max value
#define MAX_RS_POS  511
// sensor position min value
#define MIN_RS_POS  -512
 
// fpga config flags
enum FpgaConfigFlagsEnm 
{
    FpgaConfig_Analog             = 0x00000001,
    FpgaConfig_MtrCtl             = 0x00000002,
    FpgaConfig_XY_MtrCtl          = 0x00000004,
    FpgaConfig_Std_Mcm            = 0x00000008,
    FpgaConfig_Maaf               = 0x00000010,
    FpgaConfig_Mfc_Mcm            = 0x00000020,
    FpgaConfig_StepDir_Mcm        = 0x00000040,
    FpgaConfig_HW_Link_Mcm        = 0x00000080,
    FpgaConfig_Any_Mcm            = 0x0000007e,
 
    FpgaConfigMfc_Led1            = 0x00000100,
    FpgaConfigMfc_Led2            = 0x00000200,
    FpgaConfigMfc_Led3            = 0x00000400,
    FpgaConfigMfc_12VReg          = 0x00000800,
    FpgaConfigMfc_Epld            = 0x00001000,
    FpgaConfigMfc_Whistle         = 0x00002000,
    FpgaConfigMfc_IntZDrive       = 0x00004000,
    FpgaConfigMfc_Reserved        = 0x00008000,
    FpgaConfigMfc_Flags           = 0x0000ff00,
 
    FpgaConfigMfcLinkDown         = 0x00010000,
 
    FpgaConfig_XY_Encoder         = 0x01000000,
};
 
// hardware status flags
enum HwStatusFlagsEnm 
{
    HwOK                    = 0x00000001,   // exec: hardware seems to be OK
    HwCasErr                = 0x00000002,   // exec: PPR_SR_CAS_TIME_ERR
 
    HwLaserDioDisabled      = 0x00000010,   // exec: PPR_SR_DIOR_LASER_ENABLE
 
    HwSyncDioAsserted       = 0x00000100,   // exec: ^PPR_SR_DIOR_SYNC
    HwSyncDioLastFrame      = 0x00000200,   // exec: PPR_SR_DIOR_SYNC_LASTFRAME
    HwSyncEnabled           = 0x00000400,   // exec: FCS_CR_SYNC_SENSE_ENABLE
 
    HwMotionZ               = 0x00001000,   // exec: FMP_CR_MOTION_BUSY
    HwMotionX               = 0x00002000,   // exec: FMP_CR_X_MOVE
    HwMotionY               = 0x00004000,   // exec: FMP_CR_Y_MOVE
 
    HwMotionCWLimit         = 0x00010000,   // exec: FMP_CR_CW_LIMIT_SWITCH
    HwMotionCWLimitSense    = 0x00020000,   // exec: FMP_CR_CW_SENSE    
    HwMotionCCWLimit        = 0x00040000,   // exec: FMP_CR_CCW_LIMIT_SWITCH
    HwMotionCCWLimitSense   = 0x00080000,   // exec: FMP_CR_CCW_SENSE
 
    HwMotionInhibit         = 0x00100000,   // exec: FMP_CR_MOTION_INHIBIT
    HwMotionInhibitSense    = 0x00200000,   // exec: FMP_CR_MOTION_INHIBIT_SENSE    
};
 
// sensor status flags
enum StatusFlagsEnm 
{
    MsHwOK                  = 0x00000001,   // exec: hardware seems to be OK
    MsSwOK                  = 0x00000002,   // exec: software finds all OK    
    MsXYMotion              = 0x00000004,   // exec: XY motion
    MsZMotion               = 0x00000008,   // exec: Z  motion
 
    MsEnableLaser           = 0x00000010,   // param: turn laser On, Off
    MsLaserDisabledMode     = 0x00000020,   // exec: entered laser disabled mode    
    MsEnableSyncSensitivity = 0x00000040,   // param: sync is enabled
    MsSyncMode              = 0x00000080,   // exec: entered sync mode
 
    MsExecuteAf             = 0x00000100,   // param    
    MsLaserTracking         = 0x00000200,   // param
    MsZTracking             = 0x00000400,   // param
    MsNearWindow            = 0x00000800,   // exec: set if near mode is used (7D or dominate)
 
    MsMiv                   = 0x00001000,   // exec
    MsInFocus               = 0x00002000,   // exec
    MsFocusRefining         = 0x00004000,   // exec: obsoleted
    MsCachedData            = 0x00008000,   // exec: signifies that data is generated from last frame, and temporary unavailable
};
 
// sensor window definitions
#define     FAR_WINDOW                  0       // far mode window
#define     NEAR_WINDOW                 1       // near mode window
#define     FAR3D_WINDOW                2       // indicate far window working in 3D mode
#define     SV_WINDOW                   3       // single frame window
 
#define MAX_SCANLINE_LENGTH                1400
 
// error codes return by sensor
enum AtfCodesEnm 
{
    AfStatusOK                    = 0,
    AfStatusSaturated            = 1,
    AfStatusLowIntensity        = 2,
    AfStatusOutOfBound            = 3,
    AfStatusFailed                = 5,
    AfNotSupported                = 6,
    AfSyntaxError                = 7,
    AfNotAvailable                = 11,
};
 
#define AtfNamesTable                    \
    static const char* g_AtfStatusName[] = {\
    "0-OK",                                \
    "1-Saturated",                        \
    "2-LowIntensity",                    \
    "3-OutOfBound",                        \
    0,                                    \
    "5-Failed",                            \
    "6-NotSupported",                    \
    "7-SyntaxError",                    \
    0,                                    \
    0,                                    \
    0,                                    \
    "11-Not Available",                    \
    };
 
typedef enum {
    WindowFarEnm    = 0,    // far mode window
    WindowAtf4Enm    = 0,    // atf4 window
    WindowNear1Enm    = 1,    // near mode single window
    WindowNear7Enm    = 2,    // near mode seven segment window
    WindowNear3Enm    = 2,    // near mode 3 segments window
} WindowEnm;
 
enum CmAutoDetectEnum
{
    CmAutoDetectStatusDone        = 0,    // ready to be run
    CmAutoDetectStop            = 1,    // 
    CmAutoDetectStatusInitial    = 4,    // not ran yet, ready to be run
    CmAutoDetectStatusPending    = 11,    // will be in progress
    CmAutoDetectStatusFailed    = 10,    // failed due to some error
    CmAutoDetectStatusBusy        = 13,    // in progress
    // other codes indicate error
};
enum CmRetarderEnum
{
    CmRetarderStatusUnavailable = 0,    // no retardation installed (not a wasp)
    CmRetarderStatusCalibrating = 1,    // undergoing calibration
    CmRetarderStatusActive        = 2,    // ready for operation
    CmRetarderStatusInactive    = 3,    // turned off
};
 
enum ConfigExtEnum {
    CeePZ1_Activate     = 0x0400,             // activate PZ1 (turns on PZ1 and sets it to 0)
    CeePZ2_Activate     = 0x0800,             // activate PZ2 (turns on PZ2 and sets it to 0)
    CeeZAA_Move         = 0x0100,             // use Zaa for motion
    CeePZ_Move          = 0x0200,             // use Pz for motion
    CeeAO_Out           = 0x0000,             // use analog out for sensor position
} ;
 
enum StageSelectorEnum {
    SseZAA                = 1,
    SsePZ                = 2,
};
 
#ifdef __cplusplus
    }
#endif