1:
9:
10:
14:
15:
#ifndef VIDMGR_H
16:
#define VIDMGR_H
17:
18:
19:
#ifdef __cplusplus
20:
extern "C" {
21:
#endif
22:
23:
#include <stdint.h>
24:
#include <stdbool.h>
25:
#include "AG903_errno.h"
26:
27:
28:
#define AG903_VID_MGR_MAX_IN_PORTS (2)
29:
30:
#define AG903_VID_MGR_MAX_OUT_PORTS (4)
31:
32:
33:
#define AG903_VID_MGR_INPUT_HANDLE_ID (0xB1234BBB)
34:
35:
#define AG903_VID_MGR_OUTPUT_HANDLE_ID (0xB5678BBB)
36:
37:
38:
#define AG903_VID_MGR_INPUT_HANDLE (0)
39:
40:
#define AG903_VID_MGR_OUTPUT_HANDLE (1)
41:
42:
43:
#define AG903_VID_MGR_24BIT_TO_CH0 (0)
44:
45:
#define AG903_VID_MGR_8BITCH0_TO_CH0 (1)
46:
47:
#define AG903_VID_MGR_8BITCH1_TO_CH1 (2)
48:
49:
#define AG903_VID_MGR_8BITCH01_TO_CH01 (3)
50:
51:
#define AG903_VID_MGR_8BITCH0_TO_CH0123 (4)
52:
53:
54:
#define AG903_VID_MGR_IO_SIGNAL_INPUT (0)
55:
56:
#define AG903_VID_MGR_IO_SIGNAL_OUTPUT (1)
57:
58:
59:
#define AG903_VID_MGR_IO_VSYNC_POL_MINUS (0)
60:
61:
#define AG903_VID_MGR_IO_VSYNC_POL_PLUS (1)
62:
63:
#define AG903_VID_MGR_IO_HSYNC_POL_MINUS (0)
64:
65:
#define AG903_VID_MGR_IO_HSYNC_POL_PLUS (1)
66:
67:
68:
#define AG903_VID_MGR_IN_DE_POL_MINUS (0)
69:
70:
#define AG903_VID_MGR_IN_DE_POL_PLUS (1)
71:
72:
73:
#define AG903_VID_MGR_IN_FIELD_POL_MINUS (0)
74:
75:
#define AG903_VID_MGR_IN_FIELD_POL_PLUS (1)
76:
77:
78:
#define AG903_VID_MGR_IN_CLK_POL_MINUS (0)
79:
80:
#define AG903_VID_MGR_IN_CLK_POL_PLUS (1)
81:
82:
83:
#define AG903_VID_MGR_MAX_OUT_HORIZONTAL_PULSE_WIDTH (4096)
84:
85:
86:
#define AG903_VID_MGR_MAX_OUT_HORIZONTAL_FRONT_PORCH (4096)
87:
88:
89:
#define AG903_VID_MGR_MAX_OUT_HORIZONTAL_BACK_PORCH (4096)
90:
91:
92:
#define AG903_VID_MGR_MAX_OUT_HORIZONTAL_FRAME_SIZE (4096)
93:
94:
95:
#define AG903_VID_MGR_MAX_OUT_VERTICAL_PULSE_WIDTH (4096)
96:
97:
98:
#define AG903_VID_MGR_MAX_OUT_VERTICAL_FRONT_PORCH (4096)
99:
100:
101:
#define AG903_VID_MGR_MAX_OUT_VERTICAL_BACK_PORCH (4096)
102:
103:
104:
#define AG903_VID_MGR_MAX_OUT_VERTICAL_FRAME_SIZE (4096)
105:
106:
107:
#define AG903_VID_MGR_TDM_NONE (0)
108:
109:
#define AG903_VID_MGR_TDM_FIT_BLANK_SIGNAL (1)
110:
111:
#define AG903_VID_MGR_TDM_FIT_TRS_SIGNAL (2)
112:
113:
114:
#define AG903_VID_MGR_TRS_EFP_ZERO (0)
115:
116:
#define AG903_VID_MGR_TRS_EFP_ONE (1)
117:
118:
#define AG903_VID_MGR_TRS_OFP_ZERO (0)
119:
120:
#define AG903_VID_MGR_TRS_OFP_ONE (1)
121:
122:
123:
#define AG903_VID_MGR_MAX_TRS_VFP (4096)
124:
125:
126:
#define AG903_VID_MGR_TRS_HREF_EAV (0)
127:
128:
#define AG903_VID_MGR_TRS_HREF_SAV (1)
129:
130:
131:
#define AG903_VID_MGR_MAX_TRS_HFP (4095)
132:
133:
134:
#define AG903_VID_MGR_MAX_SD_VERTICAL_CYCLE (8192)
135:
136:
#define AG903_VID_MGR_MAX_SD_HORIZONTAL_CYCLE (8192)
137:
138:
141:
typedef struct _AG903_VidMgrInputHandle {
142: uint32_t id;
143: _Bool is_dirty;
144: uint32_t port_no;
145: uint32_t sync_signal;
146: uint32_t inout_vsync_pol;
147: uint32_t inout_hsync_pol;
148: uint32_t in_de_pol;
149: uint32_t in_field_pol;
150: uint32_t in_clk_pol;
151: uint32_t h_pulse_width;
152: uint32_t h_front_porch;
153: uint32_t h_back_porch;
154: uint32_t h_frame_size;
155: uint32_t v_pulse_width;
156: uint32_t v_front_porch;
157: uint32_t v_back_porch;
158: uint32_t v_frame_size;
159: }
AG903_VidMgrInputHandle;
160:
161:
164:
typedef struct _AG903_VidMgrOutputHandle {
165: uint32_t id;
166: _Bool is_dirty;
167: uint32_t port_no;
168: uint32_t tdm;
169: _Bool delay;
170: _Bool trs_dec_enable;
171: uint32_t trs_efp;
172: uint32_t trs_ofp;
173: uint32_t trs_vfp;
174: uint32_t trs_href;
175: uint32_t trs_hfp;
176: uint32_t v_max;
177: uint32_t h_max;
178: }
AG903_VidMgrOutputHandle;
179:
180:
181: int32_t
AG903_VidMgrEnable(_Bool enable);
182: int32_t
AG903_VidMgrSetInputFormat(uint32_t format);
183: int32_t
AG903_VidMgrGetInputHandle(int32_t *ports, int32_t num_ports,
AG903_VidMgrInputHandle **handles);
184: int32_t
AG903_VidMgrReleaseInputHandle(
AG903_VidMgrInputHandle *handle);
185: int32_t
AG903_VidMgrGetOutputHandle(int32_t *ports, int32_t num_ports,
AG903_VidMgrOutputHandle **handles);
186: int32_t
AG903_VidMgrReleaseOutputHandle(
AG903_VidMgrOutputHandle *handle);
187: int32_t
AG903_VidMgrCommitSetting(
void);
188: int32_t
AG903_VidMgrCheckHandleValidation(
void *handle, int32_t handle_type);
189: int32_t
AG903_VidMgrSetIOSignal(
AG903_VidMgrInputHandle *handle, uint32_t inout);
190: int32_t
AG903_VidMgrSetIOMode(
AG903_VidMgrInputHandle *handle, uint32_t v_pol, uint32_t h_pol, uint32_t d_pol, uint32_t f_pol, uint32_t c_pol);
191: int32_t
AG903_VidMgrSetIOParameter(
AG903_VidMgrInputHandle *handle, uint32_t h_pw, uint32_t h_fp, uint32_t h_bp, uint32_t h_fs, uint32_t v_pw, uint32_t v_fp, uint32_t v_bp, uint32_t v_fs);
192: int32_t
AG903_VidMgrGetIODotClk(
AG903_VidMgrInputHandle *handle, uint32_t *cwt);
193: int32_t
AG903_VidMgrSetCaptureTDMMode(
AG903_VidMgrOutputHandle *handle, uint32_t tdm);
194: int32_t
AG903_VidMgrEnableCaptureDelay(
AG903_VidMgrOutputHandle *handle, _Bool delay);
195: int32_t
AG903_VidMgrEnableTRSDecode(
AG903_VidMgrOutputHandle *handle, _Bool trs_dec);
196: int32_t
AG903_VidMgrSetTRSParameter(
AG903_VidMgrOutputHandle *handle, uint32_t efp, uint32_t ofp, uint32_t vfp, uint32_t href, uint32_t hfp);
197: int32_t
AG903_VidMgrSetDetectionCycle(
AG903_VidMgrOutputHandle *handle, uint32_t v_max, uint32_t h_max);
198: int32_t
AG903_VidMgrGetOutputState(
AG903_VidMgrOutputHandle *handle, uint32_t *blk_val, uint32_t *trs_val, uint32_t *v_blank, uint32_t *h_blank, uint32_t *tdm_ch);
199:
200:
201:
#ifdef __cplusplus
202: }
203:
#endif
204:
205:
206:
#endif