STM32F439xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f4xx_hal_dcmi_ex.h 00004 * @author MCD Application Team 00005 * @brief Header file of DCMI Extension HAL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> 00010 * 00011 * Redistribution and use in source and binary forms, with or without modification, 00012 * are permitted provided that the following conditions are met: 00013 * 1. Redistributions of source code must retain the above copyright notice, 00014 * this list of conditions and the following disclaimer. 00015 * 2. Redistributions in binary form must reproduce the above copyright notice, 00016 * this list of conditions and the following disclaimer in the documentation 00017 * and/or other materials provided with the distribution. 00018 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00019 * may be used to endorse or promote products derived from this software 00020 * without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00025 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00026 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00027 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00028 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00030 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00031 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 * 00033 ****************************************************************************** 00034 */ 00035 00036 /* Define to prevent recursive inclusion -------------------------------------*/ 00037 #ifndef __STM32F4xx_HAL_DCMI_EX_H 00038 #define __STM32F4xx_HAL_DCMI_EX_H 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 #if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\ 00045 defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) || defined(STM32F469xx) ||\ 00046 defined(STM32F479xx) 00047 00048 /* Includes ------------------------------------------------------------------*/ 00049 #include "stm32f4xx_hal_def.h" 00050 00051 00052 /** @addtogroup STM32F4xx_HAL_Driver 00053 * @{ 00054 */ 00055 00056 /** @addtogroup DCMIEx 00057 * @brief DCMI HAL module driver 00058 * @{ 00059 */ 00060 00061 /* Exported types ------------------------------------------------------------*/ 00062 /** @defgroup DCMIEx_Exported_Types DCMI Extended Exported Types 00063 * @{ 00064 */ 00065 /** 00066 * @brief DCMIEx Embedded Synchronisation CODE Init structure definition 00067 */ 00068 typedef struct 00069 { 00070 uint8_t FrameStartCode; /*!< Specifies the code of the frame start delimiter. */ 00071 uint8_t LineStartCode; /*!< Specifies the code of the line start delimiter. */ 00072 uint8_t LineEndCode; /*!< Specifies the code of the line end delimiter. */ 00073 uint8_t FrameEndCode; /*!< Specifies the code of the frame end delimiter. */ 00074 }DCMI_CodesInitTypeDef; 00075 00076 /** 00077 * @brief DCMI Init structure definition 00078 */ 00079 typedef struct 00080 { 00081 uint32_t SynchroMode; /*!< Specifies the Synchronization Mode: Hardware or Embedded. 00082 This parameter can be a value of @ref DCMI_Synchronization_Mode */ 00083 00084 uint32_t PCKPolarity; /*!< Specifies the Pixel clock polarity: Falling or Rising. 00085 This parameter can be a value of @ref DCMI_PIXCK_Polarity */ 00086 00087 uint32_t VSPolarity; /*!< Specifies the Vertical synchronization polarity: High or Low. 00088 This parameter can be a value of @ref DCMI_VSYNC_Polarity */ 00089 00090 uint32_t HSPolarity; /*!< Specifies the Horizontal synchronization polarity: High or Low. 00091 This parameter can be a value of @ref DCMI_HSYNC_Polarity */ 00092 00093 uint32_t CaptureRate; /*!< Specifies the frequency of frame capture: All, 1/2 or 1/4. 00094 This parameter can be a value of @ref DCMI_Capture_Rate */ 00095 00096 uint32_t ExtendedDataMode; /*!< Specifies the data width: 8-bit, 10-bit, 12-bit or 14-bit. 00097 This parameter can be a value of @ref DCMI_Extended_Data_Mode */ 00098 00099 DCMI_CodesInitTypeDef SyncroCode; /*!< Specifies the code of the frame start delimiter. */ 00100 00101 uint32_t JPEGMode; /*!< Enable or Disable the JPEG mode 00102 This parameter can be a value of @ref DCMI_MODE_JPEG */ 00103 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) 00104 uint32_t ByteSelectMode; /*!< Specifies the data to be captured by the interface 00105 This parameter can be a value of @ref DCMIEx_Byte_Select_Mode */ 00106 00107 uint32_t ByteSelectStart; /*!< Specifies if the data to be captured by the interface is even or odd 00108 This parameter can be a value of @ref DCMIEx_Byte_Select_Start */ 00109 00110 uint32_t LineSelectMode; /*!< Specifies the line of data to be captured by the interface 00111 This parameter can be a value of @ref DCMIEx_Line_Select_Mode */ 00112 00113 uint32_t LineSelectStart; /*!< Specifies if the line of data to be captured by the interface is even or odd 00114 This parameter can be a value of @ref DCMIEx_Line_Select_Start */ 00115 00116 #endif /* STM32F446xx || STM32F469xx || STM32F479xx */ 00117 }DCMI_InitTypeDef; 00118 00119 /** 00120 * @} 00121 */ 00122 00123 /* Exported constants --------------------------------------------------------*/ 00124 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) 00125 /** @defgroup DCMIEx_Exported_Constants DCMI Exported Constants 00126 * @{ 00127 */ 00128 00129 /** @defgroup DCMIEx_Byte_Select_Mode DCMI Byte Select Mode 00130 * @{ 00131 */ 00132 #define DCMI_BSM_ALL 0x00000000U /*!< Interface captures all received data */ 00133 #define DCMI_BSM_OTHER ((uint32_t)DCMI_CR_BSM_0) /*!< Interface captures every other byte from the received data */ 00134 #define DCMI_BSM_ALTERNATE_4 ((uint32_t)DCMI_CR_BSM_1) /*!< Interface captures one byte out of four */ 00135 #define DCMI_BSM_ALTERNATE_2 ((uint32_t)(DCMI_CR_BSM_0 | DCMI_CR_BSM_1)) /*!< Interface captures two bytes out of four */ 00136 00137 /** 00138 * @} 00139 */ 00140 00141 /** @defgroup DCMIEx_Byte_Select_Start DCMI Byte Select Start 00142 * @{ 00143 */ 00144 #define DCMI_OEBS_ODD 0x00000000U /*!< Interface captures first data from the frame/line start, second one being dropped */ 00145 #define DCMI_OEBS_EVEN ((uint32_t)DCMI_CR_OEBS) /*!< Interface captures second data from the frame/line start, first one being dropped */ 00146 00147 /** 00148 * @} 00149 */ 00150 00151 /** @defgroup DCMIEx_Line_Select_Mode DCMI Line Select Mode 00152 * @{ 00153 */ 00154 #define DCMI_LSM_ALL 0x00000000U /*!< Interface captures all received lines */ 00155 #define DCMI_LSM_ALTERNATE_2 ((uint32_t)DCMI_CR_LSM) /*!< Interface captures one line out of two */ 00156 00157 /** 00158 * @} 00159 */ 00160 00161 /** @defgroup DCMIEx_Line_Select_Start DCMI Line Select Start 00162 * @{ 00163 */ 00164 #define DCMI_OELS_ODD 0x00000000U /*!< Interface captures first line from the frame start, second one being dropped */ 00165 #define DCMI_OELS_EVEN ((uint32_t)DCMI_CR_OELS) /*!< Interface captures second line from the frame start, first one being dropped */ 00166 00167 /** 00168 * @} 00169 */ 00170 00171 /** 00172 * @} 00173 */ 00174 #endif /* STM32F446xx || STM32F469xx || STM32F479xx */ 00175 00176 /* Exported macro ------------------------------------------------------------*/ 00177 /* Exported functions --------------------------------------------------------*/ 00178 /* Private types -------------------------------------------------------------*/ 00179 /* Private variables ---------------------------------------------------------*/ 00180 /* Private constants ---------------------------------------------------------*/ 00181 #define DCMI_POSITION_ESCR_LSC (uint32_t)DCMI_ESCR_LSC_Pos /*!< Required left shift to set line start delimiter */ 00182 #define DCMI_POSITION_ESCR_LEC (uint32_t)DCMI_ESCR_LEC_Pos /*!< Required left shift to set line end delimiter */ 00183 #define DCMI_POSITION_ESCR_FEC (uint32_t)DCMI_ESCR_FEC_Pos /*!< Required left shift to set frame end delimiter */ 00184 00185 /* Private macro -------------------------------------------------------------*/ 00186 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) 00187 /** @defgroup DCMIEx_Private_Macros DCMI Extended Private Macros 00188 * @{ 00189 */ 00190 #define IS_DCMI_BYTE_SELECT_MODE(MODE)(((MODE) == DCMI_BSM_ALL) || \ 00191 ((MODE) == DCMI_BSM_OTHER) || \ 00192 ((MODE) == DCMI_BSM_ALTERNATE_4) || \ 00193 ((MODE) == DCMI_BSM_ALTERNATE_2)) 00194 00195 #define IS_DCMI_BYTE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OEBS_ODD) || \ 00196 ((POLARITY) == DCMI_OEBS_EVEN)) 00197 00198 #define IS_DCMI_LINE_SELECT_MODE(MODE)(((MODE) == DCMI_LSM_ALL) || \ 00199 ((MODE) == DCMI_LSM_ALTERNATE_2)) 00200 00201 #define IS_DCMI_LINE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OELS_ODD) || \ 00202 ((POLARITY) == DCMI_OELS_EVEN)) 00203 #endif /* STM32F446xx || STM32F469xx || STM32F479xx */ 00204 /** 00205 * @} 00206 */ 00207 00208 /* Private functions ---------------------------------------------------------*/ 00209 #endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ 00210 STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\ 00211 STM32F479xx */ 00212 00213 00214 /** 00215 * @} 00216 */ 00217 00218 /** 00219 * @} 00220 */ 00221 00222 #ifdef __cplusplus 00223 } 00224 #endif 00225 00226 #endif /* __STM32F4xx_HAL_DCMI_H */ 00227 00228 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/