2 ******************************************************************************
3 * @file stm32f7xx_hal_dcmi.h
4 * @author MCD Application Team
7 * @brief Header file of DCMI HAL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F7xx_HAL_DCMI_H
40 #define __STM32F7xx_HAL_DCMI_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f7xx_hal_def.h"
51 /** @addtogroup STM32F7xx_HAL_Driver
55 /** @addtogroup DCMI DCMI
56 * @brief DCMI HAL module driver
60 /* Exported types ------------------------------------------------------------*/
61 /** @defgroup DCMI_Exported_Types DCMI Exported Types
65 * @brief HAL DCMI State structures definition
69 HAL_DCMI_STATE_RESET
= 0x00U
, /*!< DCMI not yet initialized or disabled */
70 HAL_DCMI_STATE_READY
= 0x01U
, /*!< DCMI initialized and ready for use */
71 HAL_DCMI_STATE_BUSY
= 0x02U
, /*!< DCMI internal processing is ongoing */
72 HAL_DCMI_STATE_TIMEOUT
= 0x03U
, /*!< DCMI timeout state */
73 HAL_DCMI_STATE_ERROR
= 0x04U
, /*!< DCMI error state */
74 HAL_DCMI_STATE_SUSPENDED
= 0x05U
/*!< DCMI suspend state */
75 }HAL_DCMI_StateTypeDef
;
78 * @brief DCMIEx Embedded Synchronisation CODE Init structure definition
82 uint8_t FrameStartCode
; /*!< Specifies the code of the frame start delimiter. */
83 uint8_t LineStartCode
; /*!< Specifies the code of the line start delimiter. */
84 uint8_t LineEndCode
; /*!< Specifies the code of the line end delimiter. */
85 uint8_t FrameEndCode
; /*!< Specifies the code of the frame end delimiter. */
86 }DCMI_CodesInitTypeDef
;
89 * @brief DCMI Init structure definition
93 uint32_t SynchroMode
; /*!< Specifies the Synchronization Mode: Hardware or Embedded.
94 This parameter can be a value of @ref DCMI_Synchronization_Mode */
96 uint32_t PCKPolarity
; /*!< Specifies the Pixel clock polarity: Falling or Rising.
97 This parameter can be a value of @ref DCMI_PIXCK_Polarity */
99 uint32_t VSPolarity
; /*!< Specifies the Vertical synchronization polarity: High or Low.
100 This parameter can be a value of @ref DCMI_VSYNC_Polarity */
102 uint32_t HSPolarity
; /*!< Specifies the Horizontal synchronization polarity: High or Low.
103 This parameter can be a value of @ref DCMI_HSYNC_Polarity */
105 uint32_t CaptureRate
; /*!< Specifies the frequency of frame capture: All, 1/2 or 1/4.
106 This parameter can be a value of @ref DCMI_Capture_Rate */
108 uint32_t ExtendedDataMode
; /*!< Specifies the data width: 8-bit, 10-bit, 12-bit or 14-bit.
109 This parameter can be a value of @ref DCMI_Extended_Data_Mode */
111 DCMI_CodesInitTypeDef SyncroCode
; /*!< Specifies the code of the line/frame start delimiter and the
112 line/frame end delimiter */
114 uint32_t JPEGMode
; /*!< Enable or Disable the JPEG mode.
115 This parameter can be a value of @ref DCMI_MODE_JPEG */
117 uint32_t ByteSelectMode
; /*!< Specifies the data to be captured by the interface
118 This parameter can be a value of @ref DCMI_Byte_Select_Mode */
120 uint32_t ByteSelectStart
; /*!< Specifies if the data to be captured by the interface is even or odd
121 This parameter can be a value of @ref DCMI_Byte_Select_Start */
123 uint32_t LineSelectMode
; /*!< Specifies the line of data to be captured by the interface
124 This parameter can be a value of @ref DCMI_Line_Select_Mode */
126 uint32_t LineSelectStart
; /*!< Specifies if the line of data to be captured by the interface is even or odd
127 This parameter can be a value of @ref DCMI_Line_Select_Start */
131 * @brief DCMI handle Structure definition
135 DCMI_TypeDef
*Instance
; /*!< DCMI Register base address */
137 DCMI_InitTypeDef Init
; /*!< DCMI parameters */
139 HAL_LockTypeDef Lock
; /*!< DCMI locking object */
141 __IO HAL_DCMI_StateTypeDef State
; /*!< DCMI state */
143 __IO
uint32_t XferCount
; /*!< DMA transfer counter */
145 __IO
uint32_t XferSize
; /*!< DMA transfer size */
147 uint32_t XferTransferNumber
; /*!< DMA transfer number */
149 uint32_t pBuffPtr
; /*!< Pointer to DMA output buffer */
151 DMA_HandleTypeDef
*DMA_Handle
; /*!< Pointer to the DMA handler */
153 __IO
uint32_t ErrorCode
; /*!< DCMI Error code */
159 /* Exported constants --------------------------------------------------------*/
161 /** @defgroup DCMI_Exported_Constants DCMI Exported Constants
165 /** @defgroup DCMI_Error_Code DCMI Error Code
168 #define HAL_DCMI_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
169 #define HAL_DCMI_ERROR_OVR ((uint32_t)0x00000001U) /*!< Overrun error */
170 #define HAL_DCMI_ERROR_SYNC ((uint32_t)0x00000002U) /*!< Synchronization error */
171 #define HAL_DCMI_ERROR_TIMEOUT ((uint32_t)0x00000020U) /*!< Timeout error */
172 #define HAL_DCMI_ERROR_DMA ((uint32_t)0x00000040U) /*!< DMA error */
177 /** @defgroup DCMI_Capture_Mode DCMI Capture Mode
180 #define DCMI_MODE_CONTINUOUS ((uint32_t)0x00000000U) /*!< The received data are transferred continuously
181 into the destination memory through the DMA */
182 #define DCMI_MODE_SNAPSHOT ((uint32_t)DCMI_CR_CM) /*!< Once activated, the interface waits for the start of
183 frame and then transfers a single frame through the DMA */
188 /** @defgroup DCMI_Synchronization_Mode DCMI Synchronization Mode
191 #define DCMI_SYNCHRO_HARDWARE ((uint32_t)0x00000000U) /*!< Hardware synchronization data capture (frame/line start/stop)
192 is synchronized with the HSYNC/VSYNC signals */
193 #define DCMI_SYNCHRO_EMBEDDED ((uint32_t)DCMI_CR_ESS) /*!< Embedded synchronization data capture is synchronized with
194 synchronization codes embedded in the data flow */
200 /** @defgroup DCMI_PIXCK_Polarity DCMI PIXCK Polarity
203 #define DCMI_PCKPOLARITY_FALLING ((uint32_t)0x00000000U) /*!< Pixel clock active on Falling edge */
204 #define DCMI_PCKPOLARITY_RISING ((uint32_t)DCMI_CR_PCKPOL) /*!< Pixel clock active on Rising edge */
210 /** @defgroup DCMI_VSYNC_Polarity DCMI VSYNC Polarity
213 #define DCMI_VSPOLARITY_LOW ((uint32_t)0x00000000U) /*!< Vertical synchronization active Low */
214 #define DCMI_VSPOLARITY_HIGH ((uint32_t)DCMI_CR_VSPOL) /*!< Vertical synchronization active High */
220 /** @defgroup DCMI_HSYNC_Polarity DCMI HSYNC Polarity
223 #define DCMI_HSPOLARITY_LOW ((uint32_t)0x00000000U) /*!< Horizontal synchronization active Low */
224 #define DCMI_HSPOLARITY_HIGH ((uint32_t)DCMI_CR_HSPOL) /*!< Horizontal synchronization active High */
230 /** @defgroup DCMI_MODE_JPEG DCMI MODE JPEG
233 #define DCMI_JPEG_DISABLE ((uint32_t)0x00000000U) /*!< Mode JPEG Disabled */
234 #define DCMI_JPEG_ENABLE ((uint32_t)DCMI_CR_JPEG) /*!< Mode JPEG Enabled */
240 /** @defgroup DCMI_Capture_Rate DCMI Capture Rate
243 #define DCMI_CR_ALL_FRAME ((uint32_t)0x00000000U) /*!< All frames are captured */
244 #define DCMI_CR_ALTERNATE_2_FRAME ((uint32_t)DCMI_CR_FCRC_0) /*!< Every alternate frame captured */
245 #define DCMI_CR_ALTERNATE_4_FRAME ((uint32_t)DCMI_CR_FCRC_1) /*!< One frame in 4 frames captured */
251 /** @defgroup DCMI_Extended_Data_Mode DCMI Extended Data Mode
254 #define DCMI_EXTEND_DATA_8B ((uint32_t)0x00000000U) /*!< Interface captures 8-bit data on every pixel clock */
255 #define DCMI_EXTEND_DATA_10B ((uint32_t)DCMI_CR_EDM_0) /*!< Interface captures 10-bit data on every pixel clock */
256 #define DCMI_EXTEND_DATA_12B ((uint32_t)DCMI_CR_EDM_1) /*!< Interface captures 12-bit data on every pixel clock */
257 #define DCMI_EXTEND_DATA_14B ((uint32_t)(DCMI_CR_EDM_0 | DCMI_CR_EDM_1)) /*!< Interface captures 14-bit data on every pixel clock */
263 /** @defgroup DCMI_Window_Coordinate DCMI Window Coordinate
266 #define DCMI_WINDOW_COORDINATE ((uint32_t)0x3FFFU) /*!< Window coordinate */
272 /** @defgroup DCMI_Window_Height DCMI Window Height
275 #define DCMI_WINDOW_HEIGHT ((uint32_t)0x1FFFU) /*!< Window Height */
281 /** @defgroup DCMI_interrupt_sources DCMI interrupt sources
284 #define DCMI_IT_FRAME ((uint32_t)DCMI_IER_FRAME_IE) /*!< Capture complete interrupt */
285 #define DCMI_IT_OVR ((uint32_t)DCMI_IER_OVR_IE) /*!< Overrun interrupt */
286 #define DCMI_IT_ERR ((uint32_t)DCMI_IER_ERR_IE) /*!< Synchronization error interrupt */
287 #define DCMI_IT_VSYNC ((uint32_t)DCMI_IER_VSYNC_IE) /*!< VSYNC interrupt */
288 #define DCMI_IT_LINE ((uint32_t)DCMI_IER_LINE_IE) /*!< Line interrupt */
293 /** @defgroup DCMI_Flags DCMI Flags
298 * @brief DCMI SR register
300 #define DCMI_FLAG_HSYNC ((uint32_t)DCMI_SR_INDEX|DCMI_SR_HSYNC) /*!< HSYNC pin state (active line / synchronization between lines) */
301 #define DCMI_FLAG_VSYNC ((uint32_t)DCMI_SR_INDEX|DCMI_SR_VSYNC) /*!< VSYNC pin state (active frame / synchronization between frames) */
302 #define DCMI_FLAG_FNE ((uint32_t)DCMI_SR_INDEX|DCMI_SR_FNE) /*!< FIFO not empty flag */
304 * @brief DCMI RIS register
306 #define DCMI_FLAG_FRAMERI ((uint32_t)DCMI_RIS_FRAME_RIS) /*!< Frame capture complete interrupt flag */
307 #define DCMI_FLAG_OVRRI ((uint32_t)DCMI_RIS_OVR_RIS) /*!< Overrun interrupt flag */
308 #define DCMI_FLAG_ERRRI ((uint32_t)DCMI_RIS_ERR_RIS) /*!< Synchronization error interrupt flag */
309 #define DCMI_FLAG_VSYNCRI ((uint32_t)DCMI_RIS_VSYNC_RIS) /*!< VSYNC interrupt flag */
310 #define DCMI_FLAG_LINERI ((uint32_t)DCMI_RIS_LINE_RIS) /*!< Line interrupt flag */
312 * @brief DCMI MIS register
314 #define DCMI_FLAG_FRAMEMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_FRAME_MIS) /*!< DCMI Frame capture complete masked interrupt status */
315 #define DCMI_FLAG_OVRMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_OVR_MIS ) /*!< DCMI Overrun masked interrupt status */
316 #define DCMI_FLAG_ERRMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_ERR_MIS ) /*!< DCMI Synchronization error masked interrupt status */
317 #define DCMI_FLAG_VSYNCMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_VSYNC_MIS) /*!< DCMI VSYNC masked interrupt status */
318 #define DCMI_FLAG_LINEMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_LINE_MIS ) /*!< DCMI Line masked interrupt status */
323 /** @defgroup DCMI_Byte_Select_Mode DCMI Byte Select Mode
326 #define DCMI_BSM_ALL ((uint32_t)0x00000000U) /*!< Interface captures all received data */
327 #define DCMI_BSM_OTHER ((uint32_t)DCMI_CR_BSM_0) /*!< Interface captures every other byte from the received data */
328 #define DCMI_BSM_ALTERNATE_4 ((uint32_t)DCMI_CR_BSM_1) /*!< Interface captures one byte out of four */
329 #define DCMI_BSM_ALTERNATE_2 ((uint32_t)(DCMI_CR_BSM_0 | DCMI_CR_BSM_1)) /*!< Interface captures two bytes out of four */
335 /** @defgroup DCMI_Byte_Select_Start DCMI Byte Select Start
338 #define DCMI_OEBS_ODD ((uint32_t)0x00000000U) /*!< Interface captures first data from the frame/line start, second one being dropped */
339 #define DCMI_OEBS_EVEN ((uint32_t)DCMI_CR_OEBS) /*!< Interface captures second data from the frame/line start, first one being dropped */
345 /** @defgroup DCMI_Line_Select_Mode DCMI Line Select Mode
348 #define DCMI_LSM_ALL ((uint32_t)0x00000000U) /*!< Interface captures all received lines */
349 #define DCMI_LSM_ALTERNATE_2 ((uint32_t)DCMI_CR_LSM) /*!< Interface captures one line out of two */
355 /** @defgroup DCMI_Line_Select_Start DCMI Line Select Start
358 #define DCMI_OELS_ODD ((uint32_t)0x00000000U) /*!< Interface captures first line from the frame start, second one being dropped */
359 #define DCMI_OELS_EVEN ((uint32_t)DCMI_CR_OELS) /*!< Interface captures second line from the frame start, first one being dropped */
369 /* Exported macro ------------------------------------------------------------*/
370 /** @defgroup DCMI_Exported_Macros DCMI Exported Macros
374 /** @brief Reset DCMI handle state
375 * @param __HANDLE__: specifies the DCMI handle.
378 #define __HAL_DCMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DCMI_STATE_RESET)
381 * @brief Enable the DCMI.
382 * @param __HANDLE__: DCMI handle
385 #define __HAL_DCMI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DCMI_CR_ENABLE)
388 * @brief Disable the DCMI.
389 * @param __HANDLE__: DCMI handle
392 #define __HAL_DCMI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(DCMI_CR_ENABLE))
394 /* Interrupt & Flag management */
396 * @brief Get the DCMI pending flag.
397 * @param __HANDLE__: DCMI handle
398 * @param __FLAG__: Get the specified flag.
399 * This parameter can be one of the following values (no combination allowed)
400 * @arg DCMI_FLAG_HSYNC: HSYNC pin state (active line / synchronization between lines)
401 * @arg DCMI_FLAG_VSYNC: VSYNC pin state (active frame / synchronization between frames)
402 * @arg DCMI_FLAG_FNE: FIFO empty flag
403 * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
404 * @arg DCMI_FLAG_OVRRI: Overrun flag mask
405 * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
406 * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
407 * @arg DCMI_FLAG_LINERI: Line flag mask
408 * @arg DCMI_FLAG_FRAMEMI: DCMI Capture complete masked interrupt status
409 * @arg DCMI_FLAG_OVRMI: DCMI Overrun masked interrupt status
410 * @arg DCMI_FLAG_ERRMI: DCMI Synchronization error masked interrupt status
411 * @arg DCMI_FLAG_VSYNCMI: DCMI VSYNC masked interrupt status
412 * @arg DCMI_FLAG_LINEMI: DCMI Line masked interrupt status
413 * @retval The state of FLAG.
415 #define __HAL_DCMI_GET_FLAG(__HANDLE__, __FLAG__)\
416 ((((__FLAG__) & (DCMI_SR_INDEX|DCMI_MIS_INDEX)) == 0x0)? ((__HANDLE__)->Instance->RIS & (__FLAG__)) :\
417 (((__FLAG__) & DCMI_SR_INDEX) == 0x0)? ((__HANDLE__)->Instance->MIS & (__FLAG__)) : ((__HANDLE__)->Instance->SR & (__FLAG__)))
420 * @brief Clear the DCMI pending flags.
421 * @param __HANDLE__: DCMI handle
422 * @param __FLAG__: specifies the flag to clear.
423 * This parameter can be any combination of the following values:
424 * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
425 * @arg DCMI_FLAG_OVFRI: Overflow flag mask
426 * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
427 * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
428 * @arg DCMI_FLAG_LINERI: Line flag mask
431 #define __HAL_DCMI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
434 * @brief Enable the specified DCMI interrupts.
435 * @param __HANDLE__: DCMI handle
436 * @param __INTERRUPT__: specifies the DCMI interrupt sources to be enabled.
437 * This parameter can be any combination of the following values:
438 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
439 * @arg DCMI_IT_OVF: Overflow interrupt mask
440 * @arg DCMI_IT_ERR: Synchronization error interrupt mask
441 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
442 * @arg DCMI_IT_LINE: Line interrupt mask
445 #define __HAL_DCMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
448 * @brief Disable the specified DCMI interrupts.
449 * @param __HANDLE__: DCMI handle
450 * @param __INTERRUPT__: specifies the DCMI interrupt sources to be enabled.
451 * This parameter can be any combination of the following values:
452 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
453 * @arg DCMI_IT_OVF: Overflow interrupt mask
454 * @arg DCMI_IT_ERR: Synchronization error interrupt mask
455 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
456 * @arg DCMI_IT_LINE: Line interrupt mask
459 #define __HAL_DCMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
462 * @brief Check whether the specified DCMI interrupt has occurred or not.
463 * @param __HANDLE__: DCMI handle
464 * @param __INTERRUPT__: specifies the DCMI interrupt source to check.
465 * This parameter can be one of the following values:
466 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
467 * @arg DCMI_IT_OVF: Overflow interrupt mask
468 * @arg DCMI_IT_ERR: Synchronization error interrupt mask
469 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
470 * @arg DCMI_IT_LINE: Line interrupt mask
471 * @retval The state of INTERRUPT.
473 #define __HAL_DCMI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__))
479 /* Exported functions --------------------------------------------------------*/
480 /** @addtogroup DCMI_Exported_Functions DCMI Exported Functions
484 /** @addtogroup DCMI_Exported_Functions_Group1 Initialization and Configuration functions
487 /* Initialization and de-initialization functions *****************************/
488 HAL_StatusTypeDef
HAL_DCMI_Init(DCMI_HandleTypeDef
*hdcmi
);
489 HAL_StatusTypeDef
HAL_DCMI_DeInit(DCMI_HandleTypeDef
*hdcmi
);
490 void HAL_DCMI_MspInit(DCMI_HandleTypeDef
* hdcmi
);
491 void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef
* hdcmi
);
496 /** @addtogroup DCMI_Exported_Functions_Group2 IO operation functions
499 /* IO operation functions *****************************************************/
500 HAL_StatusTypeDef
HAL_DCMI_Start_DMA(DCMI_HandleTypeDef
* hdcmi
, uint32_t DCMI_Mode
, uint32_t pData
, uint32_t Length
);
501 HAL_StatusTypeDef
HAL_DCMI_Stop(DCMI_HandleTypeDef
* hdcmi
);
502 HAL_StatusTypeDef
HAL_DCMI_Suspend(DCMI_HandleTypeDef
* hdcmi
);
503 HAL_StatusTypeDef
HAL_DCMI_Resume(DCMI_HandleTypeDef
* hdcmi
);
504 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef
*hdcmi
);
505 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef
*hdcmi
);
506 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef
*hdcmi
);
507 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef
*hdcmi
);
508 void HAL_DCMI_VsyncCallback(DCMI_HandleTypeDef
*hdcmi
);
509 void HAL_DCMI_HsyncCallback(DCMI_HandleTypeDef
*hdcmi
);
510 void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef
*hdcmi
);
515 /** @addtogroup DCMI_Exported_Functions_Group3 Peripheral Control functions
518 /* Peripheral Control functions ***********************************************/
519 HAL_StatusTypeDef
HAL_DCMI_ConfigCrop(DCMI_HandleTypeDef
*hdcmi
, uint32_t X0
, uint32_t Y0
, uint32_t XSize
, uint32_t YSize
);
520 HAL_StatusTypeDef
HAL_DCMI_EnableCrop(DCMI_HandleTypeDef
*hdcmi
);
521 HAL_StatusTypeDef
HAL_DCMI_DisableCrop(DCMI_HandleTypeDef
*hdcmi
);
527 /** @addtogroup DCMI_Exported_Functions_Group4 Peripheral State functions
530 /* Peripheral State functions *************************************************/
531 HAL_DCMI_StateTypeDef
HAL_DCMI_GetState(DCMI_HandleTypeDef
*hdcmi
);
532 uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef
*hdcmi
);
541 /* Private types -------------------------------------------------------------*/
542 /* Private variables ---------------------------------------------------------*/
543 /* Private constants ---------------------------------------------------------*/
544 /** @defgroup DCMI_Private_Constants DCMI Private Constants
547 #define DCMI_MIS_INDEX ((uint32_t)0x1000) /*!< DCMI MIS register index */
548 #define DCMI_SR_INDEX ((uint32_t)0x2000) /*!< DCMI SR register index */
552 /* Private macro -------------------------------------------------------------*/
553 /** @defgroup DCMI_Private_Macros DCMI Private Macros
556 #define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_MODE_CONTINUOUS) || \
557 ((MODE) == DCMI_MODE_SNAPSHOT))
559 #define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SYNCHRO_HARDWARE) || \
560 ((MODE) == DCMI_SYNCHRO_EMBEDDED))
562 #define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPOLARITY_FALLING) || \
563 ((POLARITY) == DCMI_PCKPOLARITY_RISING))
565 #define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPOLARITY_LOW) || \
566 ((POLARITY) == DCMI_VSPOLARITY_HIGH))
568 #define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPOLARITY_LOW) || \
569 ((POLARITY) == DCMI_HSPOLARITY_HIGH))
571 #define IS_DCMI_MODE_JPEG(JPEG_MODE)(((JPEG_MODE) == DCMI_JPEG_DISABLE) || \
572 ((JPEG_MODE) == DCMI_JPEG_ENABLE))
574 #define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CR_ALL_FRAME) || \
575 ((RATE) == DCMI_CR_ALTERNATE_2_FRAME) || \
576 ((RATE) == DCMI_CR_ALTERNATE_4_FRAME))
578 #define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_EXTEND_DATA_8B) || \
579 ((DATA) == DCMI_EXTEND_DATA_10B) || \
580 ((DATA) == DCMI_EXTEND_DATA_12B) || \
581 ((DATA) == DCMI_EXTEND_DATA_14B))
583 #define IS_DCMI_WINDOW_COORDINATE(COORDINATE) ((COORDINATE) <= DCMI_WINDOW_COORDINATE)
585 #define IS_DCMI_WINDOW_HEIGHT(HEIGHT) ((HEIGHT) <= DCMI_WINDOW_HEIGHT)
587 #define IS_DCMI_BYTE_SELECT_MODE(MODE)(((MODE) == DCMI_BSM_ALL) || \
588 ((MODE) == DCMI_BSM_OTHER) || \
589 ((MODE) == DCMI_BSM_ALTERNATE_4) || \
590 ((MODE) == DCMI_BSM_ALTERNATE_2))
592 #define IS_DCMI_BYTE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OEBS_ODD) || \
593 ((POLARITY) == DCMI_OEBS_EVEN))
595 #define IS_DCMI_LINE_SELECT_MODE(MODE)(((MODE) == DCMI_LSM_ALL) || \
596 ((MODE) == DCMI_LSM_ALTERNATE_2))
598 #define IS_DCMI_LINE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OELS_ODD) || \
599 ((POLARITY) == DCMI_OELS_EVEN))
605 /* Private functions ---------------------------------------------------------*/
606 /** @addtogroup DCMI_Private_Functions DCMI Private Functions
626 #endif /* __STM32F7xx_HAL_DCMI_H */
628 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/