patch for F746 demo

Dependents:   F7DISCO_Demo

Fork of BSP_DISCO_F746NG by ST

Committer:
NirT
Date:
Mon Nov 02 23:35:17 2015 +0000
Revision:
1:e8fac4061a5b
Error: Incomplete type is not allowed in "patch/LwIP/src/include/lwip/dhcp.h", Line: 83, Col: 4; ; and more like this.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NirT 1:e8fac4061a5b 1 /**
NirT 1:e8fac4061a5b 2 ******************************************************************************
NirT 1:e8fac4061a5b 3 * @file stm32746g_discovery_camera.c
NirT 1:e8fac4061a5b 4 * @author MCD Application Team
NirT 1:e8fac4061a5b 5 * @version V1.0.0
NirT 1:e8fac4061a5b 6 * @date 25-June-2015
NirT 1:e8fac4061a5b 7 * @brief This file includes the driver for Camera modules mounted on
NirT 1:e8fac4061a5b 8 * STM32746G-Discovery board.
NirT 1:e8fac4061a5b 9 @verbatim
NirT 1:e8fac4061a5b 10 How to use this driver:
NirT 1:e8fac4061a5b 11 ------------------------
NirT 1:e8fac4061a5b 12 - This driver is used to drive the camera.
NirT 1:e8fac4061a5b 13 - The OV9655 component driver MUST be included with this driver.
NirT 1:e8fac4061a5b 14
NirT 1:e8fac4061a5b 15 Driver description:
NirT 1:e8fac4061a5b 16 -------------------
NirT 1:e8fac4061a5b 17 + Initialization steps:
NirT 1:e8fac4061a5b 18 o Initialize the camera using the BSP_CAMERA_Init() function.
NirT 1:e8fac4061a5b 19 o Start the camera capture/snapshot using the CAMERA_Start() function.
NirT 1:e8fac4061a5b 20 o Suspend, resume or stop the camera capture using the following functions:
NirT 1:e8fac4061a5b 21 - BSP_CAMERA_Suspend()
NirT 1:e8fac4061a5b 22 - BSP_CAMERA_Resume()
NirT 1:e8fac4061a5b 23 - BSP_CAMERA_Stop()
NirT 1:e8fac4061a5b 24
NirT 1:e8fac4061a5b 25 + Options
NirT 1:e8fac4061a5b 26 o Increase or decrease on the fly the brightness and/or contrast
NirT 1:e8fac4061a5b 27 using the following function:
NirT 1:e8fac4061a5b 28 - BSP_CAMERA_ContrastBrightnessConfig
NirT 1:e8fac4061a5b 29 o Add a special effect on the fly using the following functions:
NirT 1:e8fac4061a5b 30 - BSP_CAMERA_BlackWhiteConfig()
NirT 1:e8fac4061a5b 31 - BSP_CAMERA_ColorEffectConfig()
NirT 1:e8fac4061a5b 32 @endverbatim
NirT 1:e8fac4061a5b 33 ******************************************************************************
NirT 1:e8fac4061a5b 34 * @attention
NirT 1:e8fac4061a5b 35 *
NirT 1:e8fac4061a5b 36 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
NirT 1:e8fac4061a5b 37 *
NirT 1:e8fac4061a5b 38 * Redistribution and use in source and binary forms, with or without modification,
NirT 1:e8fac4061a5b 39 * are permitted provided that the following conditions are met:
NirT 1:e8fac4061a5b 40 * 1. Redistributions of source code must retain the above copyright notice,
NirT 1:e8fac4061a5b 41 * this list of conditions and the following disclaimer.
NirT 1:e8fac4061a5b 42 * 2. Redistributions in binary form must reproduce the above copyright notice,
NirT 1:e8fac4061a5b 43 * this list of conditions and the following disclaimer in the documentation
NirT 1:e8fac4061a5b 44 * and/or other materials provided with the distribution.
NirT 1:e8fac4061a5b 45 * 3. Neither the name of STMicroelectronics nor the names of its contributors
NirT 1:e8fac4061a5b 46 * may be used to endorse or promote products derived from this software
NirT 1:e8fac4061a5b 47 * without specific prior written permission.
NirT 1:e8fac4061a5b 48 *
NirT 1:e8fac4061a5b 49 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
NirT 1:e8fac4061a5b 50 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
NirT 1:e8fac4061a5b 51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
NirT 1:e8fac4061a5b 52 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
NirT 1:e8fac4061a5b 53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
NirT 1:e8fac4061a5b 54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
NirT 1:e8fac4061a5b 55 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
NirT 1:e8fac4061a5b 56 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
NirT 1:e8fac4061a5b 57 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
NirT 1:e8fac4061a5b 58 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NirT 1:e8fac4061a5b 59 *
NirT 1:e8fac4061a5b 60 ******************************************************************************
NirT 1:e8fac4061a5b 61 */
NirT 1:e8fac4061a5b 62
NirT 1:e8fac4061a5b 63 /* Includes ------------------------------------------------------------------*/
NirT 1:e8fac4061a5b 64 #include "stm32746g_discovery_camera.h"
NirT 1:e8fac4061a5b 65 #include "stm32746g_discovery.h"
NirT 1:e8fac4061a5b 66
NirT 1:e8fac4061a5b 67 /** @addtogroup BSP
NirT 1:e8fac4061a5b 68 * @{
NirT 1:e8fac4061a5b 69 */
NirT 1:e8fac4061a5b 70
NirT 1:e8fac4061a5b 71 /** @addtogroup STM32746G_DISCOVERY
NirT 1:e8fac4061a5b 72 * @{
NirT 1:e8fac4061a5b 73 */
NirT 1:e8fac4061a5b 74
NirT 1:e8fac4061a5b 75 /** @addtogroup STM32746G_DISCOVERY_CAMERA
NirT 1:e8fac4061a5b 76 * @{
NirT 1:e8fac4061a5b 77 */
NirT 1:e8fac4061a5b 78
NirT 1:e8fac4061a5b 79 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_TypesDefinitions STM32746G_DISCOVERY_CAMERA Private Types Definitions
NirT 1:e8fac4061a5b 80 * @{
NirT 1:e8fac4061a5b 81 */
NirT 1:e8fac4061a5b 82 /**
NirT 1:e8fac4061a5b 83 * @}
NirT 1:e8fac4061a5b 84 */
NirT 1:e8fac4061a5b 85
NirT 1:e8fac4061a5b 86 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_Defines STM32746G_DISCOVERY_CAMERA Private Defines
NirT 1:e8fac4061a5b 87 * @{
NirT 1:e8fac4061a5b 88 */
NirT 1:e8fac4061a5b 89 #define CAMERA_VGA_RES_X 640
NirT 1:e8fac4061a5b 90 #define CAMERA_VGA_RES_Y 480
NirT 1:e8fac4061a5b 91 #define CAMERA_480x272_RES_X 480
NirT 1:e8fac4061a5b 92 #define CAMERA_480x272_RES_Y 272
NirT 1:e8fac4061a5b 93 #define CAMERA_QVGA_RES_X 320
NirT 1:e8fac4061a5b 94 #define CAMERA_QVGA_RES_Y 240
NirT 1:e8fac4061a5b 95 #define CAMERA_QQVGA_RES_X 160
NirT 1:e8fac4061a5b 96 #define CAMERA_QQVGA_RES_Y 120
NirT 1:e8fac4061a5b 97 /**
NirT 1:e8fac4061a5b 98 * @}
NirT 1:e8fac4061a5b 99 */
NirT 1:e8fac4061a5b 100
NirT 1:e8fac4061a5b 101 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_Macros STM32746G_DISCOVERY_CAMERA Private Macros
NirT 1:e8fac4061a5b 102 * @{
NirT 1:e8fac4061a5b 103 */
NirT 1:e8fac4061a5b 104 /**
NirT 1:e8fac4061a5b 105 * @}
NirT 1:e8fac4061a5b 106 */
NirT 1:e8fac4061a5b 107
NirT 1:e8fac4061a5b 108 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_Variables STM32746G_DISCOVERY_CAMERA Private Variables
NirT 1:e8fac4061a5b 109 * @{
NirT 1:e8fac4061a5b 110 */
NirT 1:e8fac4061a5b 111 static DCMI_HandleTypeDef hDcmiHandler;
NirT 1:e8fac4061a5b 112 CAMERA_DrvTypeDef *camera_drv;
NirT 1:e8fac4061a5b 113 /* Camera current resolution naming (QQVGA, VGA, ...) */
NirT 1:e8fac4061a5b 114 static uint32_t CameraCurrentResolution;
NirT 1:e8fac4061a5b 115
NirT 1:e8fac4061a5b 116 /* Camera module I2C HW address */
NirT 1:e8fac4061a5b 117 static uint32_t CameraHwAddress;
NirT 1:e8fac4061a5b 118 /**
NirT 1:e8fac4061a5b 119 * @}
NirT 1:e8fac4061a5b 120 */
NirT 1:e8fac4061a5b 121
NirT 1:e8fac4061a5b 122 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_FunctionPrototypes STM32746G_DISCOVERY_CAMERA Private Function Prototypes
NirT 1:e8fac4061a5b 123 * @{
NirT 1:e8fac4061a5b 124 */
NirT 1:e8fac4061a5b 125 static uint32_t GetSize(uint32_t resolution);
NirT 1:e8fac4061a5b 126 /**
NirT 1:e8fac4061a5b 127 * @}
NirT 1:e8fac4061a5b 128 */
NirT 1:e8fac4061a5b 129
NirT 1:e8fac4061a5b 130 /** @defgroup STM32746G_DISCOVERY_CAMERA_Exported_Functions STM32746G_DISCOVERY_CAMERA Exported Functions
NirT 1:e8fac4061a5b 131 * @{
NirT 1:e8fac4061a5b 132 */
NirT 1:e8fac4061a5b 133
NirT 1:e8fac4061a5b 134 /**
NirT 1:e8fac4061a5b 135 * @brief Initializes the camera.
NirT 1:e8fac4061a5b 136 * @param Resolution : camera sensor requested resolution (x, y) : standard resolution
NirT 1:e8fac4061a5b 137 * naming QQVGA, QVGA, VGA ...
NirT 1:e8fac4061a5b 138 * @retval Camera status
NirT 1:e8fac4061a5b 139 */
NirT 1:e8fac4061a5b 140 uint8_t BSP_CAMERA_Init(uint32_t Resolution)
NirT 1:e8fac4061a5b 141 {
NirT 1:e8fac4061a5b 142 DCMI_HandleTypeDef *phdcmi;
NirT 1:e8fac4061a5b 143 uint8_t status = CAMERA_ERROR;
NirT 1:e8fac4061a5b 144
NirT 1:e8fac4061a5b 145 /* Get the DCMI handle structure */
NirT 1:e8fac4061a5b 146 phdcmi = &hDcmiHandler;
NirT 1:e8fac4061a5b 147
NirT 1:e8fac4061a5b 148 /*** Configures the DCMI to interface with the camera module ***/
NirT 1:e8fac4061a5b 149 /* DCMI configuration */
NirT 1:e8fac4061a5b 150 phdcmi->Init.CaptureRate = DCMI_CR_ALL_FRAME;
NirT 1:e8fac4061a5b 151 phdcmi->Init.HSPolarity = DCMI_HSPOLARITY_LOW;
NirT 1:e8fac4061a5b 152 phdcmi->Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
NirT 1:e8fac4061a5b 153 phdcmi->Init.VSPolarity = DCMI_VSPOLARITY_HIGH;
NirT 1:e8fac4061a5b 154 phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
NirT 1:e8fac4061a5b 155 phdcmi->Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;
NirT 1:e8fac4061a5b 156 phdcmi->Instance = DCMI;
NirT 1:e8fac4061a5b 157
NirT 1:e8fac4061a5b 158 /* Power up camera */
NirT 1:e8fac4061a5b 159 BSP_CAMERA_PwrUp();
NirT 1:e8fac4061a5b 160
NirT 1:e8fac4061a5b 161 /* Read ID of Camera module via I2C */
NirT 1:e8fac4061a5b 162 if(ov9655_ReadID(CAMERA_I2C_ADDRESS) == OV9655_ID)
NirT 1:e8fac4061a5b 163 {
NirT 1:e8fac4061a5b 164 /* Initialize the camera driver structure */
NirT 1:e8fac4061a5b 165 camera_drv = &ov9655_drv;
NirT 1:e8fac4061a5b 166 CameraHwAddress = CAMERA_I2C_ADDRESS;
NirT 1:e8fac4061a5b 167
NirT 1:e8fac4061a5b 168 /* DCMI Initialization */
NirT 1:e8fac4061a5b 169 BSP_CAMERA_MspInit(&hDcmiHandler, NULL);
NirT 1:e8fac4061a5b 170 HAL_DCMI_Init(phdcmi);
NirT 1:e8fac4061a5b 171
NirT 1:e8fac4061a5b 172 /* Camera Module Initialization via I2C to the wanted 'Resolution' */
NirT 1:e8fac4061a5b 173 if (Resolution == CAMERA_R480x272)
NirT 1:e8fac4061a5b 174 { /* For 480x272 resolution, the OV9655 sensor is set to VGA resolution
NirT 1:e8fac4061a5b 175 * as OV9655 doesn't supports 480x272 resolution,
NirT 1:e8fac4061a5b 176 * then DCMI is configured to output a 480x272 cropped window */
NirT 1:e8fac4061a5b 177 camera_drv->Init(CameraHwAddress, CAMERA_R640x480);
NirT 1:e8fac4061a5b 178 HAL_DCMI_ConfigCROP(phdcmi, /* Crop in the middle of the VGA picture */
NirT 1:e8fac4061a5b 179 (CAMERA_VGA_RES_X - CAMERA_480x272_RES_X)/2,
NirT 1:e8fac4061a5b 180 (CAMERA_VGA_RES_Y - CAMERA_480x272_RES_Y)/2,
NirT 1:e8fac4061a5b 181 (CAMERA_480x272_RES_X * 2) - 1,
NirT 1:e8fac4061a5b 182 CAMERA_480x272_RES_Y - 1);
NirT 1:e8fac4061a5b 183 HAL_DCMI_EnableCROP(phdcmi);
NirT 1:e8fac4061a5b 184 }
NirT 1:e8fac4061a5b 185 else
NirT 1:e8fac4061a5b 186 {
NirT 1:e8fac4061a5b 187 camera_drv->Init(CameraHwAddress, Resolution);
NirT 1:e8fac4061a5b 188 HAL_DCMI_DisableCROP(phdcmi);
NirT 1:e8fac4061a5b 189 }
NirT 1:e8fac4061a5b 190
NirT 1:e8fac4061a5b 191 CameraCurrentResolution = Resolution;
NirT 1:e8fac4061a5b 192
NirT 1:e8fac4061a5b 193 /* Return CAMERA_OK status */
NirT 1:e8fac4061a5b 194 status = CAMERA_OK;
NirT 1:e8fac4061a5b 195 }
NirT 1:e8fac4061a5b 196 else
NirT 1:e8fac4061a5b 197 {
NirT 1:e8fac4061a5b 198 /* Return CAMERA_NOT_SUPPORTED status */
NirT 1:e8fac4061a5b 199 status = CAMERA_NOT_SUPPORTED;
NirT 1:e8fac4061a5b 200 }
NirT 1:e8fac4061a5b 201
NirT 1:e8fac4061a5b 202 return status;
NirT 1:e8fac4061a5b 203 }
NirT 1:e8fac4061a5b 204
NirT 1:e8fac4061a5b 205 /**
NirT 1:e8fac4061a5b 206 * @brief DeInitializes the camera.
NirT 1:e8fac4061a5b 207 * @retval Camera status
NirT 1:e8fac4061a5b 208 */
NirT 1:e8fac4061a5b 209 uint8_t BSP_CAMERA_DeInit(void)
NirT 1:e8fac4061a5b 210 {
NirT 1:e8fac4061a5b 211 hDcmiHandler.Instance = DCMI;
NirT 1:e8fac4061a5b 212
NirT 1:e8fac4061a5b 213 HAL_DCMI_DeInit(&hDcmiHandler);
NirT 1:e8fac4061a5b 214 BSP_CAMERA_MspDeInit(&hDcmiHandler, NULL);
NirT 1:e8fac4061a5b 215 return CAMERA_OK;
NirT 1:e8fac4061a5b 216 }
NirT 1:e8fac4061a5b 217
NirT 1:e8fac4061a5b 218 /**
NirT 1:e8fac4061a5b 219 * @brief Starts the camera capture in continuous mode.
NirT 1:e8fac4061a5b 220 * @param buff: pointer to the camera output buffer
NirT 1:e8fac4061a5b 221 * @retval None
NirT 1:e8fac4061a5b 222 */
NirT 1:e8fac4061a5b 223 void BSP_CAMERA_ContinuousStart(uint8_t *buff)
NirT 1:e8fac4061a5b 224 {
NirT 1:e8fac4061a5b 225 /* Start the camera capture */
NirT 1:e8fac4061a5b 226 HAL_DCMI_Start_DMA(&hDcmiHandler, DCMI_MODE_CONTINUOUS, (uint32_t)buff, GetSize(CameraCurrentResolution));
NirT 1:e8fac4061a5b 227 }
NirT 1:e8fac4061a5b 228
NirT 1:e8fac4061a5b 229 /**
NirT 1:e8fac4061a5b 230 * @brief Starts the camera capture in snapshot mode.
NirT 1:e8fac4061a5b 231 * @param buff: pointer to the camera output buffer
NirT 1:e8fac4061a5b 232 * @retval None
NirT 1:e8fac4061a5b 233 */
NirT 1:e8fac4061a5b 234 void BSP_CAMERA_SnapshotStart(uint8_t *buff)
NirT 1:e8fac4061a5b 235 {
NirT 1:e8fac4061a5b 236 /* Start the camera capture */
NirT 1:e8fac4061a5b 237 HAL_DCMI_Start_DMA(&hDcmiHandler, DCMI_MODE_SNAPSHOT, (uint32_t)buff, GetSize(CameraCurrentResolution));
NirT 1:e8fac4061a5b 238 }
NirT 1:e8fac4061a5b 239
NirT 1:e8fac4061a5b 240 /**
NirT 1:e8fac4061a5b 241 * @brief Suspend the CAMERA capture
NirT 1:e8fac4061a5b 242 * @retval None
NirT 1:e8fac4061a5b 243 */
NirT 1:e8fac4061a5b 244 void BSP_CAMERA_Suspend(void)
NirT 1:e8fac4061a5b 245 {
NirT 1:e8fac4061a5b 246 /* Disable the DMA */
NirT 1:e8fac4061a5b 247 __HAL_DMA_DISABLE(hDcmiHandler.DMA_Handle);
NirT 1:e8fac4061a5b 248 /* Disable the DCMI */
NirT 1:e8fac4061a5b 249 __HAL_DCMI_DISABLE(&hDcmiHandler);
NirT 1:e8fac4061a5b 250
NirT 1:e8fac4061a5b 251 }
NirT 1:e8fac4061a5b 252
NirT 1:e8fac4061a5b 253 /**
NirT 1:e8fac4061a5b 254 * @brief Resume the CAMERA capture
NirT 1:e8fac4061a5b 255 * @retval None
NirT 1:e8fac4061a5b 256 */
NirT 1:e8fac4061a5b 257 void BSP_CAMERA_Resume(void)
NirT 1:e8fac4061a5b 258 {
NirT 1:e8fac4061a5b 259 /* Enable the DCMI */
NirT 1:e8fac4061a5b 260 __HAL_DCMI_ENABLE(&hDcmiHandler);
NirT 1:e8fac4061a5b 261 /* Enable the DMA */
NirT 1:e8fac4061a5b 262 __HAL_DMA_ENABLE(hDcmiHandler.DMA_Handle);
NirT 1:e8fac4061a5b 263 }
NirT 1:e8fac4061a5b 264
NirT 1:e8fac4061a5b 265 /**
NirT 1:e8fac4061a5b 266 * @brief Stop the CAMERA capture
NirT 1:e8fac4061a5b 267 * @retval Camera status
NirT 1:e8fac4061a5b 268 */
NirT 1:e8fac4061a5b 269 uint8_t BSP_CAMERA_Stop(void)
NirT 1:e8fac4061a5b 270 {
NirT 1:e8fac4061a5b 271 uint8_t status = CAMERA_ERROR;
NirT 1:e8fac4061a5b 272
NirT 1:e8fac4061a5b 273 if(HAL_DCMI_Stop(&hDcmiHandler) == HAL_OK)
NirT 1:e8fac4061a5b 274 {
NirT 1:e8fac4061a5b 275 status = CAMERA_OK;
NirT 1:e8fac4061a5b 276 }
NirT 1:e8fac4061a5b 277
NirT 1:e8fac4061a5b 278 /* Set Camera in Power Down */
NirT 1:e8fac4061a5b 279 BSP_CAMERA_PwrDown();
NirT 1:e8fac4061a5b 280
NirT 1:e8fac4061a5b 281 return status;
NirT 1:e8fac4061a5b 282 }
NirT 1:e8fac4061a5b 283
NirT 1:e8fac4061a5b 284 /**
NirT 1:e8fac4061a5b 285 * @brief CANERA power up
NirT 1:e8fac4061a5b 286 * @retval None
NirT 1:e8fac4061a5b 287 */
NirT 1:e8fac4061a5b 288 void BSP_CAMERA_PwrUp(void)
NirT 1:e8fac4061a5b 289 {
NirT 1:e8fac4061a5b 290 GPIO_InitTypeDef gpio_init_structure;
NirT 1:e8fac4061a5b 291
NirT 1:e8fac4061a5b 292 /* Enable GPIO clock */
NirT 1:e8fac4061a5b 293 __HAL_RCC_GPIOH_CLK_ENABLE();
NirT 1:e8fac4061a5b 294
NirT 1:e8fac4061a5b 295 /*** Configure the GPIO ***/
NirT 1:e8fac4061a5b 296 /* Configure DCMI GPIO as alternate function */
NirT 1:e8fac4061a5b 297 gpio_init_structure.Pin = GPIO_PIN_13;
NirT 1:e8fac4061a5b 298 gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
NirT 1:e8fac4061a5b 299 gpio_init_structure.Pull = GPIO_NOPULL;
NirT 1:e8fac4061a5b 300 gpio_init_structure.Speed = GPIO_SPEED_HIGH;
NirT 1:e8fac4061a5b 301 HAL_GPIO_Init(GPIOH, &gpio_init_structure);
NirT 1:e8fac4061a5b 302
NirT 1:e8fac4061a5b 303 /* De-assert the camera POWER_DOWN pin (active high) */
NirT 1:e8fac4061a5b 304 HAL_GPIO_WritePin(GPIOH, GPIO_PIN_13, GPIO_PIN_RESET);
NirT 1:e8fac4061a5b 305
NirT 1:e8fac4061a5b 306 HAL_Delay(3); /* POWER_DOWN de-asserted during 3ms */
NirT 1:e8fac4061a5b 307 }
NirT 1:e8fac4061a5b 308
NirT 1:e8fac4061a5b 309 /**
NirT 1:e8fac4061a5b 310 * @brief CAMERA power down
NirT 1:e8fac4061a5b 311 * @retval None
NirT 1:e8fac4061a5b 312 */
NirT 1:e8fac4061a5b 313 void BSP_CAMERA_PwrDown(void)
NirT 1:e8fac4061a5b 314 {
NirT 1:e8fac4061a5b 315 GPIO_InitTypeDef gpio_init_structure;
NirT 1:e8fac4061a5b 316
NirT 1:e8fac4061a5b 317 /* Enable GPIO clock */
NirT 1:e8fac4061a5b 318 __HAL_RCC_GPIOH_CLK_ENABLE();
NirT 1:e8fac4061a5b 319
NirT 1:e8fac4061a5b 320 /*** Configure the GPIO ***/
NirT 1:e8fac4061a5b 321 /* Configure DCMI GPIO as alternate function */
NirT 1:e8fac4061a5b 322 gpio_init_structure.Pin = GPIO_PIN_13;
NirT 1:e8fac4061a5b 323 gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
NirT 1:e8fac4061a5b 324 gpio_init_structure.Pull = GPIO_NOPULL;
NirT 1:e8fac4061a5b 325 gpio_init_structure.Speed = GPIO_SPEED_HIGH;
NirT 1:e8fac4061a5b 326 HAL_GPIO_Init(GPIOH, &gpio_init_structure);
NirT 1:e8fac4061a5b 327
NirT 1:e8fac4061a5b 328 /* Assert the camera POWER_DOWN pin (active high) */
NirT 1:e8fac4061a5b 329 HAL_GPIO_WritePin(GPIOH, GPIO_PIN_13, GPIO_PIN_SET);
NirT 1:e8fac4061a5b 330 }
NirT 1:e8fac4061a5b 331
NirT 1:e8fac4061a5b 332 /**
NirT 1:e8fac4061a5b 333 * @brief Configures the camera contrast and brightness.
NirT 1:e8fac4061a5b 334 * @param contrast_level: Contrast level
NirT 1:e8fac4061a5b 335 * This parameter can be one of the following values:
NirT 1:e8fac4061a5b 336 * @arg CAMERA_CONTRAST_LEVEL4: for contrast +2
NirT 1:e8fac4061a5b 337 * @arg CAMERA_CONTRAST_LEVEL3: for contrast +1
NirT 1:e8fac4061a5b 338 * @arg CAMERA_CONTRAST_LEVEL2: for contrast 0
NirT 1:e8fac4061a5b 339 * @arg CAMERA_CONTRAST_LEVEL1: for contrast -1
NirT 1:e8fac4061a5b 340 * @arg CAMERA_CONTRAST_LEVEL0: for contrast -2
NirT 1:e8fac4061a5b 341 * @param brightness_level: Contrast level
NirT 1:e8fac4061a5b 342 * This parameter can be one of the following values:
NirT 1:e8fac4061a5b 343 * @arg CAMERA_BRIGHTNESS_LEVEL4: for brightness +2
NirT 1:e8fac4061a5b 344 * @arg CAMERA_BRIGHTNESS_LEVEL3: for brightness +1
NirT 1:e8fac4061a5b 345 * @arg CAMERA_BRIGHTNESS_LEVEL2: for brightness 0
NirT 1:e8fac4061a5b 346 * @arg CAMERA_BRIGHTNESS_LEVEL1: for brightness -1
NirT 1:e8fac4061a5b 347 * @arg CAMERA_BRIGHTNESS_LEVEL0: for brightness -2
NirT 1:e8fac4061a5b 348 * @retval None
NirT 1:e8fac4061a5b 349 */
NirT 1:e8fac4061a5b 350 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level)
NirT 1:e8fac4061a5b 351 {
NirT 1:e8fac4061a5b 352 if(camera_drv->Config != NULL)
NirT 1:e8fac4061a5b 353 {
NirT 1:e8fac4061a5b 354 camera_drv->Config(CameraHwAddress, CAMERA_CONTRAST_BRIGHTNESS, contrast_level, brightness_level);
NirT 1:e8fac4061a5b 355 }
NirT 1:e8fac4061a5b 356 }
NirT 1:e8fac4061a5b 357
NirT 1:e8fac4061a5b 358 /**
NirT 1:e8fac4061a5b 359 * @brief Configures the camera white balance.
NirT 1:e8fac4061a5b 360 * @param Mode: black_white mode
NirT 1:e8fac4061a5b 361 * This parameter can be one of the following values:
NirT 1:e8fac4061a5b 362 * @arg CAMERA_BLACK_WHITE_BW
NirT 1:e8fac4061a5b 363 * @arg CAMERA_BLACK_WHITE_NEGATIVE
NirT 1:e8fac4061a5b 364 * @arg CAMERA_BLACK_WHITE_BW_NEGATIVE
NirT 1:e8fac4061a5b 365 * @arg CAMERA_BLACK_WHITE_NORMAL
NirT 1:e8fac4061a5b 366 * @retval None
NirT 1:e8fac4061a5b 367 */
NirT 1:e8fac4061a5b 368 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode)
NirT 1:e8fac4061a5b 369 {
NirT 1:e8fac4061a5b 370 if(camera_drv->Config != NULL)
NirT 1:e8fac4061a5b 371 {
NirT 1:e8fac4061a5b 372 camera_drv->Config(CameraHwAddress, CAMERA_BLACK_WHITE, Mode, 0);
NirT 1:e8fac4061a5b 373 }
NirT 1:e8fac4061a5b 374 }
NirT 1:e8fac4061a5b 375
NirT 1:e8fac4061a5b 376 /**
NirT 1:e8fac4061a5b 377 * @brief Configures the camera color effect.
NirT 1:e8fac4061a5b 378 * @param Effect: Color effect
NirT 1:e8fac4061a5b 379 * This parameter can be one of the following values:
NirT 1:e8fac4061a5b 380 * @arg CAMERA_COLOR_EFFECT_ANTIQUE
NirT 1:e8fac4061a5b 381 * @arg CAMERA_COLOR_EFFECT_BLUE
NirT 1:e8fac4061a5b 382 * @arg CAMERA_COLOR_EFFECT_GREEN
NirT 1:e8fac4061a5b 383 * @arg CAMERA_COLOR_EFFECT_RED
NirT 1:e8fac4061a5b 384 * @retval None
NirT 1:e8fac4061a5b 385 */
NirT 1:e8fac4061a5b 386 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect)
NirT 1:e8fac4061a5b 387 {
NirT 1:e8fac4061a5b 388 if(camera_drv->Config != NULL)
NirT 1:e8fac4061a5b 389 {
NirT 1:e8fac4061a5b 390 camera_drv->Config(CameraHwAddress, CAMERA_COLOR_EFFECT, Effect, 0);
NirT 1:e8fac4061a5b 391 }
NirT 1:e8fac4061a5b 392 }
NirT 1:e8fac4061a5b 393
NirT 1:e8fac4061a5b 394 /**
NirT 1:e8fac4061a5b 395 * @brief Handles DCMI interrupt request.
NirT 1:e8fac4061a5b 396 * @retval None
NirT 1:e8fac4061a5b 397 */
NirT 1:e8fac4061a5b 398 void BSP_CAMERA_IRQHandler(void)
NirT 1:e8fac4061a5b 399 {
NirT 1:e8fac4061a5b 400 HAL_DCMI_IRQHandler(&hDcmiHandler);
NirT 1:e8fac4061a5b 401 }
NirT 1:e8fac4061a5b 402
NirT 1:e8fac4061a5b 403 /**
NirT 1:e8fac4061a5b 404 * @brief Handles DMA interrupt request.
NirT 1:e8fac4061a5b 405 * @retval None
NirT 1:e8fac4061a5b 406 */
NirT 1:e8fac4061a5b 407 void BSP_CAMERA_DMA_IRQHandler(void)
NirT 1:e8fac4061a5b 408 {
NirT 1:e8fac4061a5b 409 HAL_DMA_IRQHandler(hDcmiHandler.DMA_Handle);
NirT 1:e8fac4061a5b 410 }
NirT 1:e8fac4061a5b 411
NirT 1:e8fac4061a5b 412 /**
NirT 1:e8fac4061a5b 413 * @brief Get the capture size in pixels unit.
NirT 1:e8fac4061a5b 414 * @param resolution: the current resolution.
NirT 1:e8fac4061a5b 415 * @retval capture size in pixels unit.
NirT 1:e8fac4061a5b 416 */
NirT 1:e8fac4061a5b 417 static uint32_t GetSize(uint32_t resolution)
NirT 1:e8fac4061a5b 418 {
NirT 1:e8fac4061a5b 419 uint32_t size = 0;
NirT 1:e8fac4061a5b 420
NirT 1:e8fac4061a5b 421 /* Get capture size */
NirT 1:e8fac4061a5b 422 switch (resolution)
NirT 1:e8fac4061a5b 423 {
NirT 1:e8fac4061a5b 424 case CAMERA_R160x120:
NirT 1:e8fac4061a5b 425 {
NirT 1:e8fac4061a5b 426 size = 0x2580;
NirT 1:e8fac4061a5b 427 }
NirT 1:e8fac4061a5b 428 break;
NirT 1:e8fac4061a5b 429 case CAMERA_R320x240:
NirT 1:e8fac4061a5b 430 {
NirT 1:e8fac4061a5b 431 size = 0x9600;
NirT 1:e8fac4061a5b 432 }
NirT 1:e8fac4061a5b 433 break;
NirT 1:e8fac4061a5b 434 case CAMERA_R480x272:
NirT 1:e8fac4061a5b 435 {
NirT 1:e8fac4061a5b 436 size = 0xFF00;
NirT 1:e8fac4061a5b 437 }
NirT 1:e8fac4061a5b 438 break;
NirT 1:e8fac4061a5b 439 case CAMERA_R640x480:
NirT 1:e8fac4061a5b 440 {
NirT 1:e8fac4061a5b 441 size = 0x25800;
NirT 1:e8fac4061a5b 442 }
NirT 1:e8fac4061a5b 443 break;
NirT 1:e8fac4061a5b 444 default:
NirT 1:e8fac4061a5b 445 {
NirT 1:e8fac4061a5b 446 break;
NirT 1:e8fac4061a5b 447 }
NirT 1:e8fac4061a5b 448 }
NirT 1:e8fac4061a5b 449
NirT 1:e8fac4061a5b 450 return size;
NirT 1:e8fac4061a5b 451 }
NirT 1:e8fac4061a5b 452
NirT 1:e8fac4061a5b 453 /**
NirT 1:e8fac4061a5b 454 * @brief Initializes the DCMI MSP.
NirT 1:e8fac4061a5b 455 * @param hdcmi: HDMI handle
NirT 1:e8fac4061a5b 456 * @param Params
NirT 1:e8fac4061a5b 457 * @retval None
NirT 1:e8fac4061a5b 458 */
NirT 1:e8fac4061a5b 459 __weak void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params)
NirT 1:e8fac4061a5b 460 {
NirT 1:e8fac4061a5b 461 static DMA_HandleTypeDef hdma_handler;
NirT 1:e8fac4061a5b 462 GPIO_InitTypeDef gpio_init_structure;
NirT 1:e8fac4061a5b 463
NirT 1:e8fac4061a5b 464 /*** Enable peripherals and GPIO clocks ***/
NirT 1:e8fac4061a5b 465 /* Enable DCMI clock */
NirT 1:e8fac4061a5b 466 __HAL_RCC_DCMI_CLK_ENABLE();
NirT 1:e8fac4061a5b 467
NirT 1:e8fac4061a5b 468 /* Enable DMA2 clock */
NirT 1:e8fac4061a5b 469 __HAL_RCC_DMA2_CLK_ENABLE();
NirT 1:e8fac4061a5b 470
NirT 1:e8fac4061a5b 471 /* Enable GPIO clocks */
NirT 1:e8fac4061a5b 472 __HAL_RCC_GPIOA_CLK_ENABLE();
NirT 1:e8fac4061a5b 473 __HAL_RCC_GPIOD_CLK_ENABLE();
NirT 1:e8fac4061a5b 474 __HAL_RCC_GPIOE_CLK_ENABLE();
NirT 1:e8fac4061a5b 475 __HAL_RCC_GPIOG_CLK_ENABLE();
NirT 1:e8fac4061a5b 476 __HAL_RCC_GPIOH_CLK_ENABLE();
NirT 1:e8fac4061a5b 477
NirT 1:e8fac4061a5b 478 /*** Configure the GPIO ***/
NirT 1:e8fac4061a5b 479 /* Configure DCMI GPIO as alternate function */
NirT 1:e8fac4061a5b 480 gpio_init_structure.Pin = GPIO_PIN_4 | GPIO_PIN_6;
NirT 1:e8fac4061a5b 481 gpio_init_structure.Mode = GPIO_MODE_AF_PP;
NirT 1:e8fac4061a5b 482 gpio_init_structure.Pull = GPIO_PULLUP;
NirT 1:e8fac4061a5b 483 gpio_init_structure.Speed = GPIO_SPEED_HIGH;
NirT 1:e8fac4061a5b 484 gpio_init_structure.Alternate = GPIO_AF13_DCMI;
NirT 1:e8fac4061a5b 485 HAL_GPIO_Init(GPIOA, &gpio_init_structure);
NirT 1:e8fac4061a5b 486
NirT 1:e8fac4061a5b 487 gpio_init_structure.Pin = GPIO_PIN_3;
NirT 1:e8fac4061a5b 488 gpio_init_structure.Mode = GPIO_MODE_AF_PP;
NirT 1:e8fac4061a5b 489 gpio_init_structure.Pull = GPIO_PULLUP;
NirT 1:e8fac4061a5b 490 gpio_init_structure.Speed = GPIO_SPEED_HIGH;
NirT 1:e8fac4061a5b 491 gpio_init_structure.Alternate = GPIO_AF13_DCMI;
NirT 1:e8fac4061a5b 492 HAL_GPIO_Init(GPIOD, &gpio_init_structure);
NirT 1:e8fac4061a5b 493
NirT 1:e8fac4061a5b 494 gpio_init_structure.Pin = GPIO_PIN_5 | GPIO_PIN_6;
NirT 1:e8fac4061a5b 495 gpio_init_structure.Mode = GPIO_MODE_AF_PP;
NirT 1:e8fac4061a5b 496 gpio_init_structure.Pull = GPIO_PULLUP;
NirT 1:e8fac4061a5b 497 gpio_init_structure.Speed = GPIO_SPEED_HIGH;
NirT 1:e8fac4061a5b 498 gpio_init_structure.Alternate = GPIO_AF13_DCMI;
NirT 1:e8fac4061a5b 499 HAL_GPIO_Init(GPIOE, &gpio_init_structure);
NirT 1:e8fac4061a5b 500
NirT 1:e8fac4061a5b 501 gpio_init_structure.Pin = GPIO_PIN_9;
NirT 1:e8fac4061a5b 502 gpio_init_structure.Mode = GPIO_MODE_AF_PP;
NirT 1:e8fac4061a5b 503 gpio_init_structure.Pull = GPIO_PULLUP;
NirT 1:e8fac4061a5b 504 gpio_init_structure.Speed = GPIO_SPEED_HIGH;
NirT 1:e8fac4061a5b 505 gpio_init_structure.Alternate = GPIO_AF13_DCMI;
NirT 1:e8fac4061a5b 506 HAL_GPIO_Init(GPIOG, &gpio_init_structure);
NirT 1:e8fac4061a5b 507
NirT 1:e8fac4061a5b 508 gpio_init_structure.Pin = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 |\
NirT 1:e8fac4061a5b 509 GPIO_PIN_12 | GPIO_PIN_14;
NirT 1:e8fac4061a5b 510 gpio_init_structure.Mode = GPIO_MODE_AF_PP;
NirT 1:e8fac4061a5b 511 gpio_init_structure.Pull = GPIO_PULLUP;
NirT 1:e8fac4061a5b 512 gpio_init_structure.Speed = GPIO_SPEED_HIGH;
NirT 1:e8fac4061a5b 513 gpio_init_structure.Alternate = GPIO_AF13_DCMI;
NirT 1:e8fac4061a5b 514 HAL_GPIO_Init(GPIOH, &gpio_init_structure);
NirT 1:e8fac4061a5b 515
NirT 1:e8fac4061a5b 516 /*** Configure the DMA ***/
NirT 1:e8fac4061a5b 517 /* Set the parameters to be configured */
NirT 1:e8fac4061a5b 518 hdma_handler.Init.Channel = DMA_CHANNEL_1;
NirT 1:e8fac4061a5b 519 hdma_handler.Init.Direction = DMA_PERIPH_TO_MEMORY;
NirT 1:e8fac4061a5b 520 hdma_handler.Init.PeriphInc = DMA_PINC_DISABLE;
NirT 1:e8fac4061a5b 521 hdma_handler.Init.MemInc = DMA_MINC_ENABLE;
NirT 1:e8fac4061a5b 522 hdma_handler.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
NirT 1:e8fac4061a5b 523 hdma_handler.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
NirT 1:e8fac4061a5b 524 hdma_handler.Init.Mode = DMA_CIRCULAR;
NirT 1:e8fac4061a5b 525 hdma_handler.Init.Priority = DMA_PRIORITY_HIGH;
NirT 1:e8fac4061a5b 526 hdma_handler.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
NirT 1:e8fac4061a5b 527 hdma_handler.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
NirT 1:e8fac4061a5b 528 hdma_handler.Init.MemBurst = DMA_MBURST_SINGLE;
NirT 1:e8fac4061a5b 529 hdma_handler.Init.PeriphBurst = DMA_PBURST_SINGLE;
NirT 1:e8fac4061a5b 530
NirT 1:e8fac4061a5b 531 hdma_handler.Instance = DMA2_Stream1;
NirT 1:e8fac4061a5b 532
NirT 1:e8fac4061a5b 533 /* Associate the initialized DMA handle to the DCMI handle */
NirT 1:e8fac4061a5b 534 __HAL_LINKDMA(hdcmi, DMA_Handle, hdma_handler);
NirT 1:e8fac4061a5b 535
NirT 1:e8fac4061a5b 536 /*** Configure the NVIC for DCMI and DMA ***/
NirT 1:e8fac4061a5b 537 /* NVIC configuration for DCMI transfer complete interrupt */
NirT 1:e8fac4061a5b 538 HAL_NVIC_SetPriority(DCMI_IRQn, 5, 0);
NirT 1:e8fac4061a5b 539 HAL_NVIC_EnableIRQ(DCMI_IRQn);
NirT 1:e8fac4061a5b 540
NirT 1:e8fac4061a5b 541 /* NVIC configuration for DMA2D transfer complete interrupt */
NirT 1:e8fac4061a5b 542 HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 5, 0);
NirT 1:e8fac4061a5b 543 HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
NirT 1:e8fac4061a5b 544
NirT 1:e8fac4061a5b 545 /* Configure the DMA stream */
NirT 1:e8fac4061a5b 546 HAL_DMA_Init(hdcmi->DMA_Handle);
NirT 1:e8fac4061a5b 547 }
NirT 1:e8fac4061a5b 548
NirT 1:e8fac4061a5b 549
NirT 1:e8fac4061a5b 550 /**
NirT 1:e8fac4061a5b 551 * @brief DeInitializes the DCMI MSP.
NirT 1:e8fac4061a5b 552 * @param hdcmi: HDMI handle
NirT 1:e8fac4061a5b 553 * @param Params
NirT 1:e8fac4061a5b 554 * @retval None
NirT 1:e8fac4061a5b 555 */
NirT 1:e8fac4061a5b 556 __weak void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params)
NirT 1:e8fac4061a5b 557 {
NirT 1:e8fac4061a5b 558 /* Disable NVIC for DCMI transfer complete interrupt */
NirT 1:e8fac4061a5b 559 HAL_NVIC_DisableIRQ(DCMI_IRQn);
NirT 1:e8fac4061a5b 560
NirT 1:e8fac4061a5b 561 /* Disable NVIC for DMA2 transfer complete interrupt */
NirT 1:e8fac4061a5b 562 HAL_NVIC_DisableIRQ(DMA2_Stream1_IRQn);
NirT 1:e8fac4061a5b 563
NirT 1:e8fac4061a5b 564 /* Configure the DMA stream */
NirT 1:e8fac4061a5b 565 HAL_DMA_DeInit(hdcmi->DMA_Handle);
NirT 1:e8fac4061a5b 566
NirT 1:e8fac4061a5b 567 /* Disable DCMI clock */
NirT 1:e8fac4061a5b 568 __HAL_RCC_DCMI_CLK_DISABLE();
NirT 1:e8fac4061a5b 569
NirT 1:e8fac4061a5b 570 /* GPIO pins clock and DMA clock can be shut down in the application
NirT 1:e8fac4061a5b 571 by surcharging this __weak function */
NirT 1:e8fac4061a5b 572 }
NirT 1:e8fac4061a5b 573
NirT 1:e8fac4061a5b 574 /**
NirT 1:e8fac4061a5b 575 * @brief Line event callback
NirT 1:e8fac4061a5b 576 * @param hdcmi: pointer to the DCMI handle
NirT 1:e8fac4061a5b 577 * @retval None
NirT 1:e8fac4061a5b 578 */
NirT 1:e8fac4061a5b 579 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi)
NirT 1:e8fac4061a5b 580 {
NirT 1:e8fac4061a5b 581 BSP_CAMERA_LineEventCallback();
NirT 1:e8fac4061a5b 582 }
NirT 1:e8fac4061a5b 583
NirT 1:e8fac4061a5b 584 /**
NirT 1:e8fac4061a5b 585 * @brief Line Event callback.
NirT 1:e8fac4061a5b 586 * @retval None
NirT 1:e8fac4061a5b 587 */
NirT 1:e8fac4061a5b 588 __weak void BSP_CAMERA_LineEventCallback(void)
NirT 1:e8fac4061a5b 589 {
NirT 1:e8fac4061a5b 590 /* NOTE : This function Should not be modified, when the callback is needed,
NirT 1:e8fac4061a5b 591 the HAL_DCMI_LineEventCallback could be implemented in the user file
NirT 1:e8fac4061a5b 592 */
NirT 1:e8fac4061a5b 593 }
NirT 1:e8fac4061a5b 594
NirT 1:e8fac4061a5b 595 /**
NirT 1:e8fac4061a5b 596 * @brief VSYNC event callback
NirT 1:e8fac4061a5b 597 * @param hdcmi: pointer to the DCMI handle
NirT 1:e8fac4061a5b 598 * @retval None
NirT 1:e8fac4061a5b 599 */
NirT 1:e8fac4061a5b 600 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi)
NirT 1:e8fac4061a5b 601 {
NirT 1:e8fac4061a5b 602 BSP_CAMERA_VsyncEventCallback();
NirT 1:e8fac4061a5b 603 }
NirT 1:e8fac4061a5b 604
NirT 1:e8fac4061a5b 605 /**
NirT 1:e8fac4061a5b 606 * @brief VSYNC Event callback.
NirT 1:e8fac4061a5b 607 * @retval None
NirT 1:e8fac4061a5b 608 */
NirT 1:e8fac4061a5b 609 __weak void BSP_CAMERA_VsyncEventCallback(void)
NirT 1:e8fac4061a5b 610 {
NirT 1:e8fac4061a5b 611 /* NOTE : This function Should not be modified, when the callback is needed,
NirT 1:e8fac4061a5b 612 the HAL_DCMI_VsyncEventCallback could be implemented in the user file
NirT 1:e8fac4061a5b 613 */
NirT 1:e8fac4061a5b 614 }
NirT 1:e8fac4061a5b 615
NirT 1:e8fac4061a5b 616 /**
NirT 1:e8fac4061a5b 617 * @brief Frame event callback
NirT 1:e8fac4061a5b 618 * @param hdcmi: pointer to the DCMI handle
NirT 1:e8fac4061a5b 619 * @retval None
NirT 1:e8fac4061a5b 620 */
NirT 1:e8fac4061a5b 621 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi)
NirT 1:e8fac4061a5b 622 {
NirT 1:e8fac4061a5b 623 BSP_CAMERA_FrameEventCallback();
NirT 1:e8fac4061a5b 624 }
NirT 1:e8fac4061a5b 625
NirT 1:e8fac4061a5b 626 /**
NirT 1:e8fac4061a5b 627 * @brief Frame Event callback.
NirT 1:e8fac4061a5b 628 * @retval None
NirT 1:e8fac4061a5b 629 */
NirT 1:e8fac4061a5b 630 __weak void BSP_CAMERA_FrameEventCallback(void)
NirT 1:e8fac4061a5b 631 {
NirT 1:e8fac4061a5b 632 /* NOTE : This function Should not be modified, when the callback is needed,
NirT 1:e8fac4061a5b 633 the HAL_DCMI_FrameEventCallback could be implemented in the user file
NirT 1:e8fac4061a5b 634 */
NirT 1:e8fac4061a5b 635 }
NirT 1:e8fac4061a5b 636
NirT 1:e8fac4061a5b 637 /**
NirT 1:e8fac4061a5b 638 * @brief Error callback
NirT 1:e8fac4061a5b 639 * @param hdcmi: pointer to the DCMI handle
NirT 1:e8fac4061a5b 640 * @retval None
NirT 1:e8fac4061a5b 641 */
NirT 1:e8fac4061a5b 642 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi)
NirT 1:e8fac4061a5b 643 {
NirT 1:e8fac4061a5b 644 BSP_CAMERA_ErrorCallback();
NirT 1:e8fac4061a5b 645 }
NirT 1:e8fac4061a5b 646
NirT 1:e8fac4061a5b 647 /**
NirT 1:e8fac4061a5b 648 * @brief Error callback.
NirT 1:e8fac4061a5b 649 * @retval None
NirT 1:e8fac4061a5b 650 */
NirT 1:e8fac4061a5b 651 __weak void BSP_CAMERA_ErrorCallback(void)
NirT 1:e8fac4061a5b 652 {
NirT 1:e8fac4061a5b 653 /* NOTE : This function Should not be modified, when the callback is needed,
NirT 1:e8fac4061a5b 654 the HAL_DCMI_ErrorCallback could be implemented in the user file
NirT 1:e8fac4061a5b 655 */
NirT 1:e8fac4061a5b 656 }
NirT 1:e8fac4061a5b 657
NirT 1:e8fac4061a5b 658 /**
NirT 1:e8fac4061a5b 659 * @}
NirT 1:e8fac4061a5b 660 */
NirT 1:e8fac4061a5b 661
NirT 1:e8fac4061a5b 662 /**
NirT 1:e8fac4061a5b 663 * @}
NirT 1:e8fac4061a5b 664 */
NirT 1:e8fac4061a5b 665
NirT 1:e8fac4061a5b 666 /**
NirT 1:e8fac4061a5b 667 * @}
NirT 1:e8fac4061a5b 668 */
NirT 1:e8fac4061a5b 669
NirT 1:e8fac4061a5b 670 /**
NirT 1:e8fac4061a5b 671 * @}
NirT 1:e8fac4061a5b 672 */
NirT 1:e8fac4061a5b 673
NirT 1:e8fac4061a5b 674 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
NirT 1:e8fac4061a5b 675