inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NYX 0:85b3fd62ea1a 1 /**
NYX 0:85b3fd62ea1a 2 ******************************************************************************
NYX 0:85b3fd62ea1a 3 * @file stm32f4xx_hal_dcmi_ex.h
NYX 0:85b3fd62ea1a 4 * @author MCD Application Team
NYX 0:85b3fd62ea1a 5 * @version V1.7.1
NYX 0:85b3fd62ea1a 6 * @date 14-April-2017
NYX 0:85b3fd62ea1a 7 * @brief Header file of DCMI Extension HAL module.
NYX 0:85b3fd62ea1a 8 ******************************************************************************
NYX 0:85b3fd62ea1a 9 * @attention
NYX 0:85b3fd62ea1a 10 *
NYX 0:85b3fd62ea1a 11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
NYX 0:85b3fd62ea1a 12 *
NYX 0:85b3fd62ea1a 13 * Redistribution and use in source and binary forms, with or without modification,
NYX 0:85b3fd62ea1a 14 * are permitted provided that the following conditions are met:
NYX 0:85b3fd62ea1a 15 * 1. Redistributions of source code must retain the above copyright notice,
NYX 0:85b3fd62ea1a 16 * this list of conditions and the following disclaimer.
NYX 0:85b3fd62ea1a 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
NYX 0:85b3fd62ea1a 18 * this list of conditions and the following disclaimer in the documentation
NYX 0:85b3fd62ea1a 19 * and/or other materials provided with the distribution.
NYX 0:85b3fd62ea1a 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
NYX 0:85b3fd62ea1a 21 * may be used to endorse or promote products derived from this software
NYX 0:85b3fd62ea1a 22 * without specific prior written permission.
NYX 0:85b3fd62ea1a 23 *
NYX 0:85b3fd62ea1a 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
NYX 0:85b3fd62ea1a 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
NYX 0:85b3fd62ea1a 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
NYX 0:85b3fd62ea1a 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
NYX 0:85b3fd62ea1a 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
NYX 0:85b3fd62ea1a 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
NYX 0:85b3fd62ea1a 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
NYX 0:85b3fd62ea1a 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
NYX 0:85b3fd62ea1a 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
NYX 0:85b3fd62ea1a 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NYX 0:85b3fd62ea1a 34 *
NYX 0:85b3fd62ea1a 35 ******************************************************************************
NYX 0:85b3fd62ea1a 36 */
NYX 0:85b3fd62ea1a 37
NYX 0:85b3fd62ea1a 38 /* Define to prevent recursive inclusion -------------------------------------*/
NYX 0:85b3fd62ea1a 39 #ifndef __STM32F4xx_HAL_DCMI_EX_H
NYX 0:85b3fd62ea1a 40 #define __STM32F4xx_HAL_DCMI_EX_H
NYX 0:85b3fd62ea1a 41
NYX 0:85b3fd62ea1a 42 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 43 extern "C" {
NYX 0:85b3fd62ea1a 44 #endif
NYX 0:85b3fd62ea1a 45
NYX 0:85b3fd62ea1a 46 #if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\
NYX 0:85b3fd62ea1a 47 defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) || defined(STM32F469xx) ||\
NYX 0:85b3fd62ea1a 48 defined(STM32F479xx)
NYX 0:85b3fd62ea1a 49
NYX 0:85b3fd62ea1a 50 /* Includes ------------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 51 #include "stm32f4xx_hal_def.h"
NYX 0:85b3fd62ea1a 52
NYX 0:85b3fd62ea1a 53
NYX 0:85b3fd62ea1a 54 /** @addtogroup STM32F4xx_HAL_Driver
NYX 0:85b3fd62ea1a 55 * @{
NYX 0:85b3fd62ea1a 56 */
NYX 0:85b3fd62ea1a 57
NYX 0:85b3fd62ea1a 58 /** @addtogroup DCMIEx
NYX 0:85b3fd62ea1a 59 * @brief DCMI HAL module driver
NYX 0:85b3fd62ea1a 60 * @{
NYX 0:85b3fd62ea1a 61 */
NYX 0:85b3fd62ea1a 62
NYX 0:85b3fd62ea1a 63 /* Exported types ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 64 /** @defgroup DCMIEx_Exported_Types DCMI Extended Exported Types
NYX 0:85b3fd62ea1a 65 * @{
NYX 0:85b3fd62ea1a 66 */
NYX 0:85b3fd62ea1a 67 /**
NYX 0:85b3fd62ea1a 68 * @brief DCMIEx Embedded Synchronisation CODE Init structure definition
NYX 0:85b3fd62ea1a 69 */
NYX 0:85b3fd62ea1a 70 typedef struct
NYX 0:85b3fd62ea1a 71 {
NYX 0:85b3fd62ea1a 72 uint8_t FrameStartCode; /*!< Specifies the code of the frame start delimiter. */
NYX 0:85b3fd62ea1a 73 uint8_t LineStartCode; /*!< Specifies the code of the line start delimiter. */
NYX 0:85b3fd62ea1a 74 uint8_t LineEndCode; /*!< Specifies the code of the line end delimiter. */
NYX 0:85b3fd62ea1a 75 uint8_t FrameEndCode; /*!< Specifies the code of the frame end delimiter. */
NYX 0:85b3fd62ea1a 76 }DCMI_CodesInitTypeDef;
NYX 0:85b3fd62ea1a 77
NYX 0:85b3fd62ea1a 78 /**
NYX 0:85b3fd62ea1a 79 * @brief DCMI Init structure definition
NYX 0:85b3fd62ea1a 80 */
NYX 0:85b3fd62ea1a 81 typedef struct
NYX 0:85b3fd62ea1a 82 {
NYX 0:85b3fd62ea1a 83 uint32_t SynchroMode; /*!< Specifies the Synchronization Mode: Hardware or Embedded.
NYX 0:85b3fd62ea1a 84 This parameter can be a value of @ref DCMI_Synchronization_Mode */
NYX 0:85b3fd62ea1a 85
NYX 0:85b3fd62ea1a 86 uint32_t PCKPolarity; /*!< Specifies the Pixel clock polarity: Falling or Rising.
NYX 0:85b3fd62ea1a 87 This parameter can be a value of @ref DCMI_PIXCK_Polarity */
NYX 0:85b3fd62ea1a 88
NYX 0:85b3fd62ea1a 89 uint32_t VSPolarity; /*!< Specifies the Vertical synchronization polarity: High or Low.
NYX 0:85b3fd62ea1a 90 This parameter can be a value of @ref DCMI_VSYNC_Polarity */
NYX 0:85b3fd62ea1a 91
NYX 0:85b3fd62ea1a 92 uint32_t HSPolarity; /*!< Specifies the Horizontal synchronization polarity: High or Low.
NYX 0:85b3fd62ea1a 93 This parameter can be a value of @ref DCMI_HSYNC_Polarity */
NYX 0:85b3fd62ea1a 94
NYX 0:85b3fd62ea1a 95 uint32_t CaptureRate; /*!< Specifies the frequency of frame capture: All, 1/2 or 1/4.
NYX 0:85b3fd62ea1a 96 This parameter can be a value of @ref DCMI_Capture_Rate */
NYX 0:85b3fd62ea1a 97
NYX 0:85b3fd62ea1a 98 uint32_t ExtendedDataMode; /*!< Specifies the data width: 8-bit, 10-bit, 12-bit or 14-bit.
NYX 0:85b3fd62ea1a 99 This parameter can be a value of @ref DCMI_Extended_Data_Mode */
NYX 0:85b3fd62ea1a 100
NYX 0:85b3fd62ea1a 101 DCMI_CodesInitTypeDef SyncroCode; /*!< Specifies the code of the frame start delimiter. */
NYX 0:85b3fd62ea1a 102
NYX 0:85b3fd62ea1a 103 uint32_t JPEGMode; /*!< Enable or Disable the JPEG mode
NYX 0:85b3fd62ea1a 104 This parameter can be a value of @ref DCMI_MODE_JPEG */
NYX 0:85b3fd62ea1a 105 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
NYX 0:85b3fd62ea1a 106 uint32_t ByteSelectMode; /*!< Specifies the data to be captured by the interface
NYX 0:85b3fd62ea1a 107 This parameter can be a value of @ref DCMIEx_Byte_Select_Mode */
NYX 0:85b3fd62ea1a 108
NYX 0:85b3fd62ea1a 109 uint32_t ByteSelectStart; /*!< Specifies if the data to be captured by the interface is even or odd
NYX 0:85b3fd62ea1a 110 This parameter can be a value of @ref DCMIEx_Byte_Select_Start */
NYX 0:85b3fd62ea1a 111
NYX 0:85b3fd62ea1a 112 uint32_t LineSelectMode; /*!< Specifies the line of data to be captured by the interface
NYX 0:85b3fd62ea1a 113 This parameter can be a value of @ref DCMIEx_Line_Select_Mode */
NYX 0:85b3fd62ea1a 114
NYX 0:85b3fd62ea1a 115 uint32_t LineSelectStart; /*!< Specifies if the line of data to be captured by the interface is even or odd
NYX 0:85b3fd62ea1a 116 This parameter can be a value of @ref DCMIEx_Line_Select_Start */
NYX 0:85b3fd62ea1a 117
NYX 0:85b3fd62ea1a 118 #endif /* STM32F446xx || STM32F469xx || STM32F479xx */
NYX 0:85b3fd62ea1a 119 }DCMI_InitTypeDef;
NYX 0:85b3fd62ea1a 120
NYX 0:85b3fd62ea1a 121 /**
NYX 0:85b3fd62ea1a 122 * @}
NYX 0:85b3fd62ea1a 123 */
NYX 0:85b3fd62ea1a 124
NYX 0:85b3fd62ea1a 125 /* Exported constants --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 126 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
NYX 0:85b3fd62ea1a 127 /** @defgroup DCMIEx_Exported_Constants DCMI Exported Constants
NYX 0:85b3fd62ea1a 128 * @{
NYX 0:85b3fd62ea1a 129 */
NYX 0:85b3fd62ea1a 130
NYX 0:85b3fd62ea1a 131 /** @defgroup DCMIEx_Byte_Select_Mode DCMI Byte Select Mode
NYX 0:85b3fd62ea1a 132 * @{
NYX 0:85b3fd62ea1a 133 */
NYX 0:85b3fd62ea1a 134 #define DCMI_BSM_ALL 0x00000000U /*!< Interface captures all received data */
NYX 0:85b3fd62ea1a 135 #define DCMI_BSM_OTHER ((uint32_t)DCMI_CR_BSM_0) /*!< Interface captures every other byte from the received data */
NYX 0:85b3fd62ea1a 136 #define DCMI_BSM_ALTERNATE_4 ((uint32_t)DCMI_CR_BSM_1) /*!< Interface captures one byte out of four */
NYX 0:85b3fd62ea1a 137 #define DCMI_BSM_ALTERNATE_2 ((uint32_t)(DCMI_CR_BSM_0 | DCMI_CR_BSM_1)) /*!< Interface captures two bytes out of four */
NYX 0:85b3fd62ea1a 138
NYX 0:85b3fd62ea1a 139 /**
NYX 0:85b3fd62ea1a 140 * @}
NYX 0:85b3fd62ea1a 141 */
NYX 0:85b3fd62ea1a 142
NYX 0:85b3fd62ea1a 143 /** @defgroup DCMIEx_Byte_Select_Start DCMI Byte Select Start
NYX 0:85b3fd62ea1a 144 * @{
NYX 0:85b3fd62ea1a 145 */
NYX 0:85b3fd62ea1a 146 #define DCMI_OEBS_ODD 0x00000000U /*!< Interface captures first data from the frame/line start, second one being dropped */
NYX 0:85b3fd62ea1a 147 #define DCMI_OEBS_EVEN ((uint32_t)DCMI_CR_OEBS) /*!< Interface captures second data from the frame/line start, first one being dropped */
NYX 0:85b3fd62ea1a 148
NYX 0:85b3fd62ea1a 149 /**
NYX 0:85b3fd62ea1a 150 * @}
NYX 0:85b3fd62ea1a 151 */
NYX 0:85b3fd62ea1a 152
NYX 0:85b3fd62ea1a 153 /** @defgroup DCMIEx_Line_Select_Mode DCMI Line Select Mode
NYX 0:85b3fd62ea1a 154 * @{
NYX 0:85b3fd62ea1a 155 */
NYX 0:85b3fd62ea1a 156 #define DCMI_LSM_ALL 0x00000000U /*!< Interface captures all received lines */
NYX 0:85b3fd62ea1a 157 #define DCMI_LSM_ALTERNATE_2 ((uint32_t)DCMI_CR_LSM) /*!< Interface captures one line out of two */
NYX 0:85b3fd62ea1a 158
NYX 0:85b3fd62ea1a 159 /**
NYX 0:85b3fd62ea1a 160 * @}
NYX 0:85b3fd62ea1a 161 */
NYX 0:85b3fd62ea1a 162
NYX 0:85b3fd62ea1a 163 /** @defgroup DCMIEx_Line_Select_Start DCMI Line Select Start
NYX 0:85b3fd62ea1a 164 * @{
NYX 0:85b3fd62ea1a 165 */
NYX 0:85b3fd62ea1a 166 #define DCMI_OELS_ODD 0x00000000U /*!< Interface captures first line from the frame start, second one being dropped */
NYX 0:85b3fd62ea1a 167 #define DCMI_OELS_EVEN ((uint32_t)DCMI_CR_OELS) /*!< Interface captures second line from the frame start, first one being dropped */
NYX 0:85b3fd62ea1a 168
NYX 0:85b3fd62ea1a 169 /**
NYX 0:85b3fd62ea1a 170 * @}
NYX 0:85b3fd62ea1a 171 */
NYX 0:85b3fd62ea1a 172
NYX 0:85b3fd62ea1a 173 /**
NYX 0:85b3fd62ea1a 174 * @}
NYX 0:85b3fd62ea1a 175 */
NYX 0:85b3fd62ea1a 176 #endif /* STM32F446xx || STM32F469xx || STM32F479xx */
NYX 0:85b3fd62ea1a 177
NYX 0:85b3fd62ea1a 178 /* Exported macro ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 179 /* Exported functions --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 180 /* Private types -------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 181 /* Private variables ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 182 /* Private constants ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 183 #define DCMI_POSITION_ESCR_LSC (uint32_t)POSITION_VAL(DCMI_ESCR_LSC) /*!< Required left shift to set line start delimiter */
NYX 0:85b3fd62ea1a 184 #define DCMI_POSITION_ESCR_LEC (uint32_t)POSITION_VAL(DCMI_ESCR_LEC) /*!< Required left shift to set line end delimiter */
NYX 0:85b3fd62ea1a 185 #define DCMI_POSITION_ESCR_FEC (uint32_t)POSITION_VAL(DCMI_ESCR_FEC) /*!< Required left shift to set frame end delimiter */
NYX 0:85b3fd62ea1a 186
NYX 0:85b3fd62ea1a 187 /* Private macro -------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 188 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
NYX 0:85b3fd62ea1a 189 /** @defgroup DCMIEx_Private_Macros DCMI Extended Private Macros
NYX 0:85b3fd62ea1a 190 * @{
NYX 0:85b3fd62ea1a 191 */
NYX 0:85b3fd62ea1a 192 #define IS_DCMI_BYTE_SELECT_MODE(MODE)(((MODE) == DCMI_BSM_ALL) || \
NYX 0:85b3fd62ea1a 193 ((MODE) == DCMI_BSM_OTHER) || \
NYX 0:85b3fd62ea1a 194 ((MODE) == DCMI_BSM_ALTERNATE_4) || \
NYX 0:85b3fd62ea1a 195 ((MODE) == DCMI_BSM_ALTERNATE_2))
NYX 0:85b3fd62ea1a 196
NYX 0:85b3fd62ea1a 197 #define IS_DCMI_BYTE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OEBS_ODD) || \
NYX 0:85b3fd62ea1a 198 ((POLARITY) == DCMI_OEBS_EVEN))
NYX 0:85b3fd62ea1a 199
NYX 0:85b3fd62ea1a 200 #define IS_DCMI_LINE_SELECT_MODE(MODE)(((MODE) == DCMI_LSM_ALL) || \
NYX 0:85b3fd62ea1a 201 ((MODE) == DCMI_LSM_ALTERNATE_2))
NYX 0:85b3fd62ea1a 202
NYX 0:85b3fd62ea1a 203 #define IS_DCMI_LINE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OELS_ODD) || \
NYX 0:85b3fd62ea1a 204 ((POLARITY) == DCMI_OELS_EVEN))
NYX 0:85b3fd62ea1a 205 #endif /* STM32F446xx || STM32F469xx || STM32F479xx */
NYX 0:85b3fd62ea1a 206 /**
NYX 0:85b3fd62ea1a 207 * @}
NYX 0:85b3fd62ea1a 208 */
NYX 0:85b3fd62ea1a 209
NYX 0:85b3fd62ea1a 210 /* Private functions ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 211 #endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\
NYX 0:85b3fd62ea1a 212 STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\
NYX 0:85b3fd62ea1a 213 STM32F479xx */
NYX 0:85b3fd62ea1a 214
NYX 0:85b3fd62ea1a 215
NYX 0:85b3fd62ea1a 216 /**
NYX 0:85b3fd62ea1a 217 * @}
NYX 0:85b3fd62ea1a 218 */
NYX 0:85b3fd62ea1a 219
NYX 0:85b3fd62ea1a 220 /**
NYX 0:85b3fd62ea1a 221 * @}
NYX 0:85b3fd62ea1a 222 */
NYX 0:85b3fd62ea1a 223
NYX 0:85b3fd62ea1a 224 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 225 }
NYX 0:85b3fd62ea1a 226 #endif
NYX 0:85b3fd62ea1a 227
NYX 0:85b3fd62ea1a 228 #endif /* __STM32F4xx_HAL_DCMI_H */
NYX 0:85b3fd62ea1a 229
NYX 0:85b3fd62ea1a 230 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/