001

Committer:
ganlikun
Date:
Sun Jun 12 14:02:44 2022 +0000
Revision:
0:13413ea9a877
00

Who changed what in which revision?

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