Projet

Dependents:   DISCO-F746NG_Scope_copy

Fork of BSP_DISCO_F746NG by ST

Committer:
bcostm
Date:
Wed Nov 09 18:26:13 2016 +0100
Revision:
5:5a395e126678
Parent:
1:ee089790cdbb
Add more MBED comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 1:ee089790cdbb 1 /**
bcostm 1:ee089790cdbb 2 ******************************************************************************
bcostm 1:ee089790cdbb 3 * @file stm32746g_discovery_camera.h
bcostm 1:ee089790cdbb 4 * @author MCD Application Team
bcostm 1:ee089790cdbb 5 * @version V1.0.0
bcostm 1:ee089790cdbb 6 * @date 25-June-2015
bcostm 1:ee089790cdbb 7 * @brief This file contains the common defines and functions prototypes for
bcostm 1:ee089790cdbb 8 * the stm32746g_discovery_camera.c driver.
bcostm 1:ee089790cdbb 9 ******************************************************************************
bcostm 1:ee089790cdbb 10 * @attention
bcostm 1:ee089790cdbb 11 *
bcostm 1:ee089790cdbb 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bcostm 1:ee089790cdbb 13 *
bcostm 1:ee089790cdbb 14 * Redistribution and use in source and binary forms, with or without modification,
bcostm 1:ee089790cdbb 15 * are permitted provided that the following conditions are met:
bcostm 1:ee089790cdbb 16 * 1. Redistributions of source code must retain the above copyright notice,
bcostm 1:ee089790cdbb 17 * this list of conditions and the following disclaimer.
bcostm 1:ee089790cdbb 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
bcostm 1:ee089790cdbb 19 * this list of conditions and the following disclaimer in the documentation
bcostm 1:ee089790cdbb 20 * and/or other materials provided with the distribution.
bcostm 1:ee089790cdbb 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bcostm 1:ee089790cdbb 22 * may be used to endorse or promote products derived from this software
bcostm 1:ee089790cdbb 23 * without specific prior written permission.
bcostm 1:ee089790cdbb 24 *
bcostm 1:ee089790cdbb 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bcostm 1:ee089790cdbb 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bcostm 1:ee089790cdbb 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bcostm 1:ee089790cdbb 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bcostm 1:ee089790cdbb 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bcostm 1:ee089790cdbb 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bcostm 1:ee089790cdbb 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bcostm 1:ee089790cdbb 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bcostm 1:ee089790cdbb 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bcostm 1:ee089790cdbb 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bcostm 1:ee089790cdbb 35 *
bcostm 1:ee089790cdbb 36 ******************************************************************************
bcostm 1:ee089790cdbb 37 */
bcostm 1:ee089790cdbb 38
bcostm 1:ee089790cdbb 39 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 1:ee089790cdbb 40 #ifndef __STM32746G_DISCOVERY_CAMERA_H
bcostm 1:ee089790cdbb 41 #define __STM32746G_DISCOVERY_CAMERA_H
bcostm 1:ee089790cdbb 42
bcostm 1:ee089790cdbb 43 #ifdef __cplusplus
bcostm 1:ee089790cdbb 44 extern "C" {
bcostm 1:ee089790cdbb 45 #endif
bcostm 1:ee089790cdbb 46
bcostm 1:ee089790cdbb 47 /* Includes ------------------------------------------------------------------*/
bcostm 1:ee089790cdbb 48 /* Include Camera component Driver */
bcostm 5:5a395e126678 49 #include "ov9655.h" // MBED
bcostm 1:ee089790cdbb 50 #include "stm32746g_discovery.h"
bcostm 1:ee089790cdbb 51
bcostm 1:ee089790cdbb 52 /** @addtogroup BSP
bcostm 1:ee089790cdbb 53 * @{
bcostm 1:ee089790cdbb 54 */
bcostm 1:ee089790cdbb 55
bcostm 1:ee089790cdbb 56 /** @addtogroup STM32746G_DISCOVERY
bcostm 1:ee089790cdbb 57 * @{
bcostm 1:ee089790cdbb 58 */
bcostm 1:ee089790cdbb 59
bcostm 1:ee089790cdbb 60 /** @addtogroup STM32746G_DISCOVERY_CAMERA
bcostm 1:ee089790cdbb 61 * @{
bcostm 1:ee089790cdbb 62 */
bcostm 1:ee089790cdbb 63
bcostm 1:ee089790cdbb 64 /** @defgroup STM32746G_DISCOVERY_CAMERA_Exported_Types STM32746G_DISCOVERY_CAMERA Exported Types
bcostm 1:ee089790cdbb 65 * @{
bcostm 1:ee089790cdbb 66 */
bcostm 1:ee089790cdbb 67
bcostm 1:ee089790cdbb 68 /**
bcostm 1:ee089790cdbb 69 * @brief Camera State structures definition
bcostm 1:ee089790cdbb 70 */
bcostm 1:ee089790cdbb 71 typedef enum
bcostm 1:ee089790cdbb 72 {
bcostm 1:ee089790cdbb 73 CAMERA_OK = 0x00,
bcostm 1:ee089790cdbb 74 CAMERA_ERROR = 0x01,
bcostm 1:ee089790cdbb 75 CAMERA_TIMEOUT = 0x02,
bcostm 1:ee089790cdbb 76 CAMERA_NOT_DETECTED = 0x03,
bcostm 1:ee089790cdbb 77 CAMERA_NOT_SUPPORTED = 0x04
bcostm 1:ee089790cdbb 78
bcostm 1:ee089790cdbb 79 } Camera_StatusTypeDef;
bcostm 1:ee089790cdbb 80
bcostm 1:ee089790cdbb 81 #define RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */
bcostm 1:ee089790cdbb 82 #define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */
bcostm 1:ee089790cdbb 83 #define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */
bcostm 1:ee089790cdbb 84 #define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */
bcostm 1:ee089790cdbb 85 /**
bcostm 1:ee089790cdbb 86 * @}
bcostm 1:ee089790cdbb 87 */
bcostm 1:ee089790cdbb 88
bcostm 1:ee089790cdbb 89 /** @defgroup STM32746G_DISCOVERY_CAMERA_Exported_Constants STM32746G_DISCOVERY_CAMERA Exported Constants
bcostm 1:ee089790cdbb 90 * @{
bcostm 1:ee089790cdbb 91 */
bcostm 1:ee089790cdbb 92 /**
bcostm 1:ee089790cdbb 93 * @}
bcostm 1:ee089790cdbb 94 */
bcostm 1:ee089790cdbb 95
bcostm 1:ee089790cdbb 96 /** @addtogroup STM32746G_DISCOVERY_CAMERA_Exported_Functions
bcostm 1:ee089790cdbb 97 * @{
bcostm 1:ee089790cdbb 98 */
bcostm 1:ee089790cdbb 99 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
bcostm 1:ee089790cdbb 100 uint8_t BSP_CAMERA_DeInit(void);
bcostm 1:ee089790cdbb 101 void BSP_CAMERA_ContinuousStart(uint8_t *buff);
bcostm 1:ee089790cdbb 102 void BSP_CAMERA_SnapshotStart(uint8_t *buff);
bcostm 1:ee089790cdbb 103 void BSP_CAMERA_Suspend(void);
bcostm 1:ee089790cdbb 104 void BSP_CAMERA_Resume(void);
bcostm 1:ee089790cdbb 105 uint8_t BSP_CAMERA_Stop(void);
bcostm 1:ee089790cdbb 106 void BSP_CAMERA_PwrUp(void);
bcostm 1:ee089790cdbb 107 void BSP_CAMERA_PwrDown(void);
bcostm 1:ee089790cdbb 108 void BSP_CAMERA_LineEventCallback(void);
bcostm 1:ee089790cdbb 109 void BSP_CAMERA_VsyncEventCallback(void);
bcostm 1:ee089790cdbb 110 void BSP_CAMERA_FrameEventCallback(void);
bcostm 1:ee089790cdbb 111 void BSP_CAMERA_ErrorCallback(void);
bcostm 1:ee089790cdbb 112
bcostm 1:ee089790cdbb 113 /* Camera features functions prototype */
bcostm 1:ee089790cdbb 114 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
bcostm 1:ee089790cdbb 115 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
bcostm 1:ee089790cdbb 116 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
bcostm 1:ee089790cdbb 117
bcostm 1:ee089790cdbb 118 /* To be called in DCMI_IRQHandler function */
bcostm 1:ee089790cdbb 119 void BSP_CAMERA_IRQHandler(void);
bcostm 1:ee089790cdbb 120 /* To be called in DMA2_Stream1_IRQHandler function */
bcostm 1:ee089790cdbb 121 void BSP_CAMERA_DMA_IRQHandler(void);
bcostm 1:ee089790cdbb 122
bcostm 1:ee089790cdbb 123 /* These functions can be modified in case the current settings (e.g. DMA stream)
bcostm 1:ee089790cdbb 124 need to be changed for specific application needs */
bcostm 1:ee089790cdbb 125 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
bcostm 1:ee089790cdbb 126 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
bcostm 1:ee089790cdbb 127
bcostm 1:ee089790cdbb 128
bcostm 1:ee089790cdbb 129 /**
bcostm 1:ee089790cdbb 130 * @}
bcostm 1:ee089790cdbb 131 */
bcostm 1:ee089790cdbb 132
bcostm 1:ee089790cdbb 133 /**
bcostm 1:ee089790cdbb 134 * @}
bcostm 1:ee089790cdbb 135 */
bcostm 1:ee089790cdbb 136
bcostm 1:ee089790cdbb 137 /**
bcostm 1:ee089790cdbb 138 * @}
bcostm 1:ee089790cdbb 139 */
bcostm 1:ee089790cdbb 140
bcostm 1:ee089790cdbb 141 /**
bcostm 1:ee089790cdbb 142 * @}
bcostm 1:ee089790cdbb 143 */
bcostm 1:ee089790cdbb 144
bcostm 1:ee089790cdbb 145 #ifdef __cplusplus
bcostm 1:ee089790cdbb 146 }
bcostm 1:ee089790cdbb 147 #endif
bcostm 1:ee089790cdbb 148
bcostm 1:ee089790cdbb 149 #endif /* __STM32746G_DISCOVERY_CAMERA_H */
bcostm 1:ee089790cdbb 150
bcostm 1:ee089790cdbb 151 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/