STM32H735xx HAL User Manual
Defines | Functions
stm32h7xx_hal_dcmi.c File Reference

DCMI HAL module driver This file provides firmware functions to manage the following functionalities of the Digital Camera Interface (DCMI) peripheral: + Initialization and de-initialization functions + IO operation functions + Peripheral Control functions + Peripheral State and Error functions. More...

#include "stm32h7xx_hal.h"

Go to the source code of this file.

Defines

#define HAL_TIMEOUT_DCMI_STOP   ((uint32_t)1000) /* Set timeout to 1s */

Functions

static void DCMI_DMAXferCplt (DMA_HandleTypeDef *hdma)
 DMA conversion complete callback.
static void DCMI_DMAError (DMA_HandleTypeDef *hdma)
 DMA error callback.
HAL_StatusTypeDef HAL_DCMI_Init (DCMI_HandleTypeDef *hdcmi)
 Initializes the DCMI according to the specified parameters in the DCMI_InitTypeDef and create the associated handle.
HAL_StatusTypeDef HAL_DCMI_DeInit (DCMI_HandleTypeDef *hdcmi)
 Deinitializes the DCMI peripheral registers to their default reset values.
__weak void HAL_DCMI_MspInit (DCMI_HandleTypeDef *hdcmi)
 Initializes the DCMI MSP.
__weak void HAL_DCMI_MspDeInit (DCMI_HandleTypeDef *hdcmi)
 DeInitializes the DCMI MSP.
HAL_StatusTypeDef HAL_DCMI_Start_DMA (DCMI_HandleTypeDef *hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length)
 Enables DCMI DMA request and enables DCMI capture.
HAL_StatusTypeDef HAL_DCMI_Stop (DCMI_HandleTypeDef *hdcmi)
 Disable DCMI DMA request and Disable DCMI capture.
HAL_StatusTypeDef HAL_DCMI_Suspend (DCMI_HandleTypeDef *hdcmi)
 Suspend DCMI capture.
HAL_StatusTypeDef HAL_DCMI_Resume (DCMI_HandleTypeDef *hdcmi)
 Resume DCMI capture.
void HAL_DCMI_IRQHandler (DCMI_HandleTypeDef *hdcmi)
 Handles DCMI interrupt request.
__weak void HAL_DCMI_ErrorCallback (DCMI_HandleTypeDef *hdcmi)
 Error DCMI callback.
__weak void HAL_DCMI_LineEventCallback (DCMI_HandleTypeDef *hdcmi)
 Line Event callback.
__weak void HAL_DCMI_VsyncEventCallback (DCMI_HandleTypeDef *hdcmi)
 VSYNC Event callback.
__weak void HAL_DCMI_FrameEventCallback (DCMI_HandleTypeDef *hdcmi)
 Frame Event callback.
HAL_StatusTypeDef HAL_DCMI_ConfigCrop (DCMI_HandleTypeDef *hdcmi, uint32_t X0, uint32_t Y0, uint32_t XSize, uint32_t YSize)
 Configure the DCMI CROP coordinate.
HAL_StatusTypeDef HAL_DCMI_DisableCrop (DCMI_HandleTypeDef *hdcmi)
 Disable the Crop feature.
HAL_StatusTypeDef HAL_DCMI_EnableCrop (DCMI_HandleTypeDef *hdcmi)
 Enable the Crop feature.
HAL_StatusTypeDef HAL_DCMI_ConfigSyncUnmask (DCMI_HandleTypeDef *hdcmi, DCMI_SyncUnmaskTypeDef *SyncUnmask)
 Set embedded synchronization delimiters unmasks.
HAL_DCMI_StateTypeDef HAL_DCMI_GetState (DCMI_HandleTypeDef *hdcmi)
 Return the DCMI state.
uint32_t HAL_DCMI_GetError (DCMI_HandleTypeDef *hdcmi)
 Return the DCMI error code.
HAL_StatusTypeDef HAL_DCMI_RegisterCallback (DCMI_HandleTypeDef *hdcmi, HAL_DCMI_CallbackIDTypeDef CallbackID, pDCMI_CallbackTypeDef pCallback)
 Register a User DCMI Callback To be used instead of the weak predefined callback.
HAL_StatusTypeDef HAL_DCMI_UnRegisterCallback (DCMI_HandleTypeDef *hdcmi, HAL_DCMI_CallbackIDTypeDef CallbackID)
 Unregister a DCMI Callback DCMI callabck is redirected to the weak predefined callback.

Detailed Description

DCMI HAL module driver This file provides firmware functions to manage the following functionalities of the Digital Camera Interface (DCMI) peripheral: + Initialization and de-initialization functions + IO operation functions + Peripheral Control functions + Peripheral State and Error functions.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

  ==============================================================================
                        ##### How to use this driver #####
  ==============================================================================
  [..]
      The sequence below describes how to use this driver to capture image
      from a camera module connected to the DCMI Interface.
      This sequence does not take into account the configuration of the
      camera module, which should be made before to configure and enable
      the DCMI to capture images.

    (#) Program the required configuration through following parameters:
        horizontal and vertical polarity, pixel clock polarity, Capture Rate,
        Synchronization Mode, code of the frame delimiter and data width
        using HAL_DCMI_Init() function.

    (#) Configure the selected DMA stream to transfer Data from DCMI DR
        register to the destination memory buffer.

    (#) Program the required configuration through following parameters:
        DCMI mode, destination memory Buffer address and the data length
        and enable capture using HAL_DCMI_Start_DMA() function.

    (#) Optionally, configure and Enable the CROP feature to select a rectangular
        window from the received image using HAL_DCMI_ConfigCrop()
        and HAL_DCMI_EnableCrop() functions

    (#) The capture can be stopped using HAL_DCMI_Stop() function.

    (#) To control DCMI state you can use the function HAL_DCMI_GetState().

     *** Callback registration ***
     =============================================

     The compilation flag USE_HAL_DCMI_REGISTER_CALLBACKS when set to 1
     allows the user to configure dynamically the driver callbacks.
     Use Functions HAL_DCMI_RegisterCallback() to register an interrupt callback.

     Function HAL_DCMI_RegisterCallback() allows to register following callbacks:
       (+) LineEventCallback    : callback for DCMI line event.
       (+) FrameEventCallback   : callback for DCMI Frame event.
       (+) VsyncEventCallback   : callback for DCMI Vsync event.
       (+) ErrorCallback        : callback for error detection.
       (+) MspInitCallback      : callback for Msp Init.
       (+) MspDeInitCallback    : callback for Msp DeInit.
     This function takes as parameters the HAL peripheral handle, the Callback ID
     and a pointer to the user callback function.

     Use function HAL_DCMI_UnRegisterCallback to reset a callback to the default weak function.
     HAL_DCMI_UnRegisterCallback takes as parameters the HAL peripheral handle and the Callback ID.
     This function allows to reset following callbacks:
       (+) LineEventCallback    : callback for DCMI line event.
       (+) FrameEventCallback   : callback for DCMI Frame event.
       (+) VsyncEventCallback   : callback for DCMI Vsync event.
       (+) ErrorCallback        : callback for error detection.
       (+) MspInitCallback      : callback for Msp Init.
       (+) MspDeInitCallback    : callback for Msp DeInit.

     By default, after the HAL_DCMI_Init() and when the state is HAL_DCMI_STATE_RESET
     all callbacks are set to the corresponding weak functions:
     examples HAL_DCMI_LineEventCallback(), HAL_DCMI_FrameEventCallback().
     Exception done for MspInit and MspDeInit functions that are
     reset to the legacy weak functions in the HAL_DCMI_Init()/ HAL_DCMI_DeInit() only when
     these callbacks are null (not registered beforehand).
     If MspInit or MspDeInit are not null, the HAL_DCMI_Init()/ HAL_DCMI_DeInit()
     keep and use the user MspInit/MspDeInit callbacks (registered beforehand) whatever the state.

     Callbacks can be registered/unregistered in HAL_DCMI_STATE_READY state only.
     Exception done MspInit/MspDeInit functions that can be registered/unregistered
     in HAL_DCMI_STATE_READY or HAL_DCMI_STATE_RESET state,
     thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit.
     In that case first register the MspInit/MspDeInit user callbacks
     using HAL_DCMI_RegisterCallback() before calling HAL_DCMI_DeInit() or HAL_DCMI_Init() function.

     When the compilation flag USE_HAL_DCMI_REGISTER_CALLBACKS is set to 0 or
     not defined, the callback registration feature is not available and all callbacks
     are set to the corresponding weak functions.

     *** DCMI HAL driver macros list ***
     =============================================
     [..]
       Below the list of most used macros in DCMI HAL driver.

      (+) __HAL_DCMI_ENABLE: Enable the DCMI peripheral.
      (+) __HAL_DCMI_DISABLE: Disable the DCMI peripheral.
      (+) __HAL_DCMI_GET_FLAG: Get the DCMI pending flags.
      (+) __HAL_DCMI_CLEAR_FLAG: Clear the DCMI pending flags.
      (+) __HAL_DCMI_ENABLE_IT: Enable the specified DCMI interrupts.
      (+) __HAL_DCMI_DISABLE_IT: Disable the specified DCMI interrupts.
      (+) __HAL_DCMI_GET_IT_SOURCE: Check whether the specified DCMI interrupt has occurred or not.

     [..]
       (@) You can refer to the DCMI HAL driver header file for more useful macros

  

Definition in file stm32h7xx_hal_dcmi.c.