CameraCC32XXDMA.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, 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 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 #include <stdint.h>
56 #include <stdbool.h>
57 #include <ti/drivers/Camera.h>
58 #include <ti/drivers/dpl/HwiP.h>
59 #include <ti/drivers/dpl/SemaphoreP.h>
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 
126 typedef struct CameraCC32XXDMA_HWAttrs {
128  uint32_t baseAddr;
130  uint32_t intNum;
132  uint32_t intPriority;
134  unsigned long channelIndex;
136 
142 typedef struct CameraCC32XXDMA_Object {
143  /* Camera control variables */
144  bool opened; /* Has the obj been opened */
145  Camera_CaptureMode operationMode; /* Mode of operation of Camera */
146 
147  /* Camera capture variables */
148  Camera_Callback captureCallback; /* Pointer to capture callback */
149  uint32_t captureTimeout; /* Timeout for capture semaphore */
150  void *captureBuf; /* Buffer data pointer */
151  size_t bufferlength; /* Input Buffer length*/
152  size_t frameLength; /* Captured frame length */
153 
154  bool cameraDMA_PingPongMode; /* DMA ping pong mode */
155  size_t cameraDMAxIntrRcvd; /* Number of DMA interrupts*/
156  bool inUse; /* Camera in Use */
157 
158  /* Camera OS objects */
159  SemaphoreP_Handle captureSem;
160  HwiP_Handle hwiHandle;
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif /* ti_drivers_Camera_CameraCC32XXDMA__include */
CameraCC32XXDMA Hardware attributes.
Definition: CameraCC32XXDMA.h:126
CameraCC32XXDMA Object.
Definition: CameraCC32XXDMA.h:142
Camera_CaptureMode operationMode
Definition: CameraCC32XXDMA.h:145
uint32_t intNum
Definition: CameraCC32XXDMA.h:130
size_t cameraDMAxIntrRcvd
Definition: CameraCC32XXDMA.h:155
unsigned long channelIndex
Definition: CameraCC32XXDMA.h:134
struct CameraCC32XXDMA_HWAttrs CameraCC32XXDMA_HWAttrs
CameraCC32XXDMA Hardware attributes.
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:144
uint32_t intPriority
Definition: CameraCC32XXDMA.h:132
const Camera_FxnTable CameraCC32XXDMA_fxnTable
struct CameraCC32XXDMA_Object CameraCC32XXDMA_Object
CameraCC32XXDMA Object.
enum Camera_CaptureMode_ Camera_CaptureMode
Camera capture mode settings.
The definition of a Camera function table that contains the required set of functions to control a sp...
Definition: Camera.h:476
uint32_t baseAddr
Definition: CameraCC32XXDMA.h:128
void * captureBuf
Definition: CameraCC32XXDMA.h:150
uint32_t captureTimeout
Definition: CameraCC32XXDMA.h:149
size_t frameLength
Definition: CameraCC32XXDMA.h:152
bool cameraDMA_PingPongMode
Definition: CameraCC32XXDMA.h:154
HwiP_Handle hwiHandle
Definition: CameraCC32XXDMA.h:160
bool inUse
Definition: CameraCC32XXDMA.h:156
Camera driver interface.
size_t bufferlength
Definition: CameraCC32XXDMA.h:151
struct CameraCC32XXDMA_Object * CameraCC32XXDMA_Handle
SemaphoreP_Handle captureSem
Definition: CameraCC32XXDMA.h:159
Camera_Callback captureCallback
Definition: CameraCC32XXDMA.h:148
Copyright 2017, Texas Instruments Incorporated