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