1 /*
2 *
3 * SPDX-License-Identifier: GPL-2.0
4 *
5 * Copyright (C) 2011-2018 ARM or its affiliates
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 */
19
20 #ifndef __ACAMERA_ISP1_CONFIG_H__
21 #define __ACAMERA_ISP1_CONFIG_H__
22
23
24 #include "system_sw_io.h"
25
26 #include "system_hw_io.h"
27
28 // ------------------------------------------------------------------------------ //
29 // Instance 'isp1' of module 'single_context_config'
30 // ------------------------------------------------------------------------------ //
31
32 #define ACAMERA_ISP1_BASE_ADDR (0x18e88L)
33 #define ACAMERA_ISP1_SIZE (0x4000)
34
35 // ------------------------------------------------------------------------------ //
36 // Group: top
37 // ------------------------------------------------------------------------------ //
38
39 // ------------------------------------------------------------------------------ //
40 // Miscellaneous top-level ISP controls
41 // ------------------------------------------------------------------------------ //
42
43 // ------------------------------------------------------------------------------ //
44 // Register: Active Width
45 // ------------------------------------------------------------------------------ //
46
47 // ------------------------------------------------------------------------------ //
48 // Active video width in pixels
49 // ------------------------------------------------------------------------------ //
50
51 #define ACAMERA_ISP_TOP_ACTIVE_WIDTH_DEFAULT (0x780)
52 #define ACAMERA_ISP_TOP_ACTIVE_WIDTH_DATASIZE (16)
53 #define ACAMERA_ISP_TOP_ACTIVE_WIDTH_OFFSET (0x0)
54 #define ACAMERA_ISP_TOP_ACTIVE_WIDTH_MASK (0xffff)
55
56 // args: data (16-bit)
acamera_isp_top_active_width_write(uintptr_t base,uint16_t data)57 static __inline void acamera_isp_top_active_width_write(uintptr_t base, uint16_t data) {
58 uint32_t curr = system_sw_read_32(base + 0x18e88L);
59 system_sw_write_32(base + 0x18e88L, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
60 }
acamera_isp_top_active_width_read(uintptr_t base)61 static __inline uint16_t acamera_isp_top_active_width_read(uintptr_t base) {
62 return (uint16_t)((system_sw_read_32(base + 0x18e88L) & 0xffff) >> 0);
63 }
64 // ------------------------------------------------------------------------------ //
65 // Register: Active Height
66 // ------------------------------------------------------------------------------ //
67
68 // ------------------------------------------------------------------------------ //
69 // Active video height in lines
70 // ------------------------------------------------------------------------------ //
71
72 #define ACAMERA_ISP_TOP_ACTIVE_HEIGHT_DEFAULT (0x438)
73 #define ACAMERA_ISP_TOP_ACTIVE_HEIGHT_DATASIZE (16)
74 #define ACAMERA_ISP_TOP_ACTIVE_HEIGHT_OFFSET (0x0)
75 #define ACAMERA_ISP_TOP_ACTIVE_HEIGHT_MASK (0xffff0000)
76
77 // args: data (16-bit)
acamera_isp_top_active_height_write(uintptr_t base,uint16_t data)78 static __inline void acamera_isp_top_active_height_write(uintptr_t base, uint16_t data) {
79 uint32_t curr = system_sw_read_32(base + 0x18e88L);
80 system_sw_write_32(base + 0x18e88L, (((uint32_t) (data & 0xffff)) << 16) | (curr & 0xffff));
81 }
acamera_isp_top_active_height_read(uintptr_t base)82 static __inline uint16_t acamera_isp_top_active_height_read(uintptr_t base) {
83 return (uint16_t)((system_sw_read_32(base + 0x18e88L) & 0xffff0000) >> 16);
84 }
85 // ------------------------------------------------------------------------------ //
86 // Register: RGGB start pre mirror
87 // ------------------------------------------------------------------------------ //
88
89 // ------------------------------------------------------------------------------ //
90 // Starting color of the rggb pattern for all the modules before mirror
91 // ------------------------------------------------------------------------------ //
92
93 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_DEFAULT (0x0)
94 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_DATASIZE (2)
95 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_OFFSET (0x4)
96 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_MASK (0x3)
97 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_R_GR_GB_B (0)
98 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_GR_R_B_GB (1)
99 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_GB_B_R_GR (2)
100 #define ACAMERA_ISP_TOP_RGGB_START_PRE_MIRROR_B_GB_GR_R (3)
101
102 // args: data (2-bit)
acamera_isp_top_rggb_start_pre_mirror_write(uintptr_t base,uint8_t data)103 static __inline void acamera_isp_top_rggb_start_pre_mirror_write(uintptr_t base, uint8_t data) {
104 uint32_t curr = system_sw_read_32(base + 0x18e8cL);
105 system_sw_write_32(base + 0x18e8cL, (((uint32_t) (data & 0x3)) << 0) | (curr & 0xfffffffc));
106 }
acamera_isp_top_rggb_start_pre_mirror_read(uintptr_t base)107 static __inline uint8_t acamera_isp_top_rggb_start_pre_mirror_read(uintptr_t base) {
108 return (uint8_t)((system_sw_read_32(base + 0x18e8cL) & 0x3) >> 0);
109 }
110 // ------------------------------------------------------------------------------ //
111 // Register: RGGB start post mirror
112 // ------------------------------------------------------------------------------ //
113
114 // ------------------------------------------------------------------------------ //
115 // Starting color of the rggb pattern for all the modules after mirror
116 // this must be same as RGGB start pre mirror if mirror is bypassed
117 //
118 // ------------------------------------------------------------------------------ //
119
120 #define ACAMERA_ISP_TOP_RGGB_START_POST_MIRROR_DEFAULT (0x0)
121 #define ACAMERA_ISP_TOP_RGGB_START_POST_MIRROR_DATASIZE (2)
122 #define ACAMERA_ISP_TOP_RGGB_START_POST_MIRROR_OFFSET (0x4)
123 #define ACAMERA_ISP_TOP_RGGB_START_POST_MIRROR_MASK (0x300)
124
125 // args: data (2-bit)
acamera_isp_top_rggb_start_post_mirror_write(uintptr_t base,uint8_t data)126 static __inline void acamera_isp_top_rggb_start_post_mirror_write(uintptr_t base, uint8_t data) {
127 uint32_t curr = system_sw_read_32(base + 0x18e8cL);
128 system_sw_write_32(base + 0x18e8cL, (((uint32_t) (data & 0x3)) << 8) | (curr & 0xfffffcff));
129 }
acamera_isp_top_rggb_start_post_mirror_read(uintptr_t base)130 static __inline uint8_t acamera_isp_top_rggb_start_post_mirror_read(uintptr_t base) {
131 return (uint8_t)((system_sw_read_32(base + 0x18e8cL) & 0x300) >> 8);
132 }
133 // ------------------------------------------------------------------------------ //
134 // Register: Cfa pattern
135 // ------------------------------------------------------------------------------ //
136
137 // ------------------------------------------------------------------------------ //
138 // The pixel arrangement of the CFA array on the sensor. Set in the Top register group and used by several blocks in the pipeline:
139 // ------------------------------------------------------------------------------ //
140
141 #define ACAMERA_ISP_TOP_CFA_PATTERN_DEFAULT (0x0)
142 #define ACAMERA_ISP_TOP_CFA_PATTERN_DATASIZE (2)
143 #define ACAMERA_ISP_TOP_CFA_PATTERN_OFFSET (0x4)
144 #define ACAMERA_ISP_TOP_CFA_PATTERN_MASK (0x30000)
145 #define ACAMERA_ISP_TOP_CFA_PATTERN_RGGB (0)
146 #define ACAMERA_ISP_TOP_CFA_PATTERN_RESERVED (1)
147 #define ACAMERA_ISP_TOP_CFA_PATTERN_RIRGB (2)
148 #define ACAMERA_ISP_TOP_CFA_PATTERN_RGIRB (3)
149
150 // args: data (2-bit)
acamera_isp_top_cfa_pattern_write(uintptr_t base,uint8_t data)151 static __inline void acamera_isp_top_cfa_pattern_write(uintptr_t base, uint8_t data) {
152 uint32_t curr = system_sw_read_32(base + 0x18e8cL);
153 system_sw_write_32(base + 0x18e8cL, (((uint32_t) (data & 0x3)) << 16) | (curr & 0xfffcffff));
154 }
acamera_isp_top_cfa_pattern_read(uintptr_t base)155 static __inline uint8_t acamera_isp_top_cfa_pattern_read(uintptr_t base) {
156 return (uint8_t)((system_sw_read_32(base + 0x18e8cL) & 0x30000) >> 16);
157 }
158 // ------------------------------------------------------------------------------ //
159 // Register: Linear data src
160 // ------------------------------------------------------------------------------ //
161
162 // ------------------------------------------------------------------------------ //
163 // Linear data src
164 // ------------------------------------------------------------------------------ //
165
166 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_DEFAULT (0x0)
167 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_DATASIZE (2)
168 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_OFFSET (0x4)
169 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_MASK (0x3000000)
170 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_SENSOR_STITCHED_AND_LINEAR_DATA_DIRECTLY_COMING_FROM_SENSOR (0)
171 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_LINEAR_DATA_FROM_FRAME_STITCH (1)
172 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_SENSOR_COMPANDED_DATA_LINEARISED_THROUGH_DECOMPANDER (2)
173 #define ACAMERA_ISP_TOP_LINEAR_DATA_SRC_RESERVED (3)
174
175 // args: data (2-bit)
acamera_isp_top_linear_data_src_write(uintptr_t base,uint8_t data)176 static __inline void acamera_isp_top_linear_data_src_write(uintptr_t base, uint8_t data) {
177 uint32_t curr = system_sw_read_32(base + 0x18e8cL);
178 system_sw_write_32(base + 0x18e8cL, (((uint32_t) (data & 0x3)) << 24) | (curr & 0xfcffffff));
179 }
acamera_isp_top_linear_data_src_read(uintptr_t base)180 static __inline uint8_t acamera_isp_top_linear_data_src_read(uintptr_t base) {
181 return (uint8_t)((system_sw_read_32(base + 0x18e8cL) & 0x3000000) >> 24);
182 }
183 // ------------------------------------------------------------------------------ //
184 // Register: Bypass video test gen
185 // ------------------------------------------------------------------------------ //
186
187 // ------------------------------------------------------------------------------ //
188 // Bypass video test generator
189 // ------------------------------------------------------------------------------ //
190
191 #define ACAMERA_ISP_TOP_BYPASS_VIDEO_TEST_GEN_DEFAULT (0)
192 #define ACAMERA_ISP_TOP_BYPASS_VIDEO_TEST_GEN_DATASIZE (1)
193 #define ACAMERA_ISP_TOP_BYPASS_VIDEO_TEST_GEN_OFFSET (0x24)
194 #define ACAMERA_ISP_TOP_BYPASS_VIDEO_TEST_GEN_MASK (0x1)
195
196 // args: data (1-bit)
acamera_isp_top_bypass_video_test_gen_write(uintptr_t base,uint8_t data)197 static __inline void acamera_isp_top_bypass_video_test_gen_write(uintptr_t base, uint8_t data) {
198 uint32_t curr = system_sw_read_32(base + 0x18eacL);
199 system_sw_write_32(base + 0x18eacL, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
200 }
acamera_isp_top_bypass_video_test_gen_read(uintptr_t base)201 static __inline uint8_t acamera_isp_top_bypass_video_test_gen_read(uintptr_t base) {
202 return (uint8_t)((system_sw_read_32(base + 0x18eacL) & 0x1) >> 0);
203 }
204 // ------------------------------------------------------------------------------ //
205 // Register: Bypass input formatter
206 // ------------------------------------------------------------------------------ //
207
208 // ------------------------------------------------------------------------------ //
209 // Bypass input formatter module.
210 // ------------------------------------------------------------------------------ //
211
212 #define ACAMERA_ISP_TOP_BYPASS_INPUT_FORMATTER_DEFAULT (0)
213 #define ACAMERA_ISP_TOP_BYPASS_INPUT_FORMATTER_DATASIZE (1)
214 #define ACAMERA_ISP_TOP_BYPASS_INPUT_FORMATTER_OFFSET (0x24)
215 #define ACAMERA_ISP_TOP_BYPASS_INPUT_FORMATTER_MASK (0x2)
216
217 // args: data (1-bit)
acamera_isp_top_bypass_input_formatter_write(uintptr_t base,uint8_t data)218 static __inline void acamera_isp_top_bypass_input_formatter_write(uintptr_t base, uint8_t data) {
219 uint32_t curr = system_sw_read_32(base + 0x18eacL);
220 system_sw_write_32(base + 0x18eacL, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
221 }
acamera_isp_top_bypass_input_formatter_read(uintptr_t base)222 static __inline uint8_t acamera_isp_top_bypass_input_formatter_read(uintptr_t base) {
223 return (uint8_t)((system_sw_read_32(base + 0x18eacL) & 0x2) >> 1);
224 }
225 // ------------------------------------------------------------------------------ //
226 // Register: Bypass decompander
227 // ------------------------------------------------------------------------------ //
228
229 // ------------------------------------------------------------------------------ //
230 // Bypass front end decompander
231 // ------------------------------------------------------------------------------ //
232
233 #define ACAMERA_ISP_TOP_BYPASS_DECOMPANDER_DEFAULT (0)
234 #define ACAMERA_ISP_TOP_BYPASS_DECOMPANDER_DATASIZE (1)
235 #define ACAMERA_ISP_TOP_BYPASS_DECOMPANDER_OFFSET (0x24)
236 #define ACAMERA_ISP_TOP_BYPASS_DECOMPANDER_MASK (0x4)
237
238 // args: data (1-bit)
acamera_isp_top_bypass_decompander_write(uintptr_t base,uint8_t data)239 static __inline void acamera_isp_top_bypass_decompander_write(uintptr_t base, uint8_t data) {
240 uint32_t curr = system_sw_read_32(base + 0x18eacL);
241 system_sw_write_32(base + 0x18eacL, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
242 }
acamera_isp_top_bypass_decompander_read(uintptr_t base)243 static __inline uint8_t acamera_isp_top_bypass_decompander_read(uintptr_t base) {
244 return (uint8_t)((system_sw_read_32(base + 0x18eacL) & 0x4) >> 2);
245 }
246 // ------------------------------------------------------------------------------ //
247 // Register: Bypass sensor offset wdr
248 // ------------------------------------------------------------------------------ //
249
250 // ------------------------------------------------------------------------------ //
251 // Bypass sensor offset wdr
252 // ------------------------------------------------------------------------------ //
253
254 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_WDR_DEFAULT (0)
255 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_WDR_DATASIZE (1)
256 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_WDR_OFFSET (0x24)
257 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_WDR_MASK (0x8)
258
259 // args: data (1-bit)
acamera_isp_top_bypass_sensor_offset_wdr_write(uintptr_t base,uint8_t data)260 static __inline void acamera_isp_top_bypass_sensor_offset_wdr_write(uintptr_t base, uint8_t data) {
261 uint32_t curr = system_sw_read_32(base + 0x18eacL);
262 system_sw_write_32(base + 0x18eacL, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
263 }
acamera_isp_top_bypass_sensor_offset_wdr_read(uintptr_t base)264 static __inline uint8_t acamera_isp_top_bypass_sensor_offset_wdr_read(uintptr_t base) {
265 return (uint8_t)((system_sw_read_32(base + 0x18eacL) & 0x8) >> 3);
266 }
267 // ------------------------------------------------------------------------------ //
268 // Register: Bypass gain wdr
269 // ------------------------------------------------------------------------------ //
270
271 // ------------------------------------------------------------------------------ //
272 // Bypass gain wdr
273 // ------------------------------------------------------------------------------ //
274
275 #define ACAMERA_ISP_TOP_BYPASS_GAIN_WDR_DEFAULT (0)
276 #define ACAMERA_ISP_TOP_BYPASS_GAIN_WDR_DATASIZE (1)
277 #define ACAMERA_ISP_TOP_BYPASS_GAIN_WDR_OFFSET (0x24)
278 #define ACAMERA_ISP_TOP_BYPASS_GAIN_WDR_MASK (0x10)
279
280 // args: data (1-bit)
acamera_isp_top_bypass_gain_wdr_write(uintptr_t base,uint8_t data)281 static __inline void acamera_isp_top_bypass_gain_wdr_write(uintptr_t base, uint8_t data) {
282 uint32_t curr = system_sw_read_32(base + 0x18eacL);
283 system_sw_write_32(base + 0x18eacL, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
284 }
acamera_isp_top_bypass_gain_wdr_read(uintptr_t base)285 static __inline uint8_t acamera_isp_top_bypass_gain_wdr_read(uintptr_t base) {
286 return (uint8_t)((system_sw_read_32(base + 0x18eacL) & 0x10) >> 4);
287 }
288 // ------------------------------------------------------------------------------ //
289 // Register: Bypass frame stitch
290 // ------------------------------------------------------------------------------ //
291
292 // ------------------------------------------------------------------------------ //
293 // Bypass frame stitching logic
294 // ------------------------------------------------------------------------------ //
295
296 #define ACAMERA_ISP_TOP_BYPASS_FRAME_STITCH_DEFAULT (0)
297 #define ACAMERA_ISP_TOP_BYPASS_FRAME_STITCH_DATASIZE (1)
298 #define ACAMERA_ISP_TOP_BYPASS_FRAME_STITCH_OFFSET (0x24)
299 #define ACAMERA_ISP_TOP_BYPASS_FRAME_STITCH_MASK (0x20)
300
301 // args: data (1-bit)
acamera_isp_top_bypass_frame_stitch_write(uintptr_t base,uint8_t data)302 static __inline void acamera_isp_top_bypass_frame_stitch_write(uintptr_t base, uint8_t data) {
303 uint32_t curr = system_sw_read_32(base + 0x18eacL);
304 system_sw_write_32(base + 0x18eacL, (((uint32_t) (data & 0x1)) << 5) | (curr & 0xffffffdf));
305 }
acamera_isp_top_bypass_frame_stitch_read(uintptr_t base)306 static __inline uint8_t acamera_isp_top_bypass_frame_stitch_read(uintptr_t base) {
307 return (uint8_t)((system_sw_read_32(base + 0x18eacL) & 0x20) >> 5);
308 }
309 // ------------------------------------------------------------------------------ //
310 // Register: Bypass digital gain
311 // ------------------------------------------------------------------------------ //
312
313 // ------------------------------------------------------------------------------ //
314 // Bypass digital gain module
315 // ------------------------------------------------------------------------------ //
316
317 #define ACAMERA_ISP_TOP_BYPASS_DIGITAL_GAIN_DEFAULT (0)
318 #define ACAMERA_ISP_TOP_BYPASS_DIGITAL_GAIN_DATASIZE (1)
319 #define ACAMERA_ISP_TOP_BYPASS_DIGITAL_GAIN_OFFSET (0x28)
320 #define ACAMERA_ISP_TOP_BYPASS_DIGITAL_GAIN_MASK (0x1)
321
322 // args: data (1-bit)
acamera_isp_top_bypass_digital_gain_write(uintptr_t base,uint8_t data)323 static __inline void acamera_isp_top_bypass_digital_gain_write(uintptr_t base, uint8_t data) {
324 uint32_t curr = system_sw_read_32(base + 0x18eb0L);
325 system_sw_write_32(base + 0x18eb0L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
326 }
acamera_isp_top_bypass_digital_gain_read(uintptr_t base)327 static __inline uint8_t acamera_isp_top_bypass_digital_gain_read(uintptr_t base) {
328 return (uint8_t)((system_sw_read_32(base + 0x18eb0L) & 0x1) >> 0);
329 }
330 // ------------------------------------------------------------------------------ //
331 // Register: Bypass frontend sensor offset
332 // ------------------------------------------------------------------------------ //
333
334 // ------------------------------------------------------------------------------ //
335 // Bypass digital gain module
336 // ------------------------------------------------------------------------------ //
337
338 #define ACAMERA_ISP_TOP_BYPASS_FRONTEND_SENSOR_OFFSET_DEFAULT (0)
339 #define ACAMERA_ISP_TOP_BYPASS_FRONTEND_SENSOR_OFFSET_DATASIZE (1)
340 #define ACAMERA_ISP_TOP_BYPASS_FRONTEND_SENSOR_OFFSET_OFFSET (0x28)
341 #define ACAMERA_ISP_TOP_BYPASS_FRONTEND_SENSOR_OFFSET_MASK (0x2)
342
343 // args: data (1-bit)
acamera_isp_top_bypass_frontend_sensor_offset_write(uintptr_t base,uint8_t data)344 static __inline void acamera_isp_top_bypass_frontend_sensor_offset_write(uintptr_t base, uint8_t data) {
345 uint32_t curr = system_sw_read_32(base + 0x18eb0L);
346 system_sw_write_32(base + 0x18eb0L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
347 }
acamera_isp_top_bypass_frontend_sensor_offset_read(uintptr_t base)348 static __inline uint8_t acamera_isp_top_bypass_frontend_sensor_offset_read(uintptr_t base) {
349 return (uint8_t)((system_sw_read_32(base + 0x18eb0L) & 0x2) >> 1);
350 }
351 // ------------------------------------------------------------------------------ //
352 // Register: Bypass fe sqrt
353 // ------------------------------------------------------------------------------ //
354
355 // ------------------------------------------------------------------------------ //
356 // Bypass square root function before raw frontend
357 // ------------------------------------------------------------------------------ //
358
359 #define ACAMERA_ISP_TOP_BYPASS_FE_SQRT_DEFAULT (1)
360 #define ACAMERA_ISP_TOP_BYPASS_FE_SQRT_DATASIZE (1)
361 #define ACAMERA_ISP_TOP_BYPASS_FE_SQRT_OFFSET (0x28)
362 #define ACAMERA_ISP_TOP_BYPASS_FE_SQRT_MASK (0x4)
363
364 // args: data (1-bit)
acamera_isp_top_bypass_fe_sqrt_write(uintptr_t base,uint8_t data)365 static __inline void acamera_isp_top_bypass_fe_sqrt_write(uintptr_t base, uint8_t data) {
366 uint32_t curr = system_sw_read_32(base + 0x18eb0L);
367 system_sw_write_32(base + 0x18eb0L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
368 }
acamera_isp_top_bypass_fe_sqrt_read(uintptr_t base)369 static __inline uint8_t acamera_isp_top_bypass_fe_sqrt_read(uintptr_t base) {
370 return (uint8_t)((system_sw_read_32(base + 0x18eb0L) & 0x4) >> 2);
371 }
372 // ------------------------------------------------------------------------------ //
373 // Register: Bypass RAW frontend
374 // ------------------------------------------------------------------------------ //
375
376 // ------------------------------------------------------------------------------ //
377 // Bypass RAW frontend (green equalization and dynamic defect pixel)
378 // ------------------------------------------------------------------------------ //
379
380 #define ACAMERA_ISP_TOP_BYPASS_RAW_FRONTEND_DEFAULT (0)
381 #define ACAMERA_ISP_TOP_BYPASS_RAW_FRONTEND_DATASIZE (1)
382 #define ACAMERA_ISP_TOP_BYPASS_RAW_FRONTEND_OFFSET (0x28)
383 #define ACAMERA_ISP_TOP_BYPASS_RAW_FRONTEND_MASK (0x8)
384
385 // args: data (1-bit)
acamera_isp_top_bypass_raw_frontend_write(uintptr_t base,uint8_t data)386 static __inline void acamera_isp_top_bypass_raw_frontend_write(uintptr_t base, uint8_t data) {
387 uint32_t curr = system_sw_read_32(base + 0x18eb0L);
388 system_sw_write_32(base + 0x18eb0L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
389 }
acamera_isp_top_bypass_raw_frontend_read(uintptr_t base)390 static __inline uint8_t acamera_isp_top_bypass_raw_frontend_read(uintptr_t base) {
391 return (uint8_t)((system_sw_read_32(base + 0x18eb0L) & 0x8) >> 3);
392 }
393 // ------------------------------------------------------------------------------ //
394 // Register: Bypass defect pixel
395 // ------------------------------------------------------------------------------ //
396
397 // ------------------------------------------------------------------------------ //
398 // Bypass static defect pixel
399 // ------------------------------------------------------------------------------ //
400
401 #define ACAMERA_ISP_TOP_BYPASS_DEFECT_PIXEL_DEFAULT (0)
402 #define ACAMERA_ISP_TOP_BYPASS_DEFECT_PIXEL_DATASIZE (1)
403 #define ACAMERA_ISP_TOP_BYPASS_DEFECT_PIXEL_OFFSET (0x28)
404 #define ACAMERA_ISP_TOP_BYPASS_DEFECT_PIXEL_MASK (0x10)
405
406 // args: data (1-bit)
acamera_isp_top_bypass_defect_pixel_write(uintptr_t base,uint8_t data)407 static __inline void acamera_isp_top_bypass_defect_pixel_write(uintptr_t base, uint8_t data) {
408 uint32_t curr = system_sw_read_32(base + 0x18eb0L);
409 system_sw_write_32(base + 0x18eb0L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
410 }
acamera_isp_top_bypass_defect_pixel_read(uintptr_t base)411 static __inline uint8_t acamera_isp_top_bypass_defect_pixel_read(uintptr_t base) {
412 return (uint8_t)((system_sw_read_32(base + 0x18eb0L) & 0x10) >> 4);
413 }
414 // ------------------------------------------------------------------------------ //
415 // Register: Bypass sinter
416 // ------------------------------------------------------------------------------ //
417
418 // ------------------------------------------------------------------------------ //
419 // Bypass sinter
420 // ------------------------------------------------------------------------------ //
421
422 #define ACAMERA_ISP_TOP_BYPASS_SINTER_DEFAULT (0)
423 #define ACAMERA_ISP_TOP_BYPASS_SINTER_DATASIZE (1)
424 #define ACAMERA_ISP_TOP_BYPASS_SINTER_OFFSET (0x30)
425 #define ACAMERA_ISP_TOP_BYPASS_SINTER_MASK (0x1)
426
427 // args: data (1-bit)
acamera_isp_top_bypass_sinter_write(uintptr_t base,uint8_t data)428 static __inline void acamera_isp_top_bypass_sinter_write(uintptr_t base, uint8_t data) {
429 uint32_t curr = system_sw_read_32(base + 0x18eb8L);
430 system_sw_write_32(base + 0x18eb8L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
431 }
acamera_isp_top_bypass_sinter_read(uintptr_t base)432 static __inline uint8_t acamera_isp_top_bypass_sinter_read(uintptr_t base) {
433 return (uint8_t)((system_sw_read_32(base + 0x18eb8L) & 0x1) >> 0);
434 }
435 // ------------------------------------------------------------------------------ //
436 // Register: Bypass temper
437 // ------------------------------------------------------------------------------ //
438
439 // ------------------------------------------------------------------------------ //
440 // Bypass temper
441 // ------------------------------------------------------------------------------ //
442
443 #define ACAMERA_ISP_TOP_BYPASS_TEMPER_DEFAULT (1)
444 #define ACAMERA_ISP_TOP_BYPASS_TEMPER_DATASIZE (1)
445 #define ACAMERA_ISP_TOP_BYPASS_TEMPER_OFFSET (0x30)
446 #define ACAMERA_ISP_TOP_BYPASS_TEMPER_MASK (0x2)
447
448 // args: data (1-bit)
acamera_isp_top_bypass_temper_write(uintptr_t base,uint8_t data)449 static __inline void acamera_isp_top_bypass_temper_write(uintptr_t base, uint8_t data) {
450 uint32_t curr = system_sw_read_32(base + 0x18eb8L);
451 system_sw_write_32(base + 0x18eb8L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
452 }
acamera_isp_top_bypass_temper_read(uintptr_t base)453 static __inline uint8_t acamera_isp_top_bypass_temper_read(uintptr_t base) {
454 return (uint8_t)((system_sw_read_32(base + 0x18eb8L) & 0x2) >> 1);
455 }
456 // ------------------------------------------------------------------------------ //
457 // Register: Bypass ca correction
458 // ------------------------------------------------------------------------------ //
459
460 // ------------------------------------------------------------------------------ //
461 // Bypass chromatic abberation correction
462 // ------------------------------------------------------------------------------ //
463
464 #define ACAMERA_ISP_TOP_BYPASS_CA_CORRECTION_DEFAULT (0)
465 #define ACAMERA_ISP_TOP_BYPASS_CA_CORRECTION_DATASIZE (1)
466 #define ACAMERA_ISP_TOP_BYPASS_CA_CORRECTION_OFFSET (0x30)
467 #define ACAMERA_ISP_TOP_BYPASS_CA_CORRECTION_MASK (0x4)
468
469 // args: data (1-bit)
acamera_isp_top_bypass_ca_correction_write(uintptr_t base,uint8_t data)470 static __inline void acamera_isp_top_bypass_ca_correction_write(uintptr_t base, uint8_t data) {
471 uint32_t curr = system_sw_read_32(base + 0x18eb8L);
472 system_sw_write_32(base + 0x18eb8L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
473 }
acamera_isp_top_bypass_ca_correction_read(uintptr_t base)474 static __inline uint8_t acamera_isp_top_bypass_ca_correction_read(uintptr_t base) {
475 return (uint8_t)((system_sw_read_32(base + 0x18eb8L) & 0x4) >> 2);
476 }
477 // ------------------------------------------------------------------------------ //
478 // Register: Bypass square_be
479 // ------------------------------------------------------------------------------ //
480
481 // ------------------------------------------------------------------------------ //
482 // Bypass backend square
483 // ------------------------------------------------------------------------------ //
484
485 #define ACAMERA_ISP_TOP_BYPASS_SQUARE_BE_DEFAULT (0)
486 #define ACAMERA_ISP_TOP_BYPASS_SQUARE_BE_DATASIZE (1)
487 #define ACAMERA_ISP_TOP_BYPASS_SQUARE_BE_OFFSET (0x34)
488 #define ACAMERA_ISP_TOP_BYPASS_SQUARE_BE_MASK (0x1)
489
490 // args: data (1-bit)
acamera_isp_top_bypass_square_be_write(uintptr_t base,uint8_t data)491 static __inline void acamera_isp_top_bypass_square_be_write(uintptr_t base, uint8_t data) {
492 uint32_t curr = system_sw_read_32(base + 0x18ebcL);
493 system_sw_write_32(base + 0x18ebcL, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
494 }
acamera_isp_top_bypass_square_be_read(uintptr_t base)495 static __inline uint8_t acamera_isp_top_bypass_square_be_read(uintptr_t base) {
496 return (uint8_t)((system_sw_read_32(base + 0x18ebcL) & 0x1) >> 0);
497 }
498 // ------------------------------------------------------------------------------ //
499 // Register: Bypass sensor_offset_pre_shading
500 // ------------------------------------------------------------------------------ //
501
502 // ------------------------------------------------------------------------------ //
503 // Bypass sensor offset pre shading
504 // ------------------------------------------------------------------------------ //
505
506 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_PRE_SHADING_DEFAULT (0)
507 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_PRE_SHADING_DATASIZE (1)
508 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_PRE_SHADING_OFFSET (0x34)
509 #define ACAMERA_ISP_TOP_BYPASS_SENSOR_OFFSET_PRE_SHADING_MASK (0x2)
510
511 // args: data (1-bit)
acamera_isp_top_bypass_sensor_offset_pre_shading_write(uintptr_t base,uint8_t data)512 static __inline void acamera_isp_top_bypass_sensor_offset_pre_shading_write(uintptr_t base, uint8_t data) {
513 uint32_t curr = system_sw_read_32(base + 0x18ebcL);
514 system_sw_write_32(base + 0x18ebcL, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
515 }
acamera_isp_top_bypass_sensor_offset_pre_shading_read(uintptr_t base)516 static __inline uint8_t acamera_isp_top_bypass_sensor_offset_pre_shading_read(uintptr_t base) {
517 return (uint8_t)((system_sw_read_32(base + 0x18ebcL) & 0x2) >> 1);
518 }
519 // ------------------------------------------------------------------------------ //
520 // Register: Bypass radial shading
521 // ------------------------------------------------------------------------------ //
522
523 // ------------------------------------------------------------------------------ //
524 // Bypass radial shading
525 // ------------------------------------------------------------------------------ //
526
527 #define ACAMERA_ISP_TOP_BYPASS_RADIAL_SHADING_DEFAULT (0)
528 #define ACAMERA_ISP_TOP_BYPASS_RADIAL_SHADING_DATASIZE (1)
529 #define ACAMERA_ISP_TOP_BYPASS_RADIAL_SHADING_OFFSET (0x34)
530 #define ACAMERA_ISP_TOP_BYPASS_RADIAL_SHADING_MASK (0x4)
531
532 // args: data (1-bit)
acamera_isp_top_bypass_radial_shading_write(uintptr_t base,uint8_t data)533 static __inline void acamera_isp_top_bypass_radial_shading_write(uintptr_t base, uint8_t data) {
534 uint32_t curr = system_sw_read_32(base + 0x18ebcL);
535 system_sw_write_32(base + 0x18ebcL, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
536 }
acamera_isp_top_bypass_radial_shading_read(uintptr_t base)537 static __inline uint8_t acamera_isp_top_bypass_radial_shading_read(uintptr_t base) {
538 return (uint8_t)((system_sw_read_32(base + 0x18ebcL) & 0x4) >> 2);
539 }
540 // ------------------------------------------------------------------------------ //
541 // Register: Bypass mesh shading
542 // ------------------------------------------------------------------------------ //
543
544 // ------------------------------------------------------------------------------ //
545 // Bypass mesh ashading
546 // ------------------------------------------------------------------------------ //
547
548 #define ACAMERA_ISP_TOP_BYPASS_MESH_SHADING_DEFAULT (0)
549 #define ACAMERA_ISP_TOP_BYPASS_MESH_SHADING_DATASIZE (1)
550 #define ACAMERA_ISP_TOP_BYPASS_MESH_SHADING_OFFSET (0x34)
551 #define ACAMERA_ISP_TOP_BYPASS_MESH_SHADING_MASK (0x8)
552
553 // args: data (1-bit)
acamera_isp_top_bypass_mesh_shading_write(uintptr_t base,uint8_t data)554 static __inline void acamera_isp_top_bypass_mesh_shading_write(uintptr_t base, uint8_t data) {
555 uint32_t curr = system_sw_read_32(base + 0x18ebcL);
556 system_sw_write_32(base + 0x18ebcL, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
557 }
acamera_isp_top_bypass_mesh_shading_read(uintptr_t base)558 static __inline uint8_t acamera_isp_top_bypass_mesh_shading_read(uintptr_t base) {
559 return (uint8_t)((system_sw_read_32(base + 0x18ebcL) & 0x8) >> 3);
560 }
561 // ------------------------------------------------------------------------------ //
562 // Register: Bypass white balance
563 // ------------------------------------------------------------------------------ //
564
565 // ------------------------------------------------------------------------------ //
566 // Bypass white balance
567 // ------------------------------------------------------------------------------ //
568
569 #define ACAMERA_ISP_TOP_BYPASS_WHITE_BALANCE_DEFAULT (0)
570 #define ACAMERA_ISP_TOP_BYPASS_WHITE_BALANCE_DATASIZE (1)
571 #define ACAMERA_ISP_TOP_BYPASS_WHITE_BALANCE_OFFSET (0x34)
572 #define ACAMERA_ISP_TOP_BYPASS_WHITE_BALANCE_MASK (0x10)
573
574 // args: data (1-bit)
acamera_isp_top_bypass_white_balance_write(uintptr_t base,uint8_t data)575 static __inline void acamera_isp_top_bypass_white_balance_write(uintptr_t base, uint8_t data) {
576 uint32_t curr = system_sw_read_32(base + 0x18ebcL);
577 system_sw_write_32(base + 0x18ebcL, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
578 }
acamera_isp_top_bypass_white_balance_read(uintptr_t base)579 static __inline uint8_t acamera_isp_top_bypass_white_balance_read(uintptr_t base) {
580 return (uint8_t)((system_sw_read_32(base + 0x18ebcL) & 0x10) >> 4);
581 }
582 // ------------------------------------------------------------------------------ //
583 // Register: Bypass iridix gain
584 // ------------------------------------------------------------------------------ //
585
586 // ------------------------------------------------------------------------------ //
587 // Bypass
588 // ------------------------------------------------------------------------------ //
589
590 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_GAIN_DEFAULT (0)
591 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_GAIN_DATASIZE (1)
592 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_GAIN_OFFSET (0x34)
593 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_GAIN_MASK (0x20)
594
595 // args: data (1-bit)
acamera_isp_top_bypass_iridix_gain_write(uintptr_t base,uint8_t data)596 static __inline void acamera_isp_top_bypass_iridix_gain_write(uintptr_t base, uint8_t data) {
597 uint32_t curr = system_sw_read_32(base + 0x18ebcL);
598 system_sw_write_32(base + 0x18ebcL, (((uint32_t) (data & 0x1)) << 5) | (curr & 0xffffffdf));
599 }
acamera_isp_top_bypass_iridix_gain_read(uintptr_t base)600 static __inline uint8_t acamera_isp_top_bypass_iridix_gain_read(uintptr_t base) {
601 return (uint8_t)((system_sw_read_32(base + 0x18ebcL) & 0x20) >> 5);
602 }
603 // ------------------------------------------------------------------------------ //
604 // Register: Bypass iridix
605 // ------------------------------------------------------------------------------ //
606
607 // ------------------------------------------------------------------------------ //
608 // Bypass
609 // ------------------------------------------------------------------------------ //
610
611 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_DEFAULT (0)
612 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_DATASIZE (1)
613 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_OFFSET (0x34)
614 #define ACAMERA_ISP_TOP_BYPASS_IRIDIX_MASK (0x40)
615
616 // args: data (1-bit)
acamera_isp_top_bypass_iridix_write(uintptr_t base,uint8_t data)617 static __inline void acamera_isp_top_bypass_iridix_write(uintptr_t base, uint8_t data) {
618 uint32_t curr = system_sw_read_32(base + 0x18ebcL);
619 system_sw_write_32(base + 0x18ebcL, (((uint32_t) (data & 0x1)) << 6) | (curr & 0xffffffbf));
620 }
acamera_isp_top_bypass_iridix_read(uintptr_t base)621 static __inline uint8_t acamera_isp_top_bypass_iridix_read(uintptr_t base) {
622 return (uint8_t)((system_sw_read_32(base + 0x18ebcL) & 0x40) >> 6);
623 }
624 // ------------------------------------------------------------------------------ //
625 // Register: Bypass mirror
626 // ------------------------------------------------------------------------------ //
627
628 // ------------------------------------------------------------------------------ //
629 // Bypass EW mirror
630 // ------------------------------------------------------------------------------ //
631
632 #define ACAMERA_ISP_TOP_BYPASS_MIRROR_DEFAULT (0)
633 #define ACAMERA_ISP_TOP_BYPASS_MIRROR_DATASIZE (1)
634 #define ACAMERA_ISP_TOP_BYPASS_MIRROR_OFFSET (0x38)
635 #define ACAMERA_ISP_TOP_BYPASS_MIRROR_MASK (0x1)
636
637 // args: data (1-bit)
acamera_isp_top_bypass_mirror_write(uintptr_t base,uint8_t data)638 static __inline void acamera_isp_top_bypass_mirror_write(uintptr_t base, uint8_t data) {
639 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
640 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
641 }
acamera_isp_top_bypass_mirror_read(uintptr_t base)642 static __inline uint8_t acamera_isp_top_bypass_mirror_read(uintptr_t base) {
643 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x1) >> 0);
644 }
645 // ------------------------------------------------------------------------------ //
646 // Register: Bypass demosaic rgb
647 // ------------------------------------------------------------------------------ //
648
649 // ------------------------------------------------------------------------------ //
650 // Bypass demosaic rgb
651 // ------------------------------------------------------------------------------ //
652
653 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGB_DEFAULT (0)
654 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGB_DATASIZE (1)
655 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGB_OFFSET (0x38)
656 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGB_MASK (0x2)
657
658 // args: data (1-bit)
acamera_isp_top_bypass_demosaic_rgb_write(uintptr_t base,uint8_t data)659 static __inline void acamera_isp_top_bypass_demosaic_rgb_write(uintptr_t base, uint8_t data) {
660 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
661 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
662 }
acamera_isp_top_bypass_demosaic_rgb_read(uintptr_t base)663 static __inline uint8_t acamera_isp_top_bypass_demosaic_rgb_read(uintptr_t base) {
664 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x2) >> 1);
665 }
666 // ------------------------------------------------------------------------------ //
667 // Register: Bypass demosaic rgbir
668 // ------------------------------------------------------------------------------ //
669
670 // ------------------------------------------------------------------------------ //
671 // Bypass demosaic rgbir
672 // ------------------------------------------------------------------------------ //
673
674 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGBIR_DEFAULT (0)
675 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGBIR_DATASIZE (1)
676 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGBIR_OFFSET (0x38)
677 #define ACAMERA_ISP_TOP_BYPASS_DEMOSAIC_RGBIR_MASK (0x4)
678
679 // args: data (1-bit)
acamera_isp_top_bypass_demosaic_rgbir_write(uintptr_t base,uint8_t data)680 static __inline void acamera_isp_top_bypass_demosaic_rgbir_write(uintptr_t base, uint8_t data) {
681 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
682 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
683 }
acamera_isp_top_bypass_demosaic_rgbir_read(uintptr_t base)684 static __inline uint8_t acamera_isp_top_bypass_demosaic_rgbir_read(uintptr_t base) {
685 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x4) >> 2);
686 }
687 // ------------------------------------------------------------------------------ //
688 // Register: Bypass pf correction
689 // ------------------------------------------------------------------------------ //
690
691 // ------------------------------------------------------------------------------ //
692 // Bypass pf correction
693 // ------------------------------------------------------------------------------ //
694
695 #define ACAMERA_ISP_TOP_BYPASS_PF_CORRECTION_DEFAULT (0)
696 #define ACAMERA_ISP_TOP_BYPASS_PF_CORRECTION_DATASIZE (1)
697 #define ACAMERA_ISP_TOP_BYPASS_PF_CORRECTION_OFFSET (0x38)
698 #define ACAMERA_ISP_TOP_BYPASS_PF_CORRECTION_MASK (0x8)
699
700 // args: data (1-bit)
acamera_isp_top_bypass_pf_correction_write(uintptr_t base,uint8_t data)701 static __inline void acamera_isp_top_bypass_pf_correction_write(uintptr_t base, uint8_t data) {
702 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
703 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
704 }
acamera_isp_top_bypass_pf_correction_read(uintptr_t base)705 static __inline uint8_t acamera_isp_top_bypass_pf_correction_read(uintptr_t base) {
706 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x8) >> 3);
707 }
708 // ------------------------------------------------------------------------------ //
709 // Register: Bypass CCM
710 // ------------------------------------------------------------------------------ //
711
712 // ------------------------------------------------------------------------------ //
713 // Bypass CCM
714 // ------------------------------------------------------------------------------ //
715
716 #define ACAMERA_ISP_TOP_BYPASS_CCM_DEFAULT (0)
717 #define ACAMERA_ISP_TOP_BYPASS_CCM_DATASIZE (1)
718 #define ACAMERA_ISP_TOP_BYPASS_CCM_OFFSET (0x38)
719 #define ACAMERA_ISP_TOP_BYPASS_CCM_MASK (0x10)
720
721 // args: data (1-bit)
acamera_isp_top_bypass_ccm_write(uintptr_t base,uint8_t data)722 static __inline void acamera_isp_top_bypass_ccm_write(uintptr_t base, uint8_t data) {
723 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
724 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
725 }
acamera_isp_top_bypass_ccm_read(uintptr_t base)726 static __inline uint8_t acamera_isp_top_bypass_ccm_read(uintptr_t base) {
727 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x10) >> 4);
728 }
729 // ------------------------------------------------------------------------------ //
730 // Register: Bypass CNR
731 // ------------------------------------------------------------------------------ //
732
733 // ------------------------------------------------------------------------------ //
734 // Bypass CNR
735 // ------------------------------------------------------------------------------ //
736
737 #define ACAMERA_ISP_TOP_BYPASS_CNR_DEFAULT (0)
738 #define ACAMERA_ISP_TOP_BYPASS_CNR_DATASIZE (1)
739 #define ACAMERA_ISP_TOP_BYPASS_CNR_OFFSET (0x38)
740 #define ACAMERA_ISP_TOP_BYPASS_CNR_MASK (0x20)
741
742 // args: data (1-bit)
acamera_isp_top_bypass_cnr_write(uintptr_t base,uint8_t data)743 static __inline void acamera_isp_top_bypass_cnr_write(uintptr_t base, uint8_t data) {
744 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
745 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 5) | (curr & 0xffffffdf));
746 }
acamera_isp_top_bypass_cnr_read(uintptr_t base)747 static __inline uint8_t acamera_isp_top_bypass_cnr_read(uintptr_t base) {
748 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x20) >> 5);
749 }
750 // ------------------------------------------------------------------------------ //
751 // Register: Bypass 3D lut
752 // ------------------------------------------------------------------------------ //
753
754 // ------------------------------------------------------------------------------ //
755 // Bypass 3d lut
756 // ------------------------------------------------------------------------------ //
757
758 #define ACAMERA_ISP_TOP_BYPASS_3D_LUT_DEFAULT (0)
759 #define ACAMERA_ISP_TOP_BYPASS_3D_LUT_DATASIZE (1)
760 #define ACAMERA_ISP_TOP_BYPASS_3D_LUT_OFFSET (0x38)
761 #define ACAMERA_ISP_TOP_BYPASS_3D_LUT_MASK (0x40)
762
763 // args: data (1-bit)
acamera_isp_top_bypass_3d_lut_write(uintptr_t base,uint8_t data)764 static __inline void acamera_isp_top_bypass_3d_lut_write(uintptr_t base, uint8_t data) {
765 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
766 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 6) | (curr & 0xffffffbf));
767 }
acamera_isp_top_bypass_3d_lut_read(uintptr_t base)768 static __inline uint8_t acamera_isp_top_bypass_3d_lut_read(uintptr_t base) {
769 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x40) >> 6);
770 }
771 // ------------------------------------------------------------------------------ //
772 // Register: Bypass nonequ gamma
773 // ------------------------------------------------------------------------------ //
774
775 // ------------------------------------------------------------------------------ //
776 // Bypass nonequ gamma
777 // ------------------------------------------------------------------------------ //
778
779 #define ACAMERA_ISP_TOP_BYPASS_NONEQU_GAMMA_DEFAULT (0)
780 #define ACAMERA_ISP_TOP_BYPASS_NONEQU_GAMMA_DATASIZE (1)
781 #define ACAMERA_ISP_TOP_BYPASS_NONEQU_GAMMA_OFFSET (0x38)
782 #define ACAMERA_ISP_TOP_BYPASS_NONEQU_GAMMA_MASK (0x80)
783
784 // args: data (1-bit)
acamera_isp_top_bypass_nonequ_gamma_write(uintptr_t base,uint8_t data)785 static __inline void acamera_isp_top_bypass_nonequ_gamma_write(uintptr_t base, uint8_t data) {
786 uint32_t curr = system_sw_read_32(base + 0x18ec0L);
787 system_sw_write_32(base + 0x18ec0L, (((uint32_t) (data & 0x1)) << 7) | (curr & 0xffffff7f));
788 }
acamera_isp_top_bypass_nonequ_gamma_read(uintptr_t base)789 static __inline uint8_t acamera_isp_top_bypass_nonequ_gamma_read(uintptr_t base) {
790 return (uint8_t)((system_sw_read_32(base + 0x18ec0L) & 0x80) >> 7);
791 }
792 // ------------------------------------------------------------------------------ //
793 // Register: Bypass fr crop
794 // ------------------------------------------------------------------------------ //
795
796 // ------------------------------------------------------------------------------ //
797 // Bypass fr crop
798 // ------------------------------------------------------------------------------ //
799
800 #define ACAMERA_ISP_TOP_BYPASS_FR_CROP_DEFAULT (0)
801 #define ACAMERA_ISP_TOP_BYPASS_FR_CROP_DATASIZE (1)
802 #define ACAMERA_ISP_TOP_BYPASS_FR_CROP_OFFSET (0x3c)
803 #define ACAMERA_ISP_TOP_BYPASS_FR_CROP_MASK (0x1)
804
805 // args: data (1-bit)
acamera_isp_top_bypass_fr_crop_write(uintptr_t base,uint8_t data)806 static __inline void acamera_isp_top_bypass_fr_crop_write(uintptr_t base, uint8_t data) {
807 uint32_t curr = system_sw_read_32(base + 0x18ec4L);
808 system_sw_write_32(base + 0x18ec4L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
809 }
acamera_isp_top_bypass_fr_crop_read(uintptr_t base)810 static __inline uint8_t acamera_isp_top_bypass_fr_crop_read(uintptr_t base) {
811 return (uint8_t)((system_sw_read_32(base + 0x18ec4L) & 0x1) >> 0);
812 }
813 // ------------------------------------------------------------------------------ //
814 // Register: Bypass fr gamma rgb
815 // ------------------------------------------------------------------------------ //
816
817 // ------------------------------------------------------------------------------ //
818 // Bypass fr gamma rgb
819 // ------------------------------------------------------------------------------ //
820
821 #define ACAMERA_ISP_TOP_BYPASS_FR_GAMMA_RGB_DEFAULT (0)
822 #define ACAMERA_ISP_TOP_BYPASS_FR_GAMMA_RGB_DATASIZE (1)
823 #define ACAMERA_ISP_TOP_BYPASS_FR_GAMMA_RGB_OFFSET (0x3c)
824 #define ACAMERA_ISP_TOP_BYPASS_FR_GAMMA_RGB_MASK (0x2)
825
826 // args: data (1-bit)
acamera_isp_top_bypass_fr_gamma_rgb_write(uintptr_t base,uint8_t data)827 static __inline void acamera_isp_top_bypass_fr_gamma_rgb_write(uintptr_t base, uint8_t data) {
828 uint32_t curr = system_sw_read_32(base + 0x18ec4L);
829 system_sw_write_32(base + 0x18ec4L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
830 }
acamera_isp_top_bypass_fr_gamma_rgb_read(uintptr_t base)831 static __inline uint8_t acamera_isp_top_bypass_fr_gamma_rgb_read(uintptr_t base) {
832 return (uint8_t)((system_sw_read_32(base + 0x18ec4L) & 0x2) >> 1);
833 }
834 // ------------------------------------------------------------------------------ //
835 // Register: Bypass fr sharpen
836 // ------------------------------------------------------------------------------ //
837
838 // ------------------------------------------------------------------------------ //
839 // Bypass fr sharpen
840 // ------------------------------------------------------------------------------ //
841
842 #define ACAMERA_ISP_TOP_BYPASS_FR_SHARPEN_DEFAULT (0)
843 #define ACAMERA_ISP_TOP_BYPASS_FR_SHARPEN_DATASIZE (1)
844 #define ACAMERA_ISP_TOP_BYPASS_FR_SHARPEN_OFFSET (0x3c)
845 #define ACAMERA_ISP_TOP_BYPASS_FR_SHARPEN_MASK (0x4)
846
847 // args: data (1-bit)
acamera_isp_top_bypass_fr_sharpen_write(uintptr_t base,uint8_t data)848 static __inline void acamera_isp_top_bypass_fr_sharpen_write(uintptr_t base, uint8_t data) {
849 uint32_t curr = system_sw_read_32(base + 0x18ec4L);
850 system_sw_write_32(base + 0x18ec4L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
851 }
acamera_isp_top_bypass_fr_sharpen_read(uintptr_t base)852 static __inline uint8_t acamera_isp_top_bypass_fr_sharpen_read(uintptr_t base) {
853 return (uint8_t)((system_sw_read_32(base + 0x18ec4L) & 0x4) >> 2);
854 }
855 // ------------------------------------------------------------------------------ //
856 // Register: Bypass fr cs conv
857 // ------------------------------------------------------------------------------ //
858
859 // ------------------------------------------------------------------------------ //
860 // Bypass fr cs conv
861 // ------------------------------------------------------------------------------ //
862
863 #define ACAMERA_ISP_TOP_BYPASS_FR_CS_CONV_DEFAULT (0)
864 #define ACAMERA_ISP_TOP_BYPASS_FR_CS_CONV_DATASIZE (1)
865 #define ACAMERA_ISP_TOP_BYPASS_FR_CS_CONV_OFFSET (0x3c)
866 #define ACAMERA_ISP_TOP_BYPASS_FR_CS_CONV_MASK (0x8)
867
868 // args: data (1-bit)
acamera_isp_top_bypass_fr_cs_conv_write(uintptr_t base,uint8_t data)869 static __inline void acamera_isp_top_bypass_fr_cs_conv_write(uintptr_t base, uint8_t data) {
870 uint32_t curr = system_sw_read_32(base + 0x18ec4L);
871 system_sw_write_32(base + 0x18ec4L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
872 }
acamera_isp_top_bypass_fr_cs_conv_read(uintptr_t base)873 static __inline uint8_t acamera_isp_top_bypass_fr_cs_conv_read(uintptr_t base) {
874 return (uint8_t)((system_sw_read_32(base + 0x18ec4L) & 0x8) >> 3);
875 }
876 // ------------------------------------------------------------------------------ //
877 // Register: Bypass ds crop
878 // ------------------------------------------------------------------------------ //
879
880 // ------------------------------------------------------------------------------ //
881 // Bypass ds crop
882 // ------------------------------------------------------------------------------ //
883
884 #define ACAMERA_ISP_TOP_BYPASS_DS1_CROP_DEFAULT (0)
885 #define ACAMERA_ISP_TOP_BYPASS_DS1_CROP_DATASIZE (1)
886 #define ACAMERA_ISP_TOP_BYPASS_DS1_CROP_OFFSET (0x40)
887 #define ACAMERA_ISP_TOP_BYPASS_DS1_CROP_MASK (0x1)
888
889 // args: data (1-bit)
acamera_isp_top_bypass_ds1_crop_write(uintptr_t base,uint8_t data)890 static __inline void acamera_isp_top_bypass_ds1_crop_write(uintptr_t base, uint8_t data) {
891 uint32_t curr = system_sw_read_32(base + 0x18ec8L);
892 system_sw_write_32(base + 0x18ec8L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
893 }
acamera_isp_top_bypass_ds1_crop_read(uintptr_t base)894 static __inline uint8_t acamera_isp_top_bypass_ds1_crop_read(uintptr_t base) {
895 return (uint8_t)((system_sw_read_32(base + 0x18ec8L) & 0x1) >> 0);
896 }
897 // ------------------------------------------------------------------------------ //
898 // Register: Bypass ds scaler
899 // ------------------------------------------------------------------------------ //
900
901 // ------------------------------------------------------------------------------ //
902 // Bypass ds scaler
903 // ------------------------------------------------------------------------------ //
904
905 #define ACAMERA_ISP_TOP_BYPASS_DS1_SCALER_DEFAULT (0)
906 #define ACAMERA_ISP_TOP_BYPASS_DS1_SCALER_DATASIZE (1)
907 #define ACAMERA_ISP_TOP_BYPASS_DS1_SCALER_OFFSET (0x40)
908 #define ACAMERA_ISP_TOP_BYPASS_DS1_SCALER_MASK (0x2)
909
910 // args: data (1-bit)
acamera_isp_top_bypass_ds1_scaler_write(uintptr_t base,uint8_t data)911 static __inline void acamera_isp_top_bypass_ds1_scaler_write(uintptr_t base, uint8_t data) {
912 uint32_t curr = system_sw_read_32(base + 0x18ec8L);
913 system_sw_write_32(base + 0x18ec8L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
914 }
acamera_isp_top_bypass_ds1_scaler_read(uintptr_t base)915 static __inline uint8_t acamera_isp_top_bypass_ds1_scaler_read(uintptr_t base) {
916 return (uint8_t)((system_sw_read_32(base + 0x18ec8L) & 0x2) >> 1);
917 }
918 // ------------------------------------------------------------------------------ //
919 // Register: Bypass ds gamma rgb
920 // ------------------------------------------------------------------------------ //
921
922 // ------------------------------------------------------------------------------ //
923 // Bypass ds gamma rgb
924 // ------------------------------------------------------------------------------ //
925
926 #define ACAMERA_ISP_TOP_BYPASS_DS1_GAMMA_RGB_DEFAULT (0)
927 #define ACAMERA_ISP_TOP_BYPASS_DS1_GAMMA_RGB_DATASIZE (1)
928 #define ACAMERA_ISP_TOP_BYPASS_DS1_GAMMA_RGB_OFFSET (0x40)
929 #define ACAMERA_ISP_TOP_BYPASS_DS1_GAMMA_RGB_MASK (0x4)
930
931 // args: data (1-bit)
acamera_isp_top_bypass_ds1_gamma_rgb_write(uintptr_t base,uint8_t data)932 static __inline void acamera_isp_top_bypass_ds1_gamma_rgb_write(uintptr_t base, uint8_t data) {
933 uint32_t curr = system_sw_read_32(base + 0x18ec8L);
934 system_sw_write_32(base + 0x18ec8L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
935 }
acamera_isp_top_bypass_ds1_gamma_rgb_read(uintptr_t base)936 static __inline uint8_t acamera_isp_top_bypass_ds1_gamma_rgb_read(uintptr_t base) {
937 return (uint8_t)((system_sw_read_32(base + 0x18ec8L) & 0x4) >> 2);
938 }
939 // ------------------------------------------------------------------------------ //
940 // Register: Bypass ds sharpen
941 // ------------------------------------------------------------------------------ //
942
943 // ------------------------------------------------------------------------------ //
944 // Bypass ds sharpen
945 // ------------------------------------------------------------------------------ //
946
947 #define ACAMERA_ISP_TOP_BYPASS_DS1_SHARPEN_DEFAULT (0)
948 #define ACAMERA_ISP_TOP_BYPASS_DS1_SHARPEN_DATASIZE (1)
949 #define ACAMERA_ISP_TOP_BYPASS_DS1_SHARPEN_OFFSET (0x40)
950 #define ACAMERA_ISP_TOP_BYPASS_DS1_SHARPEN_MASK (0x8)
951
952 // args: data (1-bit)
acamera_isp_top_bypass_ds1_sharpen_write(uintptr_t base,uint8_t data)953 static __inline void acamera_isp_top_bypass_ds1_sharpen_write(uintptr_t base, uint8_t data) {
954 uint32_t curr = system_sw_read_32(base + 0x18ec8L);
955 system_sw_write_32(base + 0x18ec8L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
956 }
acamera_isp_top_bypass_ds1_sharpen_read(uintptr_t base)957 static __inline uint8_t acamera_isp_top_bypass_ds1_sharpen_read(uintptr_t base) {
958 return (uint8_t)((system_sw_read_32(base + 0x18ec8L) & 0x8) >> 3);
959 }
960 // ------------------------------------------------------------------------------ //
961 // Register: Bypass ds cs conv
962 // ------------------------------------------------------------------------------ //
963
964 // ------------------------------------------------------------------------------ //
965 // Bypass ds cs conv
966 // ------------------------------------------------------------------------------ //
967
968 #define ACAMERA_ISP_TOP_BYPASS_DS1_CS_CONV_DEFAULT (0)
969 #define ACAMERA_ISP_TOP_BYPASS_DS1_CS_CONV_DATASIZE (1)
970 #define ACAMERA_ISP_TOP_BYPASS_DS1_CS_CONV_OFFSET (0x40)
971 #define ACAMERA_ISP_TOP_BYPASS_DS1_CS_CONV_MASK (0x10)
972
973 // args: data (1-bit)
acamera_isp_top_bypass_ds1_cs_conv_write(uintptr_t base,uint8_t data)974 static __inline void acamera_isp_top_bypass_ds1_cs_conv_write(uintptr_t base, uint8_t data) {
975 uint32_t curr = system_sw_read_32(base + 0x18ec8L);
976 system_sw_write_32(base + 0x18ec8L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
977 }
acamera_isp_top_bypass_ds1_cs_conv_read(uintptr_t base)978 static __inline uint8_t acamera_isp_top_bypass_ds1_cs_conv_read(uintptr_t base) {
979 return (uint8_t)((system_sw_read_32(base + 0x18ec8L) & 0x10) >> 4);
980 }
981 // ------------------------------------------------------------------------------ //
982 // Register: ISP RAW bypass
983 // ------------------------------------------------------------------------------ //
984
985 // ------------------------------------------------------------------------------ //
986 // Used to select between normal ISP processing with image sensor data and up to 12 bit RGB input.
987 // In the latler case data is reinserted into pipeline after purple fringing correction block.
988 //
989 // ------------------------------------------------------------------------------ //
990
991 #define ACAMERA_ISP_TOP_ISP_RAW_BYPASS_DEFAULT (0)
992 #define ACAMERA_ISP_TOP_ISP_RAW_BYPASS_DATASIZE (1)
993 #define ACAMERA_ISP_TOP_ISP_RAW_BYPASS_OFFSET (0x44)
994 #define ACAMERA_ISP_TOP_ISP_RAW_BYPASS_MASK (0x1)
995 #define ACAMERA_ISP_TOP_ISP_RAW_BYPASS_SELECT_PROCESSED (0)
996 #define ACAMERA_ISP_TOP_ISP_RAW_BYPASS_BYPASS_ISP_RAW_PROCESSING (1)
997
998 // args: data (1-bit)
acamera_isp_top_isp_raw_bypass_write(uintptr_t base,uint8_t data)999 static __inline void acamera_isp_top_isp_raw_bypass_write(uintptr_t base, uint8_t data) {
1000 uint32_t curr = system_sw_read_32(base + 0x18eccL);
1001 system_sw_write_32(base + 0x18eccL, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
1002 }
acamera_isp_top_isp_raw_bypass_read(uintptr_t base)1003 static __inline uint8_t acamera_isp_top_isp_raw_bypass_read(uintptr_t base) {
1004 return (uint8_t)((system_sw_read_32(base + 0x18eccL) & 0x1) >> 0);
1005 }
1006 // ------------------------------------------------------------------------------ //
1007 // Register: ISP downscale pipe disable
1008 // ------------------------------------------------------------------------------ //
1009
1010 // ------------------------------------------------------------------------------ //
1011 //
1012 // 0: Downscale pipeline is enabled
1013 // 1: Downscale pipeline is disabled. No data is sent out in DMA and streaming channel
1014 //
1015 // ------------------------------------------------------------------------------ //
1016
1017 #define ACAMERA_ISP_TOP_ISP_DOWNSCALE_PIPE_DISABLE_DEFAULT (0)
1018 #define ACAMERA_ISP_TOP_ISP_DOWNSCALE_PIPE_DISABLE_DATASIZE (1)
1019 #define ACAMERA_ISP_TOP_ISP_DOWNSCALE_PIPE_DISABLE_OFFSET (0x44)
1020 #define ACAMERA_ISP_TOP_ISP_DOWNSCALE_PIPE_DISABLE_MASK (0x2)
1021 #define ACAMERA_ISP_TOP_ISP_DOWNSCALE_PIPE_DISABLE_SELECT_PROCESSED (0)
1022 #define ACAMERA_ISP_TOP_ISP_DOWNSCALE_PIPE_DISABLE_BYPASS_ISP_RAW_PROCESSING (1)
1023
1024 // args: data (1-bit)
acamera_isp_top_isp_downscale_pipe_disable_write(uintptr_t base,uint8_t data)1025 static __inline void acamera_isp_top_isp_downscale_pipe_disable_write(uintptr_t base, uint8_t data) {
1026 uint32_t curr = system_sw_read_32(base + 0x18eccL);
1027 system_sw_write_32(base + 0x18eccL, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
1028 }
acamera_isp_top_isp_downscale_pipe_disable_read(uintptr_t base)1029 static __inline uint8_t acamera_isp_top_isp_downscale_pipe_disable_read(uintptr_t base) {
1030 return (uint8_t)((system_sw_read_32(base + 0x18eccL) & 0x2) >> 1);
1031 }
1032 // ------------------------------------------------------------------------------ //
1033 // Register: ISP processing fr bypass mode
1034 // ------------------------------------------------------------------------------ //
1035
1036 // ------------------------------------------------------------------------------ //
1037 //
1038 // ISP FR bypass modes. For debug purposes only. Should be set to 0 during normal operation.
1039 // Used to bypass entire ISP after input port or to pass the stitched image directly to the output.
1040 //
1041 // ------------------------------------------------------------------------------ //
1042
1043 #define ACAMERA_ISP_TOP_ISP_PROCESSING_FR_BYPASS_MODE_DEFAULT (0)
1044 #define ACAMERA_ISP_TOP_ISP_PROCESSING_FR_BYPASS_MODE_DATASIZE (2)
1045 #define ACAMERA_ISP_TOP_ISP_PROCESSING_FR_BYPASS_MODE_OFFSET (0x44)
1046 #define ACAMERA_ISP_TOP_ISP_PROCESSING_FR_BYPASS_MODE_MASK (0x300)
1047 #define ACAMERA_ISP_TOP_ISP_PROCESSING_FR_BYPASS_MODE_FULL_PROCESSING (0)
1048 #define ACAMERA_ISP_TOP_ISP_PROCESSING_FR_BYPASS_MODE_BYPASS_ENTIRE_ISP_PROCESSING_AND_OUTPUT_194_OF_RAW_SENSOR_DATA_AFTER_VIDEO_TEST_GEN (1)
1049 #define ACAMERA_ISP_TOP_ISP_PROCESSING_FR_BYPASS_MODE_BYPASS_ENTIRE_ISP_PROCESSING_AND_OUTPUT_LSB_10BITS_BITS_OF_RAW_SENSOR_DATA_AFTER_VIDEO_TEST_GEN_DATA_MUST_BE_MSB_ALIGNED (2)
1050
1051 // args: data (2-bit)
acamera_isp_top_isp_processing_fr_bypass_mode_write(uintptr_t base,uint8_t data)1052 static __inline void acamera_isp_top_isp_processing_fr_bypass_mode_write(uintptr_t base, uint8_t data) {
1053 uint32_t curr = system_sw_read_32(base + 0x18eccL);
1054 system_sw_write_32(base + 0x18eccL, (((uint32_t) (data & 0x3)) << 8) | (curr & 0xfffffcff));
1055 }
acamera_isp_top_isp_processing_fr_bypass_mode_read(uintptr_t base)1056 static __inline uint8_t acamera_isp_top_isp_processing_fr_bypass_mode_read(uintptr_t base) {
1057 return (uint8_t)((system_sw_read_32(base + 0x18eccL) & 0x300) >> 8);
1058 }
1059 // ------------------------------------------------------------------------------ //
1060 // Register: AE 5bin hist disable
1061 // ------------------------------------------------------------------------------ //
1062
1063 // ------------------------------------------------------------------------------ //
1064 //
1065 // 0: AEXP 5-bin histogram enabled
1066 // 1: AEXP 5-bin histogram disabled
1067 //
1068 // ------------------------------------------------------------------------------ //
1069
1070 #define ACAMERA_ISP_TOP_AE_5BIN_HIST_DISABLE_DEFAULT (0)
1071 #define ACAMERA_ISP_TOP_AE_5BIN_HIST_DISABLE_DATASIZE (1)
1072 #define ACAMERA_ISP_TOP_AE_5BIN_HIST_DISABLE_OFFSET (0x48)
1073 #define ACAMERA_ISP_TOP_AE_5BIN_HIST_DISABLE_MASK (0x1)
1074
1075 // args: data (1-bit)
acamera_isp_top_ae_5bin_hist_disable_write(uintptr_t base,uint8_t data)1076 static __inline void acamera_isp_top_ae_5bin_hist_disable_write(uintptr_t base, uint8_t data) {
1077 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1078 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
1079 }
acamera_isp_top_ae_5bin_hist_disable_read(uintptr_t base)1080 static __inline uint8_t acamera_isp_top_ae_5bin_hist_disable_read(uintptr_t base) {
1081 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x1) >> 0);
1082 }
1083 // ------------------------------------------------------------------------------ //
1084 // Register: AE switch
1085 // ------------------------------------------------------------------------------ //
1086
1087 // ------------------------------------------------------------------------------ //
1088 // AE 5bin histogram tap in the pipeline. Location of AE statistic collection.
1089 // ------------------------------------------------------------------------------ //
1090
1091 #define ACAMERA_ISP_TOP_AE_SWITCH_DEFAULT (0)
1092 #define ACAMERA_ISP_TOP_AE_SWITCH_DATASIZE (2)
1093 #define ACAMERA_ISP_TOP_AE_SWITCH_OFFSET (0x48)
1094 #define ACAMERA_ISP_TOP_AE_SWITCH_MASK (0x6)
1095 #define ACAMERA_ISP_TOP_AE_SWITCH_AFTER_STATIC_WHITE_BALANCE_WHOSE_POSITION_IS_SELECTED_BY_AEXP_SRC_SIGNAL (0)
1096 #define ACAMERA_ISP_TOP_AE_SWITCH_AFTER_WDR_FRAME_STITCH_IF_ITS_SENSOR_COMPANDED_DATA_THEN_USE_DECOMPANDED_OUTPUT_IF_ITS_SENSOR_LINEARISED_DATA_THEN_USE_IT_DIRECTLY (1)
1097 #define ACAMERA_ISP_TOP_AE_SWITCH_AFTER_VTPG (2)
1098 #define ACAMERA_ISP_TOP_AE_SWITCH_RESERVED (3)
1099
1100 // args: data (2-bit)
acamera_isp_top_ae_switch_write(uintptr_t base,uint8_t data)1101 static __inline void acamera_isp_top_ae_switch_write(uintptr_t base, uint8_t data) {
1102 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1103 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x3)) << 1) | (curr & 0xfffffff9));
1104 }
acamera_isp_top_ae_switch_read(uintptr_t base)1105 static __inline uint8_t acamera_isp_top_ae_switch_read(uintptr_t base) {
1106 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x6) >> 1);
1107 }
1108 // ------------------------------------------------------------------------------ //
1109 // Register: AF disable
1110 // ------------------------------------------------------------------------------ //
1111
1112 // ------------------------------------------------------------------------------ //
1113 //
1114 // 0: AF enabled
1115 // 1: AF disabled
1116 //
1117 // ------------------------------------------------------------------------------ //
1118
1119 #define ACAMERA_ISP_TOP_AF_DISABLE_DEFAULT (0)
1120 #define ACAMERA_ISP_TOP_AF_DISABLE_DATASIZE (1)
1121 #define ACAMERA_ISP_TOP_AF_DISABLE_OFFSET (0x48)
1122 #define ACAMERA_ISP_TOP_AF_DISABLE_MASK (0x10)
1123
1124 // args: data (1-bit)
acamera_isp_top_af_disable_write(uintptr_t base,uint8_t data)1125 static __inline void acamera_isp_top_af_disable_write(uintptr_t base, uint8_t data) {
1126 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1127 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
1128 }
acamera_isp_top_af_disable_read(uintptr_t base)1129 static __inline uint8_t acamera_isp_top_af_disable_read(uintptr_t base) {
1130 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x10) >> 4);
1131 }
1132 // ------------------------------------------------------------------------------ //
1133 // Register: AF switch
1134 // ------------------------------------------------------------------------------ //
1135
1136 // ------------------------------------------------------------------------------ //
1137 // AF tap in the pipeline. .
1138 // ------------------------------------------------------------------------------ //
1139
1140 #define ACAMERA_ISP_TOP_AF_SWITCH_DEFAULT (0)
1141 #define ACAMERA_ISP_TOP_AF_SWITCH_DATASIZE (1)
1142 #define ACAMERA_ISP_TOP_AF_SWITCH_OFFSET (0x48)
1143 #define ACAMERA_ISP_TOP_AF_SWITCH_MASK (0x20)
1144 #define ACAMERA_ISP_TOP_AF_SWITCH_AFTER_SINTER (0)
1145 #define ACAMERA_ISP_TOP_AF_SWITCH_BEFORE_SINTER (1)
1146
1147 // args: data (1-bit)
acamera_isp_top_af_switch_write(uintptr_t base,uint8_t data)1148 static __inline void acamera_isp_top_af_switch_write(uintptr_t base, uint8_t data) {
1149 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1150 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 5) | (curr & 0xffffffdf));
1151 }
acamera_isp_top_af_switch_read(uintptr_t base)1152 static __inline uint8_t acamera_isp_top_af_switch_read(uintptr_t base) {
1153 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x20) >> 5);
1154 }
1155 // ------------------------------------------------------------------------------ //
1156 // Register: AWB disable
1157 // ------------------------------------------------------------------------------ //
1158
1159 // ------------------------------------------------------------------------------ //
1160 //
1161 // 0: AWB enabled
1162 // 1: AWB disabled
1163 //
1164 // ------------------------------------------------------------------------------ //
1165
1166 #define ACAMERA_ISP_TOP_AWB_DISABLE_DEFAULT (0)
1167 #define ACAMERA_ISP_TOP_AWB_DISABLE_DATASIZE (1)
1168 #define ACAMERA_ISP_TOP_AWB_DISABLE_OFFSET (0x48)
1169 #define ACAMERA_ISP_TOP_AWB_DISABLE_MASK (0x100)
1170
1171 // args: data (1-bit)
acamera_isp_top_awb_disable_write(uintptr_t base,uint8_t data)1172 static __inline void acamera_isp_top_awb_disable_write(uintptr_t base, uint8_t data) {
1173 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1174 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 8) | (curr & 0xfffffeff));
1175 }
acamera_isp_top_awb_disable_read(uintptr_t base)1176 static __inline uint8_t acamera_isp_top_awb_disable_read(uintptr_t base) {
1177 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x100) >> 8);
1178 }
1179 // ------------------------------------------------------------------------------ //
1180 // Register: AWB switch
1181 // ------------------------------------------------------------------------------ //
1182
1183 // ------------------------------------------------------------------------------ //
1184 // AWB tap in the pipeline. Location of AWB statistics collection.
1185 // ------------------------------------------------------------------------------ //
1186
1187 #define ACAMERA_ISP_TOP_AWB_SWITCH_DEFAULT (0)
1188 #define ACAMERA_ISP_TOP_AWB_SWITCH_DATASIZE (1)
1189 #define ACAMERA_ISP_TOP_AWB_SWITCH_OFFSET (0x48)
1190 #define ACAMERA_ISP_TOP_AWB_SWITCH_MASK (0x200)
1191 #define ACAMERA_ISP_TOP_AWB_SWITCH_IMMEDIATELY_AFTER_DEMOSAIC (0)
1192 #define ACAMERA_ISP_TOP_AWB_SWITCH_IMMEDIATELY_AFTER_CNR (1)
1193
1194 // args: data (1-bit)
acamera_isp_top_awb_switch_write(uintptr_t base,uint8_t data)1195 static __inline void acamera_isp_top_awb_switch_write(uintptr_t base, uint8_t data) {
1196 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1197 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 9) | (curr & 0xfffffdff));
1198 }
acamera_isp_top_awb_switch_read(uintptr_t base)1199 static __inline uint8_t acamera_isp_top_awb_switch_read(uintptr_t base) {
1200 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x200) >> 9);
1201 }
1202 // ------------------------------------------------------------------------------ //
1203 // Register: AEXP hist disable
1204 // ------------------------------------------------------------------------------ //
1205
1206 // ------------------------------------------------------------------------------ //
1207 //
1208 // 0: AEXP 1024-bin histogram enabled
1209 // 1: AEXP 1024-bin histogram disabled
1210 //
1211 // ------------------------------------------------------------------------------ //
1212
1213 #define ACAMERA_ISP_TOP_AEXP_HIST_DISABLE_DEFAULT (0)
1214 #define ACAMERA_ISP_TOP_AEXP_HIST_DISABLE_DATASIZE (1)
1215 #define ACAMERA_ISP_TOP_AEXP_HIST_DISABLE_OFFSET (0x48)
1216 #define ACAMERA_ISP_TOP_AEXP_HIST_DISABLE_MASK (0x1000)
1217
1218 // args: data (1-bit)
acamera_isp_top_aexp_hist_disable_write(uintptr_t base,uint8_t data)1219 static __inline void acamera_isp_top_aexp_hist_disable_write(uintptr_t base, uint8_t data) {
1220 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1221 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 12) | (curr & 0xffffefff));
1222 }
acamera_isp_top_aexp_hist_disable_read(uintptr_t base)1223 static __inline uint8_t acamera_isp_top_aexp_hist_disable_read(uintptr_t base) {
1224 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x1000) >> 12);
1225 }
1226 // ------------------------------------------------------------------------------ //
1227 // Register: AEXP Histogram switch
1228 // ------------------------------------------------------------------------------ //
1229
1230 // ------------------------------------------------------------------------------ //
1231 // AE global histogram tap in the pipeline. Location of statistics gathering for 1024 bin global histogram
1232 // ------------------------------------------------------------------------------ //
1233
1234 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_DEFAULT (0)
1235 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_DATASIZE (2)
1236 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_OFFSET (0x48)
1237 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_MASK (0x6000)
1238 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_AFTER_STATIC_WHITE_BALANCE_WHOSE_POSITION_IS_SELECTED_BY_AEXP_SRC_SIGNAL (0)
1239 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_AFTER_WDR_FRAME_STITCH_IF_ITS_SENSOR_COMPANDED_DATA_THEN_USE_DECOMPANDED_OUTPUT_IF_ITS_SENSOR_LINEARISED_DATA_THEN_USE_IT_DIRECTLY (1)
1240 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_AFTER_VTPG (2)
1241 #define ACAMERA_ISP_TOP_AEXP_HISTOGRAM_SWITCH_RESERVED (3)
1242
1243 // args: data (2-bit)
acamera_isp_top_aexp_histogram_switch_write(uintptr_t base,uint8_t data)1244 static __inline void acamera_isp_top_aexp_histogram_switch_write(uintptr_t base, uint8_t data) {
1245 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1246 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x3)) << 13) | (curr & 0xffff9fff));
1247 }
acamera_isp_top_aexp_histogram_switch_read(uintptr_t base)1248 static __inline uint8_t acamera_isp_top_aexp_histogram_switch_read(uintptr_t base) {
1249 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x6000) >> 13);
1250 }
1251 // ------------------------------------------------------------------------------ //
1252 // Register: iHist disable
1253 // ------------------------------------------------------------------------------ //
1254
1255 // ------------------------------------------------------------------------------ //
1256 // Post iridix histogram enable. Enables statistics gathering for global histogram
1257 // ------------------------------------------------------------------------------ //
1258
1259 #define ACAMERA_ISP_TOP_IHIST_DISABLE_DEFAULT (1)
1260 #define ACAMERA_ISP_TOP_IHIST_DISABLE_DATASIZE (1)
1261 #define ACAMERA_ISP_TOP_IHIST_DISABLE_OFFSET (0x48)
1262 #define ACAMERA_ISP_TOP_IHIST_DISABLE_MASK (0x10000)
1263 #define ACAMERA_ISP_TOP_IHIST_DISABLE_ENABLED (0)
1264 #define ACAMERA_ISP_TOP_IHIST_DISABLE_DISABLED (1)
1265
1266 // args: data (1-bit)
acamera_isp_top_ihist_disable_write(uintptr_t base,uint8_t data)1267 static __inline void acamera_isp_top_ihist_disable_write(uintptr_t base, uint8_t data) {
1268 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1269 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 16) | (curr & 0xfffeffff));
1270 }
acamera_isp_top_ihist_disable_read(uintptr_t base)1271 static __inline uint8_t acamera_isp_top_ihist_disable_read(uintptr_t base) {
1272 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x10000) >> 16);
1273 }
1274 // ------------------------------------------------------------------------------ //
1275 // Register: Lumavar Disable
1276 // ------------------------------------------------------------------------------ //
1277
1278 #define ACAMERA_ISP_TOP_LUMAVAR_DISABLE_DEFAULT (0)
1279 #define ACAMERA_ISP_TOP_LUMAVAR_DISABLE_DATASIZE (1)
1280 #define ACAMERA_ISP_TOP_LUMAVAR_DISABLE_OFFSET (0x48)
1281 #define ACAMERA_ISP_TOP_LUMAVAR_DISABLE_MASK (0x40000)
1282 #define ACAMERA_ISP_TOP_LUMAVAR_DISABLE_ENABLED (0)
1283 #define ACAMERA_ISP_TOP_LUMAVAR_DISABLE_DISABLED (1)
1284
1285 // args: data (1-bit)
acamera_isp_top_lumavar_disable_write(uintptr_t base,uint8_t data)1286 static __inline void acamera_isp_top_lumavar_disable_write(uintptr_t base, uint8_t data) {
1287 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1288 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 18) | (curr & 0xfffbffff));
1289 }
acamera_isp_top_lumavar_disable_read(uintptr_t base)1290 static __inline uint8_t acamera_isp_top_lumavar_disable_read(uintptr_t base) {
1291 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x40000) >> 18);
1292 }
1293 // ------------------------------------------------------------------------------ //
1294 // Register: Lumavar switch
1295 // ------------------------------------------------------------------------------ //
1296
1297 // ------------------------------------------------------------------------------ //
1298 // Luma variance tap in the pipeline.
1299 // ------------------------------------------------------------------------------ //
1300
1301 #define ACAMERA_ISP_TOP_LUMAVAR_SWITCH_DEFAULT (0)
1302 #define ACAMERA_ISP_TOP_LUMAVAR_SWITCH_DATASIZE (1)
1303 #define ACAMERA_ISP_TOP_LUMAVAR_SWITCH_OFFSET (0x48)
1304 #define ACAMERA_ISP_TOP_LUMAVAR_SWITCH_MASK (0x80000)
1305 #define ACAMERA_ISP_TOP_LUMAVAR_SWITCH_FULL_RESOLUTION_PIPELINE (0)
1306 #define ACAMERA_ISP_TOP_LUMAVAR_SWITCH_DOWNSCALED_PIPELINE (1)
1307
1308 // args: data (1-bit)
acamera_isp_top_lumavar_switch_write(uintptr_t base,uint8_t data)1309 static __inline void acamera_isp_top_lumavar_switch_write(uintptr_t base, uint8_t data) {
1310 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1311 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 19) | (curr & 0xfff7ffff));
1312 }
acamera_isp_top_lumavar_switch_read(uintptr_t base)1313 static __inline uint8_t acamera_isp_top_lumavar_switch_read(uintptr_t base) {
1314 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x80000) >> 19);
1315 }
1316 // ------------------------------------------------------------------------------ //
1317 // Register: aexp_src
1318 // ------------------------------------------------------------------------------ //
1319
1320 // ------------------------------------------------------------------------------ //
1321 //
1322 //
1323 // ------------------------------------------------------------------------------ //
1324
1325 #define ACAMERA_ISP_TOP_AEXP_SRC_DEFAULT (0)
1326 #define ACAMERA_ISP_TOP_AEXP_SRC_DATASIZE (1)
1327 #define ACAMERA_ISP_TOP_AEXP_SRC_OFFSET (0x48)
1328 #define ACAMERA_ISP_TOP_AEXP_SRC_MASK (0x1000000)
1329 #define ACAMERA_ISP_TOP_AEXP_SRC_AFTER_STATIC_WHITE_BALANCE_WHEN_APPLIED_BEFORE_SHADING (0)
1330 #define ACAMERA_ISP_TOP_AEXP_SRC_AFTER_STATIC_WHITE_BALANCE_WHEN_APPLIED_AFTER_SHADING (1)
1331
1332 // args: data (1-bit)
acamera_isp_top_aexp_src_write(uintptr_t base,uint8_t data)1333 static __inline void acamera_isp_top_aexp_src_write(uintptr_t base, uint8_t data) {
1334 uint32_t curr = system_sw_read_32(base + 0x18ed0L);
1335 system_sw_write_32(base + 0x18ed0L, (((uint32_t) (data & 0x1)) << 24) | (curr & 0xfeffffff));
1336 }
acamera_isp_top_aexp_src_read(uintptr_t base)1337 static __inline uint8_t acamera_isp_top_aexp_src_read(uintptr_t base) {
1338 return (uint8_t)((system_sw_read_32(base + 0x18ed0L) & 0x1000000) >> 24);
1339 }
1340 // ------------------------------------------------------------------------------ //
1341 // Group: crossbar
1342 // ------------------------------------------------------------------------------ //
1343
1344 // ------------------------------------------------------------------------------ //
1345 // Register: channel1_select
1346 // ------------------------------------------------------------------------------ //
1347
1348 // ------------------------------------------------------------------------------ //
1349 // channel0 selection from the input 4 channels
1350 // ------------------------------------------------------------------------------ //
1351
1352 #define ACAMERA_ISP_CROSSBAR_CHANNEL1_SELECT_DEFAULT (0x0)
1353 #define ACAMERA_ISP_CROSSBAR_CHANNEL1_SELECT_DATASIZE (2)
1354 #define ACAMERA_ISP_CROSSBAR_CHANNEL1_SELECT_OFFSET (0x4c)
1355 #define ACAMERA_ISP_CROSSBAR_CHANNEL1_SELECT_MASK (0x3)
1356
1357 // args: data (2-bit)
acamera_isp_crossbar_channel1_select_write(uintptr_t base,uint8_t data)1358 static __inline void acamera_isp_crossbar_channel1_select_write(uintptr_t base, uint8_t data) {
1359 uint32_t curr = system_sw_read_32(base + 0x18ed4L);
1360 system_sw_write_32(base + 0x18ed4L, (((uint32_t) (data & 0x3)) << 0) | (curr & 0xfffffffc));
1361 }
acamera_isp_crossbar_channel1_select_read(uintptr_t base)1362 static __inline uint8_t acamera_isp_crossbar_channel1_select_read(uintptr_t base) {
1363 return (uint8_t)((system_sw_read_32(base + 0x18ed4L) & 0x3) >> 0);
1364 }
1365 // ------------------------------------------------------------------------------ //
1366 // Register: channel2_select
1367 // ------------------------------------------------------------------------------ //
1368
1369 // ------------------------------------------------------------------------------ //
1370 // channel1 selection from the input 4 channels
1371 // ------------------------------------------------------------------------------ //
1372
1373 #define ACAMERA_ISP_CROSSBAR_CHANNEL2_SELECT_DEFAULT (0x1)
1374 #define ACAMERA_ISP_CROSSBAR_CHANNEL2_SELECT_DATASIZE (2)
1375 #define ACAMERA_ISP_CROSSBAR_CHANNEL2_SELECT_OFFSET (0x4c)
1376 #define ACAMERA_ISP_CROSSBAR_CHANNEL2_SELECT_MASK (0x300)
1377
1378 // args: data (2-bit)
acamera_isp_crossbar_channel2_select_write(uintptr_t base,uint8_t data)1379 static __inline void acamera_isp_crossbar_channel2_select_write(uintptr_t base, uint8_t data) {
1380 uint32_t curr = system_sw_read_32(base + 0x18ed4L);
1381 system_sw_write_32(base + 0x18ed4L, (((uint32_t) (data & 0x3)) << 8) | (curr & 0xfffffcff));
1382 }
acamera_isp_crossbar_channel2_select_read(uintptr_t base)1383 static __inline uint8_t acamera_isp_crossbar_channel2_select_read(uintptr_t base) {
1384 return (uint8_t)((system_sw_read_32(base + 0x18ed4L) & 0x300) >> 8);
1385 }
1386 // ------------------------------------------------------------------------------ //
1387 // Register: channel3_select
1388 // ------------------------------------------------------------------------------ //
1389
1390 // ------------------------------------------------------------------------------ //
1391 // channel2 selection from the input 4 channels
1392 // ------------------------------------------------------------------------------ //
1393
1394 #define ACAMERA_ISP_CROSSBAR_CHANNEL3_SELECT_DEFAULT (0x2)
1395 #define ACAMERA_ISP_CROSSBAR_CHANNEL3_SELECT_DATASIZE (2)
1396 #define ACAMERA_ISP_CROSSBAR_CHANNEL3_SELECT_OFFSET (0x4c)
1397 #define ACAMERA_ISP_CROSSBAR_CHANNEL3_SELECT_MASK (0x30000)
1398
1399 // args: data (2-bit)
acamera_isp_crossbar_channel3_select_write(uintptr_t base,uint8_t data)1400 static __inline void acamera_isp_crossbar_channel3_select_write(uintptr_t base, uint8_t data) {
1401 uint32_t curr = system_sw_read_32(base + 0x18ed4L);
1402 system_sw_write_32(base + 0x18ed4L, (((uint32_t) (data & 0x3)) << 16) | (curr & 0xfffcffff));
1403 }
acamera_isp_crossbar_channel3_select_read(uintptr_t base)1404 static __inline uint8_t acamera_isp_crossbar_channel3_select_read(uintptr_t base) {
1405 return (uint8_t)((system_sw_read_32(base + 0x18ed4L) & 0x30000) >> 16);
1406 }
1407 // ------------------------------------------------------------------------------ //
1408 // Register: channel4_select
1409 // ------------------------------------------------------------------------------ //
1410
1411 // ------------------------------------------------------------------------------ //
1412 // channel4 selection from the input 4 channels
1413 // ------------------------------------------------------------------------------ //
1414
1415 #define ACAMERA_ISP_CROSSBAR_CHANNEL4_SELECT_DEFAULT (0x3)
1416 #define ACAMERA_ISP_CROSSBAR_CHANNEL4_SELECT_DATASIZE (2)
1417 #define ACAMERA_ISP_CROSSBAR_CHANNEL4_SELECT_OFFSET (0x4c)
1418 #define ACAMERA_ISP_CROSSBAR_CHANNEL4_SELECT_MASK (0x3000000)
1419
1420 // args: data (2-bit)
acamera_isp_crossbar_channel4_select_write(uintptr_t base,uint8_t data)1421 static __inline void acamera_isp_crossbar_channel4_select_write(uintptr_t base, uint8_t data) {
1422 uint32_t curr = system_sw_read_32(base + 0x18ed4L);
1423 system_sw_write_32(base + 0x18ed4L, (((uint32_t) (data & 0x3)) << 24) | (curr & 0xfcffffff));
1424 }
acamera_isp_crossbar_channel4_select_read(uintptr_t base)1425 static __inline uint8_t acamera_isp_crossbar_channel4_select_read(uintptr_t base) {
1426 return (uint8_t)((system_sw_read_32(base + 0x18ed4L) & 0x3000000) >> 24);
1427 }
1428 // ------------------------------------------------------------------------------ //
1429 // Group: video test gen ch0
1430 // ------------------------------------------------------------------------------ //
1431
1432 // ------------------------------------------------------------------------------ //
1433 // Video test generator controls. See ISP Guide for further details
1434 // ------------------------------------------------------------------------------ //
1435
1436 // ------------------------------------------------------------------------------ //
1437 // Register: test_pattern_off on
1438 // ------------------------------------------------------------------------------ //
1439
1440 // ------------------------------------------------------------------------------ //
1441 // Test pattern off-on: 0=off, 1=on
1442 // ------------------------------------------------------------------------------ //
1443
1444 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_TEST_PATTERN_OFF_ON_DEFAULT (0)
1445 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_TEST_PATTERN_OFF_ON_DATASIZE (1)
1446 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_TEST_PATTERN_OFF_ON_OFFSET (0x50)
1447 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_TEST_PATTERN_OFF_ON_MASK (0x1)
1448
1449 // args: data (1-bit)
acamera_isp_video_test_gen_ch0_test_pattern_off_on_write(uintptr_t base,uint8_t data)1450 static __inline void acamera_isp_video_test_gen_ch0_test_pattern_off_on_write(uintptr_t base, uint8_t data) {
1451 uint32_t curr = system_sw_read_32(base + 0x18ed8L);
1452 system_sw_write_32(base + 0x18ed8L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
1453 }
acamera_isp_video_test_gen_ch0_test_pattern_off_on_read(uintptr_t base)1454 static __inline uint8_t acamera_isp_video_test_gen_ch0_test_pattern_off_on_read(uintptr_t base) {
1455 return (uint8_t)((system_sw_read_32(base + 0x18ed8L) & 0x1) >> 0);
1456 }
1457 // ------------------------------------------------------------------------------ //
1458 // Register: bayer_rgb_i sel
1459 // ------------------------------------------------------------------------------ //
1460
1461 // ------------------------------------------------------------------------------ //
1462 // Bayer or rgb select for input video: 0=bayer, 1=rgb
1463 // ------------------------------------------------------------------------------ //
1464
1465 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_I_SEL_DEFAULT (0)
1466 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_I_SEL_DATASIZE (1)
1467 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_I_SEL_OFFSET (0x50)
1468 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_I_SEL_MASK (0x2)
1469
1470 // args: data (1-bit)
acamera_isp_video_test_gen_ch0_bayer_rgb_i_sel_write(uintptr_t base,uint8_t data)1471 static __inline void acamera_isp_video_test_gen_ch0_bayer_rgb_i_sel_write(uintptr_t base, uint8_t data) {
1472 uint32_t curr = system_sw_read_32(base + 0x18ed8L);
1473 system_sw_write_32(base + 0x18ed8L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
1474 }
acamera_isp_video_test_gen_ch0_bayer_rgb_i_sel_read(uintptr_t base)1475 static __inline uint8_t acamera_isp_video_test_gen_ch0_bayer_rgb_i_sel_read(uintptr_t base) {
1476 return (uint8_t)((system_sw_read_32(base + 0x18ed8L) & 0x2) >> 1);
1477 }
1478 // ------------------------------------------------------------------------------ //
1479 // Register: bayer_rgb_o sel
1480 // ------------------------------------------------------------------------------ //
1481
1482 // ------------------------------------------------------------------------------ //
1483 // Bayer or rgb select for output video: 0=bayer, 1=rgb
1484 // ------------------------------------------------------------------------------ //
1485
1486 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_O_SEL_DEFAULT (0)
1487 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_O_SEL_DATASIZE (1)
1488 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_O_SEL_OFFSET (0x50)
1489 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_BAYER_RGB_O_SEL_MASK (0x4)
1490
1491 // args: data (1-bit)
acamera_isp_video_test_gen_ch0_bayer_rgb_o_sel_write(uintptr_t base,uint8_t data)1492 static __inline void acamera_isp_video_test_gen_ch0_bayer_rgb_o_sel_write(uintptr_t base, uint8_t data) {
1493 uint32_t curr = system_sw_read_32(base + 0x18ed8L);
1494 system_sw_write_32(base + 0x18ed8L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
1495 }
acamera_isp_video_test_gen_ch0_bayer_rgb_o_sel_read(uintptr_t base)1496 static __inline uint8_t acamera_isp_video_test_gen_ch0_bayer_rgb_o_sel_read(uintptr_t base) {
1497 return (uint8_t)((system_sw_read_32(base + 0x18ed8L) & 0x4) >> 2);
1498 }
1499 // ------------------------------------------------------------------------------ //
1500 // Register: Generate mode
1501 // ------------------------------------------------------------------------------ //
1502
1503 // ------------------------------------------------------------------------------ //
1504 // 0 = One Shot (on request) generation. 1 = free run (continuous) generation
1505 // ------------------------------------------------------------------------------ //
1506
1507 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_GENERATE_MODE_DEFAULT (0)
1508 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_GENERATE_MODE_DATASIZE (1)
1509 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_GENERATE_MODE_OFFSET (0x50)
1510 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_GENERATE_MODE_MASK (0x8)
1511
1512 // args: data (1-bit)
acamera_isp_video_test_gen_ch0_generate_mode_write(uintptr_t base,uint8_t data)1513 static __inline void acamera_isp_video_test_gen_ch0_generate_mode_write(uintptr_t base, uint8_t data) {
1514 uint32_t curr = system_sw_read_32(base + 0x18ed8L);
1515 system_sw_write_32(base + 0x18ed8L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
1516 }
acamera_isp_video_test_gen_ch0_generate_mode_read(uintptr_t base)1517 static __inline uint8_t acamera_isp_video_test_gen_ch0_generate_mode_read(uintptr_t base) {
1518 return (uint8_t)((system_sw_read_32(base + 0x18ed8L) & 0x8) >> 3);
1519 }
1520 // ------------------------------------------------------------------------------ //
1521 // Register: Video source
1522 // ------------------------------------------------------------------------------ //
1523
1524 // ------------------------------------------------------------------------------ //
1525 // 0 = Video in interface 1 = Internal Video generation
1526 // ------------------------------------------------------------------------------ //
1527
1528 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_VIDEO_SOURCE_DEFAULT (0)
1529 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_VIDEO_SOURCE_DATASIZE (1)
1530 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_VIDEO_SOURCE_OFFSET (0x50)
1531 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_VIDEO_SOURCE_MASK (0x10)
1532
1533 // args: data (1-bit)
acamera_isp_video_test_gen_ch0_video_source_write(uintptr_t base,uint8_t data)1534 static __inline void acamera_isp_video_test_gen_ch0_video_source_write(uintptr_t base, uint8_t data) {
1535 uint32_t curr = system_sw_read_32(base + 0x18ed8L);
1536 system_sw_write_32(base + 0x18ed8L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
1537 }
acamera_isp_video_test_gen_ch0_video_source_read(uintptr_t base)1538 static __inline uint8_t acamera_isp_video_test_gen_ch0_video_source_read(uintptr_t base) {
1539 return (uint8_t)((system_sw_read_32(base + 0x18ed8L) & 0x10) >> 4);
1540 }
1541 // ------------------------------------------------------------------------------ //
1542 // Register: pattern type
1543 // ------------------------------------------------------------------------------ //
1544
1545 // ------------------------------------------------------------------------------ //
1546 // Pattern type select: 0=Flat field,1=Horizontal gradient,2=Vertical Gradient,3=Vertical Bars,4=Rectangle,5-255=Default white frame on black
1547 // ------------------------------------------------------------------------------ //
1548
1549 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_PATTERN_TYPE_DEFAULT (0x03)
1550 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_PATTERN_TYPE_DATASIZE (8)
1551 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_PATTERN_TYPE_OFFSET (0x54)
1552 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_PATTERN_TYPE_MASK (0xff)
1553
1554 // args: data (8-bit)
acamera_isp_video_test_gen_ch0_pattern_type_write(uintptr_t base,uint8_t data)1555 static __inline void acamera_isp_video_test_gen_ch0_pattern_type_write(uintptr_t base, uint8_t data) {
1556 uint32_t curr = system_sw_read_32(base + 0x18edcL);
1557 system_sw_write_32(base + 0x18edcL, (((uint32_t) (data & 0xff)) << 0) | (curr & 0xffffff00));
1558 }
acamera_isp_video_test_gen_ch0_pattern_type_read(uintptr_t base)1559 static __inline uint8_t acamera_isp_video_test_gen_ch0_pattern_type_read(uintptr_t base) {
1560 return (uint8_t)((system_sw_read_32(base + 0x18edcL) & 0xff) >> 0);
1561 }
1562 // ------------------------------------------------------------------------------ //
1563 // Register: r backgnd
1564 // ------------------------------------------------------------------------------ //
1565
1566 // ------------------------------------------------------------------------------ //
1567 // Red background value 16bit, MSB aligned to used width
1568 // ------------------------------------------------------------------------------ //
1569
1570 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_BACKGND_DEFAULT (0xFFFF)
1571 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_BACKGND_DATASIZE (20)
1572 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_BACKGND_OFFSET (0x58)
1573 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_BACKGND_MASK (0xfffff)
1574
1575 // args: data (20-bit)
acamera_isp_video_test_gen_ch0_r_backgnd_write(uintptr_t base,uint32_t data)1576 static __inline void acamera_isp_video_test_gen_ch0_r_backgnd_write(uintptr_t base, uint32_t data) {
1577 uint32_t curr = system_sw_read_32(base + 0x18ee0L);
1578 system_sw_write_32(base + 0x18ee0L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1579 }
acamera_isp_video_test_gen_ch0_r_backgnd_read(uintptr_t base)1580 static __inline uint32_t acamera_isp_video_test_gen_ch0_r_backgnd_read(uintptr_t base) {
1581 return (uint32_t)((system_sw_read_32(base + 0x18ee0L) & 0xfffff) >> 0);
1582 }
1583 // ------------------------------------------------------------------------------ //
1584 // Register: g backgnd
1585 // ------------------------------------------------------------------------------ //
1586
1587 // ------------------------------------------------------------------------------ //
1588 // Green background value 16bit, MSB aligned to used width
1589 // ------------------------------------------------------------------------------ //
1590
1591 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_BACKGND_DEFAULT (0xFFFF)
1592 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_BACKGND_DATASIZE (20)
1593 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_BACKGND_OFFSET (0x5c)
1594 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_BACKGND_MASK (0xfffff)
1595
1596 // args: data (20-bit)
acamera_isp_video_test_gen_ch0_g_backgnd_write(uintptr_t base,uint32_t data)1597 static __inline void acamera_isp_video_test_gen_ch0_g_backgnd_write(uintptr_t base, uint32_t data) {
1598 uint32_t curr = system_sw_read_32(base + 0x18ee4L);
1599 system_sw_write_32(base + 0x18ee4L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1600 }
acamera_isp_video_test_gen_ch0_g_backgnd_read(uintptr_t base)1601 static __inline uint32_t acamera_isp_video_test_gen_ch0_g_backgnd_read(uintptr_t base) {
1602 return (uint32_t)((system_sw_read_32(base + 0x18ee4L) & 0xfffff) >> 0);
1603 }
1604 // ------------------------------------------------------------------------------ //
1605 // Register: b backgnd
1606 // ------------------------------------------------------------------------------ //
1607
1608 // ------------------------------------------------------------------------------ //
1609 // Blue background value 16bit, MSB aligned to used width
1610 // ------------------------------------------------------------------------------ //
1611
1612 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_BACKGND_DEFAULT (0xFFFF)
1613 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_BACKGND_DATASIZE (20)
1614 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_BACKGND_OFFSET (0x60)
1615 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_BACKGND_MASK (0xfffff)
1616
1617 // args: data (20-bit)
acamera_isp_video_test_gen_ch0_b_backgnd_write(uintptr_t base,uint32_t data)1618 static __inline void acamera_isp_video_test_gen_ch0_b_backgnd_write(uintptr_t base, uint32_t data) {
1619 uint32_t curr = system_sw_read_32(base + 0x18ee8L);
1620 system_sw_write_32(base + 0x18ee8L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1621 }
acamera_isp_video_test_gen_ch0_b_backgnd_read(uintptr_t base)1622 static __inline uint32_t acamera_isp_video_test_gen_ch0_b_backgnd_read(uintptr_t base) {
1623 return (uint32_t)((system_sw_read_32(base + 0x18ee8L) & 0xfffff) >> 0);
1624 }
1625 // ------------------------------------------------------------------------------ //
1626 // Register: r foregnd
1627 // ------------------------------------------------------------------------------ //
1628
1629 // ------------------------------------------------------------------------------ //
1630 // Red foreground value 16bit, MSB aligned to used width
1631 // ------------------------------------------------------------------------------ //
1632
1633 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_FOREGND_DEFAULT (0x8FFF)
1634 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_FOREGND_DATASIZE (20)
1635 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_FOREGND_OFFSET (0x64)
1636 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_R_FOREGND_MASK (0xfffff)
1637
1638 // args: data (20-bit)
acamera_isp_video_test_gen_ch0_r_foregnd_write(uintptr_t base,uint32_t data)1639 static __inline void acamera_isp_video_test_gen_ch0_r_foregnd_write(uintptr_t base, uint32_t data) {
1640 uint32_t curr = system_sw_read_32(base + 0x18eecL);
1641 system_sw_write_32(base + 0x18eecL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1642 }
acamera_isp_video_test_gen_ch0_r_foregnd_read(uintptr_t base)1643 static __inline uint32_t acamera_isp_video_test_gen_ch0_r_foregnd_read(uintptr_t base) {
1644 return (uint32_t)((system_sw_read_32(base + 0x18eecL) & 0xfffff) >> 0);
1645 }
1646 // ------------------------------------------------------------------------------ //
1647 // Register: g foregnd
1648 // ------------------------------------------------------------------------------ //
1649
1650 // ------------------------------------------------------------------------------ //
1651 // Green foreground value 16bit, MSB aligned to used width
1652 // ------------------------------------------------------------------------------ //
1653
1654 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_FOREGND_DEFAULT (0x8FFF)
1655 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_FOREGND_DATASIZE (20)
1656 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_FOREGND_OFFSET (0x68)
1657 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_G_FOREGND_MASK (0xfffff)
1658
1659 // args: data (20-bit)
acamera_isp_video_test_gen_ch0_g_foregnd_write(uintptr_t base,uint32_t data)1660 static __inline void acamera_isp_video_test_gen_ch0_g_foregnd_write(uintptr_t base, uint32_t data) {
1661 uint32_t curr = system_sw_read_32(base + 0x18ef0L);
1662 system_sw_write_32(base + 0x18ef0L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1663 }
acamera_isp_video_test_gen_ch0_g_foregnd_read(uintptr_t base)1664 static __inline uint32_t acamera_isp_video_test_gen_ch0_g_foregnd_read(uintptr_t base) {
1665 return (uint32_t)((system_sw_read_32(base + 0x18ef0L) & 0xfffff) >> 0);
1666 }
1667 // ------------------------------------------------------------------------------ //
1668 // Register: b foregnd
1669 // ------------------------------------------------------------------------------ //
1670
1671 // ------------------------------------------------------------------------------ //
1672 // Blue foreground value 16bit, MSB aligned to used width
1673 // ------------------------------------------------------------------------------ //
1674
1675 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_FOREGND_DEFAULT (0x8FFF)
1676 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_FOREGND_DATASIZE (20)
1677 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_FOREGND_OFFSET (0x6c)
1678 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_B_FOREGND_MASK (0xfffff)
1679
1680 // args: data (20-bit)
acamera_isp_video_test_gen_ch0_b_foregnd_write(uintptr_t base,uint32_t data)1681 static __inline void acamera_isp_video_test_gen_ch0_b_foregnd_write(uintptr_t base, uint32_t data) {
1682 uint32_t curr = system_sw_read_32(base + 0x18ef4L);
1683 system_sw_write_32(base + 0x18ef4L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1684 }
acamera_isp_video_test_gen_ch0_b_foregnd_read(uintptr_t base)1685 static __inline uint32_t acamera_isp_video_test_gen_ch0_b_foregnd_read(uintptr_t base) {
1686 return (uint32_t)((system_sw_read_32(base + 0x18ef4L) & 0xfffff) >> 0);
1687 }
1688 // ------------------------------------------------------------------------------ //
1689 // Register: rgb gradient
1690 // ------------------------------------------------------------------------------ //
1691
1692 // ------------------------------------------------------------------------------ //
1693 // RGB gradient increment per pixel (0-15) for first channel
1694 // ------------------------------------------------------------------------------ //
1695
1696 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_DEFAULT (0x3CAA)
1697 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_DATASIZE (16)
1698 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_OFFSET (0x70)
1699 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_MASK (0xffff)
1700
1701 // args: data (16-bit)
acamera_isp_video_test_gen_ch0_rgb_gradient_write(uintptr_t base,uint16_t data)1702 static __inline void acamera_isp_video_test_gen_ch0_rgb_gradient_write(uintptr_t base, uint16_t data) {
1703 uint32_t curr = system_sw_read_32(base + 0x18ef8L);
1704 system_sw_write_32(base + 0x18ef8L, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
1705 }
acamera_isp_video_test_gen_ch0_rgb_gradient_read(uintptr_t base)1706 static __inline uint16_t acamera_isp_video_test_gen_ch0_rgb_gradient_read(uintptr_t base) {
1707 return (uint16_t)((system_sw_read_32(base + 0x18ef8L) & 0xffff) >> 0);
1708 }
1709 // ------------------------------------------------------------------------------ //
1710 // Register: rgb_gradient start
1711 // ------------------------------------------------------------------------------ //
1712
1713 // ------------------------------------------------------------------------------ //
1714 // RGB gradient start value for first channel 16bit, MSB aligned to used width
1715 // ------------------------------------------------------------------------------ //
1716
1717 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_START_DEFAULT (0x0000)
1718 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_START_DATASIZE (20)
1719 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_START_OFFSET (0x74)
1720 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RGB_GRADIENT_START_MASK (0xfffff)
1721
1722 // args: data (20-bit)
acamera_isp_video_test_gen_ch0_rgb_gradient_start_write(uintptr_t base,uint32_t data)1723 static __inline void acamera_isp_video_test_gen_ch0_rgb_gradient_start_write(uintptr_t base, uint32_t data) {
1724 uint32_t curr = system_sw_read_32(base + 0x18efcL);
1725 system_sw_write_32(base + 0x18efcL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1726 }
acamera_isp_video_test_gen_ch0_rgb_gradient_start_read(uintptr_t base)1727 static __inline uint32_t acamera_isp_video_test_gen_ch0_rgb_gradient_start_read(uintptr_t base) {
1728 return (uint32_t)((system_sw_read_32(base + 0x18efcL) & 0xfffff) >> 0);
1729 }
1730 // ------------------------------------------------------------------------------ //
1731 // Register: rect top
1732 // ------------------------------------------------------------------------------ //
1733
1734 // ------------------------------------------------------------------------------ //
1735 // Rectangle top line number 1-n
1736 // ------------------------------------------------------------------------------ //
1737
1738 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_TOP_DEFAULT (0x0001)
1739 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_TOP_DATASIZE (14)
1740 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_TOP_OFFSET (0x78)
1741 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_TOP_MASK (0x3fff)
1742
1743 // args: data (14-bit)
acamera_isp_video_test_gen_ch0_rect_top_write(uintptr_t base,uint16_t data)1744 static __inline void acamera_isp_video_test_gen_ch0_rect_top_write(uintptr_t base, uint16_t data) {
1745 uint32_t curr = system_sw_read_32(base + 0x18f00L);
1746 system_sw_write_32(base + 0x18f00L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
1747 }
acamera_isp_video_test_gen_ch0_rect_top_read(uintptr_t base)1748 static __inline uint16_t acamera_isp_video_test_gen_ch0_rect_top_read(uintptr_t base) {
1749 return (uint16_t)((system_sw_read_32(base + 0x18f00L) & 0x3fff) >> 0);
1750 }
1751 // ------------------------------------------------------------------------------ //
1752 // Register: rect bot
1753 // ------------------------------------------------------------------------------ //
1754
1755 // ------------------------------------------------------------------------------ //
1756 // Rectangle bottom line number 1-n
1757 // ------------------------------------------------------------------------------ //
1758
1759 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_BOT_DEFAULT (0x0100)
1760 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_BOT_DATASIZE (14)
1761 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_BOT_OFFSET (0x78)
1762 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_BOT_MASK (0x3fff0000)
1763
1764 // args: data (14-bit)
acamera_isp_video_test_gen_ch0_rect_bot_write(uintptr_t base,uint16_t data)1765 static __inline void acamera_isp_video_test_gen_ch0_rect_bot_write(uintptr_t base, uint16_t data) {
1766 uint32_t curr = system_sw_read_32(base + 0x18f00L);
1767 system_sw_write_32(base + 0x18f00L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
1768 }
acamera_isp_video_test_gen_ch0_rect_bot_read(uintptr_t base)1769 static __inline uint16_t acamera_isp_video_test_gen_ch0_rect_bot_read(uintptr_t base) {
1770 return (uint16_t)((system_sw_read_32(base + 0x18f00L) & 0x3fff0000) >> 16);
1771 }
1772 // ------------------------------------------------------------------------------ //
1773 // Register: rect left
1774 // ------------------------------------------------------------------------------ //
1775
1776 // ------------------------------------------------------------------------------ //
1777 // Rectangle left pixel number 1-n
1778 // ------------------------------------------------------------------------------ //
1779
1780 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_LEFT_DEFAULT (0x0001)
1781 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_LEFT_DATASIZE (14)
1782 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_LEFT_OFFSET (0x7c)
1783 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_LEFT_MASK (0x3fff)
1784
1785 // args: data (14-bit)
acamera_isp_video_test_gen_ch0_rect_left_write(uintptr_t base,uint16_t data)1786 static __inline void acamera_isp_video_test_gen_ch0_rect_left_write(uintptr_t base, uint16_t data) {
1787 uint32_t curr = system_sw_read_32(base + 0x18f04L);
1788 system_sw_write_32(base + 0x18f04L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
1789 }
acamera_isp_video_test_gen_ch0_rect_left_read(uintptr_t base)1790 static __inline uint16_t acamera_isp_video_test_gen_ch0_rect_left_read(uintptr_t base) {
1791 return (uint16_t)((system_sw_read_32(base + 0x18f04L) & 0x3fff) >> 0);
1792 }
1793 // ------------------------------------------------------------------------------ //
1794 // Register: rect right
1795 // ------------------------------------------------------------------------------ //
1796
1797 // ------------------------------------------------------------------------------ //
1798 // Rectangle right pixel number 1-n
1799 // ------------------------------------------------------------------------------ //
1800
1801 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_RIGHT_DEFAULT (0x0100)
1802 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_RIGHT_DATASIZE (14)
1803 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_RIGHT_OFFSET (0x7c)
1804 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH0_RECT_RIGHT_MASK (0x3fff0000)
1805
1806 // args: data (14-bit)
acamera_isp_video_test_gen_ch0_rect_right_write(uintptr_t base,uint16_t data)1807 static __inline void acamera_isp_video_test_gen_ch0_rect_right_write(uintptr_t base, uint16_t data) {
1808 uint32_t curr = system_sw_read_32(base + 0x18f04L);
1809 system_sw_write_32(base + 0x18f04L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
1810 }
acamera_isp_video_test_gen_ch0_rect_right_read(uintptr_t base)1811 static __inline uint16_t acamera_isp_video_test_gen_ch0_rect_right_read(uintptr_t base) {
1812 return (uint16_t)((system_sw_read_32(base + 0x18f04L) & 0x3fff0000) >> 16);
1813 }
1814 // ------------------------------------------------------------------------------ //
1815 // Group: video test gen ch1
1816 // ------------------------------------------------------------------------------ //
1817
1818 // ------------------------------------------------------------------------------ //
1819 // Video test generator controls. See ISP Guide for further details
1820 // ------------------------------------------------------------------------------ //
1821
1822 // ------------------------------------------------------------------------------ //
1823 // Register: test_pattern_off on
1824 // ------------------------------------------------------------------------------ //
1825
1826 // ------------------------------------------------------------------------------ //
1827 // Test pattern off-on: 0=off, 1=on
1828 // ------------------------------------------------------------------------------ //
1829
1830 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_TEST_PATTERN_OFF_ON_DEFAULT (0)
1831 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_TEST_PATTERN_OFF_ON_DATASIZE (1)
1832 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_TEST_PATTERN_OFF_ON_OFFSET (0x80)
1833 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_TEST_PATTERN_OFF_ON_MASK (0x1)
1834
1835 // args: data (1-bit)
acamera_isp_video_test_gen_ch1_test_pattern_off_on_write(uintptr_t base,uint8_t data)1836 static __inline void acamera_isp_video_test_gen_ch1_test_pattern_off_on_write(uintptr_t base, uint8_t data) {
1837 uint32_t curr = system_sw_read_32(base + 0x18f08L);
1838 system_sw_write_32(base + 0x18f08L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
1839 }
acamera_isp_video_test_gen_ch1_test_pattern_off_on_read(uintptr_t base)1840 static __inline uint8_t acamera_isp_video_test_gen_ch1_test_pattern_off_on_read(uintptr_t base) {
1841 return (uint8_t)((system_sw_read_32(base + 0x18f08L) & 0x1) >> 0);
1842 }
1843 // ------------------------------------------------------------------------------ //
1844 // Register: bayer_rgb_i sel
1845 // ------------------------------------------------------------------------------ //
1846
1847 // ------------------------------------------------------------------------------ //
1848 // Bayer or rgb select for input video: 0=bayer, 1=rgb
1849 // ------------------------------------------------------------------------------ //
1850
1851 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_I_SEL_DEFAULT (0)
1852 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_I_SEL_DATASIZE (1)
1853 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_I_SEL_OFFSET (0x80)
1854 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_I_SEL_MASK (0x2)
1855
1856 // args: data (1-bit)
acamera_isp_video_test_gen_ch1_bayer_rgb_i_sel_write(uintptr_t base,uint8_t data)1857 static __inline void acamera_isp_video_test_gen_ch1_bayer_rgb_i_sel_write(uintptr_t base, uint8_t data) {
1858 uint32_t curr = system_sw_read_32(base + 0x18f08L);
1859 system_sw_write_32(base + 0x18f08L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
1860 }
acamera_isp_video_test_gen_ch1_bayer_rgb_i_sel_read(uintptr_t base)1861 static __inline uint8_t acamera_isp_video_test_gen_ch1_bayer_rgb_i_sel_read(uintptr_t base) {
1862 return (uint8_t)((system_sw_read_32(base + 0x18f08L) & 0x2) >> 1);
1863 }
1864 // ------------------------------------------------------------------------------ //
1865 // Register: bayer_rgb_o sel
1866 // ------------------------------------------------------------------------------ //
1867
1868 // ------------------------------------------------------------------------------ //
1869 // Bayer or rgb select for output video: 0=bayer, 1=rgb
1870 // ------------------------------------------------------------------------------ //
1871
1872 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_O_SEL_DEFAULT (0)
1873 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_O_SEL_DATASIZE (1)
1874 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_O_SEL_OFFSET (0x80)
1875 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_BAYER_RGB_O_SEL_MASK (0x4)
1876
1877 // args: data (1-bit)
acamera_isp_video_test_gen_ch1_bayer_rgb_o_sel_write(uintptr_t base,uint8_t data)1878 static __inline void acamera_isp_video_test_gen_ch1_bayer_rgb_o_sel_write(uintptr_t base, uint8_t data) {
1879 uint32_t curr = system_sw_read_32(base + 0x18f08L);
1880 system_sw_write_32(base + 0x18f08L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
1881 }
acamera_isp_video_test_gen_ch1_bayer_rgb_o_sel_read(uintptr_t base)1882 static __inline uint8_t acamera_isp_video_test_gen_ch1_bayer_rgb_o_sel_read(uintptr_t base) {
1883 return (uint8_t)((system_sw_read_32(base + 0x18f08L) & 0x4) >> 2);
1884 }
1885 // ------------------------------------------------------------------------------ //
1886 // Register: Generate mode
1887 // ------------------------------------------------------------------------------ //
1888
1889 // ------------------------------------------------------------------------------ //
1890 // 0 = One Shot (on request) generation. 1 = free run (continuous) generation
1891 // ------------------------------------------------------------------------------ //
1892
1893 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_GENERATE_MODE_DEFAULT (0)
1894 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_GENERATE_MODE_DATASIZE (1)
1895 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_GENERATE_MODE_OFFSET (0x80)
1896 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_GENERATE_MODE_MASK (0x8)
1897
1898 // args: data (1-bit)
acamera_isp_video_test_gen_ch1_generate_mode_write(uintptr_t base,uint8_t data)1899 static __inline void acamera_isp_video_test_gen_ch1_generate_mode_write(uintptr_t base, uint8_t data) {
1900 uint32_t curr = system_sw_read_32(base + 0x18f08L);
1901 system_sw_write_32(base + 0x18f08L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
1902 }
acamera_isp_video_test_gen_ch1_generate_mode_read(uintptr_t base)1903 static __inline uint8_t acamera_isp_video_test_gen_ch1_generate_mode_read(uintptr_t base) {
1904 return (uint8_t)((system_sw_read_32(base + 0x18f08L) & 0x8) >> 3);
1905 }
1906 // ------------------------------------------------------------------------------ //
1907 // Register: Video source
1908 // ------------------------------------------------------------------------------ //
1909
1910 // ------------------------------------------------------------------------------ //
1911 // 0 = Video in interface 1 = Internal Video generation
1912 // ------------------------------------------------------------------------------ //
1913
1914 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_VIDEO_SOURCE_DEFAULT (0)
1915 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_VIDEO_SOURCE_DATASIZE (1)
1916 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_VIDEO_SOURCE_OFFSET (0x80)
1917 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_VIDEO_SOURCE_MASK (0x10)
1918
1919 // args: data (1-bit)
acamera_isp_video_test_gen_ch1_video_source_write(uintptr_t base,uint8_t data)1920 static __inline void acamera_isp_video_test_gen_ch1_video_source_write(uintptr_t base, uint8_t data) {
1921 uint32_t curr = system_sw_read_32(base + 0x18f08L);
1922 system_sw_write_32(base + 0x18f08L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
1923 }
acamera_isp_video_test_gen_ch1_video_source_read(uintptr_t base)1924 static __inline uint8_t acamera_isp_video_test_gen_ch1_video_source_read(uintptr_t base) {
1925 return (uint8_t)((system_sw_read_32(base + 0x18f08L) & 0x10) >> 4);
1926 }
1927 // ------------------------------------------------------------------------------ //
1928 // Register: pattern type
1929 // ------------------------------------------------------------------------------ //
1930
1931 // ------------------------------------------------------------------------------ //
1932 // Pattern type select: 0=Flat field,1=Horizontal gradient,2=Vertical Gradient,3=Vertical Bars,4=Rectangle,5-255=Default white frame on black
1933 // ------------------------------------------------------------------------------ //
1934
1935 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_PATTERN_TYPE_DEFAULT (0x03)
1936 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_PATTERN_TYPE_DATASIZE (8)
1937 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_PATTERN_TYPE_OFFSET (0x84)
1938 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_PATTERN_TYPE_MASK (0xff)
1939
1940 // args: data (8-bit)
acamera_isp_video_test_gen_ch1_pattern_type_write(uintptr_t base,uint8_t data)1941 static __inline void acamera_isp_video_test_gen_ch1_pattern_type_write(uintptr_t base, uint8_t data) {
1942 uint32_t curr = system_sw_read_32(base + 0x18f0cL);
1943 system_sw_write_32(base + 0x18f0cL, (((uint32_t) (data & 0xff)) << 0) | (curr & 0xffffff00));
1944 }
acamera_isp_video_test_gen_ch1_pattern_type_read(uintptr_t base)1945 static __inline uint8_t acamera_isp_video_test_gen_ch1_pattern_type_read(uintptr_t base) {
1946 return (uint8_t)((system_sw_read_32(base + 0x18f0cL) & 0xff) >> 0);
1947 }
1948 // ------------------------------------------------------------------------------ //
1949 // Register: r backgnd
1950 // ------------------------------------------------------------------------------ //
1951
1952 // ------------------------------------------------------------------------------ //
1953 // Red background value 16bit, MSB aligned to used width
1954 // ------------------------------------------------------------------------------ //
1955
1956 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_BACKGND_DEFAULT (0xFFFF)
1957 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_BACKGND_DATASIZE (20)
1958 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_BACKGND_OFFSET (0x88)
1959 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_BACKGND_MASK (0xfffff)
1960
1961 // args: data (20-bit)
acamera_isp_video_test_gen_ch1_r_backgnd_write(uintptr_t base,uint32_t data)1962 static __inline void acamera_isp_video_test_gen_ch1_r_backgnd_write(uintptr_t base, uint32_t data) {
1963 uint32_t curr = system_sw_read_32(base + 0x18f10L);
1964 system_sw_write_32(base + 0x18f10L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1965 }
acamera_isp_video_test_gen_ch1_r_backgnd_read(uintptr_t base)1966 static __inline uint32_t acamera_isp_video_test_gen_ch1_r_backgnd_read(uintptr_t base) {
1967 return (uint32_t)((system_sw_read_32(base + 0x18f10L) & 0xfffff) >> 0);
1968 }
1969 // ------------------------------------------------------------------------------ //
1970 // Register: g backgnd
1971 // ------------------------------------------------------------------------------ //
1972
1973 // ------------------------------------------------------------------------------ //
1974 // Green background value 16bit, MSB aligned to used width
1975 // ------------------------------------------------------------------------------ //
1976
1977 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_BACKGND_DEFAULT (0xFFFF)
1978 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_BACKGND_DATASIZE (20)
1979 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_BACKGND_OFFSET (0x8c)
1980 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_BACKGND_MASK (0xfffff)
1981
1982 // args: data (20-bit)
acamera_isp_video_test_gen_ch1_g_backgnd_write(uintptr_t base,uint32_t data)1983 static __inline void acamera_isp_video_test_gen_ch1_g_backgnd_write(uintptr_t base, uint32_t data) {
1984 uint32_t curr = system_sw_read_32(base + 0x18f14L);
1985 system_sw_write_32(base + 0x18f14L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
1986 }
acamera_isp_video_test_gen_ch1_g_backgnd_read(uintptr_t base)1987 static __inline uint32_t acamera_isp_video_test_gen_ch1_g_backgnd_read(uintptr_t base) {
1988 return (uint32_t)((system_sw_read_32(base + 0x18f14L) & 0xfffff) >> 0);
1989 }
1990 // ------------------------------------------------------------------------------ //
1991 // Register: b backgnd
1992 // ------------------------------------------------------------------------------ //
1993
1994 // ------------------------------------------------------------------------------ //
1995 // Blue background value 16bit, MSB aligned to used width
1996 // ------------------------------------------------------------------------------ //
1997
1998 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_BACKGND_DEFAULT (0xFFFF)
1999 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_BACKGND_DATASIZE (20)
2000 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_BACKGND_OFFSET (0x90)
2001 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_BACKGND_MASK (0xfffff)
2002
2003 // args: data (20-bit)
acamera_isp_video_test_gen_ch1_b_backgnd_write(uintptr_t base,uint32_t data)2004 static __inline void acamera_isp_video_test_gen_ch1_b_backgnd_write(uintptr_t base, uint32_t data) {
2005 uint32_t curr = system_sw_read_32(base + 0x18f18L);
2006 system_sw_write_32(base + 0x18f18L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2007 }
acamera_isp_video_test_gen_ch1_b_backgnd_read(uintptr_t base)2008 static __inline uint32_t acamera_isp_video_test_gen_ch1_b_backgnd_read(uintptr_t base) {
2009 return (uint32_t)((system_sw_read_32(base + 0x18f18L) & 0xfffff) >> 0);
2010 }
2011 // ------------------------------------------------------------------------------ //
2012 // Register: r foregnd
2013 // ------------------------------------------------------------------------------ //
2014
2015 // ------------------------------------------------------------------------------ //
2016 // Red foreground value 16bit, MSB aligned to used width
2017 // ------------------------------------------------------------------------------ //
2018
2019 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_FOREGND_DEFAULT (0x8FFF)
2020 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_FOREGND_DATASIZE (20)
2021 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_FOREGND_OFFSET (0x94)
2022 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_R_FOREGND_MASK (0xfffff)
2023
2024 // args: data (20-bit)
acamera_isp_video_test_gen_ch1_r_foregnd_write(uintptr_t base,uint32_t data)2025 static __inline void acamera_isp_video_test_gen_ch1_r_foregnd_write(uintptr_t base, uint32_t data) {
2026 uint32_t curr = system_sw_read_32(base + 0x18f1cL);
2027 system_sw_write_32(base + 0x18f1cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2028 }
acamera_isp_video_test_gen_ch1_r_foregnd_read(uintptr_t base)2029 static __inline uint32_t acamera_isp_video_test_gen_ch1_r_foregnd_read(uintptr_t base) {
2030 return (uint32_t)((system_sw_read_32(base + 0x18f1cL) & 0xfffff) >> 0);
2031 }
2032 // ------------------------------------------------------------------------------ //
2033 // Register: g foregnd
2034 // ------------------------------------------------------------------------------ //
2035
2036 // ------------------------------------------------------------------------------ //
2037 // Green foreground value 16bit, MSB aligned to used width
2038 // ------------------------------------------------------------------------------ //
2039
2040 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_FOREGND_DEFAULT (0x8FFF)
2041 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_FOREGND_DATASIZE (20)
2042 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_FOREGND_OFFSET (0x98)
2043 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_G_FOREGND_MASK (0xfffff)
2044
2045 // args: data (20-bit)
acamera_isp_video_test_gen_ch1_g_foregnd_write(uintptr_t base,uint32_t data)2046 static __inline void acamera_isp_video_test_gen_ch1_g_foregnd_write(uintptr_t base, uint32_t data) {
2047 uint32_t curr = system_sw_read_32(base + 0x18f20L);
2048 system_sw_write_32(base + 0x18f20L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2049 }
acamera_isp_video_test_gen_ch1_g_foregnd_read(uintptr_t base)2050 static __inline uint32_t acamera_isp_video_test_gen_ch1_g_foregnd_read(uintptr_t base) {
2051 return (uint32_t)((system_sw_read_32(base + 0x18f20L) & 0xfffff) >> 0);
2052 }
2053 // ------------------------------------------------------------------------------ //
2054 // Register: b foregnd
2055 // ------------------------------------------------------------------------------ //
2056
2057 // ------------------------------------------------------------------------------ //
2058 // Blue foreground value 16bit, MSB aligned to used width
2059 // ------------------------------------------------------------------------------ //
2060
2061 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_FOREGND_DEFAULT (0x8FFF)
2062 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_FOREGND_DATASIZE (20)
2063 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_FOREGND_OFFSET (0x9c)
2064 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_B_FOREGND_MASK (0xfffff)
2065
2066 // args: data (20-bit)
acamera_isp_video_test_gen_ch1_b_foregnd_write(uintptr_t base,uint32_t data)2067 static __inline void acamera_isp_video_test_gen_ch1_b_foregnd_write(uintptr_t base, uint32_t data) {
2068 uint32_t curr = system_sw_read_32(base + 0x18f24L);
2069 system_sw_write_32(base + 0x18f24L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2070 }
acamera_isp_video_test_gen_ch1_b_foregnd_read(uintptr_t base)2071 static __inline uint32_t acamera_isp_video_test_gen_ch1_b_foregnd_read(uintptr_t base) {
2072 return (uint32_t)((system_sw_read_32(base + 0x18f24L) & 0xfffff) >> 0);
2073 }
2074 // ------------------------------------------------------------------------------ //
2075 // Register: rgb gradient
2076 // ------------------------------------------------------------------------------ //
2077
2078 // ------------------------------------------------------------------------------ //
2079 // RGB gradient increment per pixel (0-15) for first channel
2080 // ------------------------------------------------------------------------------ //
2081
2082 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_DEFAULT (0x3CAA)
2083 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_DATASIZE (16)
2084 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_OFFSET (0xa0)
2085 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_MASK (0xffff)
2086
2087 // args: data (16-bit)
acamera_isp_video_test_gen_ch1_rgb_gradient_write(uintptr_t base,uint16_t data)2088 static __inline void acamera_isp_video_test_gen_ch1_rgb_gradient_write(uintptr_t base, uint16_t data) {
2089 uint32_t curr = system_sw_read_32(base + 0x18f28L);
2090 system_sw_write_32(base + 0x18f28L, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
2091 }
acamera_isp_video_test_gen_ch1_rgb_gradient_read(uintptr_t base)2092 static __inline uint16_t acamera_isp_video_test_gen_ch1_rgb_gradient_read(uintptr_t base) {
2093 return (uint16_t)((system_sw_read_32(base + 0x18f28L) & 0xffff) >> 0);
2094 }
2095 // ------------------------------------------------------------------------------ //
2096 // Register: rgb_gradient start
2097 // ------------------------------------------------------------------------------ //
2098
2099 // ------------------------------------------------------------------------------ //
2100 // RGB gradient start value for first channel 16bit, MSB aligned to used width
2101 // ------------------------------------------------------------------------------ //
2102
2103 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_START_DEFAULT (0x0000)
2104 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_START_DATASIZE (20)
2105 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_START_OFFSET (0xa4)
2106 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RGB_GRADIENT_START_MASK (0xfffff)
2107
2108 // args: data (20-bit)
acamera_isp_video_test_gen_ch1_rgb_gradient_start_write(uintptr_t base,uint32_t data)2109 static __inline void acamera_isp_video_test_gen_ch1_rgb_gradient_start_write(uintptr_t base, uint32_t data) {
2110 uint32_t curr = system_sw_read_32(base + 0x18f2cL);
2111 system_sw_write_32(base + 0x18f2cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2112 }
acamera_isp_video_test_gen_ch1_rgb_gradient_start_read(uintptr_t base)2113 static __inline uint32_t acamera_isp_video_test_gen_ch1_rgb_gradient_start_read(uintptr_t base) {
2114 return (uint32_t)((system_sw_read_32(base + 0x18f2cL) & 0xfffff) >> 0);
2115 }
2116 // ------------------------------------------------------------------------------ //
2117 // Register: rect top
2118 // ------------------------------------------------------------------------------ //
2119
2120 // ------------------------------------------------------------------------------ //
2121 // Rectangle top line number 1-n
2122 // ------------------------------------------------------------------------------ //
2123
2124 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_TOP_DEFAULT (0x0001)
2125 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_TOP_DATASIZE (14)
2126 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_TOP_OFFSET (0xa8)
2127 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_TOP_MASK (0x3fff)
2128
2129 // args: data (14-bit)
acamera_isp_video_test_gen_ch1_rect_top_write(uintptr_t base,uint16_t data)2130 static __inline void acamera_isp_video_test_gen_ch1_rect_top_write(uintptr_t base, uint16_t data) {
2131 uint32_t curr = system_sw_read_32(base + 0x18f30L);
2132 system_sw_write_32(base + 0x18f30L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
2133 }
acamera_isp_video_test_gen_ch1_rect_top_read(uintptr_t base)2134 static __inline uint16_t acamera_isp_video_test_gen_ch1_rect_top_read(uintptr_t base) {
2135 return (uint16_t)((system_sw_read_32(base + 0x18f30L) & 0x3fff) >> 0);
2136 }
2137 // ------------------------------------------------------------------------------ //
2138 // Register: rect bot
2139 // ------------------------------------------------------------------------------ //
2140
2141 // ------------------------------------------------------------------------------ //
2142 // Rectangle bottom line number 1-n
2143 // ------------------------------------------------------------------------------ //
2144
2145 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_BOT_DEFAULT (0x0100)
2146 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_BOT_DATASIZE (14)
2147 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_BOT_OFFSET (0xa8)
2148 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_BOT_MASK (0x3fff0000)
2149
2150 // args: data (14-bit)
acamera_isp_video_test_gen_ch1_rect_bot_write(uintptr_t base,uint16_t data)2151 static __inline void acamera_isp_video_test_gen_ch1_rect_bot_write(uintptr_t base, uint16_t data) {
2152 uint32_t curr = system_sw_read_32(base + 0x18f30L);
2153 system_sw_write_32(base + 0x18f30L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
2154 }
acamera_isp_video_test_gen_ch1_rect_bot_read(uintptr_t base)2155 static __inline uint16_t acamera_isp_video_test_gen_ch1_rect_bot_read(uintptr_t base) {
2156 return (uint16_t)((system_sw_read_32(base + 0x18f30L) & 0x3fff0000) >> 16);
2157 }
2158 // ------------------------------------------------------------------------------ //
2159 // Register: rect left
2160 // ------------------------------------------------------------------------------ //
2161
2162 // ------------------------------------------------------------------------------ //
2163 // Rectangle left pixel number 1-n
2164 // ------------------------------------------------------------------------------ //
2165
2166 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_LEFT_DEFAULT (0x0001)
2167 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_LEFT_DATASIZE (14)
2168 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_LEFT_OFFSET (0xac)
2169 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_LEFT_MASK (0x3fff)
2170
2171 // args: data (14-bit)
acamera_isp_video_test_gen_ch1_rect_left_write(uintptr_t base,uint16_t data)2172 static __inline void acamera_isp_video_test_gen_ch1_rect_left_write(uintptr_t base, uint16_t data) {
2173 uint32_t curr = system_sw_read_32(base + 0x18f34L);
2174 system_sw_write_32(base + 0x18f34L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
2175 }
acamera_isp_video_test_gen_ch1_rect_left_read(uintptr_t base)2176 static __inline uint16_t acamera_isp_video_test_gen_ch1_rect_left_read(uintptr_t base) {
2177 return (uint16_t)((system_sw_read_32(base + 0x18f34L) & 0x3fff) >> 0);
2178 }
2179 // ------------------------------------------------------------------------------ //
2180 // Register: rect right
2181 // ------------------------------------------------------------------------------ //
2182
2183 // ------------------------------------------------------------------------------ //
2184 // Rectangle right pixel number 1-n
2185 // ------------------------------------------------------------------------------ //
2186
2187 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_RIGHT_DEFAULT (0x0100)
2188 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_RIGHT_DATASIZE (14)
2189 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_RIGHT_OFFSET (0xac)
2190 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH1_RECT_RIGHT_MASK (0x3fff0000)
2191
2192 // args: data (14-bit)
acamera_isp_video_test_gen_ch1_rect_right_write(uintptr_t base,uint16_t data)2193 static __inline void acamera_isp_video_test_gen_ch1_rect_right_write(uintptr_t base, uint16_t data) {
2194 uint32_t curr = system_sw_read_32(base + 0x18f34L);
2195 system_sw_write_32(base + 0x18f34L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
2196 }
acamera_isp_video_test_gen_ch1_rect_right_read(uintptr_t base)2197 static __inline uint16_t acamera_isp_video_test_gen_ch1_rect_right_read(uintptr_t base) {
2198 return (uint16_t)((system_sw_read_32(base + 0x18f34L) & 0x3fff0000) >> 16);
2199 }
2200 // ------------------------------------------------------------------------------ //
2201 // Group: video test gen ch2
2202 // ------------------------------------------------------------------------------ //
2203
2204 // ------------------------------------------------------------------------------ //
2205 // Video test generator controls. See ISP Guide for further details
2206 // ------------------------------------------------------------------------------ //
2207
2208 // ------------------------------------------------------------------------------ //
2209 // Register: test_pattern_off on
2210 // ------------------------------------------------------------------------------ //
2211
2212 // ------------------------------------------------------------------------------ //
2213 // Test pattern off-on: 0=off, 1=on
2214 // ------------------------------------------------------------------------------ //
2215
2216 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_TEST_PATTERN_OFF_ON_DEFAULT (0)
2217 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_TEST_PATTERN_OFF_ON_DATASIZE (1)
2218 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_TEST_PATTERN_OFF_ON_OFFSET (0xb0)
2219 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_TEST_PATTERN_OFF_ON_MASK (0x1)
2220
2221 // args: data (1-bit)
acamera_isp_video_test_gen_ch2_test_pattern_off_on_write(uintptr_t base,uint8_t data)2222 static __inline void acamera_isp_video_test_gen_ch2_test_pattern_off_on_write(uintptr_t base, uint8_t data) {
2223 uint32_t curr = system_sw_read_32(base + 0x18f38L);
2224 system_sw_write_32(base + 0x18f38L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
2225 }
acamera_isp_video_test_gen_ch2_test_pattern_off_on_read(uintptr_t base)2226 static __inline uint8_t acamera_isp_video_test_gen_ch2_test_pattern_off_on_read(uintptr_t base) {
2227 return (uint8_t)((system_sw_read_32(base + 0x18f38L) & 0x1) >> 0);
2228 }
2229 // ------------------------------------------------------------------------------ //
2230 // Register: bayer_rgb_i sel
2231 // ------------------------------------------------------------------------------ //
2232
2233 // ------------------------------------------------------------------------------ //
2234 // Bayer or rgb select for input video: 0=bayer, 1=rgb
2235 // ------------------------------------------------------------------------------ //
2236
2237 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_I_SEL_DEFAULT (0)
2238 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_I_SEL_DATASIZE (1)
2239 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_I_SEL_OFFSET (0xb0)
2240 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_I_SEL_MASK (0x2)
2241
2242 // args: data (1-bit)
acamera_isp_video_test_gen_ch2_bayer_rgb_i_sel_write(uintptr_t base,uint8_t data)2243 static __inline void acamera_isp_video_test_gen_ch2_bayer_rgb_i_sel_write(uintptr_t base, uint8_t data) {
2244 uint32_t curr = system_sw_read_32(base + 0x18f38L);
2245 system_sw_write_32(base + 0x18f38L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
2246 }
acamera_isp_video_test_gen_ch2_bayer_rgb_i_sel_read(uintptr_t base)2247 static __inline uint8_t acamera_isp_video_test_gen_ch2_bayer_rgb_i_sel_read(uintptr_t base) {
2248 return (uint8_t)((system_sw_read_32(base + 0x18f38L) & 0x2) >> 1);
2249 }
2250 // ------------------------------------------------------------------------------ //
2251 // Register: bayer_rgb_o sel
2252 // ------------------------------------------------------------------------------ //
2253
2254 // ------------------------------------------------------------------------------ //
2255 // Bayer or rgb select for output video: 0=bayer, 1=rgb
2256 // ------------------------------------------------------------------------------ //
2257
2258 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_O_SEL_DEFAULT (0)
2259 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_O_SEL_DATASIZE (1)
2260 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_O_SEL_OFFSET (0xb0)
2261 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_BAYER_RGB_O_SEL_MASK (0x4)
2262
2263 // args: data (1-bit)
acamera_isp_video_test_gen_ch2_bayer_rgb_o_sel_write(uintptr_t base,uint8_t data)2264 static __inline void acamera_isp_video_test_gen_ch2_bayer_rgb_o_sel_write(uintptr_t base, uint8_t data) {
2265 uint32_t curr = system_sw_read_32(base + 0x18f38L);
2266 system_sw_write_32(base + 0x18f38L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
2267 }
acamera_isp_video_test_gen_ch2_bayer_rgb_o_sel_read(uintptr_t base)2268 static __inline uint8_t acamera_isp_video_test_gen_ch2_bayer_rgb_o_sel_read(uintptr_t base) {
2269 return (uint8_t)((system_sw_read_32(base + 0x18f38L) & 0x4) >> 2);
2270 }
2271 // ------------------------------------------------------------------------------ //
2272 // Register: Generate mode
2273 // ------------------------------------------------------------------------------ //
2274
2275 // ------------------------------------------------------------------------------ //
2276 // 0 = One Shot (on request) generation. 1 = free run (continuous) generation
2277 // ------------------------------------------------------------------------------ //
2278
2279 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_GENERATE_MODE_DEFAULT (0)
2280 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_GENERATE_MODE_DATASIZE (1)
2281 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_GENERATE_MODE_OFFSET (0xb0)
2282 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_GENERATE_MODE_MASK (0x8)
2283
2284 // args: data (1-bit)
acamera_isp_video_test_gen_ch2_generate_mode_write(uintptr_t base,uint8_t data)2285 static __inline void acamera_isp_video_test_gen_ch2_generate_mode_write(uintptr_t base, uint8_t data) {
2286 uint32_t curr = system_sw_read_32(base + 0x18f38L);
2287 system_sw_write_32(base + 0x18f38L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
2288 }
acamera_isp_video_test_gen_ch2_generate_mode_read(uintptr_t base)2289 static __inline uint8_t acamera_isp_video_test_gen_ch2_generate_mode_read(uintptr_t base) {
2290 return (uint8_t)((system_sw_read_32(base + 0x18f38L) & 0x8) >> 3);
2291 }
2292 // ------------------------------------------------------------------------------ //
2293 // Register: Video source
2294 // ------------------------------------------------------------------------------ //
2295
2296 // ------------------------------------------------------------------------------ //
2297 // 0 = Video in interface 1 = Internal Video generation
2298 // ------------------------------------------------------------------------------ //
2299
2300 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_VIDEO_SOURCE_DEFAULT (0)
2301 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_VIDEO_SOURCE_DATASIZE (1)
2302 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_VIDEO_SOURCE_OFFSET (0xb0)
2303 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_VIDEO_SOURCE_MASK (0x10)
2304
2305 // args: data (1-bit)
acamera_isp_video_test_gen_ch2_video_source_write(uintptr_t base,uint8_t data)2306 static __inline void acamera_isp_video_test_gen_ch2_video_source_write(uintptr_t base, uint8_t data) {
2307 uint32_t curr = system_sw_read_32(base + 0x18f38L);
2308 system_sw_write_32(base + 0x18f38L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
2309 }
acamera_isp_video_test_gen_ch2_video_source_read(uintptr_t base)2310 static __inline uint8_t acamera_isp_video_test_gen_ch2_video_source_read(uintptr_t base) {
2311 return (uint8_t)((system_sw_read_32(base + 0x18f38L) & 0x10) >> 4);
2312 }
2313 // ------------------------------------------------------------------------------ //
2314 // Register: pattern type
2315 // ------------------------------------------------------------------------------ //
2316
2317 // ------------------------------------------------------------------------------ //
2318 // Pattern type select: 0=Flat field,1=Horizontal gradient,2=Vertical Gradient,3=Vertical Bars,4=Rectangle,5-255=Default white frame on black
2319 // ------------------------------------------------------------------------------ //
2320
2321 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_PATTERN_TYPE_DEFAULT (0x03)
2322 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_PATTERN_TYPE_DATASIZE (8)
2323 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_PATTERN_TYPE_OFFSET (0xb4)
2324 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_PATTERN_TYPE_MASK (0xff)
2325
2326 // args: data (8-bit)
acamera_isp_video_test_gen_ch2_pattern_type_write(uintptr_t base,uint8_t data)2327 static __inline void acamera_isp_video_test_gen_ch2_pattern_type_write(uintptr_t base, uint8_t data) {
2328 uint32_t curr = system_sw_read_32(base + 0x18f3cL);
2329 system_sw_write_32(base + 0x18f3cL, (((uint32_t) (data & 0xff)) << 0) | (curr & 0xffffff00));
2330 }
acamera_isp_video_test_gen_ch2_pattern_type_read(uintptr_t base)2331 static __inline uint8_t acamera_isp_video_test_gen_ch2_pattern_type_read(uintptr_t base) {
2332 return (uint8_t)((system_sw_read_32(base + 0x18f3cL) & 0xff) >> 0);
2333 }
2334 // ------------------------------------------------------------------------------ //
2335 // Register: r backgnd
2336 // ------------------------------------------------------------------------------ //
2337
2338 // ------------------------------------------------------------------------------ //
2339 // Red background value 16bit, MSB aligned to used width
2340 // ------------------------------------------------------------------------------ //
2341
2342 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_BACKGND_DEFAULT (0xFFFF)
2343 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_BACKGND_DATASIZE (20)
2344 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_BACKGND_OFFSET (0xb8)
2345 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_BACKGND_MASK (0xfffff)
2346
2347 // args: data (20-bit)
acamera_isp_video_test_gen_ch2_r_backgnd_write(uintptr_t base,uint32_t data)2348 static __inline void acamera_isp_video_test_gen_ch2_r_backgnd_write(uintptr_t base, uint32_t data) {
2349 uint32_t curr = system_sw_read_32(base + 0x18f40L);
2350 system_sw_write_32(base + 0x18f40L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2351 }
acamera_isp_video_test_gen_ch2_r_backgnd_read(uintptr_t base)2352 static __inline uint32_t acamera_isp_video_test_gen_ch2_r_backgnd_read(uintptr_t base) {
2353 return (uint32_t)((system_sw_read_32(base + 0x18f40L) & 0xfffff) >> 0);
2354 }
2355 // ------------------------------------------------------------------------------ //
2356 // Register: g backgnd
2357 // ------------------------------------------------------------------------------ //
2358
2359 // ------------------------------------------------------------------------------ //
2360 // Green background value 16bit, MSB aligned to used width
2361 // ------------------------------------------------------------------------------ //
2362
2363 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_BACKGND_DEFAULT (0xFFFF)
2364 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_BACKGND_DATASIZE (20)
2365 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_BACKGND_OFFSET (0xbc)
2366 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_BACKGND_MASK (0xfffff)
2367
2368 // args: data (20-bit)
acamera_isp_video_test_gen_ch2_g_backgnd_write(uintptr_t base,uint32_t data)2369 static __inline void acamera_isp_video_test_gen_ch2_g_backgnd_write(uintptr_t base, uint32_t data) {
2370 uint32_t curr = system_sw_read_32(base + 0x18f44L);
2371 system_sw_write_32(base + 0x18f44L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2372 }
acamera_isp_video_test_gen_ch2_g_backgnd_read(uintptr_t base)2373 static __inline uint32_t acamera_isp_video_test_gen_ch2_g_backgnd_read(uintptr_t base) {
2374 return (uint32_t)((system_sw_read_32(base + 0x18f44L) & 0xfffff) >> 0);
2375 }
2376 // ------------------------------------------------------------------------------ //
2377 // Register: b backgnd
2378 // ------------------------------------------------------------------------------ //
2379
2380 // ------------------------------------------------------------------------------ //
2381 // Blue background value 16bit, MSB aligned to used width
2382 // ------------------------------------------------------------------------------ //
2383
2384 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_BACKGND_DEFAULT (0xFFFF)
2385 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_BACKGND_DATASIZE (20)
2386 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_BACKGND_OFFSET (0xc0)
2387 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_BACKGND_MASK (0xfffff)
2388
2389 // args: data (20-bit)
acamera_isp_video_test_gen_ch2_b_backgnd_write(uintptr_t base,uint32_t data)2390 static __inline void acamera_isp_video_test_gen_ch2_b_backgnd_write(uintptr_t base, uint32_t data) {
2391 uint32_t curr = system_sw_read_32(base + 0x18f48L);
2392 system_sw_write_32(base + 0x18f48L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2393 }
acamera_isp_video_test_gen_ch2_b_backgnd_read(uintptr_t base)2394 static __inline uint32_t acamera_isp_video_test_gen_ch2_b_backgnd_read(uintptr_t base) {
2395 return (uint32_t)((system_sw_read_32(base + 0x18f48L) & 0xfffff) >> 0);
2396 }
2397 // ------------------------------------------------------------------------------ //
2398 // Register: r foregnd
2399 // ------------------------------------------------------------------------------ //
2400
2401 // ------------------------------------------------------------------------------ //
2402 // Red foreground value 16bit, MSB aligned to used width
2403 // ------------------------------------------------------------------------------ //
2404
2405 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_FOREGND_DEFAULT (0x8FFF)
2406 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_FOREGND_DATASIZE (20)
2407 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_FOREGND_OFFSET (0xc4)
2408 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_R_FOREGND_MASK (0xfffff)
2409
2410 // args: data (20-bit)
acamera_isp_video_test_gen_ch2_r_foregnd_write(uintptr_t base,uint32_t data)2411 static __inline void acamera_isp_video_test_gen_ch2_r_foregnd_write(uintptr_t base, uint32_t data) {
2412 uint32_t curr = system_sw_read_32(base + 0x18f4cL);
2413 system_sw_write_32(base + 0x18f4cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2414 }
acamera_isp_video_test_gen_ch2_r_foregnd_read(uintptr_t base)2415 static __inline uint32_t acamera_isp_video_test_gen_ch2_r_foregnd_read(uintptr_t base) {
2416 return (uint32_t)((system_sw_read_32(base + 0x18f4cL) & 0xfffff) >> 0);
2417 }
2418 // ------------------------------------------------------------------------------ //
2419 // Register: g foregnd
2420 // ------------------------------------------------------------------------------ //
2421
2422 // ------------------------------------------------------------------------------ //
2423 // Green foreground value 16bit, MSB aligned to used width
2424 // ------------------------------------------------------------------------------ //
2425
2426 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_FOREGND_DEFAULT (0x8FFF)
2427 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_FOREGND_DATASIZE (20)
2428 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_FOREGND_OFFSET (0xc8)
2429 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_G_FOREGND_MASK (0xfffff)
2430
2431 // args: data (20-bit)
acamera_isp_video_test_gen_ch2_g_foregnd_write(uintptr_t base,uint32_t data)2432 static __inline void acamera_isp_video_test_gen_ch2_g_foregnd_write(uintptr_t base, uint32_t data) {
2433 uint32_t curr = system_sw_read_32(base + 0x18f50L);
2434 system_sw_write_32(base + 0x18f50L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2435 }
acamera_isp_video_test_gen_ch2_g_foregnd_read(uintptr_t base)2436 static __inline uint32_t acamera_isp_video_test_gen_ch2_g_foregnd_read(uintptr_t base) {
2437 return (uint32_t)((system_sw_read_32(base + 0x18f50L) & 0xfffff) >> 0);
2438 }
2439 // ------------------------------------------------------------------------------ //
2440 // Register: b foregnd
2441 // ------------------------------------------------------------------------------ //
2442
2443 // ------------------------------------------------------------------------------ //
2444 // Blue foreground value 16bit, MSB aligned to used width
2445 // ------------------------------------------------------------------------------ //
2446
2447 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_FOREGND_DEFAULT (0x8FFF)
2448 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_FOREGND_DATASIZE (20)
2449 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_FOREGND_OFFSET (0xcc)
2450 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_B_FOREGND_MASK (0xfffff)
2451
2452 // args: data (20-bit)
acamera_isp_video_test_gen_ch2_b_foregnd_write(uintptr_t base,uint32_t data)2453 static __inline void acamera_isp_video_test_gen_ch2_b_foregnd_write(uintptr_t base, uint32_t data) {
2454 uint32_t curr = system_sw_read_32(base + 0x18f54L);
2455 system_sw_write_32(base + 0x18f54L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2456 }
acamera_isp_video_test_gen_ch2_b_foregnd_read(uintptr_t base)2457 static __inline uint32_t acamera_isp_video_test_gen_ch2_b_foregnd_read(uintptr_t base) {
2458 return (uint32_t)((system_sw_read_32(base + 0x18f54L) & 0xfffff) >> 0);
2459 }
2460 // ------------------------------------------------------------------------------ //
2461 // Register: rgb gradient
2462 // ------------------------------------------------------------------------------ //
2463
2464 // ------------------------------------------------------------------------------ //
2465 // RGB gradient increment per pixel (0-15) for first channel
2466 // ------------------------------------------------------------------------------ //
2467
2468 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_DEFAULT (0x3CAA)
2469 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_DATASIZE (16)
2470 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_OFFSET (0xd0)
2471 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_MASK (0xffff)
2472
2473 // args: data (16-bit)
acamera_isp_video_test_gen_ch2_rgb_gradient_write(uintptr_t base,uint16_t data)2474 static __inline void acamera_isp_video_test_gen_ch2_rgb_gradient_write(uintptr_t base, uint16_t data) {
2475 uint32_t curr = system_sw_read_32(base + 0x18f58L);
2476 system_sw_write_32(base + 0x18f58L, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
2477 }
acamera_isp_video_test_gen_ch2_rgb_gradient_read(uintptr_t base)2478 static __inline uint16_t acamera_isp_video_test_gen_ch2_rgb_gradient_read(uintptr_t base) {
2479 return (uint16_t)((system_sw_read_32(base + 0x18f58L) & 0xffff) >> 0);
2480 }
2481 // ------------------------------------------------------------------------------ //
2482 // Register: rgb_gradient start
2483 // ------------------------------------------------------------------------------ //
2484
2485 // ------------------------------------------------------------------------------ //
2486 // RGB gradient start value for first channel 16bit, MSB aligned to used width
2487 // ------------------------------------------------------------------------------ //
2488
2489 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_START_DEFAULT (0x0000)
2490 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_START_DATASIZE (20)
2491 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_START_OFFSET (0xd4)
2492 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RGB_GRADIENT_START_MASK (0xfffff)
2493
2494 // args: data (20-bit)
acamera_isp_video_test_gen_ch2_rgb_gradient_start_write(uintptr_t base,uint32_t data)2495 static __inline void acamera_isp_video_test_gen_ch2_rgb_gradient_start_write(uintptr_t base, uint32_t data) {
2496 uint32_t curr = system_sw_read_32(base + 0x18f5cL);
2497 system_sw_write_32(base + 0x18f5cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2498 }
acamera_isp_video_test_gen_ch2_rgb_gradient_start_read(uintptr_t base)2499 static __inline uint32_t acamera_isp_video_test_gen_ch2_rgb_gradient_start_read(uintptr_t base) {
2500 return (uint32_t)((system_sw_read_32(base + 0x18f5cL) & 0xfffff) >> 0);
2501 }
2502 // ------------------------------------------------------------------------------ //
2503 // Register: rect top
2504 // ------------------------------------------------------------------------------ //
2505
2506 // ------------------------------------------------------------------------------ //
2507 // Rectangle top line number 1-n
2508 // ------------------------------------------------------------------------------ //
2509
2510 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_TOP_DEFAULT (0x0001)
2511 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_TOP_DATASIZE (14)
2512 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_TOP_OFFSET (0xd8)
2513 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_TOP_MASK (0x3fff)
2514
2515 // args: data (14-bit)
acamera_isp_video_test_gen_ch2_rect_top_write(uintptr_t base,uint16_t data)2516 static __inline void acamera_isp_video_test_gen_ch2_rect_top_write(uintptr_t base, uint16_t data) {
2517 uint32_t curr = system_sw_read_32(base + 0x18f60L);
2518 system_sw_write_32(base + 0x18f60L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
2519 }
acamera_isp_video_test_gen_ch2_rect_top_read(uintptr_t base)2520 static __inline uint16_t acamera_isp_video_test_gen_ch2_rect_top_read(uintptr_t base) {
2521 return (uint16_t)((system_sw_read_32(base + 0x18f60L) & 0x3fff) >> 0);
2522 }
2523 // ------------------------------------------------------------------------------ //
2524 // Register: rect bot
2525 // ------------------------------------------------------------------------------ //
2526
2527 // ------------------------------------------------------------------------------ //
2528 // Rectangle bottom line number 1-n
2529 // ------------------------------------------------------------------------------ //
2530
2531 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_BOT_DEFAULT (0x0100)
2532 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_BOT_DATASIZE (14)
2533 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_BOT_OFFSET (0xd8)
2534 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_BOT_MASK (0x3fff0000)
2535
2536 // args: data (14-bit)
acamera_isp_video_test_gen_ch2_rect_bot_write(uintptr_t base,uint16_t data)2537 static __inline void acamera_isp_video_test_gen_ch2_rect_bot_write(uintptr_t base, uint16_t data) {
2538 uint32_t curr = system_sw_read_32(base + 0x18f60L);
2539 system_sw_write_32(base + 0x18f60L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
2540 }
acamera_isp_video_test_gen_ch2_rect_bot_read(uintptr_t base)2541 static __inline uint16_t acamera_isp_video_test_gen_ch2_rect_bot_read(uintptr_t base) {
2542 return (uint16_t)((system_sw_read_32(base + 0x18f60L) & 0x3fff0000) >> 16);
2543 }
2544 // ------------------------------------------------------------------------------ //
2545 // Register: rect left
2546 // ------------------------------------------------------------------------------ //
2547
2548 // ------------------------------------------------------------------------------ //
2549 // Rectangle left pixel number 1-n
2550 // ------------------------------------------------------------------------------ //
2551
2552 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_LEFT_DEFAULT (0x0001)
2553 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_LEFT_DATASIZE (14)
2554 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_LEFT_OFFSET (0xdc)
2555 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_LEFT_MASK (0x3fff)
2556
2557 // args: data (14-bit)
acamera_isp_video_test_gen_ch2_rect_left_write(uintptr_t base,uint16_t data)2558 static __inline void acamera_isp_video_test_gen_ch2_rect_left_write(uintptr_t base, uint16_t data) {
2559 uint32_t curr = system_sw_read_32(base + 0x18f64L);
2560 system_sw_write_32(base + 0x18f64L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
2561 }
acamera_isp_video_test_gen_ch2_rect_left_read(uintptr_t base)2562 static __inline uint16_t acamera_isp_video_test_gen_ch2_rect_left_read(uintptr_t base) {
2563 return (uint16_t)((system_sw_read_32(base + 0x18f64L) & 0x3fff) >> 0);
2564 }
2565 // ------------------------------------------------------------------------------ //
2566 // Register: rect right
2567 // ------------------------------------------------------------------------------ //
2568
2569 // ------------------------------------------------------------------------------ //
2570 // Rectangle right pixel number 1-n
2571 // ------------------------------------------------------------------------------ //
2572
2573 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_RIGHT_DEFAULT (0x0100)
2574 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_RIGHT_DATASIZE (14)
2575 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_RIGHT_OFFSET (0xdc)
2576 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH2_RECT_RIGHT_MASK (0x3fff0000)
2577
2578 // args: data (14-bit)
acamera_isp_video_test_gen_ch2_rect_right_write(uintptr_t base,uint16_t data)2579 static __inline void acamera_isp_video_test_gen_ch2_rect_right_write(uintptr_t base, uint16_t data) {
2580 uint32_t curr = system_sw_read_32(base + 0x18f64L);
2581 system_sw_write_32(base + 0x18f64L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
2582 }
acamera_isp_video_test_gen_ch2_rect_right_read(uintptr_t base)2583 static __inline uint16_t acamera_isp_video_test_gen_ch2_rect_right_read(uintptr_t base) {
2584 return (uint16_t)((system_sw_read_32(base + 0x18f64L) & 0x3fff0000) >> 16);
2585 }
2586 // ------------------------------------------------------------------------------ //
2587 // Group: video test gen ch3
2588 // ------------------------------------------------------------------------------ //
2589
2590 // ------------------------------------------------------------------------------ //
2591 // Video test generator controls. See ISP Guide for further details
2592 // ------------------------------------------------------------------------------ //
2593
2594 // ------------------------------------------------------------------------------ //
2595 // Register: test_pattern_off on
2596 // ------------------------------------------------------------------------------ //
2597
2598 // ------------------------------------------------------------------------------ //
2599 // Test pattern off-on: 0=off, 1=on
2600 // ------------------------------------------------------------------------------ //
2601
2602 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_TEST_PATTERN_OFF_ON_DEFAULT (0)
2603 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_TEST_PATTERN_OFF_ON_DATASIZE (1)
2604 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_TEST_PATTERN_OFF_ON_OFFSET (0xe0)
2605 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_TEST_PATTERN_OFF_ON_MASK (0x1)
2606
2607 // args: data (1-bit)
acamera_isp_video_test_gen_ch3_test_pattern_off_on_write(uintptr_t base,uint8_t data)2608 static __inline void acamera_isp_video_test_gen_ch3_test_pattern_off_on_write(uintptr_t base, uint8_t data) {
2609 uint32_t curr = system_sw_read_32(base + 0x18f68L);
2610 system_sw_write_32(base + 0x18f68L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
2611 }
acamera_isp_video_test_gen_ch3_test_pattern_off_on_read(uintptr_t base)2612 static __inline uint8_t acamera_isp_video_test_gen_ch3_test_pattern_off_on_read(uintptr_t base) {
2613 return (uint8_t)((system_sw_read_32(base + 0x18f68L) & 0x1) >> 0);
2614 }
2615 // ------------------------------------------------------------------------------ //
2616 // Register: bayer_rgb_i sel
2617 // ------------------------------------------------------------------------------ //
2618
2619 // ------------------------------------------------------------------------------ //
2620 // Bayer or rgb select for input video: 0=bayer, 1=rgb
2621 // ------------------------------------------------------------------------------ //
2622
2623 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_I_SEL_DEFAULT (0)
2624 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_I_SEL_DATASIZE (1)
2625 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_I_SEL_OFFSET (0xe0)
2626 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_I_SEL_MASK (0x2)
2627
2628 // args: data (1-bit)
acamera_isp_video_test_gen_ch3_bayer_rgb_i_sel_write(uintptr_t base,uint8_t data)2629 static __inline void acamera_isp_video_test_gen_ch3_bayer_rgb_i_sel_write(uintptr_t base, uint8_t data) {
2630 uint32_t curr = system_sw_read_32(base + 0x18f68L);
2631 system_sw_write_32(base + 0x18f68L, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
2632 }
acamera_isp_video_test_gen_ch3_bayer_rgb_i_sel_read(uintptr_t base)2633 static __inline uint8_t acamera_isp_video_test_gen_ch3_bayer_rgb_i_sel_read(uintptr_t base) {
2634 return (uint8_t)((system_sw_read_32(base + 0x18f68L) & 0x2) >> 1);
2635 }
2636 // ------------------------------------------------------------------------------ //
2637 // Register: bayer_rgb_o sel
2638 // ------------------------------------------------------------------------------ //
2639
2640 // ------------------------------------------------------------------------------ //
2641 // Bayer or rgb select for output video: 0=bayer, 1=rgb
2642 // ------------------------------------------------------------------------------ //
2643
2644 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_O_SEL_DEFAULT (0)
2645 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_O_SEL_DATASIZE (1)
2646 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_O_SEL_OFFSET (0xe0)
2647 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_BAYER_RGB_O_SEL_MASK (0x4)
2648
2649 // args: data (1-bit)
acamera_isp_video_test_gen_ch3_bayer_rgb_o_sel_write(uintptr_t base,uint8_t data)2650 static __inline void acamera_isp_video_test_gen_ch3_bayer_rgb_o_sel_write(uintptr_t base, uint8_t data) {
2651 uint32_t curr = system_sw_read_32(base + 0x18f68L);
2652 system_sw_write_32(base + 0x18f68L, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
2653 }
acamera_isp_video_test_gen_ch3_bayer_rgb_o_sel_read(uintptr_t base)2654 static __inline uint8_t acamera_isp_video_test_gen_ch3_bayer_rgb_o_sel_read(uintptr_t base) {
2655 return (uint8_t)((system_sw_read_32(base + 0x18f68L) & 0x4) >> 2);
2656 }
2657 // ------------------------------------------------------------------------------ //
2658 // Register: Generate mode
2659 // ------------------------------------------------------------------------------ //
2660
2661 // ------------------------------------------------------------------------------ //
2662 // 0 = One Shot (on request) generation. 1 = free run (continuous) generation
2663 // ------------------------------------------------------------------------------ //
2664
2665 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_GENERATE_MODE_DEFAULT (0)
2666 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_GENERATE_MODE_DATASIZE (1)
2667 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_GENERATE_MODE_OFFSET (0xe0)
2668 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_GENERATE_MODE_MASK (0x8)
2669
2670 // args: data (1-bit)
acamera_isp_video_test_gen_ch3_generate_mode_write(uintptr_t base,uint8_t data)2671 static __inline void acamera_isp_video_test_gen_ch3_generate_mode_write(uintptr_t base, uint8_t data) {
2672 uint32_t curr = system_sw_read_32(base + 0x18f68L);
2673 system_sw_write_32(base + 0x18f68L, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
2674 }
acamera_isp_video_test_gen_ch3_generate_mode_read(uintptr_t base)2675 static __inline uint8_t acamera_isp_video_test_gen_ch3_generate_mode_read(uintptr_t base) {
2676 return (uint8_t)((system_sw_read_32(base + 0x18f68L) & 0x8) >> 3);
2677 }
2678 // ------------------------------------------------------------------------------ //
2679 // Register: Video source
2680 // ------------------------------------------------------------------------------ //
2681
2682 // ------------------------------------------------------------------------------ //
2683 // 0 = Video in interface 1 = Internal Video generation
2684 // ------------------------------------------------------------------------------ //
2685
2686 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_VIDEO_SOURCE_DEFAULT (0)
2687 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_VIDEO_SOURCE_DATASIZE (1)
2688 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_VIDEO_SOURCE_OFFSET (0xe0)
2689 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_VIDEO_SOURCE_MASK (0x10)
2690
2691 // args: data (1-bit)
acamera_isp_video_test_gen_ch3_video_source_write(uintptr_t base,uint8_t data)2692 static __inline void acamera_isp_video_test_gen_ch3_video_source_write(uintptr_t base, uint8_t data) {
2693 uint32_t curr = system_sw_read_32(base + 0x18f68L);
2694 system_sw_write_32(base + 0x18f68L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
2695 }
acamera_isp_video_test_gen_ch3_video_source_read(uintptr_t base)2696 static __inline uint8_t acamera_isp_video_test_gen_ch3_video_source_read(uintptr_t base) {
2697 return (uint8_t)((system_sw_read_32(base + 0x18f68L) & 0x10) >> 4);
2698 }
2699 // ------------------------------------------------------------------------------ //
2700 // Register: pattern type
2701 // ------------------------------------------------------------------------------ //
2702
2703 // ------------------------------------------------------------------------------ //
2704 // Pattern type select: 0=Flat field,1=Horizontal gradient,2=Vertical Gradient,3=Vertical Bars,4=Rectangle,5-255=Default white frame on black
2705 // ------------------------------------------------------------------------------ //
2706
2707 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_PATTERN_TYPE_DEFAULT (0x03)
2708 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_PATTERN_TYPE_DATASIZE (8)
2709 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_PATTERN_TYPE_OFFSET (0xe4)
2710 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_PATTERN_TYPE_MASK (0xff)
2711
2712 // args: data (8-bit)
acamera_isp_video_test_gen_ch3_pattern_type_write(uintptr_t base,uint8_t data)2713 static __inline void acamera_isp_video_test_gen_ch3_pattern_type_write(uintptr_t base, uint8_t data) {
2714 uint32_t curr = system_sw_read_32(base + 0x18f6cL);
2715 system_sw_write_32(base + 0x18f6cL, (((uint32_t) (data & 0xff)) << 0) | (curr & 0xffffff00));
2716 }
acamera_isp_video_test_gen_ch3_pattern_type_read(uintptr_t base)2717 static __inline uint8_t acamera_isp_video_test_gen_ch3_pattern_type_read(uintptr_t base) {
2718 return (uint8_t)((system_sw_read_32(base + 0x18f6cL) & 0xff) >> 0);
2719 }
2720 // ------------------------------------------------------------------------------ //
2721 // Register: r backgnd
2722 // ------------------------------------------------------------------------------ //
2723
2724 // ------------------------------------------------------------------------------ //
2725 // Red background value 16bit, MSB aligned to used width
2726 // ------------------------------------------------------------------------------ //
2727
2728 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_BACKGND_DEFAULT (0xFFFF)
2729 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_BACKGND_DATASIZE (20)
2730 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_BACKGND_OFFSET (0xe8)
2731 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_BACKGND_MASK (0xfffff)
2732
2733 // args: data (20-bit)
acamera_isp_video_test_gen_ch3_r_backgnd_write(uintptr_t base,uint32_t data)2734 static __inline void acamera_isp_video_test_gen_ch3_r_backgnd_write(uintptr_t base, uint32_t data) {
2735 uint32_t curr = system_sw_read_32(base + 0x18f70L);
2736 system_sw_write_32(base + 0x18f70L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2737 }
acamera_isp_video_test_gen_ch3_r_backgnd_read(uintptr_t base)2738 static __inline uint32_t acamera_isp_video_test_gen_ch3_r_backgnd_read(uintptr_t base) {
2739 return (uint32_t)((system_sw_read_32(base + 0x18f70L) & 0xfffff) >> 0);
2740 }
2741 // ------------------------------------------------------------------------------ //
2742 // Register: g backgnd
2743 // ------------------------------------------------------------------------------ //
2744
2745 // ------------------------------------------------------------------------------ //
2746 // Green background value 16bit, MSB aligned to used width
2747 // ------------------------------------------------------------------------------ //
2748
2749 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_BACKGND_DEFAULT (0xFFFF)
2750 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_BACKGND_DATASIZE (20)
2751 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_BACKGND_OFFSET (0xec)
2752 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_BACKGND_MASK (0xfffff)
2753
2754 // args: data (20-bit)
acamera_isp_video_test_gen_ch3_g_backgnd_write(uintptr_t base,uint32_t data)2755 static __inline void acamera_isp_video_test_gen_ch3_g_backgnd_write(uintptr_t base, uint32_t data) {
2756 uint32_t curr = system_sw_read_32(base + 0x18f74L);
2757 system_sw_write_32(base + 0x18f74L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2758 }
acamera_isp_video_test_gen_ch3_g_backgnd_read(uintptr_t base)2759 static __inline uint32_t acamera_isp_video_test_gen_ch3_g_backgnd_read(uintptr_t base) {
2760 return (uint32_t)((system_sw_read_32(base + 0x18f74L) & 0xfffff) >> 0);
2761 }
2762 // ------------------------------------------------------------------------------ //
2763 // Register: b backgnd
2764 // ------------------------------------------------------------------------------ //
2765
2766 // ------------------------------------------------------------------------------ //
2767 // Blue background value 16bit, MSB aligned to used width
2768 // ------------------------------------------------------------------------------ //
2769
2770 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_BACKGND_DEFAULT (0xFFFF)
2771 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_BACKGND_DATASIZE (20)
2772 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_BACKGND_OFFSET (0xf0)
2773 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_BACKGND_MASK (0xfffff)
2774
2775 // args: data (20-bit)
acamera_isp_video_test_gen_ch3_b_backgnd_write(uintptr_t base,uint32_t data)2776 static __inline void acamera_isp_video_test_gen_ch3_b_backgnd_write(uintptr_t base, uint32_t data) {
2777 uint32_t curr = system_sw_read_32(base + 0x18f78L);
2778 system_sw_write_32(base + 0x18f78L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2779 }
acamera_isp_video_test_gen_ch3_b_backgnd_read(uintptr_t base)2780 static __inline uint32_t acamera_isp_video_test_gen_ch3_b_backgnd_read(uintptr_t base) {
2781 return (uint32_t)((system_sw_read_32(base + 0x18f78L) & 0xfffff) >> 0);
2782 }
2783 // ------------------------------------------------------------------------------ //
2784 // Register: r foregnd
2785 // ------------------------------------------------------------------------------ //
2786
2787 // ------------------------------------------------------------------------------ //
2788 // Red foreground value 16bit, MSB aligned to used width
2789 // ------------------------------------------------------------------------------ //
2790
2791 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_FOREGND_DEFAULT (0x8FFF)
2792 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_FOREGND_DATASIZE (20)
2793 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_FOREGND_OFFSET (0xf4)
2794 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_R_FOREGND_MASK (0xfffff)
2795
2796 // args: data (20-bit)
acamera_isp_video_test_gen_ch3_r_foregnd_write(uintptr_t base,uint32_t data)2797 static __inline void acamera_isp_video_test_gen_ch3_r_foregnd_write(uintptr_t base, uint32_t data) {
2798 uint32_t curr = system_sw_read_32(base + 0x18f7cL);
2799 system_sw_write_32(base + 0x18f7cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2800 }
acamera_isp_video_test_gen_ch3_r_foregnd_read(uintptr_t base)2801 static __inline uint32_t acamera_isp_video_test_gen_ch3_r_foregnd_read(uintptr_t base) {
2802 return (uint32_t)((system_sw_read_32(base + 0x18f7cL) & 0xfffff) >> 0);
2803 }
2804 // ------------------------------------------------------------------------------ //
2805 // Register: g foregnd
2806 // ------------------------------------------------------------------------------ //
2807
2808 // ------------------------------------------------------------------------------ //
2809 // Green foreground value 16bit, MSB aligned to used width
2810 // ------------------------------------------------------------------------------ //
2811
2812 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_FOREGND_DEFAULT (0x8FFF)
2813 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_FOREGND_DATASIZE (20)
2814 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_FOREGND_OFFSET (0xf8)
2815 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_G_FOREGND_MASK (0xfffff)
2816
2817 // args: data (20-bit)
acamera_isp_video_test_gen_ch3_g_foregnd_write(uintptr_t base,uint32_t data)2818 static __inline void acamera_isp_video_test_gen_ch3_g_foregnd_write(uintptr_t base, uint32_t data) {
2819 uint32_t curr = system_sw_read_32(base + 0x18f80L);
2820 system_sw_write_32(base + 0x18f80L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2821 }
acamera_isp_video_test_gen_ch3_g_foregnd_read(uintptr_t base)2822 static __inline uint32_t acamera_isp_video_test_gen_ch3_g_foregnd_read(uintptr_t base) {
2823 return (uint32_t)((system_sw_read_32(base + 0x18f80L) & 0xfffff) >> 0);
2824 }
2825 // ------------------------------------------------------------------------------ //
2826 // Register: b foregnd
2827 // ------------------------------------------------------------------------------ //
2828
2829 // ------------------------------------------------------------------------------ //
2830 // Blue foreground value 16bit, MSB aligned to used width
2831 // ------------------------------------------------------------------------------ //
2832
2833 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_FOREGND_DEFAULT (0x8FFF)
2834 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_FOREGND_DATASIZE (20)
2835 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_FOREGND_OFFSET (0xfc)
2836 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_B_FOREGND_MASK (0xfffff)
2837
2838 // args: data (20-bit)
acamera_isp_video_test_gen_ch3_b_foregnd_write(uintptr_t base,uint32_t data)2839 static __inline void acamera_isp_video_test_gen_ch3_b_foregnd_write(uintptr_t base, uint32_t data) {
2840 uint32_t curr = system_sw_read_32(base + 0x18f84L);
2841 system_sw_write_32(base + 0x18f84L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2842 }
acamera_isp_video_test_gen_ch3_b_foregnd_read(uintptr_t base)2843 static __inline uint32_t acamera_isp_video_test_gen_ch3_b_foregnd_read(uintptr_t base) {
2844 return (uint32_t)((system_sw_read_32(base + 0x18f84L) & 0xfffff) >> 0);
2845 }
2846 // ------------------------------------------------------------------------------ //
2847 // Register: rgb gradient
2848 // ------------------------------------------------------------------------------ //
2849
2850 // ------------------------------------------------------------------------------ //
2851 // RGB gradient increment per pixel (0-15) for first channel
2852 // ------------------------------------------------------------------------------ //
2853
2854 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_DEFAULT (0x3CAA)
2855 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_DATASIZE (16)
2856 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_OFFSET (0x100)
2857 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_MASK (0xffff)
2858
2859 // args: data (16-bit)
acamera_isp_video_test_gen_ch3_rgb_gradient_write(uintptr_t base,uint16_t data)2860 static __inline void acamera_isp_video_test_gen_ch3_rgb_gradient_write(uintptr_t base, uint16_t data) {
2861 uint32_t curr = system_sw_read_32(base + 0x18f88L);
2862 system_sw_write_32(base + 0x18f88L, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
2863 }
acamera_isp_video_test_gen_ch3_rgb_gradient_read(uintptr_t base)2864 static __inline uint16_t acamera_isp_video_test_gen_ch3_rgb_gradient_read(uintptr_t base) {
2865 return (uint16_t)((system_sw_read_32(base + 0x18f88L) & 0xffff) >> 0);
2866 }
2867 // ------------------------------------------------------------------------------ //
2868 // Register: rgb_gradient start
2869 // ------------------------------------------------------------------------------ //
2870
2871 // ------------------------------------------------------------------------------ //
2872 // RGB gradient start value for first channel 16bit, MSB aligned to used width
2873 // ------------------------------------------------------------------------------ //
2874
2875 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_START_DEFAULT (0x0000)
2876 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_START_DATASIZE (20)
2877 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_START_OFFSET (0x104)
2878 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RGB_GRADIENT_START_MASK (0xfffff)
2879
2880 // args: data (20-bit)
acamera_isp_video_test_gen_ch3_rgb_gradient_start_write(uintptr_t base,uint32_t data)2881 static __inline void acamera_isp_video_test_gen_ch3_rgb_gradient_start_write(uintptr_t base, uint32_t data) {
2882 uint32_t curr = system_sw_read_32(base + 0x18f8cL);
2883 system_sw_write_32(base + 0x18f8cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
2884 }
acamera_isp_video_test_gen_ch3_rgb_gradient_start_read(uintptr_t base)2885 static __inline uint32_t acamera_isp_video_test_gen_ch3_rgb_gradient_start_read(uintptr_t base) {
2886 return (uint32_t)((system_sw_read_32(base + 0x18f8cL) & 0xfffff) >> 0);
2887 }
2888 // ------------------------------------------------------------------------------ //
2889 // Register: rect top
2890 // ------------------------------------------------------------------------------ //
2891
2892 // ------------------------------------------------------------------------------ //
2893 // Rectangle top line number 1-n
2894 // ------------------------------------------------------------------------------ //
2895
2896 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_TOP_DEFAULT (0x0001)
2897 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_TOP_DATASIZE (14)
2898 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_TOP_OFFSET (0x108)
2899 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_TOP_MASK (0x3fff)
2900
2901 // args: data (14-bit)
acamera_isp_video_test_gen_ch3_rect_top_write(uintptr_t base,uint16_t data)2902 static __inline void acamera_isp_video_test_gen_ch3_rect_top_write(uintptr_t base, uint16_t data) {
2903 uint32_t curr = system_sw_read_32(base + 0x18f90L);
2904 system_sw_write_32(base + 0x18f90L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
2905 }
acamera_isp_video_test_gen_ch3_rect_top_read(uintptr_t base)2906 static __inline uint16_t acamera_isp_video_test_gen_ch3_rect_top_read(uintptr_t base) {
2907 return (uint16_t)((system_sw_read_32(base + 0x18f90L) & 0x3fff) >> 0);
2908 }
2909 // ------------------------------------------------------------------------------ //
2910 // Register: rect bot
2911 // ------------------------------------------------------------------------------ //
2912
2913 // ------------------------------------------------------------------------------ //
2914 // Rectangle bottom line number 1-n
2915 // ------------------------------------------------------------------------------ //
2916
2917 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_BOT_DEFAULT (0x0100)
2918 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_BOT_DATASIZE (14)
2919 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_BOT_OFFSET (0x108)
2920 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_BOT_MASK (0x3fff0000)
2921
2922 // args: data (14-bit)
acamera_isp_video_test_gen_ch3_rect_bot_write(uintptr_t base,uint16_t data)2923 static __inline void acamera_isp_video_test_gen_ch3_rect_bot_write(uintptr_t base, uint16_t data) {
2924 uint32_t curr = system_sw_read_32(base + 0x18f90L);
2925 system_sw_write_32(base + 0x18f90L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
2926 }
acamera_isp_video_test_gen_ch3_rect_bot_read(uintptr_t base)2927 static __inline uint16_t acamera_isp_video_test_gen_ch3_rect_bot_read(uintptr_t base) {
2928 return (uint16_t)((system_sw_read_32(base + 0x18f90L) & 0x3fff0000) >> 16);
2929 }
2930 // ------------------------------------------------------------------------------ //
2931 // Register: rect left
2932 // ------------------------------------------------------------------------------ //
2933
2934 // ------------------------------------------------------------------------------ //
2935 // Rectangle left pixel number 1-n
2936 // ------------------------------------------------------------------------------ //
2937
2938 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_LEFT_DEFAULT (0x0001)
2939 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_LEFT_DATASIZE (14)
2940 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_LEFT_OFFSET (0x10c)
2941 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_LEFT_MASK (0x3fff)
2942
2943 // args: data (14-bit)
acamera_isp_video_test_gen_ch3_rect_left_write(uintptr_t base,uint16_t data)2944 static __inline void acamera_isp_video_test_gen_ch3_rect_left_write(uintptr_t base, uint16_t data) {
2945 uint32_t curr = system_sw_read_32(base + 0x18f94L);
2946 system_sw_write_32(base + 0x18f94L, (((uint32_t) (data & 0x3fff)) << 0) | (curr & 0xffffc000));
2947 }
acamera_isp_video_test_gen_ch3_rect_left_read(uintptr_t base)2948 static __inline uint16_t acamera_isp_video_test_gen_ch3_rect_left_read(uintptr_t base) {
2949 return (uint16_t)((system_sw_read_32(base + 0x18f94L) & 0x3fff) >> 0);
2950 }
2951 // ------------------------------------------------------------------------------ //
2952 // Register: rect right
2953 // ------------------------------------------------------------------------------ //
2954
2955 // ------------------------------------------------------------------------------ //
2956 // Rectangle right pixel number 1-n
2957 // ------------------------------------------------------------------------------ //
2958
2959 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_RIGHT_DEFAULT (0x0100)
2960 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_RIGHT_DATASIZE (14)
2961 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_RIGHT_OFFSET (0x10c)
2962 #define ACAMERA_ISP_VIDEO_TEST_GEN_CH3_RECT_RIGHT_MASK (0x3fff0000)
2963
2964 // args: data (14-bit)
acamera_isp_video_test_gen_ch3_rect_right_write(uintptr_t base,uint16_t data)2965 static __inline void acamera_isp_video_test_gen_ch3_rect_right_write(uintptr_t base, uint16_t data) {
2966 uint32_t curr = system_sw_read_32(base + 0x18f94L);
2967 system_sw_write_32(base + 0x18f94L, (((uint32_t) (data & 0x3fff)) << 16) | (curr & 0xc000ffff));
2968 }
acamera_isp_video_test_gen_ch3_rect_right_read(uintptr_t base)2969 static __inline uint16_t acamera_isp_video_test_gen_ch3_rect_right_read(uintptr_t base) {
2970 return (uint16_t)((system_sw_read_32(base + 0x18f94L) & 0x3fff0000) >> 16);
2971 }
2972 // ------------------------------------------------------------------------------ //
2973 // Group: input formatter
2974 // ------------------------------------------------------------------------------ //
2975
2976 // ------------------------------------------------------------------------------ //
2977 //
2978 // Adapts received data format to ISP format see ISP guide for a table of setting to be used for various sensors/modes.
2979 //
2980 // ------------------------------------------------------------------------------ //
2981
2982 // ------------------------------------------------------------------------------ //
2983 // Register: mode in
2984 // ------------------------------------------------------------------------------ //
2985
2986 // ------------------------------------------------------------------------------ //
2987 // Input mode
2988 // ------------------------------------------------------------------------------ //
2989
2990 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_DEFAULT (0)
2991 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_DATASIZE (3)
2992 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_OFFSET (0x110)
2993 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_MASK (0x7)
2994 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_LINEAR_DATA (0)
2995 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_23_MULTIPLE_EXPOSURE_MULTIPLEXING (1)
2996 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_LOGARITHMIC_ENCODING (2)
2997 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_COMPANDING_CURVE_WITH_KNEE_POINTS (3)
2998 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_16BIT_LINEAR_12BIT_VS (4)
2999 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_12BIT_COMPANDED__12BIT_VS (5)
3000 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_RESERVED (6)
3001 #define ACAMERA_ISP_INPUT_FORMATTER_MODE_IN_PASS_THROUGH_MODE (7)
3002
3003 // args: data (3-bit)
acamera_isp_input_formatter_mode_in_write(uintptr_t base,uint8_t data)3004 static __inline void acamera_isp_input_formatter_mode_in_write(uintptr_t base, uint8_t data) {
3005 uint32_t curr = system_sw_read_32(base + 0x18f98L);
3006 system_sw_write_32(base + 0x18f98L, (((uint32_t) (data & 0x7)) << 0) | (curr & 0xfffffff8));
3007 }
acamera_isp_input_formatter_mode_in_read(uintptr_t base)3008 static __inline uint8_t acamera_isp_input_formatter_mode_in_read(uintptr_t base) {
3009 return (uint8_t)((system_sw_read_32(base + 0x18f98L) & 0x7) >> 0);
3010 }
3011 // ------------------------------------------------------------------------------ //
3012 // Register: input bitwidth select
3013 // ------------------------------------------------------------------------------ //
3014
3015 // ------------------------------------------------------------------------------ //
3016 // Input bitwidth select
3017 //
3018 // ------------------------------------------------------------------------------ //
3019
3020 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_DEFAULT (2)
3021 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_DATASIZE (3)
3022 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_OFFSET (0x110)
3023 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_MASK (0x70000)
3024 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_8_BITS (0)
3025 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_10_BITS (1)
3026 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_12_BITS (2)
3027 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_14_BITS (3)
3028 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_16_BITS (4)
3029 #define ACAMERA_ISP_INPUT_FORMATTER_INPUT_BITWIDTH_SELECT_20_BITS_NO_18_BITS (5)
3030
3031 // args: data (3-bit)
acamera_isp_input_formatter_input_bitwidth_select_write(uintptr_t base,uint8_t data)3032 static __inline void acamera_isp_input_formatter_input_bitwidth_select_write(uintptr_t base, uint8_t data) {
3033 uint32_t curr = system_sw_read_32(base + 0x18f98L);
3034 system_sw_write_32(base + 0x18f98L, (((uint32_t) (data & 0x7)) << 16) | (curr & 0xfff8ffff));
3035 }
acamera_isp_input_formatter_input_bitwidth_select_read(uintptr_t base)3036 static __inline uint8_t acamera_isp_input_formatter_input_bitwidth_select_read(uintptr_t base) {
3037 return (uint8_t)((system_sw_read_32(base + 0x18f98L) & 0x70000) >> 16);
3038 }
3039 // ------------------------------------------------------------------------------ //
3040 // Register: factor ML
3041 // ------------------------------------------------------------------------------ //
3042
3043 // ------------------------------------------------------------------------------ //
3044 // 18 bit, 6.12 fix point - ratio between long and medium exposure for 2:3 multiplexed mode
3045 // ------------------------------------------------------------------------------ //
3046
3047 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_ML_DEFAULT (0x1000)
3048 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_ML_DATASIZE (18)
3049 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_ML_OFFSET (0x114)
3050 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_ML_MASK (0x3ffff)
3051
3052 // args: data (18-bit)
acamera_isp_input_formatter_factor_ml_write(uintptr_t base,uint32_t data)3053 static __inline void acamera_isp_input_formatter_factor_ml_write(uintptr_t base, uint32_t data) {
3054 uint32_t curr = system_sw_read_32(base + 0x18f9cL);
3055 system_sw_write_32(base + 0x18f9cL, (((uint32_t) (data & 0x3ffff)) << 0) | (curr & 0xfffc0000));
3056 }
acamera_isp_input_formatter_factor_ml_read(uintptr_t base)3057 static __inline uint32_t acamera_isp_input_formatter_factor_ml_read(uintptr_t base) {
3058 return (uint32_t)((system_sw_read_32(base + 0x18f9cL) & 0x3ffff) >> 0);
3059 }
3060 // ------------------------------------------------------------------------------ //
3061 // Register: factor MS
3062 // ------------------------------------------------------------------------------ //
3063
3064 // ------------------------------------------------------------------------------ //
3065 // 13 bit, 1.12 fix point - ratio between short and medium exposure for 2:3 multiplexed mode
3066 // ------------------------------------------------------------------------------ //
3067
3068 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_MS_DEFAULT (0x1000)
3069 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_MS_DATASIZE (13)
3070 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_MS_OFFSET (0x118)
3071 #define ACAMERA_ISP_INPUT_FORMATTER_FACTOR_MS_MASK (0x1fff)
3072
3073 // args: data (13-bit)
acamera_isp_input_formatter_factor_ms_write(uintptr_t base,uint16_t data)3074 static __inline void acamera_isp_input_formatter_factor_ms_write(uintptr_t base, uint16_t data) {
3075 uint32_t curr = system_sw_read_32(base + 0x18fa0L);
3076 system_sw_write_32(base + 0x18fa0L, (((uint32_t) (data & 0x1fff)) << 0) | (curr & 0xffffe000));
3077 }
acamera_isp_input_formatter_factor_ms_read(uintptr_t base)3078 static __inline uint16_t acamera_isp_input_formatter_factor_ms_read(uintptr_t base) {
3079 return (uint16_t)((system_sw_read_32(base + 0x18fa0L) & 0x1fff) >> 0);
3080 }
3081 // ------------------------------------------------------------------------------ //
3082 // Register: black level
3083 // ------------------------------------------------------------------------------ //
3084
3085 // ------------------------------------------------------------------------------ //
3086 // Black level of sensor data for 2:3 multiplexed mode
3087 // ------------------------------------------------------------------------------ //
3088
3089 #define ACAMERA_ISP_INPUT_FORMATTER_BLACK_LEVEL_DEFAULT (0)
3090 #define ACAMERA_ISP_INPUT_FORMATTER_BLACK_LEVEL_DATASIZE (12)
3091 #define ACAMERA_ISP_INPUT_FORMATTER_BLACK_LEVEL_OFFSET (0x11c)
3092 #define ACAMERA_ISP_INPUT_FORMATTER_BLACK_LEVEL_MASK (0xfff)
3093
3094 // args: data (12-bit)
acamera_isp_input_formatter_black_level_write(uintptr_t base,uint16_t data)3095 static __inline void acamera_isp_input_formatter_black_level_write(uintptr_t base, uint16_t data) {
3096 uint32_t curr = system_sw_read_32(base + 0x18fa4L);
3097 system_sw_write_32(base + 0x18fa4L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3098 }
acamera_isp_input_formatter_black_level_read(uintptr_t base)3099 static __inline uint16_t acamera_isp_input_formatter_black_level_read(uintptr_t base) {
3100 return (uint16_t)((system_sw_read_32(base + 0x18fa4L) & 0xfff) >> 0);
3101 }
3102 // ------------------------------------------------------------------------------ //
3103 // Register: knee point0
3104 // ------------------------------------------------------------------------------ //
3105
3106 // ------------------------------------------------------------------------------ //
3107 // First knee point
3108 // ------------------------------------------------------------------------------ //
3109
3110 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT0_DEFAULT (512)
3111 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT0_DATASIZE (16)
3112 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT0_OFFSET (0x120)
3113 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT0_MASK (0xffff)
3114
3115 // args: data (16-bit)
acamera_isp_input_formatter_knee_point0_write(uintptr_t base,uint16_t data)3116 static __inline void acamera_isp_input_formatter_knee_point0_write(uintptr_t base, uint16_t data) {
3117 uint32_t curr = system_sw_read_32(base + 0x18fa8L);
3118 system_sw_write_32(base + 0x18fa8L, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
3119 }
acamera_isp_input_formatter_knee_point0_read(uintptr_t base)3120 static __inline uint16_t acamera_isp_input_formatter_knee_point0_read(uintptr_t base) {
3121 return (uint16_t)((system_sw_read_32(base + 0x18fa8L) & 0xffff) >> 0);
3122 }
3123 // ------------------------------------------------------------------------------ //
3124 // Register: knee point1
3125 // ------------------------------------------------------------------------------ //
3126
3127 // ------------------------------------------------------------------------------ //
3128 // Second knee point
3129 // ------------------------------------------------------------------------------ //
3130
3131 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT1_DEFAULT (1408)
3132 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT1_DATASIZE (16)
3133 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT1_OFFSET (0x120)
3134 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT1_MASK (0xffff0000)
3135
3136 // args: data (16-bit)
acamera_isp_input_formatter_knee_point1_write(uintptr_t base,uint16_t data)3137 static __inline void acamera_isp_input_formatter_knee_point1_write(uintptr_t base, uint16_t data) {
3138 uint32_t curr = system_sw_read_32(base + 0x18fa8L);
3139 system_sw_write_32(base + 0x18fa8L, (((uint32_t) (data & 0xffff)) << 16) | (curr & 0xffff));
3140 }
acamera_isp_input_formatter_knee_point1_read(uintptr_t base)3141 static __inline uint16_t acamera_isp_input_formatter_knee_point1_read(uintptr_t base) {
3142 return (uint16_t)((system_sw_read_32(base + 0x18fa8L) & 0xffff0000) >> 16);
3143 }
3144 // ------------------------------------------------------------------------------ //
3145 // Register: knee point2
3146 // ------------------------------------------------------------------------------ //
3147
3148 // ------------------------------------------------------------------------------ //
3149 // Third knee point
3150 // ------------------------------------------------------------------------------ //
3151
3152 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT2_DEFAULT (2177)
3153 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT2_DATASIZE (16)
3154 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT2_OFFSET (0x124)
3155 #define ACAMERA_ISP_INPUT_FORMATTER_KNEE_POINT2_MASK (0xffff)
3156
3157 // args: data (16-bit)
acamera_isp_input_formatter_knee_point2_write(uintptr_t base,uint16_t data)3158 static __inline void acamera_isp_input_formatter_knee_point2_write(uintptr_t base, uint16_t data) {
3159 uint32_t curr = system_sw_read_32(base + 0x18facL);
3160 system_sw_write_32(base + 0x18facL, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
3161 }
acamera_isp_input_formatter_knee_point2_read(uintptr_t base)3162 static __inline uint16_t acamera_isp_input_formatter_knee_point2_read(uintptr_t base) {
3163 return (uint16_t)((system_sw_read_32(base + 0x18facL) & 0xffff) >> 0);
3164 }
3165 // ------------------------------------------------------------------------------ //
3166 // Register: slope0 select
3167 // ------------------------------------------------------------------------------ //
3168
3169 // ------------------------------------------------------------------------------ //
3170 // First slope for companding table segments
3171 // ------------------------------------------------------------------------------ //
3172
3173 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_DEFAULT (2)
3174 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_DATASIZE (4)
3175 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_OFFSET (0x128)
3176 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_MASK (0xf)
3177 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_1X (0)
3178 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_2X (1)
3179 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_4X (2)
3180 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_8X (3)
3181 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_16X (4)
3182 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_32X (5)
3183 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_64X (6)
3184 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_128X (7)
3185 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_256X (8)
3186 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_512X (9)
3187 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_1024X (10)
3188 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_2048X (11)
3189 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_4096X (12)
3190 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_8192X (13)
3191 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_16384X (14)
3192 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE0_SELECT_32768X (15)
3193
3194 // args: data (4-bit)
acamera_isp_input_formatter_slope0_select_write(uintptr_t base,uint8_t data)3195 static __inline void acamera_isp_input_formatter_slope0_select_write(uintptr_t base, uint8_t data) {
3196 uint32_t curr = system_sw_read_32(base + 0x18fb0L);
3197 system_sw_write_32(base + 0x18fb0L, (((uint32_t) (data & 0xf)) << 0) | (curr & 0xfffffff0));
3198 }
acamera_isp_input_formatter_slope0_select_read(uintptr_t base)3199 static __inline uint8_t acamera_isp_input_formatter_slope0_select_read(uintptr_t base) {
3200 return (uint8_t)((system_sw_read_32(base + 0x18fb0L) & 0xf) >> 0);
3201 }
3202 // ------------------------------------------------------------------------------ //
3203 // Register: slope1 select
3204 // ------------------------------------------------------------------------------ //
3205
3206 // ------------------------------------------------------------------------------ //
3207 // Second slope for companding table segments (encoding is the same as slope0 select)
3208 // ------------------------------------------------------------------------------ //
3209
3210 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE1_SELECT_DEFAULT (4)
3211 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE1_SELECT_DATASIZE (4)
3212 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE1_SELECT_OFFSET (0x128)
3213 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE1_SELECT_MASK (0xf00)
3214
3215 // args: data (4-bit)
acamera_isp_input_formatter_slope1_select_write(uintptr_t base,uint8_t data)3216 static __inline void acamera_isp_input_formatter_slope1_select_write(uintptr_t base, uint8_t data) {
3217 uint32_t curr = system_sw_read_32(base + 0x18fb0L);
3218 system_sw_write_32(base + 0x18fb0L, (((uint32_t) (data & 0xf)) << 8) | (curr & 0xfffff0ff));
3219 }
acamera_isp_input_formatter_slope1_select_read(uintptr_t base)3220 static __inline uint8_t acamera_isp_input_formatter_slope1_select_read(uintptr_t base) {
3221 return (uint8_t)((system_sw_read_32(base + 0x18fb0L) & 0xf00) >> 8);
3222 }
3223 // ------------------------------------------------------------------------------ //
3224 // Register: slope2 select
3225 // ------------------------------------------------------------------------------ //
3226
3227 // ------------------------------------------------------------------------------ //
3228 // Third slope for companding table segments (encoding is the same as slope0 select)
3229 // ------------------------------------------------------------------------------ //
3230
3231 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE2_SELECT_DEFAULT (6)
3232 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE2_SELECT_DATASIZE (4)
3233 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE2_SELECT_OFFSET (0x128)
3234 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE2_SELECT_MASK (0xf0000)
3235
3236 // args: data (4-bit)
acamera_isp_input_formatter_slope2_select_write(uintptr_t base,uint8_t data)3237 static __inline void acamera_isp_input_formatter_slope2_select_write(uintptr_t base, uint8_t data) {
3238 uint32_t curr = system_sw_read_32(base + 0x18fb0L);
3239 system_sw_write_32(base + 0x18fb0L, (((uint32_t) (data & 0xf)) << 16) | (curr & 0xfff0ffff));
3240 }
acamera_isp_input_formatter_slope2_select_read(uintptr_t base)3241 static __inline uint8_t acamera_isp_input_formatter_slope2_select_read(uintptr_t base) {
3242 return (uint8_t)((system_sw_read_32(base + 0x18fb0L) & 0xf0000) >> 16);
3243 }
3244 // ------------------------------------------------------------------------------ //
3245 // Register: slope3 select
3246 // ------------------------------------------------------------------------------ //
3247
3248 // ------------------------------------------------------------------------------ //
3249 // Last slope for companding table segments (encoding is the same as slope0 select)
3250 // ------------------------------------------------------------------------------ //
3251
3252 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE3_SELECT_DEFAULT (9)
3253 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE3_SELECT_DATASIZE (4)
3254 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE3_SELECT_OFFSET (0x128)
3255 #define ACAMERA_ISP_INPUT_FORMATTER_SLOPE3_SELECT_MASK (0xf000000)
3256
3257 // args: data (4-bit)
acamera_isp_input_formatter_slope3_select_write(uintptr_t base,uint8_t data)3258 static __inline void acamera_isp_input_formatter_slope3_select_write(uintptr_t base, uint8_t data) {
3259 uint32_t curr = system_sw_read_32(base + 0x18fb0L);
3260 system_sw_write_32(base + 0x18fb0L, (((uint32_t) (data & 0xf)) << 24) | (curr & 0xf0ffffff));
3261 }
acamera_isp_input_formatter_slope3_select_read(uintptr_t base)3262 static __inline uint8_t acamera_isp_input_formatter_slope3_select_read(uintptr_t base) {
3263 return (uint8_t)((system_sw_read_32(base + 0x18fb0L) & 0xf000000) >> 24);
3264 }
3265 // ------------------------------------------------------------------------------ //
3266 // Group: sensor offset wdr l
3267 // ------------------------------------------------------------------------------ //
3268
3269 // ------------------------------------------------------------------------------ //
3270 // offset offset subtraction for each color channel and exposure
3271 // ------------------------------------------------------------------------------ //
3272
3273 // ------------------------------------------------------------------------------ //
3274 // Register: offset 00
3275 // ------------------------------------------------------------------------------ //
3276
3277 // ------------------------------------------------------------------------------ //
3278 // offset offset for color channel 00 (R)
3279 // ------------------------------------------------------------------------------ //
3280
3281 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_00_DEFAULT (0x00)
3282 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_00_DATASIZE (12)
3283 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_00_OFFSET (0x12c)
3284 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_00_MASK (0xfff)
3285
3286 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_l_offset_00_write(uintptr_t base,uint16_t data)3287 static __inline void acamera_isp_sensor_offset_wdr_l_offset_00_write(uintptr_t base, uint16_t data) {
3288 uint32_t curr = system_sw_read_32(base + 0x18fb4L);
3289 system_sw_write_32(base + 0x18fb4L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3290 }
acamera_isp_sensor_offset_wdr_l_offset_00_read(uintptr_t base)3291 static __inline uint16_t acamera_isp_sensor_offset_wdr_l_offset_00_read(uintptr_t base) {
3292 return (uint16_t)((system_sw_read_32(base + 0x18fb4L) & 0xfff) >> 0);
3293 }
3294 // ------------------------------------------------------------------------------ //
3295 // Register: offset 01
3296 // ------------------------------------------------------------------------------ //
3297
3298 // ------------------------------------------------------------------------------ //
3299 // offset offset for color channel 01 (Gr)
3300 // ------------------------------------------------------------------------------ //
3301
3302 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_01_DEFAULT (0x00)
3303 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_01_DATASIZE (12)
3304 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_01_OFFSET (0x12c)
3305 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_01_MASK (0xfff0000)
3306
3307 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_l_offset_01_write(uintptr_t base,uint16_t data)3308 static __inline void acamera_isp_sensor_offset_wdr_l_offset_01_write(uintptr_t base, uint16_t data) {
3309 uint32_t curr = system_sw_read_32(base + 0x18fb4L);
3310 system_sw_write_32(base + 0x18fb4L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3311 }
acamera_isp_sensor_offset_wdr_l_offset_01_read(uintptr_t base)3312 static __inline uint16_t acamera_isp_sensor_offset_wdr_l_offset_01_read(uintptr_t base) {
3313 return (uint16_t)((system_sw_read_32(base + 0x18fb4L) & 0xfff0000) >> 16);
3314 }
3315 // ------------------------------------------------------------------------------ //
3316 // Register: offset 10
3317 // ------------------------------------------------------------------------------ //
3318
3319 // ------------------------------------------------------------------------------ //
3320 // offset offset for color channel 10 (Gb)
3321 // ------------------------------------------------------------------------------ //
3322
3323 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_10_DEFAULT (0x00)
3324 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_10_DATASIZE (12)
3325 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_10_OFFSET (0x130)
3326 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_10_MASK (0xfff)
3327
3328 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_l_offset_10_write(uintptr_t base,uint16_t data)3329 static __inline void acamera_isp_sensor_offset_wdr_l_offset_10_write(uintptr_t base, uint16_t data) {
3330 uint32_t curr = system_sw_read_32(base + 0x18fb8L);
3331 system_sw_write_32(base + 0x18fb8L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3332 }
acamera_isp_sensor_offset_wdr_l_offset_10_read(uintptr_t base)3333 static __inline uint16_t acamera_isp_sensor_offset_wdr_l_offset_10_read(uintptr_t base) {
3334 return (uint16_t)((system_sw_read_32(base + 0x18fb8L) & 0xfff) >> 0);
3335 }
3336 // ------------------------------------------------------------------------------ //
3337 // Register: offset 11
3338 // ------------------------------------------------------------------------------ //
3339
3340 // ------------------------------------------------------------------------------ //
3341 // offset offset for color channel 11 (B)
3342 // ------------------------------------------------------------------------------ //
3343
3344 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_11_DEFAULT (0x00)
3345 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_11_DATASIZE (12)
3346 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_11_OFFSET (0x130)
3347 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_L_OFFSET_11_MASK (0xfff0000)
3348
3349 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_l_offset_11_write(uintptr_t base,uint16_t data)3350 static __inline void acamera_isp_sensor_offset_wdr_l_offset_11_write(uintptr_t base, uint16_t data) {
3351 uint32_t curr = system_sw_read_32(base + 0x18fb8L);
3352 system_sw_write_32(base + 0x18fb8L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3353 }
acamera_isp_sensor_offset_wdr_l_offset_11_read(uintptr_t base)3354 static __inline uint16_t acamera_isp_sensor_offset_wdr_l_offset_11_read(uintptr_t base) {
3355 return (uint16_t)((system_sw_read_32(base + 0x18fb8L) & 0xfff0000) >> 16);
3356 }
3357 // ------------------------------------------------------------------------------ //
3358 // Group: sensor offset wdr m
3359 // ------------------------------------------------------------------------------ //
3360
3361 // ------------------------------------------------------------------------------ //
3362 // offset offset subtraction for each color channel and exposure
3363 // ------------------------------------------------------------------------------ //
3364
3365 // ------------------------------------------------------------------------------ //
3366 // Register: offset 00
3367 // ------------------------------------------------------------------------------ //
3368
3369 // ------------------------------------------------------------------------------ //
3370 // offset offset for color channel 00 (R)
3371 // ------------------------------------------------------------------------------ //
3372
3373 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_00_DEFAULT (0x00)
3374 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_00_DATASIZE (12)
3375 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_00_OFFSET (0x134)
3376 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_00_MASK (0xfff)
3377
3378 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_m_offset_00_write(uintptr_t base,uint16_t data)3379 static __inline void acamera_isp_sensor_offset_wdr_m_offset_00_write(uintptr_t base, uint16_t data) {
3380 uint32_t curr = system_sw_read_32(base + 0x18fbcL);
3381 system_sw_write_32(base + 0x18fbcL, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3382 }
acamera_isp_sensor_offset_wdr_m_offset_00_read(uintptr_t base)3383 static __inline uint16_t acamera_isp_sensor_offset_wdr_m_offset_00_read(uintptr_t base) {
3384 return (uint16_t)((system_sw_read_32(base + 0x18fbcL) & 0xfff) >> 0);
3385 }
3386 // ------------------------------------------------------------------------------ //
3387 // Register: offset 01
3388 // ------------------------------------------------------------------------------ //
3389
3390 // ------------------------------------------------------------------------------ //
3391 // offset offset for color channel 01 (Gr)
3392 // ------------------------------------------------------------------------------ //
3393
3394 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_01_DEFAULT (0x00)
3395 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_01_DATASIZE (12)
3396 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_01_OFFSET (0x134)
3397 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_01_MASK (0xfff0000)
3398
3399 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_m_offset_01_write(uintptr_t base,uint16_t data)3400 static __inline void acamera_isp_sensor_offset_wdr_m_offset_01_write(uintptr_t base, uint16_t data) {
3401 uint32_t curr = system_sw_read_32(base + 0x18fbcL);
3402 system_sw_write_32(base + 0x18fbcL, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3403 }
acamera_isp_sensor_offset_wdr_m_offset_01_read(uintptr_t base)3404 static __inline uint16_t acamera_isp_sensor_offset_wdr_m_offset_01_read(uintptr_t base) {
3405 return (uint16_t)((system_sw_read_32(base + 0x18fbcL) & 0xfff0000) >> 16);
3406 }
3407 // ------------------------------------------------------------------------------ //
3408 // Register: offset 10
3409 // ------------------------------------------------------------------------------ //
3410
3411 // ------------------------------------------------------------------------------ //
3412 // offset offset for color channel 10 (Gb)
3413 // ------------------------------------------------------------------------------ //
3414
3415 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_10_DEFAULT (0x00)
3416 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_10_DATASIZE (12)
3417 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_10_OFFSET (0x138)
3418 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_10_MASK (0xfff)
3419
3420 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_m_offset_10_write(uintptr_t base,uint16_t data)3421 static __inline void acamera_isp_sensor_offset_wdr_m_offset_10_write(uintptr_t base, uint16_t data) {
3422 uint32_t curr = system_sw_read_32(base + 0x18fc0L);
3423 system_sw_write_32(base + 0x18fc0L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3424 }
acamera_isp_sensor_offset_wdr_m_offset_10_read(uintptr_t base)3425 static __inline uint16_t acamera_isp_sensor_offset_wdr_m_offset_10_read(uintptr_t base) {
3426 return (uint16_t)((system_sw_read_32(base + 0x18fc0L) & 0xfff) >> 0);
3427 }
3428 // ------------------------------------------------------------------------------ //
3429 // Register: offset 11
3430 // ------------------------------------------------------------------------------ //
3431
3432 // ------------------------------------------------------------------------------ //
3433 // offset offset for color channel 11 (B)
3434 // ------------------------------------------------------------------------------ //
3435
3436 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_11_DEFAULT (0x00)
3437 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_11_DATASIZE (12)
3438 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_11_OFFSET (0x138)
3439 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_M_OFFSET_11_MASK (0xfff0000)
3440
3441 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_m_offset_11_write(uintptr_t base,uint16_t data)3442 static __inline void acamera_isp_sensor_offset_wdr_m_offset_11_write(uintptr_t base, uint16_t data) {
3443 uint32_t curr = system_sw_read_32(base + 0x18fc0L);
3444 system_sw_write_32(base + 0x18fc0L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3445 }
acamera_isp_sensor_offset_wdr_m_offset_11_read(uintptr_t base)3446 static __inline uint16_t acamera_isp_sensor_offset_wdr_m_offset_11_read(uintptr_t base) {
3447 return (uint16_t)((system_sw_read_32(base + 0x18fc0L) & 0xfff0000) >> 16);
3448 }
3449 // ------------------------------------------------------------------------------ //
3450 // Group: sensor offset wdr s
3451 // ------------------------------------------------------------------------------ //
3452
3453 // ------------------------------------------------------------------------------ //
3454 // offset offset subtraction for each color channel and exposure
3455 // ------------------------------------------------------------------------------ //
3456
3457 // ------------------------------------------------------------------------------ //
3458 // Register: offset 00
3459 // ------------------------------------------------------------------------------ //
3460
3461 // ------------------------------------------------------------------------------ //
3462 // offset offset for color channel 00 (R)
3463 // ------------------------------------------------------------------------------ //
3464
3465 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_00_DEFAULT (0x00)
3466 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_00_DATASIZE (12)
3467 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_00_OFFSET (0x13c)
3468 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_00_MASK (0xfff)
3469
3470 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_s_offset_00_write(uintptr_t base,uint16_t data)3471 static __inline void acamera_isp_sensor_offset_wdr_s_offset_00_write(uintptr_t base, uint16_t data) {
3472 uint32_t curr = system_sw_read_32(base + 0x18fc4L);
3473 system_sw_write_32(base + 0x18fc4L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3474 }
acamera_isp_sensor_offset_wdr_s_offset_00_read(uintptr_t base)3475 static __inline uint16_t acamera_isp_sensor_offset_wdr_s_offset_00_read(uintptr_t base) {
3476 return (uint16_t)((system_sw_read_32(base + 0x18fc4L) & 0xfff) >> 0);
3477 }
3478 // ------------------------------------------------------------------------------ //
3479 // Register: offset 01
3480 // ------------------------------------------------------------------------------ //
3481
3482 // ------------------------------------------------------------------------------ //
3483 // offset offset for color channel 01 (Gr)
3484 // ------------------------------------------------------------------------------ //
3485
3486 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_01_DEFAULT (0x00)
3487 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_01_DATASIZE (12)
3488 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_01_OFFSET (0x13c)
3489 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_01_MASK (0xfff0000)
3490
3491 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_s_offset_01_write(uintptr_t base,uint16_t data)3492 static __inline void acamera_isp_sensor_offset_wdr_s_offset_01_write(uintptr_t base, uint16_t data) {
3493 uint32_t curr = system_sw_read_32(base + 0x18fc4L);
3494 system_sw_write_32(base + 0x18fc4L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3495 }
acamera_isp_sensor_offset_wdr_s_offset_01_read(uintptr_t base)3496 static __inline uint16_t acamera_isp_sensor_offset_wdr_s_offset_01_read(uintptr_t base) {
3497 return (uint16_t)((system_sw_read_32(base + 0x18fc4L) & 0xfff0000) >> 16);
3498 }
3499 // ------------------------------------------------------------------------------ //
3500 // Register: offset 10
3501 // ------------------------------------------------------------------------------ //
3502
3503 // ------------------------------------------------------------------------------ //
3504 // offset offset for color channel 10 (Gb)
3505 // ------------------------------------------------------------------------------ //
3506
3507 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_10_DEFAULT (0x00)
3508 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_10_DATASIZE (12)
3509 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_10_OFFSET (0x140)
3510 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_10_MASK (0xfff)
3511
3512 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_s_offset_10_write(uintptr_t base,uint16_t data)3513 static __inline void acamera_isp_sensor_offset_wdr_s_offset_10_write(uintptr_t base, uint16_t data) {
3514 uint32_t curr = system_sw_read_32(base + 0x18fc8L);
3515 system_sw_write_32(base + 0x18fc8L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3516 }
acamera_isp_sensor_offset_wdr_s_offset_10_read(uintptr_t base)3517 static __inline uint16_t acamera_isp_sensor_offset_wdr_s_offset_10_read(uintptr_t base) {
3518 return (uint16_t)((system_sw_read_32(base + 0x18fc8L) & 0xfff) >> 0);
3519 }
3520 // ------------------------------------------------------------------------------ //
3521 // Register: offset 11
3522 // ------------------------------------------------------------------------------ //
3523
3524 // ------------------------------------------------------------------------------ //
3525 // offset offset for color channel 11 (B)
3526 // ------------------------------------------------------------------------------ //
3527
3528 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_11_DEFAULT (0x00)
3529 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_11_DATASIZE (12)
3530 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_11_OFFSET (0x140)
3531 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_S_OFFSET_11_MASK (0xfff0000)
3532
3533 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_s_offset_11_write(uintptr_t base,uint16_t data)3534 static __inline void acamera_isp_sensor_offset_wdr_s_offset_11_write(uintptr_t base, uint16_t data) {
3535 uint32_t curr = system_sw_read_32(base + 0x18fc8L);
3536 system_sw_write_32(base + 0x18fc8L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3537 }
acamera_isp_sensor_offset_wdr_s_offset_11_read(uintptr_t base)3538 static __inline uint16_t acamera_isp_sensor_offset_wdr_s_offset_11_read(uintptr_t base) {
3539 return (uint16_t)((system_sw_read_32(base + 0x18fc8L) & 0xfff0000) >> 16);
3540 }
3541 // ------------------------------------------------------------------------------ //
3542 // Group: sensor offset wdr vs
3543 // ------------------------------------------------------------------------------ //
3544
3545 // ------------------------------------------------------------------------------ //
3546 // offset offset subtraction for each color channel and exposure
3547 // ------------------------------------------------------------------------------ //
3548
3549 // ------------------------------------------------------------------------------ //
3550 // Register: offset 00
3551 // ------------------------------------------------------------------------------ //
3552
3553 // ------------------------------------------------------------------------------ //
3554 // offset offset for color channel 00 (R)
3555 // ------------------------------------------------------------------------------ //
3556
3557 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_00_DEFAULT (0x00)
3558 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_00_DATASIZE (12)
3559 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_00_OFFSET (0x144)
3560 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_00_MASK (0xfff)
3561
3562 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_vs_offset_00_write(uintptr_t base,uint16_t data)3563 static __inline void acamera_isp_sensor_offset_wdr_vs_offset_00_write(uintptr_t base, uint16_t data) {
3564 uint32_t curr = system_sw_read_32(base + 0x18fccL);
3565 system_sw_write_32(base + 0x18fccL, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3566 }
acamera_isp_sensor_offset_wdr_vs_offset_00_read(uintptr_t base)3567 static __inline uint16_t acamera_isp_sensor_offset_wdr_vs_offset_00_read(uintptr_t base) {
3568 return (uint16_t)((system_sw_read_32(base + 0x18fccL) & 0xfff) >> 0);
3569 }
3570 // ------------------------------------------------------------------------------ //
3571 // Register: offset 01
3572 // ------------------------------------------------------------------------------ //
3573
3574 // ------------------------------------------------------------------------------ //
3575 // offset offset for color channel 01 (Gr)
3576 // ------------------------------------------------------------------------------ //
3577
3578 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_01_DEFAULT (0x00)
3579 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_01_DATASIZE (12)
3580 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_01_OFFSET (0x144)
3581 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_01_MASK (0xfff0000)
3582
3583 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_vs_offset_01_write(uintptr_t base,uint16_t data)3584 static __inline void acamera_isp_sensor_offset_wdr_vs_offset_01_write(uintptr_t base, uint16_t data) {
3585 uint32_t curr = system_sw_read_32(base + 0x18fccL);
3586 system_sw_write_32(base + 0x18fccL, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3587 }
acamera_isp_sensor_offset_wdr_vs_offset_01_read(uintptr_t base)3588 static __inline uint16_t acamera_isp_sensor_offset_wdr_vs_offset_01_read(uintptr_t base) {
3589 return (uint16_t)((system_sw_read_32(base + 0x18fccL) & 0xfff0000) >> 16);
3590 }
3591 // ------------------------------------------------------------------------------ //
3592 // Register: offset 10
3593 // ------------------------------------------------------------------------------ //
3594
3595 // ------------------------------------------------------------------------------ //
3596 // offset offset for color channel 10 (Gb)
3597 // ------------------------------------------------------------------------------ //
3598
3599 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_10_DEFAULT (0x00)
3600 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_10_DATASIZE (12)
3601 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_10_OFFSET (0x148)
3602 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_10_MASK (0xfff)
3603
3604 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_vs_offset_10_write(uintptr_t base,uint16_t data)3605 static __inline void acamera_isp_sensor_offset_wdr_vs_offset_10_write(uintptr_t base, uint16_t data) {
3606 uint32_t curr = system_sw_read_32(base + 0x18fd0L);
3607 system_sw_write_32(base + 0x18fd0L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3608 }
acamera_isp_sensor_offset_wdr_vs_offset_10_read(uintptr_t base)3609 static __inline uint16_t acamera_isp_sensor_offset_wdr_vs_offset_10_read(uintptr_t base) {
3610 return (uint16_t)((system_sw_read_32(base + 0x18fd0L) & 0xfff) >> 0);
3611 }
3612 // ------------------------------------------------------------------------------ //
3613 // Register: offset 11
3614 // ------------------------------------------------------------------------------ //
3615
3616 // ------------------------------------------------------------------------------ //
3617 // offset offset for color channel 11 (B)
3618 // ------------------------------------------------------------------------------ //
3619
3620 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_11_DEFAULT (0x00)
3621 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_11_DATASIZE (12)
3622 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_11_OFFSET (0x148)
3623 #define ACAMERA_ISP_SENSOR_OFFSET_WDR_VS_OFFSET_11_MASK (0xfff0000)
3624
3625 // args: data (12-bit)
acamera_isp_sensor_offset_wdr_vs_offset_11_write(uintptr_t base,uint16_t data)3626 static __inline void acamera_isp_sensor_offset_wdr_vs_offset_11_write(uintptr_t base, uint16_t data) {
3627 uint32_t curr = system_sw_read_32(base + 0x18fd0L);
3628 system_sw_write_32(base + 0x18fd0L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3629 }
acamera_isp_sensor_offset_wdr_vs_offset_11_read(uintptr_t base)3630 static __inline uint16_t acamera_isp_sensor_offset_wdr_vs_offset_11_read(uintptr_t base) {
3631 return (uint16_t)((system_sw_read_32(base + 0x18fd0L) & 0xfff0000) >> 16);
3632 }
3633 // ------------------------------------------------------------------------------ //
3634 // Group: gain wdr
3635 // ------------------------------------------------------------------------------ //
3636
3637 // ------------------------------------------------------------------------------ //
3638 // Gain adjustment for the WDR stitching
3639 // ------------------------------------------------------------------------------ //
3640
3641 // ------------------------------------------------------------------------------ //
3642 // Register: Gain_l
3643 // ------------------------------------------------------------------------------ //
3644
3645 // ------------------------------------------------------------------------------ //
3646 // Gain applied to ch-long data in 5.8 format
3647 // ------------------------------------------------------------------------------ //
3648
3649 #define ACAMERA_ISP_GAIN_WDR_GAIN_L_DEFAULT (0x100)
3650 #define ACAMERA_ISP_GAIN_WDR_GAIN_L_DATASIZE (13)
3651 #define ACAMERA_ISP_GAIN_WDR_GAIN_L_OFFSET (0x14c)
3652 #define ACAMERA_ISP_GAIN_WDR_GAIN_L_MASK (0x1fff)
3653
3654 // args: data (13-bit)
acamera_isp_gain_wdr_gain_l_write(uintptr_t base,uint16_t data)3655 static __inline void acamera_isp_gain_wdr_gain_l_write(uintptr_t base, uint16_t data) {
3656 uint32_t curr = system_sw_read_32(base + 0x18fd4L);
3657 system_sw_write_32(base + 0x18fd4L, (((uint32_t) (data & 0x1fff)) << 0) | (curr & 0xffffe000));
3658 }
acamera_isp_gain_wdr_gain_l_read(uintptr_t base)3659 static __inline uint16_t acamera_isp_gain_wdr_gain_l_read(uintptr_t base) {
3660 return (uint16_t)((system_sw_read_32(base + 0x18fd4L) & 0x1fff) >> 0);
3661 }
3662 // ------------------------------------------------------------------------------ //
3663 // Register: Gain_m
3664 // ------------------------------------------------------------------------------ //
3665
3666 // ------------------------------------------------------------------------------ //
3667 // Gain applied to ch-medium data in 5.8 format
3668 // ------------------------------------------------------------------------------ //
3669
3670 #define ACAMERA_ISP_GAIN_WDR_GAIN_M_DEFAULT (0x100)
3671 #define ACAMERA_ISP_GAIN_WDR_GAIN_M_DATASIZE (13)
3672 #define ACAMERA_ISP_GAIN_WDR_GAIN_M_OFFSET (0x14c)
3673 #define ACAMERA_ISP_GAIN_WDR_GAIN_M_MASK (0x1fff0000)
3674
3675 // args: data (13-bit)
acamera_isp_gain_wdr_gain_m_write(uintptr_t base,uint16_t data)3676 static __inline void acamera_isp_gain_wdr_gain_m_write(uintptr_t base, uint16_t data) {
3677 uint32_t curr = system_sw_read_32(base + 0x18fd4L);
3678 system_sw_write_32(base + 0x18fd4L, (((uint32_t) (data & 0x1fff)) << 16) | (curr & 0xe000ffff));
3679 }
acamera_isp_gain_wdr_gain_m_read(uintptr_t base)3680 static __inline uint16_t acamera_isp_gain_wdr_gain_m_read(uintptr_t base) {
3681 return (uint16_t)((system_sw_read_32(base + 0x18fd4L) & 0x1fff0000) >> 16);
3682 }
3683 // ------------------------------------------------------------------------------ //
3684 // Register: Gain_s
3685 // ------------------------------------------------------------------------------ //
3686
3687 // ------------------------------------------------------------------------------ //
3688 // Gain applied to ch-short data in 5.8 format
3689 // ------------------------------------------------------------------------------ //
3690
3691 #define ACAMERA_ISP_GAIN_WDR_GAIN_S_DEFAULT (0x100)
3692 #define ACAMERA_ISP_GAIN_WDR_GAIN_S_DATASIZE (13)
3693 #define ACAMERA_ISP_GAIN_WDR_GAIN_S_OFFSET (0x150)
3694 #define ACAMERA_ISP_GAIN_WDR_GAIN_S_MASK (0x1fff)
3695
3696 // args: data (13-bit)
acamera_isp_gain_wdr_gain_s_write(uintptr_t base,uint16_t data)3697 static __inline void acamera_isp_gain_wdr_gain_s_write(uintptr_t base, uint16_t data) {
3698 uint32_t curr = system_sw_read_32(base + 0x18fd8L);
3699 system_sw_write_32(base + 0x18fd8L, (((uint32_t) (data & 0x1fff)) << 0) | (curr & 0xffffe000));
3700 }
acamera_isp_gain_wdr_gain_s_read(uintptr_t base)3701 static __inline uint16_t acamera_isp_gain_wdr_gain_s_read(uintptr_t base) {
3702 return (uint16_t)((system_sw_read_32(base + 0x18fd8L) & 0x1fff) >> 0);
3703 }
3704 // ------------------------------------------------------------------------------ //
3705 // Register: Gain_vs
3706 // ------------------------------------------------------------------------------ //
3707
3708 // ------------------------------------------------------------------------------ //
3709 // Gain applied to ch-vs data in 5.8 format
3710 // ------------------------------------------------------------------------------ //
3711
3712 #define ACAMERA_ISP_GAIN_WDR_GAIN_VS_DEFAULT (0x100)
3713 #define ACAMERA_ISP_GAIN_WDR_GAIN_VS_DATASIZE (13)
3714 #define ACAMERA_ISP_GAIN_WDR_GAIN_VS_OFFSET (0x150)
3715 #define ACAMERA_ISP_GAIN_WDR_GAIN_VS_MASK (0x1fff0000)
3716
3717 // args: data (13-bit)
acamera_isp_gain_wdr_gain_vs_write(uintptr_t base,uint16_t data)3718 static __inline void acamera_isp_gain_wdr_gain_vs_write(uintptr_t base, uint16_t data) {
3719 uint32_t curr = system_sw_read_32(base + 0x18fd8L);
3720 system_sw_write_32(base + 0x18fd8L, (((uint32_t) (data & 0x1fff)) << 16) | (curr & 0xe000ffff));
3721 }
acamera_isp_gain_wdr_gain_vs_read(uintptr_t base)3722 static __inline uint16_t acamera_isp_gain_wdr_gain_vs_read(uintptr_t base) {
3723 return (uint16_t)((system_sw_read_32(base + 0x18fd8L) & 0x1fff0000) >> 16);
3724 }
3725 // ------------------------------------------------------------------------------ //
3726 // Register: black_level_l
3727 // ------------------------------------------------------------------------------ //
3728
3729 // ------------------------------------------------------------------------------ //
3730 // Sensor offset applied to ch-long data
3731 // ------------------------------------------------------------------------------ //
3732
3733 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_L_DEFAULT (0x0000)
3734 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_L_DATASIZE (12)
3735 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_L_OFFSET (0x154)
3736 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_L_MASK (0xfff)
3737
3738 // args: data (12-bit)
acamera_isp_gain_wdr_black_level_l_write(uintptr_t base,uint16_t data)3739 static __inline void acamera_isp_gain_wdr_black_level_l_write(uintptr_t base, uint16_t data) {
3740 uint32_t curr = system_sw_read_32(base + 0x18fdcL);
3741 system_sw_write_32(base + 0x18fdcL, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3742 }
acamera_isp_gain_wdr_black_level_l_read(uintptr_t base)3743 static __inline uint16_t acamera_isp_gain_wdr_black_level_l_read(uintptr_t base) {
3744 return (uint16_t)((system_sw_read_32(base + 0x18fdcL) & 0xfff) >> 0);
3745 }
3746 // ------------------------------------------------------------------------------ //
3747 // Register: black_level_m
3748 // ------------------------------------------------------------------------------ //
3749
3750 // ------------------------------------------------------------------------------ //
3751 // Sensor offset applied to ch-medium data
3752 // ------------------------------------------------------------------------------ //
3753
3754 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_M_DEFAULT (0x0000)
3755 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_M_DATASIZE (12)
3756 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_M_OFFSET (0x154)
3757 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_M_MASK (0xfff0000)
3758
3759 // args: data (12-bit)
acamera_isp_gain_wdr_black_level_m_write(uintptr_t base,uint16_t data)3760 static __inline void acamera_isp_gain_wdr_black_level_m_write(uintptr_t base, uint16_t data) {
3761 uint32_t curr = system_sw_read_32(base + 0x18fdcL);
3762 system_sw_write_32(base + 0x18fdcL, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3763 }
acamera_isp_gain_wdr_black_level_m_read(uintptr_t base)3764 static __inline uint16_t acamera_isp_gain_wdr_black_level_m_read(uintptr_t base) {
3765 return (uint16_t)((system_sw_read_32(base + 0x18fdcL) & 0xfff0000) >> 16);
3766 }
3767 // ------------------------------------------------------------------------------ //
3768 // Register: black_level_s
3769 // ------------------------------------------------------------------------------ //
3770
3771 // ------------------------------------------------------------------------------ //
3772 // Sensor offset applied to ch-short data
3773 // ------------------------------------------------------------------------------ //
3774
3775 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_S_DEFAULT (0x0000)
3776 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_S_DATASIZE (12)
3777 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_S_OFFSET (0x158)
3778 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_S_MASK (0xfff)
3779
3780 // args: data (12-bit)
acamera_isp_gain_wdr_black_level_s_write(uintptr_t base,uint16_t data)3781 static __inline void acamera_isp_gain_wdr_black_level_s_write(uintptr_t base, uint16_t data) {
3782 uint32_t curr = system_sw_read_32(base + 0x18fe0L);
3783 system_sw_write_32(base + 0x18fe0L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3784 }
acamera_isp_gain_wdr_black_level_s_read(uintptr_t base)3785 static __inline uint16_t acamera_isp_gain_wdr_black_level_s_read(uintptr_t base) {
3786 return (uint16_t)((system_sw_read_32(base + 0x18fe0L) & 0xfff) >> 0);
3787 }
3788 // ------------------------------------------------------------------------------ //
3789 // Register: black_level_vs
3790 // ------------------------------------------------------------------------------ //
3791
3792 // ------------------------------------------------------------------------------ //
3793 // Sensor offset applied to ch-veryshort data
3794 // ------------------------------------------------------------------------------ //
3795
3796 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_VS_DEFAULT (0x0000)
3797 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_VS_DATASIZE (12)
3798 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_VS_OFFSET (0x158)
3799 #define ACAMERA_ISP_GAIN_WDR_BLACK_LEVEL_VS_MASK (0xfff0000)
3800
3801 // args: data (12-bit)
acamera_isp_gain_wdr_black_level_vs_write(uintptr_t base,uint16_t data)3802 static __inline void acamera_isp_gain_wdr_black_level_vs_write(uintptr_t base, uint16_t data) {
3803 uint32_t curr = system_sw_read_32(base + 0x18fe0L);
3804 system_sw_write_32(base + 0x18fe0L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3805 }
acamera_isp_gain_wdr_black_level_vs_read(uintptr_t base)3806 static __inline uint16_t acamera_isp_gain_wdr_black_level_vs_read(uintptr_t base) {
3807 return (uint16_t)((system_sw_read_32(base + 0x18fe0L) & 0xfff0000) >> 16);
3808 }
3809 // ------------------------------------------------------------------------------ //
3810 // Group: frame stitch
3811 // ------------------------------------------------------------------------------ //
3812
3813 // ------------------------------------------------------------------------------ //
3814 //
3815 // 4-exposure wide-dynamic-range blending
3816 //
3817 // NOTE:
3818 // If the WDR is configured to stitch 2 exposures, then the configuration must be done through the LM_ pair
3819 // the short exposures black level must be programmed through the med_black_level register so that the LM pair
3820 // can be used.
3821 //
3822 //
3823 //
3824 // ------------------------------------------------------------------------------ //
3825
3826 // ------------------------------------------------------------------------------ //
3827 // Register: mode_in
3828 // ------------------------------------------------------------------------------ //
3829
3830 // ------------------------------------------------------------------------------ //
3831 // 0 : 4-exposure
3832 // 1 : 2-exposure
3833 // 2 : 3-exposure
3834 // 3 : 4-exposure
3835 //
3836 // ------------------------------------------------------------------------------ //
3837
3838 #define ACAMERA_ISP_FRAME_STITCH_MODE_IN_DEFAULT (0)
3839 #define ACAMERA_ISP_FRAME_STITCH_MODE_IN_DATASIZE (2)
3840 #define ACAMERA_ISP_FRAME_STITCH_MODE_IN_OFFSET (0x15c)
3841 #define ACAMERA_ISP_FRAME_STITCH_MODE_IN_MASK (0x3)
3842
3843 // args: data (2-bit)
acamera_isp_frame_stitch_mode_in_write(uintptr_t base,uint8_t data)3844 static __inline void acamera_isp_frame_stitch_mode_in_write(uintptr_t base, uint8_t data) {
3845 uint32_t curr = system_sw_read_32(base + 0x18fe4L);
3846 system_sw_write_32(base + 0x18fe4L, (((uint32_t) (data & 0x3)) << 0) | (curr & 0xfffffffc));
3847 }
acamera_isp_frame_stitch_mode_in_read(uintptr_t base)3848 static __inline uint8_t acamera_isp_frame_stitch_mode_in_read(uintptr_t base) {
3849 return (uint8_t)((system_sw_read_32(base + 0x18fe4L) & 0x3) >> 0);
3850 }
3851 // ------------------------------------------------------------------------------ //
3852 // Register: output_select
3853 // ------------------------------------------------------------------------------ //
3854
3855 // ------------------------------------------------------------------------------ //
3856 //
3857 // This register is only for debug purpose. for normal operation it must be kept in its default value (0)
3858 // 0 : normal stitched output
3859 // 1 : long data routed out
3860 // 2 : medium data routed out
3861 // 4 : short data routed out
3862 // 8 : very short data routed out
3863 // 16: LM stitched output taken out
3864 // 32: MS stitched output taken out
3865 // 64: SVS stitched output taken out
3866 // others: reserved
3867 //
3868 // ------------------------------------------------------------------------------ //
3869
3870 #define ACAMERA_ISP_FRAME_STITCH_OUTPUT_SELECT_DEFAULT (0)
3871 #define ACAMERA_ISP_FRAME_STITCH_OUTPUT_SELECT_DATASIZE (8)
3872 #define ACAMERA_ISP_FRAME_STITCH_OUTPUT_SELECT_OFFSET (0x15c)
3873 #define ACAMERA_ISP_FRAME_STITCH_OUTPUT_SELECT_MASK (0xff00)
3874
3875 // args: data (8-bit)
acamera_isp_frame_stitch_output_select_write(uintptr_t base,uint8_t data)3876 static __inline void acamera_isp_frame_stitch_output_select_write(uintptr_t base, uint8_t data) {
3877 uint32_t curr = system_sw_read_32(base + 0x18fe4L);
3878 system_sw_write_32(base + 0x18fe4L, (((uint32_t) (data & 0xff)) << 8) | (curr & 0xffff00ff));
3879 }
acamera_isp_frame_stitch_output_select_read(uintptr_t base)3880 static __inline uint8_t acamera_isp_frame_stitch_output_select_read(uintptr_t base) {
3881 return (uint8_t)((system_sw_read_32(base + 0x18fe4L) & 0xff00) >> 8);
3882 }
3883 // ------------------------------------------------------------------------------ //
3884 // Register: LM_Exposure_Ratio
3885 // ------------------------------------------------------------------------------ //
3886
3887 // ------------------------------------------------------------------------------ //
3888 // Sets ratio between long and medium exposures - this must match the actual exposure ratio on the sensor
3889 // ------------------------------------------------------------------------------ //
3890
3891 #define ACAMERA_ISP_FRAME_STITCH_LM_EXPOSURE_RATIO_DEFAULT (0x100)
3892 #define ACAMERA_ISP_FRAME_STITCH_LM_EXPOSURE_RATIO_DATASIZE (12)
3893 #define ACAMERA_ISP_FRAME_STITCH_LM_EXPOSURE_RATIO_OFFSET (0x160)
3894 #define ACAMERA_ISP_FRAME_STITCH_LM_EXPOSURE_RATIO_MASK (0xfff)
3895
3896 // args: data (12-bit)
acamera_isp_frame_stitch_lm_exposure_ratio_write(uintptr_t base,uint16_t data)3897 static __inline void acamera_isp_frame_stitch_lm_exposure_ratio_write(uintptr_t base, uint16_t data) {
3898 uint32_t curr = system_sw_read_32(base + 0x18fe8L);
3899 system_sw_write_32(base + 0x18fe8L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3900 }
acamera_isp_frame_stitch_lm_exposure_ratio_read(uintptr_t base)3901 static __inline uint16_t acamera_isp_frame_stitch_lm_exposure_ratio_read(uintptr_t base) {
3902 return (uint16_t)((system_sw_read_32(base + 0x18fe8L) & 0xfff) >> 0);
3903 }
3904 // ------------------------------------------------------------------------------ //
3905 // Register: MS_Exposure_Ratio
3906 // ------------------------------------------------------------------------------ //
3907
3908 // ------------------------------------------------------------------------------ //
3909 // Sets ratio between medium and short exposures - this must match the actual exposure ratio on the sensor
3910 // ------------------------------------------------------------------------------ //
3911
3912 #define ACAMERA_ISP_FRAME_STITCH_MS_EXPOSURE_RATIO_DEFAULT (0x100)
3913 #define ACAMERA_ISP_FRAME_STITCH_MS_EXPOSURE_RATIO_DATASIZE (12)
3914 #define ACAMERA_ISP_FRAME_STITCH_MS_EXPOSURE_RATIO_OFFSET (0x160)
3915 #define ACAMERA_ISP_FRAME_STITCH_MS_EXPOSURE_RATIO_MASK (0xfff0000)
3916
3917 // args: data (12-bit)
acamera_isp_frame_stitch_ms_exposure_ratio_write(uintptr_t base,uint16_t data)3918 static __inline void acamera_isp_frame_stitch_ms_exposure_ratio_write(uintptr_t base, uint16_t data) {
3919 uint32_t curr = system_sw_read_32(base + 0x18fe8L);
3920 system_sw_write_32(base + 0x18fe8L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3921 }
acamera_isp_frame_stitch_ms_exposure_ratio_read(uintptr_t base)3922 static __inline uint16_t acamera_isp_frame_stitch_ms_exposure_ratio_read(uintptr_t base) {
3923 return (uint16_t)((system_sw_read_32(base + 0x18fe8L) & 0xfff0000) >> 16);
3924 }
3925 // ------------------------------------------------------------------------------ //
3926 // Register: SVS_Exposure_Ratio
3927 // ------------------------------------------------------------------------------ //
3928
3929 // ------------------------------------------------------------------------------ //
3930 // Sets ratio between short and very short exposures - this must match the actual exposure ratio on the sensor
3931 // ------------------------------------------------------------------------------ //
3932
3933 #define ACAMERA_ISP_FRAME_STITCH_SVS_EXPOSURE_RATIO_DEFAULT (0x100)
3934 #define ACAMERA_ISP_FRAME_STITCH_SVS_EXPOSURE_RATIO_DATASIZE (12)
3935 #define ACAMERA_ISP_FRAME_STITCH_SVS_EXPOSURE_RATIO_OFFSET (0x164)
3936 #define ACAMERA_ISP_FRAME_STITCH_SVS_EXPOSURE_RATIO_MASK (0xfff)
3937
3938 // args: data (12-bit)
acamera_isp_frame_stitch_svs_exposure_ratio_write(uintptr_t base,uint16_t data)3939 static __inline void acamera_isp_frame_stitch_svs_exposure_ratio_write(uintptr_t base, uint16_t data) {
3940 uint32_t curr = system_sw_read_32(base + 0x18fecL);
3941 system_sw_write_32(base + 0x18fecL, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3942 }
acamera_isp_frame_stitch_svs_exposure_ratio_read(uintptr_t base)3943 static __inline uint16_t acamera_isp_frame_stitch_svs_exposure_ratio_read(uintptr_t base) {
3944 return (uint16_t)((system_sw_read_32(base + 0x18fecL) & 0xfff) >> 0);
3945 }
3946 // ------------------------------------------------------------------------------ //
3947 // Register: LM_Thresh_high
3948 // ------------------------------------------------------------------------------ //
3949
3950 // ------------------------------------------------------------------------------ //
3951 //
3952 // These two thresholds are for LM pairs. Both are with respect to the longer stitches.
3953 // Data above this threshold will be taken from short exposure only
3954 // ------------------------------------------------------------------------------ //
3955
3956 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_HIGH_DEFAULT (0x0F00)
3957 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_HIGH_DATASIZE (12)
3958 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_HIGH_OFFSET (0x168)
3959 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_HIGH_MASK (0xfff)
3960
3961 // args: data (12-bit)
acamera_isp_frame_stitch_lm_thresh_high_write(uintptr_t base,uint16_t data)3962 static __inline void acamera_isp_frame_stitch_lm_thresh_high_write(uintptr_t base, uint16_t data) {
3963 uint32_t curr = system_sw_read_32(base + 0x18ff0L);
3964 system_sw_write_32(base + 0x18ff0L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
3965 }
acamera_isp_frame_stitch_lm_thresh_high_read(uintptr_t base)3966 static __inline uint16_t acamera_isp_frame_stitch_lm_thresh_high_read(uintptr_t base) {
3967 return (uint16_t)((system_sw_read_32(base + 0x18ff0L) & 0xfff) >> 0);
3968 }
3969 // ------------------------------------------------------------------------------ //
3970 // Register: LM_Thresh_low
3971 // ------------------------------------------------------------------------------ //
3972
3973 // ------------------------------------------------------------------------------ //
3974 //
3975 // Data below this threshold will be taken from long exposure only
3976 //
3977 // ------------------------------------------------------------------------------ //
3978
3979 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_LOW_DEFAULT (0x0C00)
3980 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_LOW_DATASIZE (12)
3981 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_LOW_OFFSET (0x168)
3982 #define ACAMERA_ISP_FRAME_STITCH_LM_THRESH_LOW_MASK (0xfff0000)
3983
3984 // args: data (12-bit)
acamera_isp_frame_stitch_lm_thresh_low_write(uintptr_t base,uint16_t data)3985 static __inline void acamera_isp_frame_stitch_lm_thresh_low_write(uintptr_t base, uint16_t data) {
3986 uint32_t curr = system_sw_read_32(base + 0x18ff0L);
3987 system_sw_write_32(base + 0x18ff0L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
3988 }
acamera_isp_frame_stitch_lm_thresh_low_read(uintptr_t base)3989 static __inline uint16_t acamera_isp_frame_stitch_lm_thresh_low_read(uintptr_t base) {
3990 return (uint16_t)((system_sw_read_32(base + 0x18ff0L) & 0xfff0000) >> 16);
3991 }
3992 // ------------------------------------------------------------------------------ //
3993 // Register: MS_Thresh_high
3994 // ------------------------------------------------------------------------------ //
3995
3996 // ------------------------------------------------------------------------------ //
3997 //
3998 // These two thresholds are for MS pairs. Both are with respect to the longer stitches.
3999 // Data above this threshold will be taken from short exposure only
4000 //
4001 // ------------------------------------------------------------------------------ //
4002
4003 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_HIGH_DEFAULT (0x0F00)
4004 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_HIGH_DATASIZE (12)
4005 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_HIGH_OFFSET (0x16c)
4006 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_HIGH_MASK (0xfff)
4007
4008 // args: data (12-bit)
acamera_isp_frame_stitch_ms_thresh_high_write(uintptr_t base,uint16_t data)4009 static __inline void acamera_isp_frame_stitch_ms_thresh_high_write(uintptr_t base, uint16_t data) {
4010 uint32_t curr = system_sw_read_32(base + 0x18ff4L);
4011 system_sw_write_32(base + 0x18ff4L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4012 }
acamera_isp_frame_stitch_ms_thresh_high_read(uintptr_t base)4013 static __inline uint16_t acamera_isp_frame_stitch_ms_thresh_high_read(uintptr_t base) {
4014 return (uint16_t)((system_sw_read_32(base + 0x18ff4L) & 0xfff) >> 0);
4015 }
4016 // ------------------------------------------------------------------------------ //
4017 // Register: MS_Thresh_low
4018 // ------------------------------------------------------------------------------ //
4019
4020 // ------------------------------------------------------------------------------ //
4021 //
4022 // Data below this threshold will be taken from long exposure only
4023 //
4024 // ------------------------------------------------------------------------------ //
4025
4026 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_LOW_DEFAULT (0x0C00)
4027 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_LOW_DATASIZE (12)
4028 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_LOW_OFFSET (0x16c)
4029 #define ACAMERA_ISP_FRAME_STITCH_MS_THRESH_LOW_MASK (0xfff0000)
4030
4031 // args: data (12-bit)
acamera_isp_frame_stitch_ms_thresh_low_write(uintptr_t base,uint16_t data)4032 static __inline void acamera_isp_frame_stitch_ms_thresh_low_write(uintptr_t base, uint16_t data) {
4033 uint32_t curr = system_sw_read_32(base + 0x18ff4L);
4034 system_sw_write_32(base + 0x18ff4L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4035 }
acamera_isp_frame_stitch_ms_thresh_low_read(uintptr_t base)4036 static __inline uint16_t acamera_isp_frame_stitch_ms_thresh_low_read(uintptr_t base) {
4037 return (uint16_t)((system_sw_read_32(base + 0x18ff4L) & 0xfff0000) >> 16);
4038 }
4039 // ------------------------------------------------------------------------------ //
4040 // Register: SVS_Thresh_high
4041 // ------------------------------------------------------------------------------ //
4042
4043 // ------------------------------------------------------------------------------ //
4044 //
4045 // These two thresholds are for SVS pairs. Both are with respect to the longer stitches.
4046 // Data above this threshold will be taken from short exposure only
4047 //
4048 // ------------------------------------------------------------------------------ //
4049
4050 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_HIGH_DEFAULT (0x0F00)
4051 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_HIGH_DATASIZE (12)
4052 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_HIGH_OFFSET (0x170)
4053 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_HIGH_MASK (0xfff)
4054
4055 // args: data (12-bit)
acamera_isp_frame_stitch_svs_thresh_high_write(uintptr_t base,uint16_t data)4056 static __inline void acamera_isp_frame_stitch_svs_thresh_high_write(uintptr_t base, uint16_t data) {
4057 uint32_t curr = system_sw_read_32(base + 0x18ff8L);
4058 system_sw_write_32(base + 0x18ff8L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4059 }
acamera_isp_frame_stitch_svs_thresh_high_read(uintptr_t base)4060 static __inline uint16_t acamera_isp_frame_stitch_svs_thresh_high_read(uintptr_t base) {
4061 return (uint16_t)((system_sw_read_32(base + 0x18ff8L) & 0xfff) >> 0);
4062 }
4063 // ------------------------------------------------------------------------------ //
4064 // Register: SVS_Thresh_low
4065 // ------------------------------------------------------------------------------ //
4066
4067 // ------------------------------------------------------------------------------ //
4068 //
4069 // Data below this threshold will be taken from long exposure only
4070 //
4071 // ------------------------------------------------------------------------------ //
4072
4073 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_LOW_DEFAULT (0x0C00)
4074 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_LOW_DATASIZE (12)
4075 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_LOW_OFFSET (0x170)
4076 #define ACAMERA_ISP_FRAME_STITCH_SVS_THRESH_LOW_MASK (0xfff0000)
4077
4078 // args: data (12-bit)
acamera_isp_frame_stitch_svs_thresh_low_write(uintptr_t base,uint16_t data)4079 static __inline void acamera_isp_frame_stitch_svs_thresh_low_write(uintptr_t base, uint16_t data) {
4080 uint32_t curr = system_sw_read_32(base + 0x18ff8L);
4081 system_sw_write_32(base + 0x18ff8L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4082 }
acamera_isp_frame_stitch_svs_thresh_low_read(uintptr_t base)4083 static __inline uint16_t acamera_isp_frame_stitch_svs_thresh_low_read(uintptr_t base) {
4084 return (uint16_t)((system_sw_read_32(base + 0x18ff8L) & 0xfff0000) >> 16);
4085 }
4086 // ------------------------------------------------------------------------------ //
4087 // Register: Black_level_long
4088 // ------------------------------------------------------------------------------ //
4089
4090 // ------------------------------------------------------------------------------ //
4091 //
4092 // Black level for long exposure input
4093 //
4094 // ------------------------------------------------------------------------------ //
4095
4096 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_LONG_DEFAULT (0x000)
4097 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_LONG_DATASIZE (12)
4098 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_LONG_OFFSET (0x174)
4099 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_LONG_MASK (0xfff)
4100
4101 // args: data (12-bit)
acamera_isp_frame_stitch_black_level_long_write(uintptr_t base,uint16_t data)4102 static __inline void acamera_isp_frame_stitch_black_level_long_write(uintptr_t base, uint16_t data) {
4103 uint32_t curr = system_sw_read_32(base + 0x18ffcL);
4104 system_sw_write_32(base + 0x18ffcL, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4105 }
acamera_isp_frame_stitch_black_level_long_read(uintptr_t base)4106 static __inline uint16_t acamera_isp_frame_stitch_black_level_long_read(uintptr_t base) {
4107 return (uint16_t)((system_sw_read_32(base + 0x18ffcL) & 0xfff) >> 0);
4108 }
4109 // ------------------------------------------------------------------------------ //
4110 // Register: Black_level_Medium
4111 // ------------------------------------------------------------------------------ //
4112
4113 // ------------------------------------------------------------------------------ //
4114 //
4115 // Black level for medium exposure input
4116 // *** NOTE ***:
4117 // If the wdr unit is configured to use as 2-exposure, THIS REGISTER POSITION must contain the black level of
4118 // short exposure as the LM pair is used for all other configurations
4119 //
4120 // ------------------------------------------------------------------------------ //
4121
4122 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_MEDIUM_DEFAULT (0x00)
4123 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_MEDIUM_DATASIZE (12)
4124 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_MEDIUM_OFFSET (0x174)
4125 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_MEDIUM_MASK (0xfff0000)
4126
4127 // args: data (12-bit)
acamera_isp_frame_stitch_black_level_medium_write(uintptr_t base,uint16_t data)4128 static __inline void acamera_isp_frame_stitch_black_level_medium_write(uintptr_t base, uint16_t data) {
4129 uint32_t curr = system_sw_read_32(base + 0x18ffcL);
4130 system_sw_write_32(base + 0x18ffcL, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4131 }
acamera_isp_frame_stitch_black_level_medium_read(uintptr_t base)4132 static __inline uint16_t acamera_isp_frame_stitch_black_level_medium_read(uintptr_t base) {
4133 return (uint16_t)((system_sw_read_32(base + 0x18ffcL) & 0xfff0000) >> 16);
4134 }
4135 // ------------------------------------------------------------------------------ //
4136 // Register: Black_level_Short
4137 // ------------------------------------------------------------------------------ //
4138
4139 // ------------------------------------------------------------------------------ //
4140 //
4141 // Black level for short exposure input
4142 //
4143 // ------------------------------------------------------------------------------ //
4144
4145 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_SHORT_DEFAULT (0x00)
4146 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_SHORT_DATASIZE (12)
4147 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_SHORT_OFFSET (0x178)
4148 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_SHORT_MASK (0xfff)
4149
4150 // args: data (12-bit)
acamera_isp_frame_stitch_black_level_short_write(uintptr_t base,uint16_t data)4151 static __inline void acamera_isp_frame_stitch_black_level_short_write(uintptr_t base, uint16_t data) {
4152 uint32_t curr = system_sw_read_32(base + 0x19000L);
4153 system_sw_write_32(base + 0x19000L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4154 }
acamera_isp_frame_stitch_black_level_short_read(uintptr_t base)4155 static __inline uint16_t acamera_isp_frame_stitch_black_level_short_read(uintptr_t base) {
4156 return (uint16_t)((system_sw_read_32(base + 0x19000L) & 0xfff) >> 0);
4157 }
4158 // ------------------------------------------------------------------------------ //
4159 // Register: Black_level_very_Short
4160 // ------------------------------------------------------------------------------ //
4161
4162 // ------------------------------------------------------------------------------ //
4163 //
4164 // Black level for very short exposure input
4165 //
4166 // ------------------------------------------------------------------------------ //
4167
4168 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_VERY_SHORT_DEFAULT (0x00)
4169 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_VERY_SHORT_DATASIZE (12)
4170 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_VERY_SHORT_OFFSET (0x178)
4171 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_VERY_SHORT_MASK (0xfff0000)
4172
4173 // args: data (12-bit)
acamera_isp_frame_stitch_black_level_very_short_write(uintptr_t base,uint16_t data)4174 static __inline void acamera_isp_frame_stitch_black_level_very_short_write(uintptr_t base, uint16_t data) {
4175 uint32_t curr = system_sw_read_32(base + 0x19000L);
4176 system_sw_write_32(base + 0x19000L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4177 }
acamera_isp_frame_stitch_black_level_very_short_read(uintptr_t base)4178 static __inline uint16_t acamera_isp_frame_stitch_black_level_very_short_read(uintptr_t base) {
4179 return (uint16_t)((system_sw_read_32(base + 0x19000L) & 0xfff0000) >> 16);
4180 }
4181 // ------------------------------------------------------------------------------ //
4182 // Register: Black_level_Out
4183 // ------------------------------------------------------------------------------ //
4184
4185 // ------------------------------------------------------------------------------ //
4186 //
4187 // Black level for module output
4188 //
4189 // ------------------------------------------------------------------------------ //
4190
4191 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_OUT_DEFAULT (0x000)
4192 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_OUT_DATASIZE (20)
4193 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_OUT_OFFSET (0x17c)
4194 #define ACAMERA_ISP_FRAME_STITCH_BLACK_LEVEL_OUT_MASK (0xfffff)
4195
4196 // args: data (20-bit)
acamera_isp_frame_stitch_black_level_out_write(uintptr_t base,uint32_t data)4197 static __inline void acamera_isp_frame_stitch_black_level_out_write(uintptr_t base, uint32_t data) {
4198 uint32_t curr = system_sw_read_32(base + 0x19004L);
4199 system_sw_write_32(base + 0x19004L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
4200 }
acamera_isp_frame_stitch_black_level_out_read(uintptr_t base)4201 static __inline uint32_t acamera_isp_frame_stitch_black_level_out_read(uintptr_t base) {
4202 return (uint32_t)((system_sw_read_32(base + 0x19004L) & 0xfffff) >> 0);
4203 }
4204 // ------------------------------------------------------------------------------ //
4205 // Register: LM_NP_mult
4206 // ------------------------------------------------------------------------------ //
4207
4208 // ------------------------------------------------------------------------------ //
4209 //
4210 // The noise profile weights are multiplied by this value to give expected noise amplitude.
4211 //
4212 // ------------------------------------------------------------------------------ //
4213
4214 #define ACAMERA_ISP_FRAME_STITCH_LM_NP_MULT_DEFAULT (0x180)
4215 #define ACAMERA_ISP_FRAME_STITCH_LM_NP_MULT_DATASIZE (12)
4216 #define ACAMERA_ISP_FRAME_STITCH_LM_NP_MULT_OFFSET (0x180)
4217 #define ACAMERA_ISP_FRAME_STITCH_LM_NP_MULT_MASK (0xfff)
4218
4219 // args: data (12-bit)
acamera_isp_frame_stitch_lm_np_mult_write(uintptr_t base,uint16_t data)4220 static __inline void acamera_isp_frame_stitch_lm_np_mult_write(uintptr_t base, uint16_t data) {
4221 uint32_t curr = system_sw_read_32(base + 0x19008L);
4222 system_sw_write_32(base + 0x19008L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4223 }
acamera_isp_frame_stitch_lm_np_mult_read(uintptr_t base)4224 static __inline uint16_t acamera_isp_frame_stitch_lm_np_mult_read(uintptr_t base) {
4225 return (uint16_t)((system_sw_read_32(base + 0x19008L) & 0xfff) >> 0);
4226 }
4227 // ------------------------------------------------------------------------------ //
4228 // Register: MS_NP_mult
4229 // ------------------------------------------------------------------------------ //
4230
4231 // ------------------------------------------------------------------------------ //
4232 //
4233 // The noise profile weights are multiplied by this value to give expected noise amplitude.
4234 //
4235 // ------------------------------------------------------------------------------ //
4236
4237 #define ACAMERA_ISP_FRAME_STITCH_MS_NP_MULT_DEFAULT (0x600)
4238 #define ACAMERA_ISP_FRAME_STITCH_MS_NP_MULT_DATASIZE (12)
4239 #define ACAMERA_ISP_FRAME_STITCH_MS_NP_MULT_OFFSET (0x180)
4240 #define ACAMERA_ISP_FRAME_STITCH_MS_NP_MULT_MASK (0xfff0000)
4241
4242 // args: data (12-bit)
acamera_isp_frame_stitch_ms_np_mult_write(uintptr_t base,uint16_t data)4243 static __inline void acamera_isp_frame_stitch_ms_np_mult_write(uintptr_t base, uint16_t data) {
4244 uint32_t curr = system_sw_read_32(base + 0x19008L);
4245 system_sw_write_32(base + 0x19008L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4246 }
acamera_isp_frame_stitch_ms_np_mult_read(uintptr_t base)4247 static __inline uint16_t acamera_isp_frame_stitch_ms_np_mult_read(uintptr_t base) {
4248 return (uint16_t)((system_sw_read_32(base + 0x19008L) & 0xfff0000) >> 16);
4249 }
4250 // ------------------------------------------------------------------------------ //
4251 // Register: SVS_NP_mult
4252 // ------------------------------------------------------------------------------ //
4253
4254 // ------------------------------------------------------------------------------ //
4255 //
4256 // The noise profile weights are multiplied by this value to give expected noise amplitude.
4257 //
4258 // ------------------------------------------------------------------------------ //
4259
4260 #define ACAMERA_ISP_FRAME_STITCH_SVS_NP_MULT_DEFAULT (0x600)
4261 #define ACAMERA_ISP_FRAME_STITCH_SVS_NP_MULT_DATASIZE (12)
4262 #define ACAMERA_ISP_FRAME_STITCH_SVS_NP_MULT_OFFSET (0x184)
4263 #define ACAMERA_ISP_FRAME_STITCH_SVS_NP_MULT_MASK (0xfff)
4264
4265 // args: data (12-bit)
acamera_isp_frame_stitch_svs_np_mult_write(uintptr_t base,uint16_t data)4266 static __inline void acamera_isp_frame_stitch_svs_np_mult_write(uintptr_t base, uint16_t data) {
4267 uint32_t curr = system_sw_read_32(base + 0x1900cL);
4268 system_sw_write_32(base + 0x1900cL, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4269 }
acamera_isp_frame_stitch_svs_np_mult_read(uintptr_t base)4270 static __inline uint16_t acamera_isp_frame_stitch_svs_np_mult_read(uintptr_t base) {
4271 return (uint16_t)((system_sw_read_32(base + 0x1900cL) & 0xfff) >> 0);
4272 }
4273 // ------------------------------------------------------------------------------ //
4274 // Register: LM_Alpha_MOV_slope
4275 // ------------------------------------------------------------------------------ //
4276
4277 // ------------------------------------------------------------------------------ //
4278 //
4279 // This defines the gradient of the motion alpha ramp. Higher values mean a steeper ramp and so a more rapid transition between
4280 // non-motion-corrected and motion-corrected regions.
4281 //
4282 // ------------------------------------------------------------------------------ //
4283
4284 #define ACAMERA_ISP_FRAME_STITCH_LM_ALPHA_MOV_SLOPE_DEFAULT (0xC00)
4285 #define ACAMERA_ISP_FRAME_STITCH_LM_ALPHA_MOV_SLOPE_DATASIZE (12)
4286 #define ACAMERA_ISP_FRAME_STITCH_LM_ALPHA_MOV_SLOPE_OFFSET (0x184)
4287 #define ACAMERA_ISP_FRAME_STITCH_LM_ALPHA_MOV_SLOPE_MASK (0xfff0000)
4288
4289 // args: data (12-bit)
acamera_isp_frame_stitch_lm_alpha_mov_slope_write(uintptr_t base,uint16_t data)4290 static __inline void acamera_isp_frame_stitch_lm_alpha_mov_slope_write(uintptr_t base, uint16_t data) {
4291 uint32_t curr = system_sw_read_32(base + 0x1900cL);
4292 system_sw_write_32(base + 0x1900cL, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4293 }
acamera_isp_frame_stitch_lm_alpha_mov_slope_read(uintptr_t base)4294 static __inline uint16_t acamera_isp_frame_stitch_lm_alpha_mov_slope_read(uintptr_t base) {
4295 return (uint16_t)((system_sw_read_32(base + 0x1900cL) & 0xfff0000) >> 16);
4296 }
4297 // ------------------------------------------------------------------------------ //
4298 // Register: MS_Alpha_MOV_slope
4299 // ------------------------------------------------------------------------------ //
4300
4301 // ------------------------------------------------------------------------------ //
4302 //
4303 // his defines the gradient of the motion alpha ramp. Higher values mean a steeper ramp and so a more rapid transition between
4304 // non-motion-corrected and motion-corrected regions.
4305 //
4306 // ------------------------------------------------------------------------------ //
4307
4308 #define ACAMERA_ISP_FRAME_STITCH_MS_ALPHA_MOV_SLOPE_DEFAULT (0x180)
4309 #define ACAMERA_ISP_FRAME_STITCH_MS_ALPHA_MOV_SLOPE_DATASIZE (12)
4310 #define ACAMERA_ISP_FRAME_STITCH_MS_ALPHA_MOV_SLOPE_OFFSET (0x188)
4311 #define ACAMERA_ISP_FRAME_STITCH_MS_ALPHA_MOV_SLOPE_MASK (0xfff)
4312
4313 // args: data (12-bit)
acamera_isp_frame_stitch_ms_alpha_mov_slope_write(uintptr_t base,uint16_t data)4314 static __inline void acamera_isp_frame_stitch_ms_alpha_mov_slope_write(uintptr_t base, uint16_t data) {
4315 uint32_t curr = system_sw_read_32(base + 0x19010L);
4316 system_sw_write_32(base + 0x19010L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4317 }
acamera_isp_frame_stitch_ms_alpha_mov_slope_read(uintptr_t base)4318 static __inline uint16_t acamera_isp_frame_stitch_ms_alpha_mov_slope_read(uintptr_t base) {
4319 return (uint16_t)((system_sw_read_32(base + 0x19010L) & 0xfff) >> 0);
4320 }
4321 // ------------------------------------------------------------------------------ //
4322 // Register: SVS_Alpha_MOV_slope
4323 // ------------------------------------------------------------------------------ //
4324
4325 // ------------------------------------------------------------------------------ //
4326 //
4327 // his defines the gradient of the motion alpha ramp. Higher values mean a steeper ramp and so a more rapid transition between
4328 // non-motion-corrected and motion-corrected regions.
4329 //
4330 // ------------------------------------------------------------------------------ //
4331
4332 #define ACAMERA_ISP_FRAME_STITCH_SVS_ALPHA_MOV_SLOPE_DEFAULT (0x180)
4333 #define ACAMERA_ISP_FRAME_STITCH_SVS_ALPHA_MOV_SLOPE_DATASIZE (12)
4334 #define ACAMERA_ISP_FRAME_STITCH_SVS_ALPHA_MOV_SLOPE_OFFSET (0x188)
4335 #define ACAMERA_ISP_FRAME_STITCH_SVS_ALPHA_MOV_SLOPE_MASK (0xfff0000)
4336
4337 // args: data (12-bit)
acamera_isp_frame_stitch_svs_alpha_mov_slope_write(uintptr_t base,uint16_t data)4338 static __inline void acamera_isp_frame_stitch_svs_alpha_mov_slope_write(uintptr_t base, uint16_t data) {
4339 uint32_t curr = system_sw_read_32(base + 0x19010L);
4340 system_sw_write_32(base + 0x19010L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4341 }
acamera_isp_frame_stitch_svs_alpha_mov_slope_read(uintptr_t base)4342 static __inline uint16_t acamera_isp_frame_stitch_svs_alpha_mov_slope_read(uintptr_t base) {
4343 return (uint16_t)((system_sw_read_32(base + 0x19010L) & 0xfff0000) >> 16);
4344 }
4345 // ------------------------------------------------------------------------------ //
4346 // Register: Gain_R
4347 // ------------------------------------------------------------------------------ //
4348
4349 // ------------------------------------------------------------------------------ //
4350 //
4351 // Multiplier for color channel R
4352 //
4353 // ------------------------------------------------------------------------------ //
4354
4355 #define ACAMERA_ISP_FRAME_STITCH_GAIN_R_DEFAULT (0x100)
4356 #define ACAMERA_ISP_FRAME_STITCH_GAIN_R_DATASIZE (12)
4357 #define ACAMERA_ISP_FRAME_STITCH_GAIN_R_OFFSET (0x18c)
4358 #define ACAMERA_ISP_FRAME_STITCH_GAIN_R_MASK (0xfff)
4359
4360 // args: data (12-bit)
acamera_isp_frame_stitch_gain_r_write(uintptr_t base,uint16_t data)4361 static __inline void acamera_isp_frame_stitch_gain_r_write(uintptr_t base, uint16_t data) {
4362 uint32_t curr = system_sw_read_32(base + 0x19014L);
4363 system_sw_write_32(base + 0x19014L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4364 }
acamera_isp_frame_stitch_gain_r_read(uintptr_t base)4365 static __inline uint16_t acamera_isp_frame_stitch_gain_r_read(uintptr_t base) {
4366 return (uint16_t)((system_sw_read_32(base + 0x19014L) & 0xfff) >> 0);
4367 }
4368 // ------------------------------------------------------------------------------ //
4369 // Register: Gain_B
4370 // ------------------------------------------------------------------------------ //
4371
4372 // ------------------------------------------------------------------------------ //
4373 //
4374 // Multiplier for color channel B
4375 //
4376 // ------------------------------------------------------------------------------ //
4377
4378 #define ACAMERA_ISP_FRAME_STITCH_GAIN_B_DEFAULT (0x100)
4379 #define ACAMERA_ISP_FRAME_STITCH_GAIN_B_DATASIZE (12)
4380 #define ACAMERA_ISP_FRAME_STITCH_GAIN_B_OFFSET (0x18c)
4381 #define ACAMERA_ISP_FRAME_STITCH_GAIN_B_MASK (0xfff0000)
4382
4383 // args: data (12-bit)
acamera_isp_frame_stitch_gain_b_write(uintptr_t base,uint16_t data)4384 static __inline void acamera_isp_frame_stitch_gain_b_write(uintptr_t base, uint16_t data) {
4385 uint32_t curr = system_sw_read_32(base + 0x19014L);
4386 system_sw_write_32(base + 0x19014L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4387 }
acamera_isp_frame_stitch_gain_b_read(uintptr_t base)4388 static __inline uint16_t acamera_isp_frame_stitch_gain_b_read(uintptr_t base) {
4389 return (uint16_t)((system_sw_read_32(base + 0x19014L) & 0xfff0000) >> 16);
4390 }
4391 // ------------------------------------------------------------------------------ //
4392 // Register: Consistency_thresh_mov
4393 // ------------------------------------------------------------------------------ //
4394
4395 // ------------------------------------------------------------------------------ //
4396 //
4397 // Pixel consistency reporting - motion threshold
4398 //
4399 // ------------------------------------------------------------------------------ //
4400
4401 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_MOV_DEFAULT (0x100)
4402 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_MOV_DATASIZE (12)
4403 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_MOV_OFFSET (0x190)
4404 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_MOV_MASK (0xfff)
4405
4406 // args: data (12-bit)
acamera_isp_frame_stitch_consistency_thresh_mov_write(uintptr_t base,uint16_t data)4407 static __inline void acamera_isp_frame_stitch_consistency_thresh_mov_write(uintptr_t base, uint16_t data) {
4408 uint32_t curr = system_sw_read_32(base + 0x19018L);
4409 system_sw_write_32(base + 0x19018L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4410 }
acamera_isp_frame_stitch_consistency_thresh_mov_read(uintptr_t base)4411 static __inline uint16_t acamera_isp_frame_stitch_consistency_thresh_mov_read(uintptr_t base) {
4412 return (uint16_t)((system_sw_read_32(base + 0x19018L) & 0xfff) >> 0);
4413 }
4414 // ------------------------------------------------------------------------------ //
4415 // Register: Consistency_thresh_lvl
4416 // ------------------------------------------------------------------------------ //
4417
4418 // ------------------------------------------------------------------------------ //
4419 //
4420 // Pixel consistency reporting - flicker threshold
4421 //
4422 // ------------------------------------------------------------------------------ //
4423
4424 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_LVL_DEFAULT (0x80000)
4425 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_LVL_DATASIZE (20)
4426 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_LVL_OFFSET (0x194)
4427 #define ACAMERA_ISP_FRAME_STITCH_CONSISTENCY_THRESH_LVL_MASK (0xfffff)
4428
4429 // args: data (20-bit)
acamera_isp_frame_stitch_consistency_thresh_lvl_write(uintptr_t base,uint32_t data)4430 static __inline void acamera_isp_frame_stitch_consistency_thresh_lvl_write(uintptr_t base, uint32_t data) {
4431 uint32_t curr = system_sw_read_32(base + 0x1901cL);
4432 system_sw_write_32(base + 0x1901cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
4433 }
acamera_isp_frame_stitch_consistency_thresh_lvl_read(uintptr_t base)4434 static __inline uint32_t acamera_isp_frame_stitch_consistency_thresh_lvl_read(uintptr_t base) {
4435 return (uint32_t)((system_sw_read_32(base + 0x1901cL) & 0xfffff) >> 0);
4436 }
4437 // ------------------------------------------------------------------------------ //
4438 // Register: lm_noise_thresh
4439 // ------------------------------------------------------------------------------ //
4440
4441 // ------------------------------------------------------------------------------ //
4442 //
4443 // Higher values make it more likely to interpret differences between the long and medium exposures as noise (and thus do no motion correction).
4444 //
4445 // ------------------------------------------------------------------------------ //
4446
4447 #define ACAMERA_ISP_FRAME_STITCH_LM_NOISE_THRESH_DEFAULT (0x0)
4448 #define ACAMERA_ISP_FRAME_STITCH_LM_NOISE_THRESH_DATASIZE (6)
4449 #define ACAMERA_ISP_FRAME_STITCH_LM_NOISE_THRESH_OFFSET (0x198)
4450 #define ACAMERA_ISP_FRAME_STITCH_LM_NOISE_THRESH_MASK (0x3f)
4451
4452 // args: data (6-bit)
acamera_isp_frame_stitch_lm_noise_thresh_write(uintptr_t base,uint8_t data)4453 static __inline void acamera_isp_frame_stitch_lm_noise_thresh_write(uintptr_t base, uint8_t data) {
4454 uint32_t curr = system_sw_read_32(base + 0x19020L);
4455 system_sw_write_32(base + 0x19020L, (((uint32_t) (data & 0x3f)) << 0) | (curr & 0xffffffc0));
4456 }
acamera_isp_frame_stitch_lm_noise_thresh_read(uintptr_t base)4457 static __inline uint8_t acamera_isp_frame_stitch_lm_noise_thresh_read(uintptr_t base) {
4458 return (uint8_t)((system_sw_read_32(base + 0x19020L) & 0x3f) >> 0);
4459 }
4460 // ------------------------------------------------------------------------------ //
4461 // Register: lm_pos_weight
4462 // ------------------------------------------------------------------------------ //
4463
4464 // ------------------------------------------------------------------------------ //
4465 //
4466 // Lower values make it more likely to interpret differences between the long and medium exposures as noise (and thus do no motion correction).
4467 //
4468 // ------------------------------------------------------------------------------ //
4469
4470 #define ACAMERA_ISP_FRAME_STITCH_LM_POS_WEIGHT_DEFAULT (0x0)
4471 #define ACAMERA_ISP_FRAME_STITCH_LM_POS_WEIGHT_DATASIZE (6)
4472 #define ACAMERA_ISP_FRAME_STITCH_LM_POS_WEIGHT_OFFSET (0x198)
4473 #define ACAMERA_ISP_FRAME_STITCH_LM_POS_WEIGHT_MASK (0x3f00)
4474
4475 // args: data (6-bit)
acamera_isp_frame_stitch_lm_pos_weight_write(uintptr_t base,uint8_t data)4476 static __inline void acamera_isp_frame_stitch_lm_pos_weight_write(uintptr_t base, uint8_t data) {
4477 uint32_t curr = system_sw_read_32(base + 0x19020L);
4478 system_sw_write_32(base + 0x19020L, (((uint32_t) (data & 0x3f)) << 8) | (curr & 0xffffc0ff));
4479 }
acamera_isp_frame_stitch_lm_pos_weight_read(uintptr_t base)4480 static __inline uint8_t acamera_isp_frame_stitch_lm_pos_weight_read(uintptr_t base) {
4481 return (uint8_t)((system_sw_read_32(base + 0x19020L) & 0x3f00) >> 8);
4482 }
4483 // ------------------------------------------------------------------------------ //
4484 // Register: lm_neg_weight
4485 // ------------------------------------------------------------------------------ //
4486
4487 // ------------------------------------------------------------------------------ //
4488 //
4489 // Higher values make it more likely to interpret differences between the long and medium exposures as noise (and thus do no motion correction).
4490 //
4491 // ------------------------------------------------------------------------------ //
4492
4493 #define ACAMERA_ISP_FRAME_STITCH_LM_NEG_WEIGHT_DEFAULT (0x0)
4494 #define ACAMERA_ISP_FRAME_STITCH_LM_NEG_WEIGHT_DATASIZE (6)
4495 #define ACAMERA_ISP_FRAME_STITCH_LM_NEG_WEIGHT_OFFSET (0x198)
4496 #define ACAMERA_ISP_FRAME_STITCH_LM_NEG_WEIGHT_MASK (0x3f0000)
4497
4498 // args: data (6-bit)
acamera_isp_frame_stitch_lm_neg_weight_write(uintptr_t base,uint8_t data)4499 static __inline void acamera_isp_frame_stitch_lm_neg_weight_write(uintptr_t base, uint8_t data) {
4500 uint32_t curr = system_sw_read_32(base + 0x19020L);
4501 system_sw_write_32(base + 0x19020L, (((uint32_t) (data & 0x3f)) << 16) | (curr & 0xffc0ffff));
4502 }
acamera_isp_frame_stitch_lm_neg_weight_read(uintptr_t base)4503 static __inline uint8_t acamera_isp_frame_stitch_lm_neg_weight_read(uintptr_t base) {
4504 return (uint8_t)((system_sw_read_32(base + 0x19020L) & 0x3f0000) >> 16);
4505 }
4506 // ------------------------------------------------------------------------------ //
4507 // Register: lm_med_noise_alpha_thresh
4508 // ------------------------------------------------------------------------------ //
4509
4510 // ------------------------------------------------------------------------------ //
4511 //
4512 //
4513 // ------------------------------------------------------------------------------ //
4514
4515 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_ALPHA_THRESH_DEFAULT (0x0)
4516 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_ALPHA_THRESH_DATASIZE (12)
4517 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_ALPHA_THRESH_OFFSET (0x19c)
4518 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_ALPHA_THRESH_MASK (0xfff)
4519
4520 // args: data (12-bit)
acamera_isp_frame_stitch_lm_med_noise_alpha_thresh_write(uintptr_t base,uint16_t data)4521 static __inline void acamera_isp_frame_stitch_lm_med_noise_alpha_thresh_write(uintptr_t base, uint16_t data) {
4522 uint32_t curr = system_sw_read_32(base + 0x19024L);
4523 system_sw_write_32(base + 0x19024L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4524 }
acamera_isp_frame_stitch_lm_med_noise_alpha_thresh_read(uintptr_t base)4525 static __inline uint16_t acamera_isp_frame_stitch_lm_med_noise_alpha_thresh_read(uintptr_t base) {
4526 return (uint16_t)((system_sw_read_32(base + 0x19024L) & 0xfff) >> 0);
4527 }
4528 // ------------------------------------------------------------------------------ //
4529 // Register: lm_med_noise_intensity_thresh
4530 // ------------------------------------------------------------------------------ //
4531
4532 // ------------------------------------------------------------------------------ //
4533 //
4534 //
4535 // ------------------------------------------------------------------------------ //
4536
4537 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_INTENSITY_THRESH_DEFAULT (0x0)
4538 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_INTENSITY_THRESH_DATASIZE (12)
4539 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_INTENSITY_THRESH_OFFSET (0x19c)
4540 #define ACAMERA_ISP_FRAME_STITCH_LM_MED_NOISE_INTENSITY_THRESH_MASK (0xfff0000)
4541
4542 // args: data (12-bit)
acamera_isp_frame_stitch_lm_med_noise_intensity_thresh_write(uintptr_t base,uint16_t data)4543 static __inline void acamera_isp_frame_stitch_lm_med_noise_intensity_thresh_write(uintptr_t base, uint16_t data) {
4544 uint32_t curr = system_sw_read_32(base + 0x19024L);
4545 system_sw_write_32(base + 0x19024L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4546 }
acamera_isp_frame_stitch_lm_med_noise_intensity_thresh_read(uintptr_t base)4547 static __inline uint16_t acamera_isp_frame_stitch_lm_med_noise_intensity_thresh_read(uintptr_t base) {
4548 return (uint16_t)((system_sw_read_32(base + 0x19024L) & 0xfff0000) >> 16);
4549 }
4550 // ------------------------------------------------------------------------------ //
4551 // Register: lm_mc_blend_slope
4552 // ------------------------------------------------------------------------------ //
4553
4554 // ------------------------------------------------------------------------------ //
4555 //
4556 //
4557 // ------------------------------------------------------------------------------ //
4558
4559 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_SLOPE_DEFAULT (0x0)
4560 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_SLOPE_DATASIZE (22)
4561 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_SLOPE_OFFSET (0x1a0)
4562 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_SLOPE_MASK (0x3fffff)
4563
4564 // args: data (22-bit)
acamera_isp_frame_stitch_lm_mc_blend_slope_write(uintptr_t base,uint32_t data)4565 static __inline void acamera_isp_frame_stitch_lm_mc_blend_slope_write(uintptr_t base, uint32_t data) {
4566 uint32_t curr = system_sw_read_32(base + 0x19028L);
4567 system_sw_write_32(base + 0x19028L, (((uint32_t) (data & 0x3fffff)) << 0) | (curr & 0xffc00000));
4568 }
acamera_isp_frame_stitch_lm_mc_blend_slope_read(uintptr_t base)4569 static __inline uint32_t acamera_isp_frame_stitch_lm_mc_blend_slope_read(uintptr_t base) {
4570 return (uint32_t)((system_sw_read_32(base + 0x19028L) & 0x3fffff) >> 0);
4571 }
4572 // ------------------------------------------------------------------------------ //
4573 // Register: lm_mc_blend_thresh
4574 // ------------------------------------------------------------------------------ //
4575
4576 // ------------------------------------------------------------------------------ //
4577 //
4578 //
4579 // ------------------------------------------------------------------------------ //
4580
4581 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_THRESH_DEFAULT (0x0)
4582 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_THRESH_DATASIZE (8)
4583 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_THRESH_OFFSET (0x1a4)
4584 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_THRESH_MASK (0xff)
4585
4586 // args: data (8-bit)
acamera_isp_frame_stitch_lm_mc_blend_thresh_write(uintptr_t base,uint8_t data)4587 static __inline void acamera_isp_frame_stitch_lm_mc_blend_thresh_write(uintptr_t base, uint8_t data) {
4588 uint32_t curr = system_sw_read_32(base + 0x1902cL);
4589 system_sw_write_32(base + 0x1902cL, (((uint32_t) (data & 0xff)) << 0) | (curr & 0xffffff00));
4590 }
acamera_isp_frame_stitch_lm_mc_blend_thresh_read(uintptr_t base)4591 static __inline uint8_t acamera_isp_frame_stitch_lm_mc_blend_thresh_read(uintptr_t base) {
4592 return (uint8_t)((system_sw_read_32(base + 0x1902cL) & 0xff) >> 0);
4593 }
4594 // ------------------------------------------------------------------------------ //
4595 // Register: lm_mc_blend_offset
4596 // ------------------------------------------------------------------------------ //
4597
4598 // ------------------------------------------------------------------------------ //
4599 //
4600 //
4601 // ------------------------------------------------------------------------------ //
4602
4603 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_OFFSET_DEFAULT (0x0)
4604 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_OFFSET_DATASIZE (12)
4605 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_OFFSET_OFFSET (0x1a4)
4606 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_BLEND_OFFSET_MASK (0xfff0000)
4607
4608 // args: data (12-bit)
acamera_isp_frame_stitch_lm_mc_blend_offset_write(uintptr_t base,uint16_t data)4609 static __inline void acamera_isp_frame_stitch_lm_mc_blend_offset_write(uintptr_t base, uint16_t data) {
4610 uint32_t curr = system_sw_read_32(base + 0x1902cL);
4611 system_sw_write_32(base + 0x1902cL, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4612 }
acamera_isp_frame_stitch_lm_mc_blend_offset_read(uintptr_t base)4613 static __inline uint16_t acamera_isp_frame_stitch_lm_mc_blend_offset_read(uintptr_t base) {
4614 return (uint16_t)((system_sw_read_32(base + 0x1902cL) & 0xfff0000) >> 16);
4615 }
4616 // ------------------------------------------------------------------------------ //
4617 // Register: lm_mc_thresh_slope
4618 // ------------------------------------------------------------------------------ //
4619
4620 // ------------------------------------------------------------------------------ //
4621 //
4622 //
4623 // ------------------------------------------------------------------------------ //
4624
4625 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_SLOPE_DEFAULT (0x0)
4626 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_SLOPE_DATASIZE (22)
4627 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_SLOPE_OFFSET (0x1a8)
4628 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_SLOPE_MASK (0x3fffff)
4629
4630 // args: data (22-bit)
acamera_isp_frame_stitch_lm_mc_thresh_slope_write(uintptr_t base,uint32_t data)4631 static __inline void acamera_isp_frame_stitch_lm_mc_thresh_slope_write(uintptr_t base, uint32_t data) {
4632 uint32_t curr = system_sw_read_32(base + 0x19030L);
4633 system_sw_write_32(base + 0x19030L, (((uint32_t) (data & 0x3fffff)) << 0) | (curr & 0xffc00000));
4634 }
acamera_isp_frame_stitch_lm_mc_thresh_slope_read(uintptr_t base)4635 static __inline uint32_t acamera_isp_frame_stitch_lm_mc_thresh_slope_read(uintptr_t base) {
4636 return (uint32_t)((system_sw_read_32(base + 0x19030L) & 0x3fffff) >> 0);
4637 }
4638 // ------------------------------------------------------------------------------ //
4639 // Register: lm_mc_thresh_thresh
4640 // ------------------------------------------------------------------------------ //
4641
4642 // ------------------------------------------------------------------------------ //
4643 //
4644 //
4645 // ------------------------------------------------------------------------------ //
4646
4647 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_THRESH_DEFAULT (0x0)
4648 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_THRESH_DATASIZE (20)
4649 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_THRESH_OFFSET (0x1ac)
4650 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_THRESH_MASK (0xfffff)
4651
4652 // args: data (20-bit)
acamera_isp_frame_stitch_lm_mc_thresh_thresh_write(uintptr_t base,uint32_t data)4653 static __inline void acamera_isp_frame_stitch_lm_mc_thresh_thresh_write(uintptr_t base, uint32_t data) {
4654 uint32_t curr = system_sw_read_32(base + 0x19034L);
4655 system_sw_write_32(base + 0x19034L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
4656 }
acamera_isp_frame_stitch_lm_mc_thresh_thresh_read(uintptr_t base)4657 static __inline uint32_t acamera_isp_frame_stitch_lm_mc_thresh_thresh_read(uintptr_t base) {
4658 return (uint32_t)((system_sw_read_32(base + 0x19034L) & 0xfffff) >> 0);
4659 }
4660 // ------------------------------------------------------------------------------ //
4661 // Register: lm_mc_thresh_offset
4662 // ------------------------------------------------------------------------------ //
4663
4664 // ------------------------------------------------------------------------------ //
4665 //
4666 //
4667 // ------------------------------------------------------------------------------ //
4668
4669 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_OFFSET_DEFAULT (0x0)
4670 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_OFFSET_DATASIZE (12)
4671 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_OFFSET_OFFSET (0x1b0)
4672 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_THRESH_OFFSET_MASK (0xfff)
4673
4674 // args: data (12-bit)
acamera_isp_frame_stitch_lm_mc_thresh_offset_write(uintptr_t base,uint16_t data)4675 static __inline void acamera_isp_frame_stitch_lm_mc_thresh_offset_write(uintptr_t base, uint16_t data) {
4676 uint32_t curr = system_sw_read_32(base + 0x19038L);
4677 system_sw_write_32(base + 0x19038L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4678 }
acamera_isp_frame_stitch_lm_mc_thresh_offset_read(uintptr_t base)4679 static __inline uint16_t acamera_isp_frame_stitch_lm_mc_thresh_offset_read(uintptr_t base) {
4680 return (uint16_t)((system_sw_read_32(base + 0x19038L) & 0xfff) >> 0);
4681 }
4682 // ------------------------------------------------------------------------------ //
4683 // Register: lm_mc_mag_thresh_slope
4684 // ------------------------------------------------------------------------------ //
4685
4686 // ------------------------------------------------------------------------------ //
4687 //
4688 //
4689 // ------------------------------------------------------------------------------ //
4690
4691 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_SLOPE_DEFAULT (0x0)
4692 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_SLOPE_DATASIZE (22)
4693 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_SLOPE_OFFSET (0x1b4)
4694 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_SLOPE_MASK (0x3fffff)
4695
4696 // args: data (22-bit)
acamera_isp_frame_stitch_lm_mc_mag_thresh_slope_write(uintptr_t base,uint32_t data)4697 static __inline void acamera_isp_frame_stitch_lm_mc_mag_thresh_slope_write(uintptr_t base, uint32_t data) {
4698 uint32_t curr = system_sw_read_32(base + 0x1903cL);
4699 system_sw_write_32(base + 0x1903cL, (((uint32_t) (data & 0x3fffff)) << 0) | (curr & 0xffc00000));
4700 }
acamera_isp_frame_stitch_lm_mc_mag_thresh_slope_read(uintptr_t base)4701 static __inline uint32_t acamera_isp_frame_stitch_lm_mc_mag_thresh_slope_read(uintptr_t base) {
4702 return (uint32_t)((system_sw_read_32(base + 0x1903cL) & 0x3fffff) >> 0);
4703 }
4704 // ------------------------------------------------------------------------------ //
4705 // Register: lm_mc_mag_thresh_thresh
4706 // ------------------------------------------------------------------------------ //
4707
4708 // ------------------------------------------------------------------------------ //
4709 //
4710 //
4711 // ------------------------------------------------------------------------------ //
4712
4713 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_THRESH_DEFAULT (0x0)
4714 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_THRESH_DATASIZE (20)
4715 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_THRESH_OFFSET (0x1b8)
4716 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_THRESH_MASK (0xfffff)
4717
4718 // args: data (20-bit)
acamera_isp_frame_stitch_lm_mc_mag_thresh_thresh_write(uintptr_t base,uint32_t data)4719 static __inline void acamera_isp_frame_stitch_lm_mc_mag_thresh_thresh_write(uintptr_t base, uint32_t data) {
4720 uint32_t curr = system_sw_read_32(base + 0x19040L);
4721 system_sw_write_32(base + 0x19040L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
4722 }
acamera_isp_frame_stitch_lm_mc_mag_thresh_thresh_read(uintptr_t base)4723 static __inline uint32_t acamera_isp_frame_stitch_lm_mc_mag_thresh_thresh_read(uintptr_t base) {
4724 return (uint32_t)((system_sw_read_32(base + 0x19040L) & 0xfffff) >> 0);
4725 }
4726 // ------------------------------------------------------------------------------ //
4727 // Register: lm_mc_mag_thresh_offset
4728 // ------------------------------------------------------------------------------ //
4729
4730 // ------------------------------------------------------------------------------ //
4731 //
4732 //
4733 // ------------------------------------------------------------------------------ //
4734
4735 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_OFFSET_DEFAULT (0x0)
4736 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_OFFSET_DATASIZE (12)
4737 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_OFFSET_OFFSET (0x1bc)
4738 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_THRESH_OFFSET_MASK (0xfff)
4739
4740 // args: data (12-bit)
acamera_isp_frame_stitch_lm_mc_mag_thresh_offset_write(uintptr_t base,uint16_t data)4741 static __inline void acamera_isp_frame_stitch_lm_mc_mag_thresh_offset_write(uintptr_t base, uint16_t data) {
4742 uint32_t curr = system_sw_read_32(base + 0x19044L);
4743 system_sw_write_32(base + 0x19044L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4744 }
acamera_isp_frame_stitch_lm_mc_mag_thresh_offset_read(uintptr_t base)4745 static __inline uint16_t acamera_isp_frame_stitch_lm_mc_mag_thresh_offset_read(uintptr_t base) {
4746 return (uint16_t)((system_sw_read_32(base + 0x19044L) & 0xfff) >> 0);
4747 }
4748 // ------------------------------------------------------------------------------ //
4749 // Register: lm_mc_mag_lblend_thresh
4750 // ------------------------------------------------------------------------------ //
4751
4752 // ------------------------------------------------------------------------------ //
4753 //
4754 //
4755 // ------------------------------------------------------------------------------ //
4756
4757 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_LBLEND_THRESH_DEFAULT (0x0)
4758 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_LBLEND_THRESH_DATASIZE (12)
4759 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_LBLEND_THRESH_OFFSET (0x1bc)
4760 #define ACAMERA_ISP_FRAME_STITCH_LM_MC_MAG_LBLEND_THRESH_MASK (0xfff0000)
4761
4762 // args: data (12-bit)
acamera_isp_frame_stitch_lm_mc_mag_lblend_thresh_write(uintptr_t base,uint16_t data)4763 static __inline void acamera_isp_frame_stitch_lm_mc_mag_lblend_thresh_write(uintptr_t base, uint16_t data) {
4764 uint32_t curr = system_sw_read_32(base + 0x19044L);
4765 system_sw_write_32(base + 0x19044L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4766 }
acamera_isp_frame_stitch_lm_mc_mag_lblend_thresh_read(uintptr_t base)4767 static __inline uint16_t acamera_isp_frame_stitch_lm_mc_mag_lblend_thresh_read(uintptr_t base) {
4768 return (uint16_t)((system_sw_read_32(base + 0x19044L) & 0xfff0000) >> 16);
4769 }
4770 // ------------------------------------------------------------------------------ //
4771 // Register: MCoff WB offset
4772 // ------------------------------------------------------------------------------ //
4773
4774 // ------------------------------------------------------------------------------ //
4775 //
4776 //
4777 // ------------------------------------------------------------------------------ //
4778
4779 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_WB_OFFSET_DEFAULT (0x0)
4780 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_WB_OFFSET_DATASIZE (12)
4781 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_WB_OFFSET_OFFSET (0x1c0)
4782 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_WB_OFFSET_MASK (0xfff)
4783
4784 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_wb_offset_write(uintptr_t base,uint16_t data)4785 static __inline void acamera_isp_frame_stitch_mcoff_wb_offset_write(uintptr_t base, uint16_t data) {
4786 uint32_t curr = system_sw_read_32(base + 0x19048L);
4787 system_sw_write_32(base + 0x19048L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4788 }
acamera_isp_frame_stitch_mcoff_wb_offset_read(uintptr_t base)4789 static __inline uint16_t acamera_isp_frame_stitch_mcoff_wb_offset_read(uintptr_t base) {
4790 return (uint16_t)((system_sw_read_32(base + 0x19048L) & 0xfff) >> 0);
4791 }
4792 // ------------------------------------------------------------------------------ //
4793 // Register: Exposure_mask_thresh
4794 // ------------------------------------------------------------------------------ //
4795
4796 // ------------------------------------------------------------------------------ //
4797 //
4798 // Threshold for selection of exposure mask in blending regions.
4799 // Where the alpha value is above this value the shorter exposure will be indicated.
4800 //
4801 // ------------------------------------------------------------------------------ //
4802
4803 #define ACAMERA_ISP_FRAME_STITCH_EXPOSURE_MASK_THRESH_DEFAULT (0x20)
4804 #define ACAMERA_ISP_FRAME_STITCH_EXPOSURE_MASK_THRESH_DATASIZE (8)
4805 #define ACAMERA_ISP_FRAME_STITCH_EXPOSURE_MASK_THRESH_OFFSET (0x1c0)
4806 #define ACAMERA_ISP_FRAME_STITCH_EXPOSURE_MASK_THRESH_MASK (0xff0000)
4807
4808 // args: data (8-bit)
acamera_isp_frame_stitch_exposure_mask_thresh_write(uintptr_t base,uint8_t data)4809 static __inline void acamera_isp_frame_stitch_exposure_mask_thresh_write(uintptr_t base, uint8_t data) {
4810 uint32_t curr = system_sw_read_32(base + 0x19048L);
4811 system_sw_write_32(base + 0x19048L, (((uint32_t) (data & 0xff)) << 16) | (curr & 0xff00ffff));
4812 }
acamera_isp_frame_stitch_exposure_mask_thresh_read(uintptr_t base)4813 static __inline uint8_t acamera_isp_frame_stitch_exposure_mask_thresh_read(uintptr_t base) {
4814 return (uint8_t)((system_sw_read_32(base + 0x19048L) & 0xff0000) >> 16);
4815 }
4816 // ------------------------------------------------------------------------------ //
4817 // Register: bwb_select
4818 // ------------------------------------------------------------------------------ //
4819
4820 // ------------------------------------------------------------------------------ //
4821 //
4822 //
4823 // ------------------------------------------------------------------------------ //
4824
4825 #define ACAMERA_ISP_FRAME_STITCH_BWB_SELECT_DEFAULT (0x0)
4826 #define ACAMERA_ISP_FRAME_STITCH_BWB_SELECT_DATASIZE (1)
4827 #define ACAMERA_ISP_FRAME_STITCH_BWB_SELECT_OFFSET (0x1c4)
4828 #define ACAMERA_ISP_FRAME_STITCH_BWB_SELECT_MASK (0x1)
4829
4830 // args: data (1-bit)
acamera_isp_frame_stitch_bwb_select_write(uintptr_t base,uint8_t data)4831 static __inline void acamera_isp_frame_stitch_bwb_select_write(uintptr_t base, uint8_t data) {
4832 uint32_t curr = system_sw_read_32(base + 0x1904cL);
4833 system_sw_write_32(base + 0x1904cL, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
4834 }
acamera_isp_frame_stitch_bwb_select_read(uintptr_t base)4835 static __inline uint8_t acamera_isp_frame_stitch_bwb_select_read(uintptr_t base) {
4836 return (uint8_t)((system_sw_read_32(base + 0x1904cL) & 0x1) >> 0);
4837 }
4838 // ------------------------------------------------------------------------------ //
4839 // Register: use_3x3_max
4840 // ------------------------------------------------------------------------------ //
4841
4842 // ------------------------------------------------------------------------------ //
4843 //
4844 //
4845 // ------------------------------------------------------------------------------ //
4846
4847 #define ACAMERA_ISP_FRAME_STITCH_USE_3X3_MAX_DEFAULT (0x0)
4848 #define ACAMERA_ISP_FRAME_STITCH_USE_3X3_MAX_DATASIZE (1)
4849 #define ACAMERA_ISP_FRAME_STITCH_USE_3X3_MAX_OFFSET (0x1c4)
4850 #define ACAMERA_ISP_FRAME_STITCH_USE_3X3_MAX_MASK (0x2)
4851
4852 // args: data (1-bit)
acamera_isp_frame_stitch_use_3x3_max_write(uintptr_t base,uint8_t data)4853 static __inline void acamera_isp_frame_stitch_use_3x3_max_write(uintptr_t base, uint8_t data) {
4854 uint32_t curr = system_sw_read_32(base + 0x1904cL);
4855 system_sw_write_32(base + 0x1904cL, (((uint32_t) (data & 0x1)) << 1) | (curr & 0xfffffffd));
4856 }
acamera_isp_frame_stitch_use_3x3_max_read(uintptr_t base)4857 static __inline uint8_t acamera_isp_frame_stitch_use_3x3_max_read(uintptr_t base) {
4858 return (uint8_t)((system_sw_read_32(base + 0x1904cL) & 0x2) >> 1);
4859 }
4860 // ------------------------------------------------------------------------------ //
4861 // Register: mcoff mode enable
4862 // ------------------------------------------------------------------------------ //
4863
4864 // ------------------------------------------------------------------------------ //
4865 //
4866 //
4867 // ------------------------------------------------------------------------------ //
4868
4869 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_MODE_ENABLE_DEFAULT (0x0)
4870 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_MODE_ENABLE_DATASIZE (1)
4871 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_MODE_ENABLE_OFFSET (0x1c4)
4872 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_MODE_ENABLE_MASK (0x100)
4873
4874 // args: data (1-bit)
acamera_isp_frame_stitch_mcoff_mode_enable_write(uintptr_t base,uint8_t data)4875 static __inline void acamera_isp_frame_stitch_mcoff_mode_enable_write(uintptr_t base, uint8_t data) {
4876 uint32_t curr = system_sw_read_32(base + 0x1904cL);
4877 system_sw_write_32(base + 0x1904cL, (((uint32_t) (data & 0x1)) << 8) | (curr & 0xfffffeff));
4878 }
acamera_isp_frame_stitch_mcoff_mode_enable_read(uintptr_t base)4879 static __inline uint8_t acamera_isp_frame_stitch_mcoff_mode_enable_read(uintptr_t base) {
4880 return (uint8_t)((system_sw_read_32(base + 0x1904cL) & 0x100) >> 8);
4881 }
4882 // ------------------------------------------------------------------------------ //
4883 // Register: lm_alg_select
4884 // ------------------------------------------------------------------------------ //
4885
4886 // ------------------------------------------------------------------------------ //
4887 //
4888 // Select which L/M stitching algorithm to use.
4889 //
4890 // ------------------------------------------------------------------------------ //
4891
4892 #define ACAMERA_ISP_FRAME_STITCH_LM_ALG_SELECT_DEFAULT (0x0)
4893 #define ACAMERA_ISP_FRAME_STITCH_LM_ALG_SELECT_DATASIZE (1)
4894 #define ACAMERA_ISP_FRAME_STITCH_LM_ALG_SELECT_OFFSET (0x1c4)
4895 #define ACAMERA_ISP_FRAME_STITCH_LM_ALG_SELECT_MASK (0x10000)
4896
4897 // args: data (1-bit)
acamera_isp_frame_stitch_lm_alg_select_write(uintptr_t base,uint8_t data)4898 static __inline void acamera_isp_frame_stitch_lm_alg_select_write(uintptr_t base, uint8_t data) {
4899 uint32_t curr = system_sw_read_32(base + 0x1904cL);
4900 system_sw_write_32(base + 0x1904cL, (((uint32_t) (data & 0x1)) << 16) | (curr & 0xfffeffff));
4901 }
acamera_isp_frame_stitch_lm_alg_select_read(uintptr_t base)4902 static __inline uint8_t acamera_isp_frame_stitch_lm_alg_select_read(uintptr_t base) {
4903 return (uint8_t)((system_sw_read_32(base + 0x1904cL) & 0x10000) >> 16);
4904 }
4905 // ------------------------------------------------------------------------------ //
4906 // Register: MCoff NC Enable
4907 // ------------------------------------------------------------------------------ //
4908
4909 // ------------------------------------------------------------------------------ //
4910 //
4911 //
4912 // ------------------------------------------------------------------------------ //
4913
4914 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_ENABLE_DEFAULT (0x0)
4915 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_ENABLE_DATASIZE (1)
4916 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_ENABLE_OFFSET (0x1c4)
4917 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_ENABLE_MASK (0x4)
4918
4919 // args: data (1-bit)
acamera_isp_frame_stitch_mcoff_nc_enable_write(uintptr_t base,uint8_t data)4920 static __inline void acamera_isp_frame_stitch_mcoff_nc_enable_write(uintptr_t base, uint8_t data) {
4921 uint32_t curr = system_sw_read_32(base + 0x1904cL);
4922 system_sw_write_32(base + 0x1904cL, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
4923 }
acamera_isp_frame_stitch_mcoff_nc_enable_read(uintptr_t base)4924 static __inline uint8_t acamera_isp_frame_stitch_mcoff_nc_enable_read(uintptr_t base) {
4925 return (uint8_t)((system_sw_read_32(base + 0x1904cL) & 0x4) >> 2);
4926 }
4927 // ------------------------------------------------------------------------------ //
4928 // Register: MCoff L max
4929 // ------------------------------------------------------------------------------ //
4930
4931 // ------------------------------------------------------------------------------ //
4932 //
4933 //
4934 // ------------------------------------------------------------------------------ //
4935
4936 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_MAX_DEFAULT (0x0)
4937 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_MAX_DATASIZE (12)
4938 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_MAX_OFFSET (0x1c8)
4939 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_MAX_MASK (0xfff)
4940
4941 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_l_max_write(uintptr_t base,uint16_t data)4942 static __inline void acamera_isp_frame_stitch_mcoff_l_max_write(uintptr_t base, uint16_t data) {
4943 uint32_t curr = system_sw_read_32(base + 0x19050L);
4944 system_sw_write_32(base + 0x19050L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4945 }
acamera_isp_frame_stitch_mcoff_l_max_read(uintptr_t base)4946 static __inline uint16_t acamera_isp_frame_stitch_mcoff_l_max_read(uintptr_t base) {
4947 return (uint16_t)((system_sw_read_32(base + 0x19050L) & 0xfff) >> 0);
4948 }
4949 // ------------------------------------------------------------------------------ //
4950 // Register: MCoff M max
4951 // ------------------------------------------------------------------------------ //
4952
4953 // ------------------------------------------------------------------------------ //
4954 //
4955 //
4956 // ------------------------------------------------------------------------------ //
4957
4958 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_M_MAX_DEFAULT (0x0)
4959 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_M_MAX_DATASIZE (12)
4960 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_M_MAX_OFFSET (0x1c8)
4961 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_M_MAX_MASK (0xfff0000)
4962
4963 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_m_max_write(uintptr_t base,uint16_t data)4964 static __inline void acamera_isp_frame_stitch_mcoff_m_max_write(uintptr_t base, uint16_t data) {
4965 uint32_t curr = system_sw_read_32(base + 0x19050L);
4966 system_sw_write_32(base + 0x19050L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
4967 }
acamera_isp_frame_stitch_mcoff_m_max_read(uintptr_t base)4968 static __inline uint16_t acamera_isp_frame_stitch_mcoff_m_max_read(uintptr_t base) {
4969 return (uint16_t)((system_sw_read_32(base + 0x19050L) & 0xfff0000) >> 16);
4970 }
4971 // ------------------------------------------------------------------------------ //
4972 // Register: MCoff S max
4973 // ------------------------------------------------------------------------------ //
4974
4975 // ------------------------------------------------------------------------------ //
4976 //
4977 //
4978 // ------------------------------------------------------------------------------ //
4979
4980 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_S_MAX_DEFAULT (0x0)
4981 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_S_MAX_DATASIZE (12)
4982 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_S_MAX_OFFSET (0x1cc)
4983 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_S_MAX_MASK (0xfff)
4984
4985 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_s_max_write(uintptr_t base,uint16_t data)4986 static __inline void acamera_isp_frame_stitch_mcoff_s_max_write(uintptr_t base, uint16_t data) {
4987 uint32_t curr = system_sw_read_32(base + 0x19054L);
4988 system_sw_write_32(base + 0x19054L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
4989 }
acamera_isp_frame_stitch_mcoff_s_max_read(uintptr_t base)4990 static __inline uint16_t acamera_isp_frame_stitch_mcoff_s_max_read(uintptr_t base) {
4991 return (uint16_t)((system_sw_read_32(base + 0x19054L) & 0xfff) >> 0);
4992 }
4993 // ------------------------------------------------------------------------------ //
4994 // Register: MCoff vs max
4995 // ------------------------------------------------------------------------------ //
4996
4997 // ------------------------------------------------------------------------------ //
4998 //
4999 //
5000 // ------------------------------------------------------------------------------ //
5001
5002 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_VS_MAX_DEFAULT (0x0)
5003 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_VS_MAX_DATASIZE (12)
5004 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_VS_MAX_OFFSET (0x1cc)
5005 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_VS_MAX_MASK (0xfff0000)
5006
5007 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_vs_max_write(uintptr_t base,uint16_t data)5008 static __inline void acamera_isp_frame_stitch_mcoff_vs_max_write(uintptr_t base, uint16_t data) {
5009 uint32_t curr = system_sw_read_32(base + 0x19054L);
5010 system_sw_write_32(base + 0x19054L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
5011 }
acamera_isp_frame_stitch_mcoff_vs_max_read(uintptr_t base)5012 static __inline uint16_t acamera_isp_frame_stitch_mcoff_vs_max_read(uintptr_t base) {
5013 return (uint16_t)((system_sw_read_32(base + 0x19054L) & 0xfff0000) >> 16);
5014 }
5015 // ------------------------------------------------------------------------------ //
5016 // Register: MCoff L scaler
5017 // ------------------------------------------------------------------------------ //
5018
5019 // ------------------------------------------------------------------------------ //
5020 //
5021 //
5022 // ------------------------------------------------------------------------------ //
5023
5024 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_SCALER_DEFAULT (0x0)
5025 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_SCALER_DATASIZE (12)
5026 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_SCALER_OFFSET (0x1d0)
5027 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_L_SCALER_MASK (0xfff)
5028
5029 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_l_scaler_write(uintptr_t base,uint16_t data)5030 static __inline void acamera_isp_frame_stitch_mcoff_l_scaler_write(uintptr_t base, uint16_t data) {
5031 uint32_t curr = system_sw_read_32(base + 0x19058L);
5032 system_sw_write_32(base + 0x19058L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
5033 }
acamera_isp_frame_stitch_mcoff_l_scaler_read(uintptr_t base)5034 static __inline uint16_t acamera_isp_frame_stitch_mcoff_l_scaler_read(uintptr_t base) {
5035 return (uint16_t)((system_sw_read_32(base + 0x19058L) & 0xfff) >> 0);
5036 }
5037 // ------------------------------------------------------------------------------ //
5038 // Register: MCoff LM scaler
5039 // ------------------------------------------------------------------------------ //
5040
5041 // ------------------------------------------------------------------------------ //
5042 //
5043 //
5044 // ------------------------------------------------------------------------------ //
5045
5046 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LM_SCALER_DEFAULT (0x0)
5047 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LM_SCALER_DATASIZE (12)
5048 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LM_SCALER_OFFSET (0x1d0)
5049 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LM_SCALER_MASK (0xfff0000)
5050
5051 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_lm_scaler_write(uintptr_t base,uint16_t data)5052 static __inline void acamera_isp_frame_stitch_mcoff_lm_scaler_write(uintptr_t base, uint16_t data) {
5053 uint32_t curr = system_sw_read_32(base + 0x19058L);
5054 system_sw_write_32(base + 0x19058L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
5055 }
acamera_isp_frame_stitch_mcoff_lm_scaler_read(uintptr_t base)5056 static __inline uint16_t acamera_isp_frame_stitch_mcoff_lm_scaler_read(uintptr_t base) {
5057 return (uint16_t)((system_sw_read_32(base + 0x19058L) & 0xfff0000) >> 16);
5058 }
5059 // ------------------------------------------------------------------------------ //
5060 // Register: MCoff LMS scaler
5061 // ------------------------------------------------------------------------------ //
5062
5063 // ------------------------------------------------------------------------------ //
5064 //
5065 //
5066 // ------------------------------------------------------------------------------ //
5067
5068 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LMS_SCALER_DEFAULT (0x0)
5069 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LMS_SCALER_DATASIZE (12)
5070 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LMS_SCALER_OFFSET (0x1d4)
5071 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_LMS_SCALER_MASK (0xfff)
5072
5073 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_lms_scaler_write(uintptr_t base,uint16_t data)5074 static __inline void acamera_isp_frame_stitch_mcoff_lms_scaler_write(uintptr_t base, uint16_t data) {
5075 uint32_t curr = system_sw_read_32(base + 0x1905cL);
5076 system_sw_write_32(base + 0x1905cL, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
5077 }
acamera_isp_frame_stitch_mcoff_lms_scaler_read(uintptr_t base)5078 static __inline uint16_t acamera_isp_frame_stitch_mcoff_lms_scaler_read(uintptr_t base) {
5079 return (uint16_t)((system_sw_read_32(base + 0x1905cL) & 0xfff) >> 0);
5080 }
5081 // ------------------------------------------------------------------------------ //
5082 // Register: MCoff NC thresh low
5083 // ------------------------------------------------------------------------------ //
5084
5085 // ------------------------------------------------------------------------------ //
5086 //
5087 //
5088 // ------------------------------------------------------------------------------ //
5089
5090 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_LOW_DEFAULT (0x0)
5091 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_LOW_DATASIZE (12)
5092 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_LOW_OFFSET (0x1d4)
5093 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_LOW_MASK (0xfff0000)
5094
5095 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_nc_thresh_low_write(uintptr_t base,uint16_t data)5096 static __inline void acamera_isp_frame_stitch_mcoff_nc_thresh_low_write(uintptr_t base, uint16_t data) {
5097 uint32_t curr = system_sw_read_32(base + 0x1905cL);
5098 system_sw_write_32(base + 0x1905cL, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
5099 }
acamera_isp_frame_stitch_mcoff_nc_thresh_low_read(uintptr_t base)5100 static __inline uint16_t acamera_isp_frame_stitch_mcoff_nc_thresh_low_read(uintptr_t base) {
5101 return (uint16_t)((system_sw_read_32(base + 0x1905cL) & 0xfff0000) >> 16);
5102 }
5103 // ------------------------------------------------------------------------------ //
5104 // Register: MCoff NC thresh high
5105 // ------------------------------------------------------------------------------ //
5106
5107 // ------------------------------------------------------------------------------ //
5108 //
5109 //
5110 // ------------------------------------------------------------------------------ //
5111
5112 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_HIGH_DEFAULT (0x0)
5113 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_HIGH_DATASIZE (12)
5114 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_HIGH_OFFSET (0x1d8)
5115 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_THRESH_HIGH_MASK (0xfff)
5116
5117 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_nc_thresh_high_write(uintptr_t base,uint16_t data)5118 static __inline void acamera_isp_frame_stitch_mcoff_nc_thresh_high_write(uintptr_t base, uint16_t data) {
5119 uint32_t curr = system_sw_read_32(base + 0x19060L);
5120 system_sw_write_32(base + 0x19060L, (((uint32_t) (data & 0xfff)) << 0) | (curr & 0xfffff000));
5121 }
acamera_isp_frame_stitch_mcoff_nc_thresh_high_read(uintptr_t base)5122 static __inline uint16_t acamera_isp_frame_stitch_mcoff_nc_thresh_high_read(uintptr_t base) {
5123 return (uint16_t)((system_sw_read_32(base + 0x19060L) & 0xfff) >> 0);
5124 }
5125 // ------------------------------------------------------------------------------ //
5126 // Register: MCoff NC scale
5127 // ------------------------------------------------------------------------------ //
5128
5129 // ------------------------------------------------------------------------------ //
5130 //
5131 //
5132 // ------------------------------------------------------------------------------ //
5133
5134 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_SCALE_DEFAULT (0x0)
5135 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_SCALE_DATASIZE (12)
5136 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_SCALE_OFFSET (0x1d8)
5137 #define ACAMERA_ISP_FRAME_STITCH_MCOFF_NC_SCALE_MASK (0xfff0000)
5138
5139 // args: data (12-bit)
acamera_isp_frame_stitch_mcoff_nc_scale_write(uintptr_t base,uint16_t data)5140 static __inline void acamera_isp_frame_stitch_mcoff_nc_scale_write(uintptr_t base, uint16_t data) {
5141 uint32_t curr = system_sw_read_32(base + 0x19060L);
5142 system_sw_write_32(base + 0x19060L, (((uint32_t) (data & 0xfff)) << 16) | (curr & 0xf000ffff));
5143 }
acamera_isp_frame_stitch_mcoff_nc_scale_read(uintptr_t base)5144 static __inline uint16_t acamera_isp_frame_stitch_mcoff_nc_scale_read(uintptr_t base) {
5145 return (uint16_t)((system_sw_read_32(base + 0x19060L) & 0xfff0000) >> 16);
5146 }
5147 // ------------------------------------------------------------------------------ //
5148 // Group: frame stitch NP LUT VS
5149 // ------------------------------------------------------------------------------ //
5150
5151 // ------------------------------------------------------------------------------ //
5152 // Noise profile for short exposure data at frame stitch
5153 // ------------------------------------------------------------------------------ //
5154
5155 // ------------------------------------------------------------------------------ //
5156 // Register: Weight lut
5157 // ------------------------------------------------------------------------------ //
5158
5159 // ------------------------------------------------------------------------------ //
5160 // Noise profile LUT. Calculated during calibration process.
5161 // ------------------------------------------------------------------------------ //
5162
5163 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_VS_WEIGHT_LUT_DEFAULT (0x0)
5164 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_VS_WEIGHT_LUT_DATASIZE (8)
5165 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_VS_WEIGHT_LUT_OFFSET (0x1dc)
5166 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_VS_WEIGHT_LUT_MASK (0xff)
5167
5168 // index (0-127), args: data (8-bit)
acamera_isp_frame_stitch_np_lut_vs_weight_lut_write(uintptr_t base,uint32_t index,uint8_t data)5169 static __inline void acamera_isp_frame_stitch_np_lut_vs_weight_lut_write( uintptr_t base, uint32_t index,uint8_t data) {
5170 uintptr_t addr = base + 0x19064L + (index & 0xFFFFFFFC);
5171 uint8_t offset = (index & 3) << 3;
5172 uint32_t curr = system_sw_read_32(addr);
5173 system_sw_write_32(addr, ((uint32_t)data << offset) | (curr & ~(0xFF << offset)));
5174 }
acamera_isp_frame_stitch_np_lut_vs_weight_lut_read(uintptr_t base,uint32_t index)5175 static __inline uint8_t acamera_isp_frame_stitch_np_lut_vs_weight_lut_read( uintptr_t base, uint32_t index) {
5176 uintptr_t addr = base + 0x19064L + (index & 0xFFFFFFFC);
5177 uint8_t offset = (index & 3) << 3;
5178 return (uint8_t)(system_sw_read_32(addr) >> offset);
5179 }
5180 // ------------------------------------------------------------------------------ //
5181 // Group: frame stitch NP LUT S
5182 // ------------------------------------------------------------------------------ //
5183
5184 // ------------------------------------------------------------------------------ //
5185 // Noise profile for med2 exposure data at frame stitch
5186 // ------------------------------------------------------------------------------ //
5187
5188 // ------------------------------------------------------------------------------ //
5189 // Register: Weight lut
5190 // ------------------------------------------------------------------------------ //
5191
5192 // ------------------------------------------------------------------------------ //
5193 // Noise profile LUT. Calculated during calibration process.
5194 // ------------------------------------------------------------------------------ //
5195
5196 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_S_WEIGHT_LUT_DEFAULT (0x0)
5197 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_S_WEIGHT_LUT_DATASIZE (8)
5198 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_S_WEIGHT_LUT_OFFSET (0x25c)
5199 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_S_WEIGHT_LUT_MASK (0xff)
5200
5201 // index (0-127), args: data (8-bit)
acamera_isp_frame_stitch_np_lut_s_weight_lut_write(uintptr_t base,uint32_t index,uint8_t data)5202 static __inline void acamera_isp_frame_stitch_np_lut_s_weight_lut_write( uintptr_t base, uint32_t index,uint8_t data) {
5203 uintptr_t addr = base + 0x190e4L + (index & 0xFFFFFFFC);
5204 uint8_t offset = (index & 3) << 3;
5205 uint32_t curr = system_sw_read_32(addr);
5206 system_sw_write_32(addr, ((uint32_t)data << offset) | (curr & ~(0xFF << offset)));
5207 }
acamera_isp_frame_stitch_np_lut_s_weight_lut_read(uintptr_t base,uint32_t index)5208 static __inline uint8_t acamera_isp_frame_stitch_np_lut_s_weight_lut_read( uintptr_t base, uint32_t index) {
5209 uintptr_t addr = base + 0x190e4L + (index & 0xFFFFFFFC);
5210 uint8_t offset = (index & 3) << 3;
5211 return (uint8_t)(system_sw_read_32(addr) >> offset);
5212 }
5213 // ------------------------------------------------------------------------------ //
5214 // Group: frame stitch NP LUT M
5215 // ------------------------------------------------------------------------------ //
5216
5217 // ------------------------------------------------------------------------------ //
5218 // Noise profile for med1 exposure data at frame stitch
5219 // ------------------------------------------------------------------------------ //
5220
5221 // ------------------------------------------------------------------------------ //
5222 // Register: Weight lut
5223 // ------------------------------------------------------------------------------ //
5224
5225 // ------------------------------------------------------------------------------ //
5226 // Noise profile LUT. Calculated during calibration process.
5227 // ------------------------------------------------------------------------------ //
5228
5229 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_M_WEIGHT_LUT_DEFAULT (0x0)
5230 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_M_WEIGHT_LUT_DATASIZE (8)
5231 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_M_WEIGHT_LUT_OFFSET (0x2dc)
5232 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_M_WEIGHT_LUT_MASK (0xff)
5233
5234 // index (0-127), args: data (8-bit)
acamera_isp_frame_stitch_np_lut_m_weight_lut_write(uintptr_t base,uint32_t index,uint8_t data)5235 static __inline void acamera_isp_frame_stitch_np_lut_m_weight_lut_write( uintptr_t base, uint32_t index,uint8_t data) {
5236 uintptr_t addr = base + 0x19164L + (index & 0xFFFFFFFC);
5237 uint8_t offset = (index & 3) << 3;
5238 uint32_t curr = system_sw_read_32(addr);
5239 system_sw_write_32(addr, ((uint32_t)data << offset) | (curr & ~(0xFF << offset)));
5240 }
acamera_isp_frame_stitch_np_lut_m_weight_lut_read(uintptr_t base,uint32_t index)5241 static __inline uint8_t acamera_isp_frame_stitch_np_lut_m_weight_lut_read( uintptr_t base, uint32_t index) {
5242 uintptr_t addr = base + 0x19164L + (index & 0xFFFFFFFC);
5243 uint8_t offset = (index & 3) << 3;
5244 return (uint8_t)(system_sw_read_32(addr) >> offset);
5245 }
5246 // ------------------------------------------------------------------------------ //
5247 // Group: frame stitch NP LUT L
5248 // ------------------------------------------------------------------------------ //
5249
5250 // ------------------------------------------------------------------------------ //
5251 // Noise profile for long exposure data at frame stitch
5252 // ------------------------------------------------------------------------------ //
5253
5254 // ------------------------------------------------------------------------------ //
5255 // Register: Weight lut
5256 // ------------------------------------------------------------------------------ //
5257
5258 // ------------------------------------------------------------------------------ //
5259 // Noise profile LUT. Calculated during calibration process.
5260 // ------------------------------------------------------------------------------ //
5261
5262 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_L_WEIGHT_LUT_DEFAULT (0x0)
5263 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_L_WEIGHT_LUT_DATASIZE (8)
5264 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_L_WEIGHT_LUT_OFFSET (0x35c)
5265 #define ACAMERA_ISP_FRAME_STITCH_NP_LUT_L_WEIGHT_LUT_MASK (0xff)
5266
5267 // index (0-127), args: data (8-bit)
acamera_isp_frame_stitch_np_lut_l_weight_lut_write(uintptr_t base,uint32_t index,uint8_t data)5268 static __inline void acamera_isp_frame_stitch_np_lut_l_weight_lut_write( uintptr_t base, uint32_t index,uint8_t data) {
5269 uintptr_t addr = base + 0x191e4L + (index & 0xFFFFFFFC);
5270 uint8_t offset = (index & 3) << 3;
5271 uint32_t curr = system_sw_read_32(addr);
5272 system_sw_write_32(addr, ((uint32_t)data << offset) | (curr & ~(0xFF << offset)));
5273 }
acamera_isp_frame_stitch_np_lut_l_weight_lut_read(uintptr_t base,uint32_t index)5274 static __inline uint8_t acamera_isp_frame_stitch_np_lut_l_weight_lut_read( uintptr_t base, uint32_t index) {
5275 uintptr_t addr = base + 0x191e4L + (index & 0xFFFFFFFC);
5276 uint8_t offset = (index & 3) << 3;
5277 return (uint8_t)(system_sw_read_32(addr) >> offset);
5278 }
5279 // ------------------------------------------------------------------------------ //
5280 // Group: decompander0
5281 // ------------------------------------------------------------------------------ //
5282
5283 // ------------------------------------------------------------------------------ //
5284 // Frontend lookup (for companded WDR sensor inputs)
5285 // ------------------------------------------------------------------------------ //
5286
5287 // ------------------------------------------------------------------------------ //
5288 // Register: Enable
5289 // ------------------------------------------------------------------------------ //
5290
5291 // ------------------------------------------------------------------------------ //
5292 // Frontend lookup0 enable: 0=off 1=on
5293 // ------------------------------------------------------------------------------ //
5294
5295 #define ACAMERA_ISP_DECOMPANDER0_ENABLE_DEFAULT (0)
5296 #define ACAMERA_ISP_DECOMPANDER0_ENABLE_DATASIZE (1)
5297 #define ACAMERA_ISP_DECOMPANDER0_ENABLE_OFFSET (0x3dc)
5298 #define ACAMERA_ISP_DECOMPANDER0_ENABLE_MASK (0x1)
5299
5300 // args: data (1-bit)
acamera_isp_decompander0_enable_write(uintptr_t base,uint8_t data)5301 static __inline void acamera_isp_decompander0_enable_write(uintptr_t base, uint8_t data) {
5302 uint32_t curr = system_sw_read_32(base + 0x19264L);
5303 system_sw_write_32(base + 0x19264L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
5304 }
acamera_isp_decompander0_enable_read(uintptr_t base)5305 static __inline uint8_t acamera_isp_decompander0_enable_read(uintptr_t base) {
5306 return (uint8_t)((system_sw_read_32(base + 0x19264L) & 0x1) >> 0);
5307 }
5308 // ------------------------------------------------------------------------------ //
5309 // Register: Offset Mode
5310 // ------------------------------------------------------------------------------ //
5311
5312 // ------------------------------------------------------------------------------ //
5313 //
5314 // Lookup0 reflection mode for black offset region
5315 // 0 = Manual curve reflection
5316 // 1 = Automatic curve reflection
5317 //
5318 // ------------------------------------------------------------------------------ //
5319
5320 #define ACAMERA_ISP_DECOMPANDER0_OFFSET_MODE_DEFAULT (0)
5321 #define ACAMERA_ISP_DECOMPANDER0_OFFSET_MODE_DATASIZE (1)
5322 #define ACAMERA_ISP_DECOMPANDER0_OFFSET_MODE_OFFSET (0x3dc)
5323 #define ACAMERA_ISP_DECOMPANDER0_OFFSET_MODE_MASK (0x10)
5324
5325 // args: data (1-bit)
acamera_isp_decompander0_offset_mode_write(uintptr_t base,uint8_t data)5326 static __inline void acamera_isp_decompander0_offset_mode_write(uintptr_t base, uint8_t data) {
5327 uint32_t curr = system_sw_read_32(base + 0x19264L);
5328 system_sw_write_32(base + 0x19264L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
5329 }
acamera_isp_decompander0_offset_mode_read(uintptr_t base)5330 static __inline uint8_t acamera_isp_decompander0_offset_mode_read(uintptr_t base) {
5331 return (uint8_t)((system_sw_read_32(base + 0x19264L) & 0x10) >> 4);
5332 }
5333 // ------------------------------------------------------------------------------ //
5334 // Group: decompander1
5335 // ------------------------------------------------------------------------------ //
5336
5337 // ------------------------------------------------------------------------------ //
5338 // Frontend lookup (for companded WDR sensor inputs)
5339 // ------------------------------------------------------------------------------ //
5340
5341 // ------------------------------------------------------------------------------ //
5342 // Register: Enable
5343 // ------------------------------------------------------------------------------ //
5344
5345 // ------------------------------------------------------------------------------ //
5346 // Frontend lookup0 enable: 0=off 1=on
5347 // ------------------------------------------------------------------------------ //
5348
5349 #define ACAMERA_ISP_DECOMPANDER1_ENABLE_DEFAULT (0)
5350 #define ACAMERA_ISP_DECOMPANDER1_ENABLE_DATASIZE (1)
5351 #define ACAMERA_ISP_DECOMPANDER1_ENABLE_OFFSET (0x3e0)
5352 #define ACAMERA_ISP_DECOMPANDER1_ENABLE_MASK (0x1)
5353
5354 // args: data (1-bit)
acamera_isp_decompander1_enable_write(uintptr_t base,uint8_t data)5355 static __inline void acamera_isp_decompander1_enable_write(uintptr_t base, uint8_t data) {
5356 uint32_t curr = system_sw_read_32(base + 0x19268L);
5357 system_sw_write_32(base + 0x19268L, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
5358 }
acamera_isp_decompander1_enable_read(uintptr_t base)5359 static __inline uint8_t acamera_isp_decompander1_enable_read(uintptr_t base) {
5360 return (uint8_t)((system_sw_read_32(base + 0x19268L) & 0x1) >> 0);
5361 }
5362 // ------------------------------------------------------------------------------ //
5363 // Register: Offset Mode
5364 // ------------------------------------------------------------------------------ //
5365
5366 // ------------------------------------------------------------------------------ //
5367 //
5368 // Lookup0 reflection mode for black offset region
5369 // 0 = Manual curve reflection
5370 // 1 = Automatic curve reflection
5371 //
5372 // ------------------------------------------------------------------------------ //
5373
5374 #define ACAMERA_ISP_DECOMPANDER1_OFFSET_MODE_DEFAULT (0)
5375 #define ACAMERA_ISP_DECOMPANDER1_OFFSET_MODE_DATASIZE (1)
5376 #define ACAMERA_ISP_DECOMPANDER1_OFFSET_MODE_OFFSET (0x3e0)
5377 #define ACAMERA_ISP_DECOMPANDER1_OFFSET_MODE_MASK (0x10)
5378
5379 // args: data (1-bit)
acamera_isp_decompander1_offset_mode_write(uintptr_t base,uint8_t data)5380 static __inline void acamera_isp_decompander1_offset_mode_write(uintptr_t base, uint8_t data) {
5381 uint32_t curr = system_sw_read_32(base + 0x19268L);
5382 system_sw_write_32(base + 0x19268L, (((uint32_t) (data & 0x1)) << 4) | (curr & 0xffffffef));
5383 }
acamera_isp_decompander1_offset_mode_read(uintptr_t base)5384 static __inline uint8_t acamera_isp_decompander1_offset_mode_read(uintptr_t base) {
5385 return (uint8_t)((system_sw_read_32(base + 0x19268L) & 0x10) >> 4);
5386 }
5387 // ------------------------------------------------------------------------------ //
5388 // Group: digital gain
5389 // ------------------------------------------------------------------------------ //
5390
5391 // ------------------------------------------------------------------------------ //
5392 // Digital gain for RAW sensor data
5393 // ------------------------------------------------------------------------------ //
5394
5395 // ------------------------------------------------------------------------------ //
5396 // Register: Gain
5397 // ------------------------------------------------------------------------------ //
5398
5399 // ------------------------------------------------------------------------------ //
5400 // Gain applied to data in 5.8 format
5401 // ------------------------------------------------------------------------------ //
5402
5403 #define ACAMERA_ISP_DIGITAL_GAIN_GAIN_DEFAULT (0x100)
5404 #define ACAMERA_ISP_DIGITAL_GAIN_GAIN_DATASIZE (13)
5405 #define ACAMERA_ISP_DIGITAL_GAIN_GAIN_OFFSET (0x3e4)
5406 #define ACAMERA_ISP_DIGITAL_GAIN_GAIN_MASK (0x1fff)
5407
5408 // args: data (13-bit)
acamera_isp_digital_gain_gain_write(uintptr_t base,uint16_t data)5409 static __inline void acamera_isp_digital_gain_gain_write(uintptr_t base, uint16_t data) {
5410 uint32_t curr = system_sw_read_32(base + 0x1926cL);
5411 system_sw_write_32(base + 0x1926cL, (((uint32_t) (data & 0x1fff)) << 0) | (curr & 0xffffe000));
5412 }
acamera_isp_digital_gain_gain_read(uintptr_t base)5413 static __inline uint16_t acamera_isp_digital_gain_gain_read(uintptr_t base) {
5414 return (uint16_t)((system_sw_read_32(base + 0x1926cL) & 0x1fff) >> 0);
5415 }
5416 // ------------------------------------------------------------------------------ //
5417 // Register: Offset
5418 // ------------------------------------------------------------------------------ //
5419
5420 // ------------------------------------------------------------------------------ //
5421 // Data black level
5422 // ------------------------------------------------------------------------------ //
5423
5424 #define ACAMERA_ISP_DIGITAL_GAIN_OFFSET_DEFAULT (0x000)
5425 #define ACAMERA_ISP_DIGITAL_GAIN_OFFSET_DATASIZE (20)
5426 #define ACAMERA_ISP_DIGITAL_GAIN_OFFSET_OFFSET (0x3e8)
5427 #define ACAMERA_ISP_DIGITAL_GAIN_OFFSET_MASK (0xfffff)
5428
5429 // args: data (20-bit)
acamera_isp_digital_gain_offset_write(uintptr_t base,uint32_t data)5430 static __inline void acamera_isp_digital_gain_offset_write(uintptr_t base, uint32_t data) {
5431 uint32_t curr = system_sw_read_32(base + 0x19270L);
5432 system_sw_write_32(base + 0x19270L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
5433 }
acamera_isp_digital_gain_offset_read(uintptr_t base)5434 static __inline uint32_t acamera_isp_digital_gain_offset_read(uintptr_t base) {
5435 return (uint32_t)((system_sw_read_32(base + 0x19270L) & 0xfffff) >> 0);
5436 }
5437 // ------------------------------------------------------------------------------ //
5438 // Group: sensor offset fe
5439 // ------------------------------------------------------------------------------ //
5440
5441 // ------------------------------------------------------------------------------ //
5442 // offset offset subtraction for each color channel and exposure
5443 // ------------------------------------------------------------------------------ //
5444
5445 // ------------------------------------------------------------------------------ //
5446 // Register: offset 00
5447 // ------------------------------------------------------------------------------ //
5448
5449 // ------------------------------------------------------------------------------ //
5450 // offset offset for color channel 00 (R)
5451 // ------------------------------------------------------------------------------ //
5452
5453 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_00_DEFAULT (0x00)
5454 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_00_DATASIZE (20)
5455 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_00_OFFSET (0x3ec)
5456 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_00_MASK (0xfffff)
5457
5458 // args: data (20-bit)
acamera_isp_sensor_offset_fe_offset_00_write(uintptr_t base,uint32_t data)5459 static __inline void acamera_isp_sensor_offset_fe_offset_00_write(uintptr_t base, uint32_t data) {
5460 uint32_t curr = system_sw_read_32(base + 0x19274L);
5461 system_sw_write_32(base + 0x19274L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
5462 }
acamera_isp_sensor_offset_fe_offset_00_read(uintptr_t base)5463 static __inline uint32_t acamera_isp_sensor_offset_fe_offset_00_read(uintptr_t base) {
5464 return (uint32_t)((system_sw_read_32(base + 0x19274L) & 0xfffff) >> 0);
5465 }
5466 // ------------------------------------------------------------------------------ //
5467 // Register: offset 01
5468 // ------------------------------------------------------------------------------ //
5469
5470 // ------------------------------------------------------------------------------ //
5471 // offset offset for color channel 01 (Gr)
5472 // ------------------------------------------------------------------------------ //
5473
5474 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_01_DEFAULT (0x00)
5475 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_01_DATASIZE (20)
5476 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_01_OFFSET (0x3f0)
5477 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_01_MASK (0xfffff)
5478
5479 // args: data (20-bit)
acamera_isp_sensor_offset_fe_offset_01_write(uintptr_t base,uint32_t data)5480 static __inline void acamera_isp_sensor_offset_fe_offset_01_write(uintptr_t base, uint32_t data) {
5481 uint32_t curr = system_sw_read_32(base + 0x19278L);
5482 system_sw_write_32(base + 0x19278L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
5483 }
acamera_isp_sensor_offset_fe_offset_01_read(uintptr_t base)5484 static __inline uint32_t acamera_isp_sensor_offset_fe_offset_01_read(uintptr_t base) {
5485 return (uint32_t)((system_sw_read_32(base + 0x19278L) & 0xfffff) >> 0);
5486 }
5487 // ------------------------------------------------------------------------------ //
5488 // Register: offset 10
5489 // ------------------------------------------------------------------------------ //
5490
5491 // ------------------------------------------------------------------------------ //
5492 // offset offset for color channel 10 (Gb)
5493 // ------------------------------------------------------------------------------ //
5494
5495 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_10_DEFAULT (0x00)
5496 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_10_DATASIZE (20)
5497 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_10_OFFSET (0x3f4)
5498 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_10_MASK (0xfffff)
5499
5500 // args: data (20-bit)
acamera_isp_sensor_offset_fe_offset_10_write(uintptr_t base,uint32_t data)5501 static __inline void acamera_isp_sensor_offset_fe_offset_10_write(uintptr_t base, uint32_t data) {
5502 uint32_t curr = system_sw_read_32(base + 0x1927cL);
5503 system_sw_write_32(base + 0x1927cL, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
5504 }
acamera_isp_sensor_offset_fe_offset_10_read(uintptr_t base)5505 static __inline uint32_t acamera_isp_sensor_offset_fe_offset_10_read(uintptr_t base) {
5506 return (uint32_t)((system_sw_read_32(base + 0x1927cL) & 0xfffff) >> 0);
5507 }
5508 // ------------------------------------------------------------------------------ //
5509 // Register: offset 11
5510 // ------------------------------------------------------------------------------ //
5511
5512 // ------------------------------------------------------------------------------ //
5513 // offset offset for color channel 11 (B)
5514 // ------------------------------------------------------------------------------ //
5515
5516 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_11_DEFAULT (0x00)
5517 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_11_DATASIZE (20)
5518 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_11_OFFSET (0x3f8)
5519 #define ACAMERA_ISP_SENSOR_OFFSET_FE_OFFSET_11_MASK (0xfffff)
5520
5521 // args: data (20-bit)
acamera_isp_sensor_offset_fe_offset_11_write(uintptr_t base,uint32_t data)5522 static __inline void acamera_isp_sensor_offset_fe_offset_11_write(uintptr_t base, uint32_t data) {
5523 uint32_t curr = system_sw_read_32(base + 0x19280L);
5524 system_sw_write_32(base + 0x19280L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
5525 }
acamera_isp_sensor_offset_fe_offset_11_read(uintptr_t base)5526 static __inline uint32_t acamera_isp_sensor_offset_fe_offset_11_read(uintptr_t base) {
5527 return (uint32_t)((system_sw_read_32(base + 0x19280L) & 0xfffff) >> 0);
5528 }
5529 // ------------------------------------------------------------------------------ //
5530 // Group: sqrt
5531 // ------------------------------------------------------------------------------ //
5532
5533 // ------------------------------------------------------------------------------ //
5534 // sensor offset for the sqrt module
5535 // ------------------------------------------------------------------------------ //
5536
5537 // ------------------------------------------------------------------------------ //
5538 // Register: black_level_in
5539 // ------------------------------------------------------------------------------ //
5540
5541 // ------------------------------------------------------------------------------ //
5542 // input Data black level
5543 // ------------------------------------------------------------------------------ //
5544
5545 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_IN_DEFAULT (0x000)
5546 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_IN_DATASIZE (20)
5547 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_IN_OFFSET (0x3fc)
5548 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_IN_MASK (0xfffff)
5549
5550 // args: data (20-bit)
acamera_isp_sqrt_black_level_in_write(uintptr_t base,uint32_t data)5551 static __inline void acamera_isp_sqrt_black_level_in_write(uintptr_t base, uint32_t data) {
5552 uint32_t curr = system_sw_read_32(base + 0x19284L);
5553 system_sw_write_32(base + 0x19284L, (((uint32_t) (data & 0xfffff)) << 0) | (curr & 0xfff00000));
5554 }
acamera_isp_sqrt_black_level_in_read(uintptr_t base)5555 static __inline uint32_t acamera_isp_sqrt_black_level_in_read(uintptr_t base) {
5556 return (uint32_t)((system_sw_read_32(base + 0x19284L) & 0xfffff) >> 0);
5557 }
5558 // ------------------------------------------------------------------------------ //
5559 // Register: black_level_out
5560 // ------------------------------------------------------------------------------ //
5561
5562 // ------------------------------------------------------------------------------ //
5563 // output Data black level
5564 // ------------------------------------------------------------------------------ //
5565
5566 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_OUT_DEFAULT (0x000)
5567 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_OUT_DATASIZE (16)
5568 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_OUT_OFFSET (0x400)
5569 #define ACAMERA_ISP_SQRT_BLACK_LEVEL_OUT_MASK (0xffff)
5570
5571 // args: data (16-bit)
acamera_isp_sqrt_black_level_out_write(uintptr_t base,uint16_t data)5572 static __inline void acamera_isp_sqrt_black_level_out_write(uintptr_t base, uint16_t data) {
5573 uint32_t curr = system_sw_read_32(base + 0x19288L);
5574 system_sw_write_32(base + 0x19288L, (((uint32_t) (data & 0xffff)) << 0) | (curr & 0xffff0000));
5575 }
acamera_isp_sqrt_black_level_out_read(uintptr_t base)5576 static __inline uint16_t acamera_isp_sqrt_black_level_out_read(uintptr_t base) {
5577 return (uint16_t)((system_sw_read_32(base + 0x19288L) & 0xffff) >> 0);
5578 }
5579 // ------------------------------------------------------------------------------ //
5580 // Group: raw frontend
5581 // ------------------------------------------------------------------------------ //
5582
5583 // ------------------------------------------------------------------------------ //
5584 // RAW frontend processing
5585 // ------------------------------------------------------------------------------ //
5586
5587 // ------------------------------------------------------------------------------ //
5588 // Register: ge enable
5589 // ------------------------------------------------------------------------------ //
5590
5591 // ------------------------------------------------------------------------------ //
5592 // Green equalization enable: 0=off, 1=on
5593 // ------------------------------------------------------------------------------ //
5594
5595 #define ACAMERA_ISP_RAW_FRONTEND_GE_ENABLE_DEFAULT (1)
5596 #define ACAMERA_ISP_RAW_FRONTEND_GE_ENABLE_DATASIZE (1)
5597 #define ACAMERA_ISP_RAW_FRONTEND_GE_ENABLE_OFFSET (0x404)
5598 #define ACAMERA_ISP_RAW_FRONTEND_GE_ENABLE_MASK (0x1)
5599
5600 // args: data (1-bit)
acamera_isp_raw_frontend_ge_enable_write(uintptr_t base,uint8_t data)5601 static __inline void acamera_isp_raw_frontend_ge_enable_write(uintptr_t base, uint8_t data) {
5602 uint32_t curr = system_sw_read_32(base + 0x1928cL);
5603 system_sw_write_32(base + 0x1928cL, (((uint32_t) (data & 0x1)) << 0) | (curr & 0xfffffffe));
5604 }
acamera_isp_raw_frontend_ge_enable_read(uintptr_t base)5605 static __inline uint8_t acamera_isp_raw_frontend_ge_enable_read(uintptr_t base) {
5606 return (uint8_t)((system_sw_read_32(base + 0x1928cL) & 0x1) >> 0);
5607 }
5608 // ------------------------------------------------------------------------------ //
5609 // Register: dp enable
5610 // ------------------------------------------------------------------------------ //
5611
5612 // ------------------------------------------------------------------------------ //
5613 // Dynamic Defect Pixel enable: 0=off, 1=on
5614 // ------------------------------------------------------------------------------ //
5615
5616 #define ACAMERA_ISP_RAW_FRONTEND_DP_ENABLE_DEFAULT (1)
5617 #define ACAMERA_ISP_RAW_FRONTEND_DP_ENABLE_DATASIZE (1)
5618 #define ACAMERA_ISP_RAW_FRONTEND_DP_ENABLE_OFFSET (0x404)
5619 #define ACAMERA_ISP_RAW_FRONTEND_DP_ENABLE_MASK (0x4)
5620
5621 // args: data (1-bit)
acamera_isp_raw_frontend_dp_enable_write(uintptr_t base,uint8_t data)5622 static __inline void acamera_isp_raw_frontend_dp_enable_write(uintptr_t base, uint8_t data) {
5623 uint32_t curr = system_sw_read_32(base + 0x1928cL);
5624 system_sw_write_32(base + 0x1928cL, (((uint32_t) (data & 0x1)) << 2) | (curr & 0xfffffffb));
5625 }
acamera_isp_raw_frontend_dp_enable_read(uintptr_t base)5626 static __inline uint8_t acamera_isp_raw_frontend_dp_enable_read(uintptr_t base) {
5627 return (uint8_t)((system_sw_read_32(base + 0x1928cL) & 0x4) >> 2);
5628 }
5629 // ------------------------------------------------------------------------------ //
5630 // Register: show dynamic defect pixel
5631 // ------------------------------------------------------------------------------ //
5632
5633 // ------------------------------------------------------------------------------ //
5634 // Show Defect Pixel: 0=off, 1=on
5635 // ------------------------------------------------------------------------------ //
5636
5637 #define ACAMERA_ISP_RAW_FRONTEND_SHOW_DYNAMIC_DEFECT_PIXEL_DEFAULT (0)
5638 #define ACAMERA_ISP_RAW_FRONTEND_SHOW_DYNAMIC_DEFECT_PIXEL_DATASIZE (1)
5639 #define ACAMERA_ISP_RAW_FRONTEND_SHOW_DYNAMIC_DEFECT_PIXEL_OFFSET (0x404)
5640 #define ACAMERA_ISP_RAW_FRONTEND_SHOW_DYNAMIC_DEFECT_PIXEL_MASK (0x8)
5641
5642 // args: data (1-bit)
acamera_isp_raw_frontend_show_dynamic_defect_pixel_write(uintptr_t base,uint8_t data)5643 static __inline void acamera_isp_raw_frontend_show_dynamic_defect_pixel_write(uintptr_t base, uint8_t data) {
5644 uint32_t curr = system_sw_read_32(base + 0x1928cL);
5645 system_sw_write_32(base + 0x1928cL, (((uint32_t) (data & 0x1)) << 3) | (curr & 0xfffffff7));
5646 }
acamera_isp_raw_frontend_show_dynamic_defect_pixel_read(uintptr_t base)5647 static __inline uint8_t acamera_isp_raw_frontend_show_dynamic_defect_pixel_read(uintptr_t base) {
5648 return (uint8_t)((system_sw_read_32(base + 0x1928cL) & 0x8) >> 3);
5649 }
5650 // ------------------------------------------------------------------------------ //
5651 // Register: dark disable
5652 // ------------------------------------------------------------------------------ //
5653
5654 // ------------------------------------------------------------------------------ //
5655 // Disable detection of dark pixels
5656 // ------------------------------------------------------------------------------ //
5657
5658 #define ACAMERA_ISP_RAW_FRONTEND_DARK_DISABLE_DEFAULT (0)
5659 #define ACAMERA_ISP_RAW_FRONTEND_DARK_DISABLE_DATASIZE (1)
5660 #define ACAMERA_ISP_RAW_FRONTEND_DARK_DISABLE_OFFSET (0x404)
5661 #define ACAMERA_ISP_RAW_FRONTEND_DARK_DISABLE_MASK (0x40)
5662
5663 // args: data (1-bit)
acamera_isp_raw_frontend_dark_disable_write(uintptr_t base,uint8_t data)5664 static __inline void acamera_isp_raw_frontend_dark_disable_write(uintptr_t base, uint8_t data) {
5665 uint32_t curr = system_sw_read_32(base + 0x1928cL);
5666 system_sw_write_32(base + 0x1928cL, (((uint32_t) (data & 0x1)) << 6) | (curr & 0xffffffbf));
5667 }
acamera_isp_raw_frontend_dark_disable_read(uintptr_t base)5668