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