STM32L4R9I-Discovery BSP User Manual: stm32l4r9i_discovery_camera.h Source File

STM32L4R9I-Discovery BSP

stm32l4r9i_discovery_camera.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l4r9i_discovery_camera.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l4r9i_discovery_camera.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036 
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32L4R9I_DISCOVERY_CAMERA_H
00039 #define __STM32L4R9I_DISCOVERY_CAMERA_H
00040 
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044 
00045 /* Includes ------------------------------------------------------------------*/
00046 /* Include Camera component Driver */
00047 #include "../Components/ov9655/ov9655.h"
00048 #include "stm32l4r9i_discovery.h"
00049 
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053 
00054 /** @addtogroup STM32L4R9I_DISCOVERY
00055   * @{
00056   */
00057 
00058 /** @addtogroup STM32L4R9I_DISCOVERY_CAMERA
00059   * @{
00060   */
00061 
00062 /** @defgroup STM32L4R9I_DISCOVERY_CAMERA_Exported_Types STM32L4R9I_DISCOVERY_CAMERA Exported Types
00063   * @{
00064   */
00065 
00066 /**
00067   * @brief  Camera State structures definition
00068   */
00069 typedef enum
00070 {
00071   CAMERA_OK            = 0x00,
00072   CAMERA_ERROR         = 0x01,
00073   CAMERA_TIMEOUT       = 0x02,
00074   CAMERA_NOT_DETECTED  = 0x03,
00075   CAMERA_NOT_SUPPORTED = 0x04
00076 
00077 } Camera_StatusTypeDef;
00078 
00079 #define RESOLUTION_R160x120      CAMERA_R160x120      /* QQVGA Resolution     */
00080 #define RESOLUTION_R320x240      CAMERA_R320x240      /* QVGA Resolution      */
00081 #define RESOLUTION_R480x272      CAMERA_R480x272      /* 480x272 Resolution   */
00082 #define RESOLUTION_R640x480      CAMERA_R640x480      /* VGA Resolution       */
00083 /**
00084   * @}
00085   */
00086 
00087 /** @defgroup STM32L4R9I_DISCOVERY_CAMERA_Exported_Constants STM32L4R9I_DISCOVERY_CAMERA Exported Constants
00088   * @{
00089   */
00090 #define BSP_CAMERA_IRQHandler      DCMI_IRQHandler
00091 #define BSP_CAMERA_DMA_IRQHandler  DMA2_Channel6_IRQHandler
00092 #define BSP_CAMERA_DMA_IRQn        DMA2_Channel6_IRQn
00093 #define BSP_CAMERA_DMA_INSTANCE    DMA2_Channel6
00094 
00095 /**
00096   * @brief Camera special pins
00097   */
00098 /* Camera power up pin */
00099 #define CAMERA_PWR_EN_PIN                  IO_PIN_12
00100 
00101 /**
00102   * @}
00103   */
00104 
00105 /** @defgroup STM32L4R9I_DISCOVERY_CAMERA_Exported_Variables STM32L4R9I_DISCOVERY_CAMERA Exported Variables
00106   * @{
00107   */
00108 extern DCMI_HandleTypeDef  hDcmiHandler;
00109 
00110 /**
00111   * @}
00112   */
00113 
00114 /** @addtogroup STM32L4R9I_DISCOVERY_CAMERA_Exported_Functions
00115   * @{
00116   */
00117 
00118 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
00119 uint8_t BSP_CAMERA_DeInit(void);
00120 void    BSP_CAMERA_ContinuousStart(uint8_t *buff);
00121 void    BSP_CAMERA_SnapshotStart(uint8_t *buff);
00122 void    BSP_CAMERA_Suspend(void);
00123 void    BSP_CAMERA_Resume(void);
00124 uint8_t BSP_CAMERA_Stop(void);
00125 void    BSP_CAMERA_PwrUp(void);
00126 void    BSP_CAMERA_PwrDown(void);
00127 
00128 /* Camera features functions prototype */
00129 void    BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
00130 void    BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
00131 void    BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
00132 
00133 /* These __weak functions can be surcharged by application code in case the current settings
00134    (eg. interrupt priority, callbacks implementation) need to be changed for specific application needs */
00135 void    BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00136 void    BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00137 void    BSP_CAMERA_LineEventCallback(void);
00138 void    BSP_CAMERA_VsyncEventCallback(void);
00139 void    BSP_CAMERA_FrameEventCallback(void);
00140 void    BSP_CAMERA_ErrorCallback(void);
00141 
00142 /**
00143   * @}
00144   */
00145 
00146 /**
00147   * @}
00148   */
00149 
00150 /**
00151   * @}
00152   */
00153 
00154 /**
00155   * @}
00156   */
00157 
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161 
00162 #endif /* __STM32L4R9I_DISCOVERY_CAMERA_H */
00163 
00164 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Fri Oct 13 2017 02:37:42 for STM32L4R9I-Discovery BSP User Manual by   doxygen 1.7.6.1