STM32F439xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f4xx_hal_dcmi.h 00004 * @author MCD Application Team 00005 * @brief Header file of DCMI 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_H 00038 #define __STM32F4xx_HAL_DCMI_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 /* Includes ------------------------------------------------------------------*/ 00048 #include "stm32f4xx_hal_def.h" 00049 00050 /* Include DCMI HAL Extended module */ 00051 /* (include on top of file since DCMI structures are defined in extended file) */ 00052 #include "stm32f4xx_hal_dcmi_ex.h" 00053 00054 /** @addtogroup STM32F4xx_HAL_Driver 00055 * @{ 00056 */ 00057 00058 /** @addtogroup DCMI DCMI 00059 * @brief DCMI HAL module driver 00060 * @{ 00061 */ 00062 00063 /* Exported types ------------------------------------------------------------*/ 00064 /** @defgroup DCMI_Exported_Types DCMI Exported Types 00065 * @{ 00066 */ 00067 /** 00068 * @brief HAL DCMI State structures definition 00069 */ 00070 typedef enum 00071 { 00072 HAL_DCMI_STATE_RESET = 0x00U, /*!< DCMI not yet initialized or disabled */ 00073 HAL_DCMI_STATE_READY = 0x01U, /*!< DCMI initialized and ready for use */ 00074 HAL_DCMI_STATE_BUSY = 0x02U, /*!< DCMI internal processing is ongoing */ 00075 HAL_DCMI_STATE_TIMEOUT = 0x03U, /*!< DCMI timeout state */ 00076 HAL_DCMI_STATE_ERROR = 0x04U, /*!< DCMI error state */ 00077 HAL_DCMI_STATE_SUSPENDED = 0x05U /*!< DCMI suspend state */ 00078 }HAL_DCMI_StateTypeDef; 00079 00080 /** 00081 * @brief DCMI handle Structure definition 00082 */ 00083 typedef struct 00084 { 00085 DCMI_TypeDef *Instance; /*!< DCMI Register base address */ 00086 00087 DCMI_InitTypeDef Init; /*!< DCMI parameters */ 00088 00089 HAL_LockTypeDef Lock; /*!< DCMI locking object */ 00090 00091 __IO HAL_DCMI_StateTypeDef State; /*!< DCMI state */ 00092 00093 __IO uint32_t XferCount; /*!< DMA transfer counter */ 00094 00095 __IO uint32_t XferSize; /*!< DMA transfer size */ 00096 00097 uint32_t XferTransferNumber; /*!< DMA transfer number */ 00098 00099 uint32_t pBuffPtr; /*!< Pointer to DMA output buffer */ 00100 00101 DMA_HandleTypeDef *DMA_Handle; /*!< Pointer to the DMA handler */ 00102 00103 __IO uint32_t ErrorCode; /*!< DCMI Error code */ 00104 00105 }DCMI_HandleTypeDef; 00106 /** 00107 * @} 00108 */ 00109 00110 /* Exported constants --------------------------------------------------------*/ 00111 /** @defgroup DCMI_Exported_Constants DCMI Exported Constants 00112 * @{ 00113 */ 00114 00115 /** @defgroup DCMI_Error_Code DCMI Error Code 00116 * @{ 00117 */ 00118 #define HAL_DCMI_ERROR_NONE 0x00000000U /*!< No error */ 00119 #define HAL_DCMI_ERROR_OVR 0x00000001U /*!< Overrun error */ 00120 #define HAL_DCMI_ERROR_SYNC 0x00000002U /*!< Synchronization error */ 00121 #define HAL_DCMI_ERROR_TIMEOUT 0x00000020U /*!< Timeout error */ 00122 #define HAL_DCMI_ERROR_DMA 0x00000040U /*!< DMA error */ 00123 /** 00124 * @} 00125 */ 00126 00127 /** @defgroup DCMI_Capture_Mode DCMI Capture Mode 00128 * @{ 00129 */ 00130 #define DCMI_MODE_CONTINUOUS 0x00000000U /*!< The received data are transferred continuously 00131 into the destination memory through the DMA */ 00132 #define DCMI_MODE_SNAPSHOT ((uint32_t)DCMI_CR_CM) /*!< Once activated, the interface waits for the start of 00133 frame and then transfers a single frame through the DMA */ 00134 /** 00135 * @} 00136 */ 00137 00138 /** @defgroup DCMI_Synchronization_Mode DCMI Synchronization Mode 00139 * @{ 00140 */ 00141 #define DCMI_SYNCHRO_HARDWARE 0x00000000U /*!< Hardware synchronization data capture (frame/line start/stop) 00142 is synchronized with the HSYNC/VSYNC signals */ 00143 #define DCMI_SYNCHRO_EMBEDDED ((uint32_t)DCMI_CR_ESS) /*!< Embedded synchronization data capture is synchronized with 00144 synchronization codes embedded in the data flow */ 00145 00146 /** 00147 * @} 00148 */ 00149 00150 /** @defgroup DCMI_PIXCK_Polarity DCMI PIXCK Polarity 00151 * @{ 00152 */ 00153 #define DCMI_PCKPOLARITY_FALLING 0x00000000U /*!< Pixel clock active on Falling edge */ 00154 #define DCMI_PCKPOLARITY_RISING ((uint32_t)DCMI_CR_PCKPOL) /*!< Pixel clock active on Rising edge */ 00155 00156 /** 00157 * @} 00158 */ 00159 00160 /** @defgroup DCMI_VSYNC_Polarity DCMI VSYNC Polarity 00161 * @{ 00162 */ 00163 #define DCMI_VSPOLARITY_LOW 0x00000000U /*!< Vertical synchronization active Low */ 00164 #define DCMI_VSPOLARITY_HIGH ((uint32_t)DCMI_CR_VSPOL) /*!< Vertical synchronization active High */ 00165 00166 /** 00167 * @} 00168 */ 00169 00170 /** @defgroup DCMI_HSYNC_Polarity DCMI HSYNC Polarity 00171 * @{ 00172 */ 00173 #define DCMI_HSPOLARITY_LOW 0x00000000U /*!< Horizontal synchronization active Low */ 00174 #define DCMI_HSPOLARITY_HIGH ((uint32_t)DCMI_CR_HSPOL) /*!< Horizontal synchronization active High */ 00175 00176 /** 00177 * @} 00178 */ 00179 00180 /** @defgroup DCMI_MODE_JPEG DCMI MODE JPEG 00181 * @{ 00182 */ 00183 #define DCMI_JPEG_DISABLE 0x00000000U /*!< Mode JPEG Disabled */ 00184 #define DCMI_JPEG_ENABLE ((uint32_t)DCMI_CR_JPEG) /*!< Mode JPEG Enabled */ 00185 00186 /** 00187 * @} 00188 */ 00189 00190 /** @defgroup DCMI_Capture_Rate DCMI Capture Rate 00191 * @{ 00192 */ 00193 #define DCMI_CR_ALL_FRAME 0x00000000U /*!< All frames are captured */ 00194 #define DCMI_CR_ALTERNATE_2_FRAME ((uint32_t)DCMI_CR_FCRC_0) /*!< Every alternate frame captured */ 00195 #define DCMI_CR_ALTERNATE_4_FRAME ((uint32_t)DCMI_CR_FCRC_1) /*!< One frame in 4 frames captured */ 00196 00197 /** 00198 * @} 00199 */ 00200 00201 /** @defgroup DCMI_Extended_Data_Mode DCMI Extended Data Mode 00202 * @{ 00203 */ 00204 #define DCMI_EXTEND_DATA_8B 0x00000000U /*!< Interface captures 8-bit data on every pixel clock */ 00205 #define DCMI_EXTEND_DATA_10B ((uint32_t)DCMI_CR_EDM_0) /*!< Interface captures 10-bit data on every pixel clock */ 00206 #define DCMI_EXTEND_DATA_12B ((uint32_t)DCMI_CR_EDM_1) /*!< Interface captures 12-bit data on every pixel clock */ 00207 #define DCMI_EXTEND_DATA_14B ((uint32_t)(DCMI_CR_EDM_0 | DCMI_CR_EDM_1)) /*!< Interface captures 14-bit data on every pixel clock */ 00208 00209 /** 00210 * @} 00211 */ 00212 00213 /** @defgroup DCMI_Window_Coordinate DCMI Window Coordinate 00214 * @{ 00215 */ 00216 #define DCMI_WINDOW_COORDINATE 0x3FFFU /*!< Window coordinate */ 00217 00218 /** 00219 * @} 00220 */ 00221 00222 /** @defgroup DCMI_Window_Height DCMI Window Height 00223 * @{ 00224 */ 00225 #define DCMI_WINDOW_HEIGHT 0x1FFFU /*!< Window Height */ 00226 00227 /** 00228 * @} 00229 */ 00230 00231 /** @defgroup DCMI_Window_Vertical_Line DCMI Window Vertical Line 00232 * @{ 00233 */ 00234 #define DCMI_POSITION_CWSIZE_VLINE (uint32_t)DCMI_CWSIZE_VLINE_Pos /*!< Required left shift to set crop window vertical line count */ 00235 #define DCMI_POSITION_CWSTRT_VST (uint32_t)DCMI_CWSTRT_VST_Pos /*!< Required left shift to set crop window vertical start line count */ 00236 00237 /** 00238 * @} 00239 */ 00240 00241 /** @defgroup DCMI_interrupt_sources DCMI interrupt sources 00242 * @{ 00243 */ 00244 #define DCMI_IT_FRAME ((uint32_t)DCMI_IER_FRAME_IE) /*!< Capture complete interrupt */ 00245 #define DCMI_IT_OVR ((uint32_t)DCMI_IER_OVR_IE) /*!< Overrun interrupt */ 00246 #define DCMI_IT_ERR ((uint32_t)DCMI_IER_ERR_IE) /*!< Synchronization error interrupt */ 00247 #define DCMI_IT_VSYNC ((uint32_t)DCMI_IER_VSYNC_IE) /*!< VSYNC interrupt */ 00248 #define DCMI_IT_LINE ((uint32_t)DCMI_IER_LINE_IE) /*!< Line interrupt */ 00249 /** 00250 * @} 00251 */ 00252 00253 /** @defgroup DCMI_Flags DCMI Flags 00254 * @{ 00255 */ 00256 00257 /** 00258 * @brief DCMI SR register 00259 */ 00260 #define DCMI_FLAG_HSYNC ((uint32_t)DCMI_SR_INDEX|DCMI_SR_HSYNC) /*!< HSYNC pin state (active line / synchronization between lines) */ 00261 #define DCMI_FLAG_VSYNC ((uint32_t)DCMI_SR_INDEX|DCMI_SR_VSYNC) /*!< VSYNC pin state (active frame / synchronization between frames) */ 00262 #define DCMI_FLAG_FNE ((uint32_t)DCMI_SR_INDEX|DCMI_SR_FNE) /*!< FIFO not empty flag */ 00263 /** 00264 * @brief DCMI RIS register 00265 */ 00266 #define DCMI_FLAG_FRAMERI ((uint32_t)DCMI_RISR_FRAME_RIS) /*!< Frame capture complete interrupt flag */ 00267 #define DCMI_FLAG_OVRRI ((uint32_t)DCMI_RISR_OVR_RIS) /*!< Overrun interrupt flag */ 00268 #define DCMI_FLAG_ERRRI ((uint32_t)DCMI_RISR_ERR_RIS) /*!< Synchronization error interrupt flag */ 00269 #define DCMI_FLAG_VSYNCRI ((uint32_t)DCMI_RISR_VSYNC_RIS) /*!< VSYNC interrupt flag */ 00270 #define DCMI_FLAG_LINERI ((uint32_t)DCMI_RISR_LINE_RIS) /*!< Line interrupt flag */ 00271 /** 00272 * @brief DCMI MIS register 00273 */ 00274 #define DCMI_FLAG_FRAMEMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_FRAME_MIS) /*!< DCMI Frame capture complete masked interrupt status */ 00275 #define DCMI_FLAG_OVRMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_OVR_MIS ) /*!< DCMI Overrun masked interrupt status */ 00276 #define DCMI_FLAG_ERRMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_ERR_MIS ) /*!< DCMI Synchronization error masked interrupt status */ 00277 #define DCMI_FLAG_VSYNCMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_VSYNC_MIS) /*!< DCMI VSYNC masked interrupt status */ 00278 #define DCMI_FLAG_LINEMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_LINE_MIS ) /*!< DCMI Line masked interrupt status */ 00279 /** 00280 * @} 00281 */ 00282 00283 /** 00284 * @} 00285 */ 00286 00287 /* Exported macro ------------------------------------------------------------*/ 00288 /** @defgroup DCMI_Exported_Macros DCMI Exported Macros 00289 * @{ 00290 */ 00291 00292 /** @brief Reset DCMI handle state 00293 * @param __HANDLE__ specifies the DCMI handle. 00294 * @retval None 00295 */ 00296 #define __HAL_DCMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DCMI_STATE_RESET) 00297 00298 /** 00299 * @brief Enable the DCMI. 00300 * @param __HANDLE__ DCMI handle 00301 * @retval None 00302 */ 00303 #define __HAL_DCMI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DCMI_CR_ENABLE) 00304 00305 /** 00306 * @brief Disable the DCMI. 00307 * @param __HANDLE__ DCMI handle 00308 * @retval None 00309 */ 00310 #define __HAL_DCMI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(DCMI_CR_ENABLE)) 00311 00312 /* Interrupt & Flag management */ 00313 /** 00314 * @brief Get the DCMI pending flag. 00315 * @param __HANDLE__ DCMI handle 00316 * @param __FLAG__ Get the specified flag. 00317 * This parameter can be one of the following values (no combination allowed) 00318 * @arg DCMI_FLAG_HSYNC: HSYNC pin state (active line / synchronization between lines) 00319 * @arg DCMI_FLAG_VSYNC: VSYNC pin state (active frame / synchronization between frames) 00320 * @arg DCMI_FLAG_FNE: FIFO empty flag 00321 * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask 00322 * @arg DCMI_FLAG_OVRRI: Overrun flag mask 00323 * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask 00324 * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask 00325 * @arg DCMI_FLAG_LINERI: Line flag mask 00326 * @arg DCMI_FLAG_FRAMEMI: DCMI Capture complete masked interrupt status 00327 * @arg DCMI_FLAG_OVRMI: DCMI Overrun masked interrupt status 00328 * @arg DCMI_FLAG_ERRMI: DCMI Synchronization error masked interrupt status 00329 * @arg DCMI_FLAG_VSYNCMI: DCMI VSYNC masked interrupt status 00330 * @arg DCMI_FLAG_LINEMI: DCMI Line masked interrupt status 00331 * @retval The state of FLAG. 00332 */ 00333 #define __HAL_DCMI_GET_FLAG(__HANDLE__, __FLAG__)\ 00334 ((((__FLAG__) & (DCMI_SR_INDEX|DCMI_MIS_INDEX)) == 0x0U)? ((__HANDLE__)->Instance->RISR & (__FLAG__)) :\ 00335 (((__FLAG__) & DCMI_SR_INDEX) == 0x0U)? ((__HANDLE__)->Instance->MISR & (__FLAG__)) : ((__HANDLE__)->Instance->SR & (__FLAG__))) 00336 00337 /** 00338 * @brief Clear the DCMI pending flags. 00339 * @param __HANDLE__ DCMI handle 00340 * @param __FLAG__ specifies the flag to clear. 00341 * This parameter can be any combination of the following values: 00342 * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask 00343 * @arg DCMI_FLAG_OVRRI: Overrun flag mask 00344 * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask 00345 * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask 00346 * @arg DCMI_FLAG_LINERI: Line flag mask 00347 * @retval None 00348 */ 00349 #define __HAL_DCMI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__)) 00350 00351 /** 00352 * @brief Enable the specified DCMI interrupts. 00353 * @param __HANDLE__ DCMI handle 00354 * @param __INTERRUPT__ specifies the DCMI interrupt sources to be enabled. 00355 * This parameter can be any combination of the following values: 00356 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask 00357 * @arg DCMI_IT_OVR: Overrun interrupt mask 00358 * @arg DCMI_IT_ERR: Synchronization error interrupt mask 00359 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask 00360 * @arg DCMI_IT_LINE: Line interrupt mask 00361 * @retval None 00362 */ 00363 #define __HAL_DCMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__)) 00364 00365 /** 00366 * @brief Disable the specified DCMI interrupts. 00367 * @param __HANDLE__ DCMI handle 00368 * @param __INTERRUPT__ specifies the DCMI interrupt sources to be enabled. 00369 * This parameter can be any combination of the following values: 00370 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask 00371 * @arg DCMI_IT_OVR: Overrun interrupt mask 00372 * @arg DCMI_IT_ERR: Synchronization error interrupt mask 00373 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask 00374 * @arg DCMI_IT_LINE: Line interrupt mask 00375 * @retval None 00376 */ 00377 #define __HAL_DCMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__)) 00378 00379 /** 00380 * @brief Check whether the specified DCMI interrupt has occurred or not. 00381 * @param __HANDLE__ DCMI handle 00382 * @param __INTERRUPT__ specifies the DCMI interrupt source to check. 00383 * This parameter can be one of the following values: 00384 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask 00385 * @arg DCMI_IT_OVR: Overrun interrupt mask 00386 * @arg DCMI_IT_ERR: Synchronization error interrupt mask 00387 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask 00388 * @arg DCMI_IT_LINE: Line interrupt mask 00389 * @retval The state of INTERRUPT. 00390 */ 00391 #define __HAL_DCMI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__)) 00392 00393 /** 00394 * @} 00395 */ 00396 00397 /* Exported functions --------------------------------------------------------*/ 00398 /** @addtogroup DCMI_Exported_Functions DCMI Exported Functions 00399 * @{ 00400 */ 00401 00402 /** @addtogroup DCMI_Exported_Functions_Group1 Initialization and Configuration functions 00403 * @{ 00404 */ 00405 /* Initialization and de-initialization functions *****************************/ 00406 HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi); 00407 HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi); 00408 void HAL_DCMI_MspInit(DCMI_HandleTypeDef* hdcmi); 00409 void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi); 00410 /** 00411 * @} 00412 */ 00413 00414 /** @addtogroup DCMI_Exported_Functions_Group2 IO operation functions 00415 * @{ 00416 */ 00417 /* IO operation functions *****************************************************/ 00418 HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length); 00419 HAL_StatusTypeDef HAL_DCMI_Stop(DCMI_HandleTypeDef* hdcmi); 00420 HAL_StatusTypeDef HAL_DCMI_Suspend(DCMI_HandleTypeDef* hdcmi); 00421 HAL_StatusTypeDef HAL_DCMI_Resume(DCMI_HandleTypeDef* hdcmi); 00422 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi); 00423 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi); 00424 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi); 00425 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi); 00426 void HAL_DCMI_VsyncCallback(DCMI_HandleTypeDef *hdcmi); 00427 void HAL_DCMI_HsyncCallback(DCMI_HandleTypeDef *hdcmi); 00428 void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi); 00429 /** 00430 * @} 00431 */ 00432 00433 /** @addtogroup DCMI_Exported_Functions_Group3 Peripheral Control functions 00434 * @{ 00435 */ 00436 /* Peripheral Control functions ***********************************************/ 00437 HAL_StatusTypeDef HAL_DCMI_ConfigCrop(DCMI_HandleTypeDef *hdcmi, uint32_t X0, uint32_t Y0, uint32_t XSize, uint32_t YSize); 00438 HAL_StatusTypeDef HAL_DCMI_EnableCrop(DCMI_HandleTypeDef *hdcmi); 00439 HAL_StatusTypeDef HAL_DCMI_DisableCrop(DCMI_HandleTypeDef *hdcmi); 00440 /** 00441 * @} 00442 */ 00443 00444 /** @addtogroup DCMI_Exported_Functions_Group4 Peripheral State functions 00445 * @{ 00446 */ 00447 /* Peripheral State functions *************************************************/ 00448 HAL_DCMI_StateTypeDef HAL_DCMI_GetState(DCMI_HandleTypeDef *hdcmi); 00449 uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef *hdcmi); 00450 /** 00451 * @} 00452 */ 00453 00454 /** 00455 * @} 00456 */ 00457 00458 /* Private types -------------------------------------------------------------*/ 00459 /* Private variables ---------------------------------------------------------*/ 00460 /* Private constants ---------------------------------------------------------*/ 00461 /** @defgroup DCMI_Private_Constants DCMI Private Constants 00462 * @{ 00463 */ 00464 #define DCMI_MIS_INDEX 0x1000U /*!< DCMI MIS register index */ 00465 #define DCMI_SR_INDEX 0x2000U /*!< DCMI SR register index */ 00466 /** 00467 * @} 00468 */ 00469 /* Private macro -------------------------------------------------------------*/ 00470 /** @defgroup DCMI_Private_Macros DCMI Private Macros 00471 * @{ 00472 */ 00473 #define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_MODE_CONTINUOUS) || \ 00474 ((MODE) == DCMI_MODE_SNAPSHOT)) 00475 00476 #define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SYNCHRO_HARDWARE) || \ 00477 ((MODE) == DCMI_SYNCHRO_EMBEDDED)) 00478 00479 #define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPOLARITY_FALLING) || \ 00480 ((POLARITY) == DCMI_PCKPOLARITY_RISING)) 00481 00482 #define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPOLARITY_LOW) || \ 00483 ((POLARITY) == DCMI_VSPOLARITY_HIGH)) 00484 00485 #define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPOLARITY_LOW) || \ 00486 ((POLARITY) == DCMI_HSPOLARITY_HIGH)) 00487 00488 #define IS_DCMI_MODE_JPEG(JPEG_MODE)(((JPEG_MODE) == DCMI_JPEG_DISABLE) || \ 00489 ((JPEG_MODE) == DCMI_JPEG_ENABLE)) 00490 00491 #define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CR_ALL_FRAME) || \ 00492 ((RATE) == DCMI_CR_ALTERNATE_2_FRAME) || \ 00493 ((RATE) == DCMI_CR_ALTERNATE_4_FRAME)) 00494 00495 #define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_EXTEND_DATA_8B) || \ 00496 ((DATA) == DCMI_EXTEND_DATA_10B) || \ 00497 ((DATA) == DCMI_EXTEND_DATA_12B) || \ 00498 ((DATA) == DCMI_EXTEND_DATA_14B)) 00499 00500 #define IS_DCMI_WINDOW_COORDINATE(COORDINATE) ((COORDINATE) <= DCMI_WINDOW_COORDINATE) 00501 00502 #define IS_DCMI_WINDOW_HEIGHT(HEIGHT) ((HEIGHT) <= DCMI_WINDOW_HEIGHT) 00503 00504 /** 00505 * @} 00506 */ 00507 00508 /* Private functions ---------------------------------------------------------*/ 00509 /** @addtogroup DCMI_Private_Functions DCMI Private Functions 00510 * @{ 00511 */ 00512 00513 /** 00514 * @} 00515 */ 00516 00517 #endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ 00518 STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\ 00519 STM32F479xx */ 00520 00521 /** 00522 * @} 00523 */ 00524 00525 /** 00526 * @} 00527 */ 00528 00529 #ifdef __cplusplus 00530 } 00531 #endif 00532 00533 #endif /* __STM32F4xx_HAL_DCMI_H */ 00534 00535 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/