BSP files for STM32H747I-Discovery Copy from ST Cube delivery

Dependents:   DISCO_H747I_LCD_demo DISCO_H747I_AUDIO_demo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32h747i_discovery_camera.h Source File

stm32h747i_discovery_camera.h

00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the STM32H747I_DISCOVERY_camera.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */ 
00020 
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_CAMERA_H
00023 #define __STM32H747I_DISCOVERY_CAMERA_H
00024 
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif 
00028 
00029 /* Includes ------------------------------------------------------------------*/
00030 /* Include Camera component Driver */
00031 #include "../Components/ov9655/ov9655.h"
00032 #include "stm32h747i_discovery.h"
00033 
00034 /** @addtogroup BSP
00035   * @{
00036   */
00037 
00038 /** @addtogroup STM32H747I_DISCOVERY
00039   * @{
00040   */
00041     
00042 /** @addtogroup STM32H747I_DISCOVERY_CAMERA
00043   * @{
00044   */ 
00045    
00046 /** @defgroup STM32H747I_DISCOVERY_CAMERA_Exported_Constants Exported Constants
00047   * @{
00048   */
00049   
00050 /** 
00051   * @brief  Camera State structures definition  
00052   */
00053 #define CAMERA_OK             0x00
00054 #define CAMERA_ERROR          0x01
00055 #define CAMERA_TIMEOUT        0x02
00056 #define CAMERA_NOT_DETECTED   0x03
00057 #define CAMERA_NOT_SUPPORTED  0x04
00058 
00059 /**
00060   * @brief  Camera Image rotation definition
00061   *         in frame buffer for LCD Display.
00062   */
00063 #define CAMERA_NO_ROTATION        0x00
00064 #define CAMERA_ROTATION_90        0x01
00065 #define CAMERA_ROTATION_INVALID   0x02
00066 
00067 #define RESOLUTION_R160x120      CAMERA_R160x120      /* QQVGA Resolution     */
00068 #define RESOLUTION_R320x240      CAMERA_R320x240      /* QVGA Resolution      */
00069 #define RESOLUTION_R480x272      CAMERA_R480x272      /* 480x272 Resolution   */
00070 #define RESOLUTION_R640x480      CAMERA_R640x480      /* VGA Resolution       */
00071 
00072 #define CAMERA_VGA_RES_X          640
00073 #define CAMERA_VGA_RES_Y          480
00074 #define CAMERA_480x272_RES_X      480
00075 #define CAMERA_480x272_RES_Y      272
00076 #define CAMERA_QVGA_RES_X         320
00077 #define CAMERA_QVGA_RES_Y         240
00078 #define CAMERA_QQVGA_RES_X        160
00079 #define CAMERA_QQVGA_RES_Y        120
00080 
00081 #define BSP_CAMERA_IRQHandler      DCMI_IRQHandler
00082 #define BSP_CAMERA_DMA_IRQHandler  DMA2_Stream3_IRQHandler
00083  
00084 /* DCMI DMA Stream definitions */
00085 #define CAMERA_DCMI_DMAx_CLK_ENABLE         __HAL_RCC_DMA2_CLK_ENABLE
00086 #define CAMERA_DCMI_DMAx_STREAM             DMA2_Stream3
00087 #define CAMERA_DCMI_DMAx_IRQ                DMA2_Stream3_IRQn 
00088 
00089 /** 
00090   * @brief  CAMERA FB_StartAddress  
00091   */
00092 #define CAMERA_FB_START_ADDRESS       ((uint32_t)0xD0600000)
00093  
00094 /**
00095   * @}
00096   */
00097 
00098 /** @addtogroup STM32H747I_DISCOVERY_CAMERA_Exported_Functions
00099   * @{
00100   */    
00101 uint8_t BSP_CAMERA_Init(uint32_t Resolution);  
00102 uint8_t BSP_CAMERA_DeInit(void);
00103 void    BSP_CAMERA_ContinuousStart(uint8_t *buff);
00104 void    BSP_CAMERA_SnapshotStart(uint8_t *buff);
00105 void    BSP_CAMERA_Suspend(void);
00106 void    BSP_CAMERA_Resume(void);
00107 uint8_t BSP_CAMERA_Stop(void); 
00108 void    BSP_CAMERA_PwrUp(void);
00109 void    BSP_CAMERA_PwrDown(void);
00110 void    BSP_CAMERA_LineEventCallback(void);
00111 void    BSP_CAMERA_VsyncEventCallback(void);
00112 void    BSP_CAMERA_FrameEventCallback(void);
00113 void    BSP_CAMERA_ErrorCallback(void);
00114 
00115 /* Camera features functions prototype */
00116 void    BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
00117 void    BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
00118 void    BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
00119  
00120 /* These functions can be modified in case the current settings (e.g. DMA stream)
00121    need to be changed for specific application needs */
00122 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00123 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00124 uint8_t  BSP_CAMERA_SetRotation(uint32_t rotation);
00125 uint32_t BSP_CAMERA_GetRotation(void);
00126 
00127 /**
00128   * @}
00129   */ 
00130 
00131 /**
00132   * @}
00133   */ 
00134 
00135 /**
00136   * @}
00137   */
00138 
00139 /**
00140   * @}
00141   */
00142 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 #endif /* __STM32H747I_DISCOVERY_CAMERA_H */
00148 
00149 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/