2 * -------------------------------------------
\r
3 * CC3220 SDK - v0.10.00.00
\r
4 * -------------------------------------------
\r
6 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
\r
8 * Redistribution and use in source and binary forms, with or without
\r
9 * modification, are permitted provided that the following conditions
\r
12 * Redistributions of source code must retain the above copyright
\r
13 * notice, this list of conditions and the following disclaimer.
\r
15 * Redistributions in binary form must reproduce the above copyright
\r
16 * notice, this list of conditions and the following disclaimer in the
\r
17 * documentation and/or other materials provided with the
\r
20 * Neither the name of Texas Instruments Incorporated nor the names of
\r
21 * its contributors may be used to endorse or promote products derived
\r
22 * from this software without specific prior written permission.
\r
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
\r
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
\r
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
\r
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
\r
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
\r
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
\r
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
\r
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
\r
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
\r
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
\r
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
38 #ifndef __HW_CAMERA_H__
\r
39 #define __HW_CAMERA_H__
\r
41 //*****************************************************************************
\r
43 // The following are defines for the CAMERA register offsets.
\r
45 //*****************************************************************************
\r
46 #define CAMERA_O_CC_REVISION 0x00000000 // This register contains the IP
\r
47 // revision code ( Parallel Mode)
\r
48 #define CAMERA_O_CC_SYSCONFIG 0x00000010 // This register controls the
\r
49 // various parameters of the OCP
\r
50 // interface (CCP and Parallel Mode)
\r
51 #define CAMERA_O_CC_SYSSTATUS 0x00000014 // This register provides status
\r
52 // information about the module
\r
53 // excluding the interrupt status
\r
54 // information (CCP and Parallel
\r
56 #define CAMERA_O_CC_IRQSTATUS 0x00000018 // The interrupt status regroups
\r
57 // all the status of the module
\r
58 // internal events that can generate
\r
59 // an interrupt (CCP & Parallel
\r
61 #define CAMERA_O_CC_IRQENABLE 0x0000001C // The interrupt enable register
\r
62 // allows to enable/disable the
\r
63 // module internal sources of
\r
64 // interrupt on an event-by-event
\r
65 // basis (CCP & Parallel Mode)
\r
66 #define CAMERA_O_CC_CTRL 0x00000040 // This register controls the
\r
67 // various parameters of the Camera
\r
68 // Core block (CCP & Parallel Mode)
\r
69 #define CAMERA_O_CC_CTRL_DMA 0x00000044 // This register controls the DMA
\r
70 // interface of the Camera Core
\r
71 // block (CCP & Parallel Mode)
\r
72 #define CAMERA_O_CC_CTRL_XCLK 0x00000048 // This register control the value
\r
73 // of the clock divisor used to
\r
74 // generate the external clock
\r
76 #define CAMERA_O_CC_FIFO_DATA 0x0000004C // This register allows to write to
\r
77 // the FIFO and read from the FIFO
\r
78 // (CCP & Parallel Mode)
\r
79 #define CAMERA_O_CC_TEST 0x00000050 // This register shows the status
\r
80 // of some important variables of
\r
81 // the camera core module (CCP &
\r
83 #define CAMERA_O_CC_GEN_PAR 0x00000054 // This register shows the values
\r
84 // of the generic parameters of the
\r
89 //******************************************************************************
\r
91 // The following are defines for the bit fields in the
\r
92 // CAMERA_O_CC_REVISION register.
\r
94 //******************************************************************************
\r
95 #define CAMERA_CC_REVISION_REV_M \
\r
96 0x000000FF // IP revision [7:4] Major revision
\r
97 // [3:0] Minor revision Examples:
\r
98 // 0x10 for 1.0 0x21 for 2.1
\r
100 #define CAMERA_CC_REVISION_REV_S 0
\r
101 //******************************************************************************
\r
103 // The following are defines for the bit fields in the
\r
104 // CAMERA_O_CC_SYSCONFIG register.
\r
106 //******************************************************************************
\r
107 #define CAMERA_CC_SYSCONFIG_S_IDLE_MODE_M \
\r
108 0x00000018 // Slave interface power management
\r
109 // req/ack control """00""
\r
110 // Force-idle. An idle request is
\r
111 // acknoledged unconditionally"
\r
112 // """01"" No-idle. An idle request
\r
113 // is never acknowledged" """10""
\r
114 // reserved (Smart-idle not
\r
117 #define CAMERA_CC_SYSCONFIG_S_IDLE_MODE_S 3
\r
118 #define CAMERA_CC_SYSCONFIG_SOFT_RESET \
\r
119 0x00000002 // Software reset. Set this bit to
\r
120 // 1 to trigger a module reset. The
\r
121 // bit is automatically reset by the
\r
122 // hardware. During reset it always
\r
123 // returns 0. 0 Normal mode 1 The
\r
126 #define CAMERA_CC_SYSCONFIG_AUTO_IDLE \
\r
127 0x00000001 // Internal OCP clock gating
\r
128 // strategy 0 OCP clock is
\r
129 // free-running 1 Automatic OCP
\r
130 // clock gating strategy is applied
\r
131 // based on the OCP interface
\r
134 //******************************************************************************
\r
136 // The following are defines for the bit fields in the
\r
137 // CAMERA_O_CC_SYSSTATUS register.
\r
139 //******************************************************************************
\r
140 #define CAMERA_CC_SYSSTATUS_RESET_DONE2 \
\r
141 0x00000001 // Internal Reset Monitoring 0
\r
142 // Internal module reset is on-going
\r
143 // 1 Reset completed
\r
145 //******************************************************************************
\r
147 // The following are defines for the bit fields in the
\r
148 // CAMERA_O_CC_IRQSTATUS register.
\r
150 //******************************************************************************
\r
151 #define CAMERA_CC_IRQSTATUS_FS_IRQ \
\r
152 0x00080000 // Frame Start has occurred 0 Event
\r
153 // false "1 Event is true
\r
154 // (""pending"")" 0 Event status bit
\r
155 // unchanged 1 Event status bit is
\r
158 #define CAMERA_CC_IRQSTATUS_LE_IRQ \
\r
159 0x00040000 // Line End has occurred 0 Event
\r
160 // false "1 Event is true
\r
161 // (""pending"")" 0 Event status bit
\r
162 // unchanged 1 Event status bit is
\r
165 #define CAMERA_CC_IRQSTATUS_LS_IRQ \
\r
166 0x00020000 // Line Start has occurred 0 Event
\r
167 // false "1 Event is true
\r
168 // (""pending"")" 0 Event status bit
\r
169 // unchanged 1 Event status bit is
\r
172 #define CAMERA_CC_IRQSTATUS_FE_IRQ \
\r
173 0x00010000 // Frame End has occurred 0 Event
\r
174 // false "1 Event is true
\r
175 // (""pending"")" 0 Event status bit
\r
176 // unchanged 1 Event status bit is
\r
179 #define CAMERA_CC_IRQSTATUS_FSP_ERR_IRQ \
\r
180 0x00000800 // FSP code error 0 Event false "1
\r
181 // Event is true (""pending"")" 0
\r
182 // Event status bit unchanged 1
\r
183 // Event status bit is reset
\r
185 #define CAMERA_CC_IRQSTATUS_FW_ERR_IRQ \
\r
186 0x00000400 // Frame Height Error 0 Event false
\r
187 // "1 Event is true (""pending"")" 0
\r
188 // Event status bit unchanged 1
\r
189 // Event status bit is reset
\r
191 #define CAMERA_CC_IRQSTATUS_FSC_ERR_IRQ \
\r
192 0x00000200 // False Synchronization Code 0
\r
193 // Event false "1 Event is true
\r
194 // (""pending"")" 0 Event status bit
\r
195 // unchanged 1 Event status bit is
\r
198 #define CAMERA_CC_IRQSTATUS_SSC_ERR_IRQ \
\r
199 0x00000100 // Shifted Synchronization Code 0
\r
200 // Event false "1 Event is true
\r
201 // (""pending"")" 0 Event status bit
\r
202 // unchanged 1 Event status bit is
\r
205 #define CAMERA_CC_IRQSTATUS_FIFO_NONEMPTY_IRQ \
\r
206 0x00000010 // FIFO is not empty 0 Event false
\r
207 // "1 Event is true (""pending"")" 0
\r
208 // Event status bit unchanged 1
\r
209 // Event status bit is reset
\r
211 #define CAMERA_CC_IRQSTATUS_FIFO_FULL_IRQ \
\r
212 0x00000008 // FIFO is full 0 Event false "1
\r
213 // Event is true (""pending"")" 0
\r
214 // Event status bit unchanged 1
\r
215 // Event status bit is reset
\r
217 #define CAMERA_CC_IRQSTATUS_FIFO_THR_IRQ \
\r
218 0x00000004 // FIFO threshold has been reached
\r
219 // 0 Event false "1 Event is true
\r
220 // (""pending"")" 0 Event status bit
\r
221 // unchanged 1 Event status bit is
\r
224 #define CAMERA_CC_IRQSTATUS_FIFO_OF_IRQ \
\r
225 0x00000002 // FIFO overflow has occurred 0
\r
226 // Event false "1 Event is true
\r
227 // (""pending"")" 0 Event status bit
\r
228 // unchanged 1 Event status bit is
\r
231 #define CAMERA_CC_IRQSTATUS_FIFO_UF_IRQ \
\r
232 0x00000001 // FIFO underflow has occurred 0
\r
233 // Event false "1 Event is true
\r
234 // (""pending"")" 0 Event status bit
\r
235 // unchanged 1 Event status bit is
\r
238 //******************************************************************************
\r
240 // The following are defines for the bit fields in the
\r
241 // CAMERA_O_CC_IRQENABLE register.
\r
243 //******************************************************************************
\r
244 #define CAMERA_CC_IRQENABLE_FS_IRQ_EN \
\r
245 0x00080000 // Frame Start Interrupt Enable 0
\r
246 // Event is masked 1 Event generates
\r
247 // an interrupt when it occurs
\r
249 #define CAMERA_CC_IRQENABLE_LE_IRQ_EN \
\r
250 0x00040000 // Line End Interrupt Enable 0
\r
251 // Event is masked 1 Event generates
\r
252 // an interrupt when it occurs
\r
254 #define CAMERA_CC_IRQENABLE_LS_IRQ_EN \
\r
255 0x00020000 // Line Start Interrupt Enable 0
\r
256 // Event is masked 1 Event generates
\r
257 // an interrupt when it occurs
\r
259 #define CAMERA_CC_IRQENABLE_FE_IRQ_EN \
\r
260 0x00010000 // Frame End Interrupt Enable 0
\r
261 // Event is masked 1 Event generates
\r
262 // an interrupt when it occurs
\r
264 #define CAMERA_CC_IRQENABLE_FSP_IRQ_EN \
\r
265 0x00000800 // FSP code Interrupt Enable 0
\r
266 // Event is masked 1 Event generates
\r
267 // an interrupt when it occurs
\r
269 #define CAMERA_CC_IRQENABLE_FW_ERR_IRQ_EN \
\r
270 0x00000400 // Frame Height Error Interrupt
\r
271 // Enable 0 Event is masked 1 Event
\r
272 // generates an interrupt when it
\r
275 #define CAMERA_CC_IRQENABLE_FSC_ERR_IRQ_EN \
\r
276 0x00000200 // False Synchronization Code
\r
277 // Interrupt Enable 0 Event is
\r
278 // masked 1 Event generates an
\r
279 // interrupt when it occurs
\r
281 #define CAMERA_CC_IRQENABLE_SSC_ERR_IRQ_EN \
\r
282 0x00000100 // False Synchronization Code
\r
283 // Interrupt Enable 0 Event is
\r
284 // masked 1 Event generates an
\r
285 // interrupt when it occurs
\r
287 #define CAMERA_CC_IRQENABLE_FIFO_NONEMPTY_IRQ_EN \
\r
288 0x00000010 // FIFO Threshold Interrupt Enable
\r
289 // 0 Event is masked 1 Event
\r
290 // generates an interrupt when it
\r
293 #define CAMERA_CC_IRQENABLE_FIFO_FULL_IRQ_EN \
\r
294 0x00000008 // FIFO Threshold Interrupt Enable
\r
295 // 0 Event is masked 1 Event
\r
296 // generates an interrupt when it
\r
299 #define CAMERA_CC_IRQENABLE_FIFO_THR_IRQ_EN \
\r
300 0x00000004 // FIFO Threshold Interrupt Enable
\r
301 // 0 Event is masked 1 Event
\r
302 // generates an interrupt when it
\r
305 #define CAMERA_CC_IRQENABLE_FIFO_OF_IRQ_EN \
\r
306 0x00000002 // FIFO Overflow Interrupt Enable 0
\r
307 // Event is masked 1 Event generates
\r
308 // an interrupt when it occurs
\r
310 #define CAMERA_CC_IRQENABLE_FIFO_UF_IRQ_EN \
\r
311 0x00000001 // FIFO Underflow Interrupt Enable
\r
312 // 0 Event is masked 1 Event
\r
313 // generates an interrupt when it
\r
316 //******************************************************************************
\r
318 // The following are defines for the bit fields in the CAMERA_O_CC_CTRL register.
\r
320 //******************************************************************************
\r
321 #define CAMERA_CC_CTRL_CC_IF_SYNCHRO \
\r
322 0x00080000 // Synchronize all camera sensor
\r
323 // inputs This must be set during
\r
324 // the configuration phase before
\r
325 // CC_EN set to '1'. This can be
\r
326 // used in very high frequency to
\r
327 // avoid dependancy to the IO
\r
328 // timings. 0 No synchro (most of
\r
329 // applications) 1 Synchro enabled
\r
330 // (should never be required)
\r
332 #define CAMERA_CC_CTRL_CC_RST 0x00040000 // Resets all the internal finite
\r
333 // states machines of the camera
\r
334 // core module - by writing a 1 to
\r
335 // this bit. must be applied when
\r
336 // CC_EN = 0 Reads returns 0
\r
337 #define CAMERA_CC_CTRL_CC_FRAME_TRIG \
\r
338 0x00020000 // Set the modality in which CC_EN
\r
339 // works when a disabling of the
\r
340 // sensor camera core is wanted "If
\r
341 // CC_FRAME_TRIG = 1 by writing
\r
342 // ""0"" to CC_EN" the module is
\r
343 // disabled at the end of the frame
\r
344 // "If CC_FRAME_TRIG = 0 by writing
\r
345 // ""0"" to CC_EN" the module is
\r
346 // disabled immediately
\r
348 #define CAMERA_CC_CTRL_CC_EN 0x00010000 // Enables the sensor interface of
\r
349 // the camera core module "By
\r
350 // writing ""1"" to this field the
\r
351 // module is enabled." "By writing
\r
352 // ""0"" to this field the module is
\r
353 // disabled at" the end of the frame
\r
354 // if CC_FRAM_TRIG =1 and is
\r
355 // disabled immediately if
\r
356 // CC_FRAM_TRIG = 0
\r
357 #define CAMERA_CC_CTRL_NOBT_SYNCHRO \
\r
358 0x00002000 // Enables to start at the
\r
359 // beginning of the frame or not in
\r
360 // NoBT 0 Acquisition starts when
\r
361 // Vertical synchro is high 1
\r
362 // Acquisition starts when Vertical
\r
363 // synchro goes from low to high
\r
364 // (beginning of the frame) -
\r
367 #define CAMERA_CC_CTRL_BT_CORRECT \
\r
368 0x00001000 // Enables the correction within
\r
369 // the sync codes in BT mode 0
\r
370 // correction is not enabled 1
\r
371 // correction is enabled
\r
373 #define CAMERA_CC_CTRL_PAR_ORDERCAM \
\r
374 0x00000800 // Enables swap between image-data
\r
375 // in parallel mode 0 swap is not
\r
376 // enabled 1 swap is enabled
\r
378 #define CAMERA_CC_CTRL_PAR_CLK_POL \
\r
379 0x00000400 // Inverts the clock coming from
\r
380 // the sensor in parallel mode 0
\r
381 // clock not inverted - data sampled
\r
382 // on rising edge 1 clock inverted -
\r
383 // data sampled on falling edge
\r
385 #define CAMERA_CC_CTRL_NOBT_HS_POL \
\r
386 0x00000200 // Sets the polarity of the
\r
387 // synchronization signals in NOBT
\r
388 // parallel mode 0 CAM_P_HS is
\r
389 // active high 1 CAM_P_HS is active
\r
392 #define CAMERA_CC_CTRL_NOBT_VS_POL \
\r
393 0x00000100 // Sets the polarity of the
\r
394 // synchronization signals in NOBT
\r
395 // parallel mode 0 CAM_P_VS is
\r
396 // active high 1 CAM_P_VS is active
\r
399 #define CAMERA_CC_CTRL_PAR_MODE_M \
\r
400 0x0000000E // Sets the Protocol Mode of the
\r
401 // Camera Core module in parallel
\r
402 // mode (when CCP_MODE = 0) """000""
\r
403 // Parallel NOBT 8-bit" """001""
\r
404 // Parallel NOBT 10-bit" """010""
\r
405 // Parallel NOBT 12-bit" """011""
\r
406 // reserved" """100"" Parallet BT
\r
407 // 8-bit" """101"" Parallel BT
\r
408 // 10-bit" """110"" reserved"
\r
409 // """111"" FIFO test mode. Refer to
\r
410 // Table 12 - FIFO Write and Read
\r
413 #define CAMERA_CC_CTRL_PAR_MODE_S 1
\r
414 #define CAMERA_CC_CTRL_CCP_MODE 0x00000001 // Set the Camera Core in CCP mode
\r
415 // 0 CCP mode disabled 1 CCP mode
\r
417 //******************************************************************************
\r
419 // The following are defines for the bit fields in the
\r
420 // CAMERA_O_CC_CTRL_DMA register.
\r
422 //******************************************************************************
\r
423 #define CAMERA_CC_CTRL_DMA_DMA_EN \
\r
424 0x00000100 // Sets the number of dma request
\r
425 // lines 0 DMA interface disabled
\r
426 // The DMA request line stays
\r
427 // inactive 1 DMA interface enabled
\r
428 // The DMA request line is
\r
431 #define CAMERA_CC_CTRL_DMA_FIFO_THRESHOLD_M \
\r
432 0x0000007F // Sets the threshold of the FIFO
\r
433 // the assertion of the dmarequest
\r
434 // line takes place when the
\r
435 // threshold is reached.
\r
436 // """0000000"" threshold set to 1"
\r
437 // """0000001"" threshold set to 2"
\r
438 // … """1111111"" threshold set to
\r
441 #define CAMERA_CC_CTRL_DMA_FIFO_THRESHOLD_S 0
\r
442 //******************************************************************************
\r
444 // The following are defines for the bit fields in the
\r
445 // CAMERA_O_CC_CTRL_XCLK register.
\r
447 //******************************************************************************
\r
448 #define CAMERA_CC_CTRL_XCLK_XCLK_DIV_M \
\r
449 0x0000001F // Sets the clock divisor value for
\r
450 // CAM_XCLK generation. based on
\r
451 // CAM_MCK (value of CAM_MCLK is
\r
452 // 96MHz) """00000"" CAM_XCLK Stable
\r
453 // Low Level" Divider not enabled
\r
454 // """00001"" CAM_XCLK Stable High
\r
455 // Level" Divider not enabled from 2
\r
456 // to 30 CAM_XCLK = CAM_MCLK /
\r
457 // XCLK_DIV """11111"" Bypass -
\r
458 // CAM_XCLK = CAM_MCLK"
\r
460 #define CAMERA_CC_CTRL_XCLK_XCLK_DIV_S 0
\r
461 //******************************************************************************
\r
463 // The following are defines for the bit fields in the
\r
464 // CAMERA_O_CC_FIFO_DATA register.
\r
466 //******************************************************************************
\r
467 #define CAMERA_CC_FIFO_DATA_FIFO_DATA_M \
\r
468 0xFFFFFFFF // Writes the 32-bit word into the
\r
469 // FIFO Reads the 32-bit word from
\r
472 #define CAMERA_CC_FIFO_DATA_FIFO_DATA_S 0
\r
473 //******************************************************************************
\r
475 // The following are defines for the bit fields in the CAMERA_O_CC_TEST register.
\r
477 //******************************************************************************
\r
478 #define CAMERA_CC_TEST_FIFO_RD_POINTER_M \
\r
479 0xFF000000 // FIFO READ Pointer This field
\r
480 // shows the value of the FIFO read
\r
481 // pointer Expected value ranges
\r
484 #define CAMERA_CC_TEST_FIFO_RD_POINTER_S 24
\r
485 #define CAMERA_CC_TEST_FIFO_WR_POINTER_M \
\r
486 0x00FF0000 // FIFO WRITE pointer This field
\r
487 // shows the value of the FIFO write
\r
488 // pointer Expected value ranges
\r
491 #define CAMERA_CC_TEST_FIFO_WR_POINTER_S 16
\r
492 #define CAMERA_CC_TEST_FIFO_LEVEL_M \
\r
493 0x0000FF00 // FIFO level (how many 32-bit
\r
494 // words the FIFO contains) This
\r
495 // field shows the value of the FIFO
\r
496 // level and can assume values from
\r
499 #define CAMERA_CC_TEST_FIFO_LEVEL_S 8
\r
500 #define CAMERA_CC_TEST_FIFO_LEVEL_PEAK_M \
\r
501 0x000000FF // FIFO level peak This field shows
\r
502 // the max value of the FIFO level
\r
503 // and can assume values from 0 to
\r
506 #define CAMERA_CC_TEST_FIFO_LEVEL_PEAK_S 0
\r
507 //******************************************************************************
\r
509 // The following are defines for the bit fields in the
\r
510 // CAMERA_O_CC_GEN_PAR register.
\r
512 //******************************************************************************
\r
513 #define CAMERA_CC_GEN_PAR_CC_FIFO_DEPTH_M \
\r
514 0x00000007 // Camera Core FIFO DEPTH generic
\r
517 #define CAMERA_CC_GEN_PAR_CC_FIFO_DEPTH_S 0
\r
521 #endif // __HW_CAMERA_H__
\r