CameraCC32XXDMA.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2019, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
48 #ifndef ti_drivers_Camera_CameraCC32XXDMA__include
49 #define ti_drivers_Camera_CameraCC32XXDMA__include
50 
51 #include <stdint.h>
52 #include <stdbool.h>
53 #include <ti/drivers/Camera.h>
54 #include <ti/drivers/dpl/HwiP.h>
55 #include <ti/drivers/dpl/SemaphoreP.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
71 /* Add CameraCC32XXDMA_STATUS_* macros here */
72 
85 /* Add CameraCC32XXDMA_CMD_* macros here */
86 
89 /* CC32XX camera DMA transfer size */
90 #define CameraCC32XXDMA_DMA_TRANSFER_SIZE 64
91 
92 /* Camera function table pointer */
94 
124 typedef struct {
126  uint32_t baseAddr;
128  uint32_t intNum;
130  uint32_t intPriority;
132  unsigned long channelIndex;
134 
140 typedef struct {
141  /* Camera control variables */
142  bool opened; /* Has the obj been opened */
143  Camera_CaptureMode operationMode; /* Mode of operation of Camera */
144 
145  /* Camera capture variables */
146  Camera_Callback captureCallback; /* Pointer to capture callback */
147  uint32_t captureTimeout; /* Timeout for capture semaphore */
148  void *captureBuf; /* Buffer data pointer */
149  size_t bufferlength; /* Input Buffer length*/
150  size_t frameLength; /* Captured frame length */
151 
152  bool cameraDMA_PingPongMode; /* DMA ping pong mode */
153  size_t cameraDMAxIntrRcvd; /* Number of DMA interrupts*/
154  bool inUse; /* Camera in Use */
155 
156  /* Camera OS objects */
157  SemaphoreP_Handle captureSem;
158  HwiP_Handle hwiHandle;
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif /* ti_drivers_Camera_CameraCC32XXDMA__include */
CameraCC32XXDMA Hardware attributes.
Definition: CameraCC32XXDMA.h:124
CameraCC32XXDMA Object.
Definition: CameraCC32XXDMA.h:140
Camera_CaptureMode operationMode
Definition: CameraCC32XXDMA.h:143
The definition of a Camera function table that contains the required set of functions to control a sp...
Definition: Camera.h:476
uint32_t intNum
Definition: CameraCC32XXDMA.h:128
size_t cameraDMAxIntrRcvd
Definition: CameraCC32XXDMA.h:153
unsigned long channelIndex
Definition: CameraCC32XXDMA.h:132
void(* Camera_Callback)(Camera_Handle handle, void *buf, size_t frameLength)
The definition of a callback function used by the Camera driver when used in Camera_MODE_CALLBACK.
Definition: Camera.h:283
bool opened
Definition: CameraCC32XXDMA.h:142
uint32_t intPriority
Definition: CameraCC32XXDMA.h:130
const Camera_FxnTable CameraCC32XXDMA_fxnTable
uint32_t baseAddr
Definition: CameraCC32XXDMA.h:126
void * captureBuf
Definition: CameraCC32XXDMA.h:148
uint32_t captureTimeout
Definition: CameraCC32XXDMA.h:147
size_t frameLength
Definition: CameraCC32XXDMA.h:150
bool cameraDMA_PingPongMode
Definition: CameraCC32XXDMA.h:152
HwiP_Handle hwiHandle
Definition: CameraCC32XXDMA.h:158
Camera_CaptureMode
Camera capture mode settings.
Definition: Camera.h:292
struct CameraCC32XXDMA_Object * CameraCC32XXDMA_Handle
bool inUse
Definition: CameraCC32XXDMA.h:154
Camera driver interface.
size_t bufferlength
Definition: CameraCC32XXDMA.h:149
SemaphoreP_Handle captureSem
Definition: CameraCC32XXDMA.h:157
Camera_Callback captureCallback
Definition: CameraCC32XXDMA.h:146
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale