STM32F2 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F2 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f2xx_dcmi.c File Reference

This file provides firmware functions to manage the following functionalities of the DCMI peripheral: More...

#include "stm32f2xx_dcmi.h"
#include "stm32f2xx_rcc.h"


void DCMI_DeInit (void)
 Deinitializes the DCMI registers to their default reset values. More...
void DCMI_Init (DCMI_InitTypeDef *DCMI_InitStruct)
 Initializes the DCMI according to the specified parameters in the DCMI_InitStruct. More...
void DCMI_StructInit (DCMI_InitTypeDef *DCMI_InitStruct)
 Fills each DCMI_InitStruct member with its default value. More...
void DCMI_CROPConfig (DCMI_CROPInitTypeDef *DCMI_CROPInitStruct)
 Initializes the DCMI peripheral CROP mode according to the specified parameters in the DCMI_CROPInitStruct. More...
void DCMI_CROPCmd (FunctionalState NewState)
 Enables or disables the DCMI Crop feature. More...
void DCMI_SetEmbeddedSynchroCodes (DCMI_CodesInitTypeDef *DCMI_CodesInitStruct)
 Sets the embedded synchronization codes. More...
void DCMI_JPEGCmd (FunctionalState NewState)
 Enables or disables the DCMI JPEG format. More...
void DCMI_Cmd (FunctionalState NewState)
 Enables or disables the DCMI interface. More...
void DCMI_CaptureCmd (FunctionalState NewState)
 Enables or disables the DCMI Capture. More...
uint32_t DCMI_ReadData (void)
 Reads the data stored in the DR register. More...
void DCMI_ITConfig (uint16_t DCMI_IT, FunctionalState NewState)
 Enables or disables the DCMI interface interrupts. More...
FlagStatus DCMI_GetFlagStatus (uint16_t DCMI_FLAG)
 Checks whether the DCMI interface flag is set or not. More...
void DCMI_ClearFlag (uint16_t DCMI_FLAG)
 Clears the DCMI's pending flags. More...
ITStatus DCMI_GetITStatus (uint16_t DCMI_IT)
 Checks whether the DCMI interrupt has occurred or not. More...
void DCMI_ClearITPendingBit (uint16_t DCMI_IT)
 Clears the DCMI's interrupt pending bits. More...

Detailed Description

This file provides firmware functions to manage the following functionalities of the DCMI peripheral:

MCD Application Team
  • Initialization and Configuration
  • Image capture functions
  • Interrupts and flags management
*          ===================================================================
*                                 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.
*          1. Enable the clock for the DCMI and associated GPIOs using the following functions:
*                 RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_DCMI, ENABLE);
*                 RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOx, ENABLE);
*          2. DCMI pins configuration 
*             - Connect the involved DCMI pins to AF13 using the following function 
*                 GPIO_PinAFConfig(GPIOx, GPIO_PinSourcex, GPIO_AF_DCMI); 
*             - Configure these DCMI pins in alternate function mode by calling the function
*                 GPIO_Init();
*          3. Declare a DCMI_InitTypeDef structure, for example:
*                 DCMI_InitTypeDef  DCMI_InitStructure;
*             and fill the DCMI_InitStructure variable with the allowed values
*             of the structure member.
*          4. Initialize the DCMI interface by calling the function
*                 DCMI_Init(&DCMI_InitStructure); 
*          5. Configure the DMA2_Stream1 channel1 to transfer Data from DCMI DR
*             register to the destination memory buffer.
*          6. Enable DCMI interface using the function
*                 DCMI_Cmd(ENABLE);
*         7. Start the image capture using the function
*                 DCMI_CaptureCmd(ENABLE);
*         8. At this stage the DCMI interface waits for the first start of frame,
*            then a DMA request is generated continuously/once (depending on the
*            mode used, Continuous/Snapshot) to transfer the received data into
*            the destination memory. 
*  @note  If you need to capture only a rectangular window from the received
*         image, you have to use the DCMI_CROPConfig() function to configure 
*         the coordinates and size of the window to be captured, then enable 
*         the Crop feature using DCMI_CROPCmd(ENABLE);  
*         In this case, the Crop configuration should be made before to enable
*         and start the DCMI interface. 

© COPYRIGHT 2012 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.