1 |
jakw |
1 |
/*****************************************************************************
|
|
|
2 |
** TEXAS INSTRUMENTS PROPRIETARY INFORMATION
|
|
|
3 |
**
|
|
|
4 |
** (c) Copyright, Texas Instruments Incorporated, 2012-2013.
|
|
|
5 |
** All Rights Reserved.
|
|
|
6 |
**
|
|
|
7 |
** Property of Texas Instruments Incorporated. Restricted Rights -
|
|
|
8 |
** Use, duplication, or disclosure is subject to restrictions set
|
|
|
9 |
** forth in TI's program license agreement and associated documentation.
|
|
|
10 |
******************************************************************************/
|
|
|
11 |
/**
|
|
|
12 |
*
|
|
|
13 |
* @file lcr_cmd.h
|
|
|
14 |
*
|
|
|
15 |
* @brief Contatins DM365 Command Interface declarations. These can be called from
|
|
|
16 |
* from main or any other functions.
|
|
|
17 |
**/
|
|
|
18 |
/*****************************************************************************/
|
|
|
19 |
|
|
|
20 |
#ifndef LCR_CMD_H_
|
|
|
21 |
#define LCR_CMD_H_
|
|
|
22 |
|
|
|
23 |
#include "common.h"
|
|
|
24 |
#include "error.h"
|
|
|
25 |
|
|
|
26 |
#ifdef __cplusplus
|
|
|
27 |
extern "C" {
|
|
|
28 |
#endif
|
|
|
29 |
|
|
|
30 |
#define LCR_CMD_VERSION_STR_LEN 32
|
|
|
31 |
#define LCR_CMD_SOLUTION_NAME_LEN 32
|
|
|
32 |
|
|
|
33 |
#define ONE_BPP_PTN_SIZE 52046
|
|
|
34 |
#define TWO_BPP_PTN_SIZE 208006
|
|
|
35 |
#define THREE_BPP_PTN_SIZE 208022
|
|
|
36 |
#define FOUR_BPP_PTN_SIZE 208054
|
|
|
37 |
#define FIVE_BPP_PTN_SIZE 416054
|
|
|
38 |
#define SIX_BPP_PTN_SIZE 416182
|
|
|
39 |
#define SEVEN_BPP_PTN_SIZE 416438
|
|
|
40 |
#define EIGHT_BPP_PTN_SIZE 416950
|
|
|
41 |
|
|
|
42 |
typedef enum
|
|
|
43 |
{
|
|
|
44 |
REV_DM365 = 0x00,
|
|
|
45 |
REV_FPGA = 0x10,
|
|
|
46 |
REV_MSP430 = 0x20,
|
|
|
47 |
|
|
|
48 |
}
|
|
|
49 |
LCR_Revision_t;
|
|
|
50 |
|
|
|
51 |
typedef enum
|
|
|
52 |
{
|
|
|
53 |
PWR_NORMAL,
|
|
|
54 |
PWR_STANDBY,
|
|
|
55 |
} LCR_PowerMode_t;
|
|
|
56 |
|
|
|
57 |
typedef enum
|
|
|
58 |
{
|
|
|
59 |
LED_RED,
|
|
|
60 |
LED_GREEN,
|
|
|
61 |
LED_BLUE,
|
|
|
62 |
LED_DEFAULT, //Only used for running custom sequence referred in Demo-8
|
|
|
63 |
} LCR_LEDSelect_t;
|
|
|
64 |
|
|
|
65 |
typedef enum
|
|
|
66 |
{
|
|
|
67 |
SOL_DELETE,
|
|
|
68 |
SOL_LOAD,
|
|
|
69 |
SOL_SET_DEFAULT,
|
|
|
70 |
} LCR_SolutionCommand_t;
|
|
|
71 |
|
|
|
72 |
typedef enum
|
|
|
73 |
{
|
|
|
74 |
DISP_MODE_IMAGE, /* Static Image */
|
|
|
75 |
DISP_MODE_TEST_PTN, /* Internal Test pattern */
|
|
|
76 |
DISP_MODE_VIDEO, /* HDMI Video */
|
|
|
77 |
DISP_MODE_VIDEO_INT_PTN, /* Interleaved pattern */
|
|
|
78 |
DISP_MODE_PTN_SEQ, /* Pattern Sequence */
|
|
|
79 |
DISP_NUM_MODES,
|
|
|
80 |
} LCR_DisplayMode_t;
|
|
|
81 |
|
|
|
82 |
typedef enum
|
|
|
83 |
{
|
|
|
84 |
TEST_PTN_FINE_CHECKER, /* 0x0 - Fine Checkerboard */
|
|
|
85 |
TEST_PTN_SOLID_BLACK, /* 0x1 - Solid black */
|
|
|
86 |
TEST_PTN_SOLID_WHITE, /* 0x2 - Solid white */
|
|
|
87 |
TEST_PTN_SOLID_GREEN, /* 0x3 - Solid green */
|
|
|
88 |
TEST_PTN_SOLID_BLUE, /* 0x4 - Solid blue */
|
|
|
89 |
TEST_PTN_SOLID_RED, /* 0x5 - Solid red */
|
|
|
90 |
TEST_PTN_VERTICAL_LINES, /* 0x6 - Vertical lines (1-white, 7-black) */
|
|
|
91 |
TEST_PTN_HORIZONTAL_LINES, /* 0x7 - Horizontal lines (1-white, 7-black) */
|
|
|
92 |
TEST_PTN_FINE_VERTICAL_LINES, /* 0x8 - Vertical lines (1-white, 1-black) */
|
|
|
93 |
TEST_PTN_FILE_HORIZONTAL_LINES, /* 0x9 - Horizontal lines (1-white, 1-black) */
|
|
|
94 |
TEST_PTN_DIAG_LINES, /* 0xA - Diagonal lines */
|
|
|
95 |
TEST_PTN_VERTICAL_RAMP, /* 0xB - Vertical Gray Ramps */
|
|
|
96 |
TEST_PTN_HORIZONTAL_RAMP, /* 0xC - Horizontal Gray Ramps */
|
|
|
97 |
TEST_PTN_ANXI_CHECKER, /* 0xD - ANSI 4x4 Checkerboard */
|
|
|
98 |
NUM_TEST_PTNS
|
|
|
99 |
} LCR_TestPattern_t;
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
typedef enum
|
|
|
103 |
{
|
|
|
104 |
TRIGGER_TYPE_SW,
|
|
|
105 |
TRIGGER_TYPE_AUTO,
|
|
|
106 |
TRIGGER_TYPE_EXTRNAL,
|
|
|
107 |
TRIGGER_TYPE_EXTRNAL_INV,
|
|
|
108 |
TRIGGER_TYPE_CAMERA,
|
|
|
109 |
TRIGGER_TYPE_CAMERA_INV,
|
|
|
110 |
/* External trigger + exposure on the same line */
|
|
|
111 |
TRIGGER_TYPE_TRIG_EXP,
|
|
|
112 |
NUM_TRIGGER_TYPES
|
|
|
113 |
} LCR_TriggerType_t;
|
|
|
114 |
|
|
|
115 |
typedef enum
|
|
|
116 |
{
|
|
|
117 |
TRIGGER_EDGE_POS,
|
|
|
118 |
TRIGGER_EDGE_NEG
|
|
|
119 |
} LCR_TriggerEdge_t;
|
|
|
120 |
|
|
|
121 |
typedef enum
|
|
|
122 |
{
|
|
|
123 |
CAPTURE_STOP,
|
|
|
124 |
CAPTURE_SINGLE,
|
|
|
125 |
CAPTURE_STREAM,
|
|
|
126 |
} LCR_CaptureMode_t;
|
|
|
127 |
|
|
|
128 |
typedef enum
|
|
|
129 |
{
|
|
|
130 |
PTN_TYPE_NORMAL,
|
|
|
131 |
PTN_TYPE_INVERTED,
|
|
|
132 |
PTN_TYPE_HW,
|
|
|
133 |
} LCR_PatternType_t;
|
|
|
134 |
|
|
|
135 |
typedef uint16 LCR_PatternCount_t;
|
|
|
136 |
|
|
|
137 |
typedef struct
|
|
|
138 |
{
|
|
|
139 |
uint8 BitDepth;
|
|
|
140 |
LCR_PatternCount_t NumPatterns;
|
|
|
141 |
LCR_PatternType_t PatternType;
|
|
|
142 |
LCR_TriggerType_t InputTriggerType;
|
|
|
143 |
uint32 InputTriggerDelay;
|
|
|
144 |
uint32 AutoTriggerPeriod;
|
|
|
145 |
uint32 ExposureTime;
|
|
|
146 |
LCR_LEDSelect_t LEDSelect;
|
|
|
147 |
uint8 Repeat;
|
|
|
148 |
} LCR_PatternSeqSetting_t;
|
|
|
149 |
|
|
|
150 |
typedef struct
|
|
|
151 |
{
|
|
|
152 |
uint8 Number;
|
|
|
153 |
uint8 Invert;
|
|
|
154 |
} LCR_HWPattern_t;
|
|
|
155 |
|
|
|
156 |
typedef struct
|
|
|
157 |
{
|
|
|
158 |
uint8 index; //0-31
|
|
|
159 |
uint8 numOfPatn; //Number of patterns from the start index
|
|
|
160 |
LCR_HWPattern_t hwPatArray[32];
|
|
|
161 |
} LCR_HWPatternSeqDef_t;
|
|
|
162 |
|
|
|
163 |
typedef struct
|
|
|
164 |
{
|
|
|
165 |
uint16 ResolutionX;
|
|
|
166 |
uint16 ResolutionY;
|
|
|
167 |
uint16 FirstPix;
|
|
|
168 |
uint16 FirstLine;
|
|
|
169 |
uint16 ActiveWidth;
|
|
|
170 |
uint16 ActiveHeight;
|
|
|
171 |
} LCR_VideoSetting_t;
|
|
|
172 |
|
|
|
173 |
typedef struct
|
|
|
174 |
{
|
|
|
175 |
uint8 FrameRate;
|
|
|
176 |
uint8 BitDepth;
|
|
|
177 |
uint8 RGB;
|
|
|
178 |
} LCR_VideoModeSetting_t;
|
|
|
179 |
|
|
|
180 |
typedef struct
|
|
|
181 |
{
|
|
|
182 |
uint8 Rotate;
|
|
|
183 |
uint8 LongAxisFlip;
|
|
|
184 |
uint8 ShortAxisFlip;
|
|
|
185 |
} LCR_DisplaySetting_t;
|
|
|
186 |
|
|
|
187 |
typedef struct
|
|
|
188 |
{
|
|
|
189 |
uint16 Red;
|
|
|
190 |
uint16 Green;
|
|
|
191 |
uint16 Blue;
|
|
|
192 |
} LCR_LEDCurrent_t;
|
|
|
193 |
|
|
|
194 |
typedef struct
|
|
|
195 |
{
|
|
|
196 |
uint8 Enable;
|
|
|
197 |
uint8 Source;
|
|
|
198 |
uint8 Polarity;
|
|
|
199 |
uint32 Delay;
|
|
|
200 |
uint32 PulseWidth;
|
|
|
201 |
uint8 Reserved[12];
|
|
|
202 |
} LCR_CamTriggerSetting_t;
|
|
|
203 |
|
|
|
204 |
typedef struct
|
|
|
205 |
{
|
|
|
206 |
LCR_DisplayMode_t DisplayMode;
|
|
|
207 |
LCR_DisplaySetting_t Display;
|
|
|
208 |
LCR_LEDCurrent_t LEDCurrent;
|
|
|
209 |
LCR_TestPattern_t TestPattern;
|
|
|
210 |
LCR_VideoSetting_t Video;
|
|
|
211 |
LCR_PatternSeqSetting_t PatternSeq;
|
|
|
212 |
LCR_CamTriggerSetting_t CamTrigger;
|
|
|
213 |
LCR_VideoModeSetting_t VideoMode;
|
|
|
214 |
uint32 StaticColor;
|
|
|
215 |
uint8 Reserved[32];
|
|
|
216 |
} LCR_Setting_t;
|
|
|
217 |
|
|
|
218 |
|
|
|
219 |
ErrorCode_t LCR_CMD_Open(void);
|
|
|
220 |
ErrorCode_t LCR_CMD_Close(void);
|
|
|
221 |
|
|
|
222 |
ErrorCode_t LCR_CMD_GetRevision(LCR_Revision_t Which, char *VersionStr);
|
|
|
223 |
|
|
|
224 |
ErrorCode_t LCR_CMD_SetDisplayMode(LCR_DisplayMode_t Mode);
|
|
|
225 |
LCR_DisplayMode_t LCR_CMD_GetDisplayMode(void);
|
|
|
226 |
|
|
|
227 |
ErrorCode_t LCR_CMD_SetPowerMode(LCR_PowerMode_t Mode);
|
|
|
228 |
LCR_PowerMode_t LCR_CMD_GetPowerMode(void);
|
|
|
229 |
|
|
|
230 |
ErrorCode_t LCR_CMD_SetTestPattern(LCR_TestPattern_t TestPtn);
|
|
|
231 |
LCR_TestPattern_t LCR_CMD_GetTestPattern(void);
|
|
|
232 |
|
|
|
233 |
ErrorCode_t LCR_CMD_SetLEDCurrent(LCR_LEDCurrent_t *LEDSetting);
|
|
|
234 |
ErrorCode_t LCR_CMD_GetLEDCurrent(LCR_LEDCurrent_t *LEDSetting);
|
|
|
235 |
|
|
|
236 |
ErrorCode_t LCR_CMD_DisplayStaticImage(char const *fileNameWithPath);
|
|
|
237 |
|
|
|
238 |
ErrorCode_t LCR_CMD_DisplayStaticColor(uint32 Color);
|
|
|
239 |
|
|
|
240 |
ErrorCode_t LCR_CMD_SetDisplaySetting(LCR_DisplaySetting_t const *Setting);
|
|
|
241 |
ErrorCode_t LCR_CMD_GetDisplaySetting(LCR_DisplaySetting_t *Setting);
|
|
|
242 |
|
|
|
243 |
ErrorCode_t LCR_CMD_SetVideoSetting(LCR_VideoSetting_t const *Setting);
|
|
|
244 |
ErrorCode_t LCR_CMD_GetVideoSetting(LCR_VideoSetting_t *Setting);
|
|
|
245 |
|
|
|
246 |
ErrorCode_t LCR_CMD_SetVideoMode(LCR_VideoModeSetting_t *Setting);
|
|
|
247 |
ErrorCode_t LCR_CMD_GetVideoMode(LCR_VideoModeSetting_t *Setting);
|
|
|
248 |
|
|
|
249 |
ErrorCode_t LCR_CMD_SetInterleavePatternOrder(uint8 NumPatterns, uint8 const *PatternOrder);
|
|
|
250 |
ErrorCode_t LCR_CMD_GetInterleavePatternOrder(uint8 *NumPatterns, uint8 *PatternOrder);
|
|
|
251 |
|
|
|
252 |
ErrorCode_t LCR_CMD_SetPatternSeqSetting(LCR_PatternSeqSetting_t const *Setting);
|
|
|
253 |
ErrorCode_t LCR_CMD_GetPatternSeqSetting(LCR_PatternSeqSetting_t *Setting);
|
|
|
254 |
|
|
|
255 |
ErrorCode_t LCR_CMD_DefinePatternBMP(LCR_PatternCount_t PatternNum, char const *fileNameWithPath);
|
|
|
256 |
//ErrorCode_t LCR_CMD_DefinePatternPix(LCR_PatternCount_t PatternNum, uint32 X, uint32 Y,
|
|
|
257 |
// uint8 *Data, uint32 Count);
|
|
|
258 |
ErrorCode_t LCR_CMD_ReadPattern(LCR_PatternCount_t PatternNum, char *fileName);
|
|
|
259 |
|
|
|
260 |
ErrorCode_t LCR_CMD_StartPatternSeq(uint8 Start);
|
|
|
261 |
|
|
|
262 |
ErrorCode_t LCR_CMD_AdvancePatternSeq(void);
|
|
|
263 |
|
|
|
264 |
ErrorCode_t LCR_CMD_GetCamTriggerSetting(LCR_CamTriggerSetting_t *Setting);
|
|
|
265 |
ErrorCode_t LCR_CMD_SetCamTriggerSetting(LCR_CamTriggerSetting_t *Setting);
|
|
|
266 |
|
|
|
267 |
//ErrorCode_t LCR_CMD_DisplayPattern(BOOL Enable, LCR_PatternCount_t PtnNumber);
|
|
|
268 |
//
|
|
|
269 |
//ErrorCode_t LCR_CMD_CaptureImage(Image_t *Image, LCR_CaptureMode_t Mode);
|
|
|
270 |
//
|
|
|
271 |
ErrorCode_t LCR_CMD_SaveSolution(char *SolutionName);
|
|
|
272 |
ErrorCode_t LCR_CMD_GetSolutionNames(uint8 *Count, uint8 *DefaultSolution, char *SolutionName);
|
|
|
273 |
ErrorCode_t LCR_CMD_ManageSolution(LCR_SolutionCommand_t Cmd, char *SolutionName);
|
|
|
274 |
|
|
|
275 |
ErrorCode_t LCR_CMD_DefineHWPatSequence(LCR_HWPatternSeqDef_t *hwPatSeqDef);
|
|
|
276 |
|
|
|
277 |
ErrorCode_t LCR_CMD_LoadCustomSequence(char *seqBinFileName);
|
|
|
278 |
ErrorCode_t LCR_CMD_SetupCustomSequencevectors(uint8 startVector, uint8 numOfvectors);
|
|
|
279 |
|
|
|
280 |
#ifdef __cplusplus
|
|
|
281 |
}
|
|
|
282 |
#endif
|
|
|
283 |
|
|
|
284 |
#endif /* LCR_CMD_H_ */
|