Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
116:c0f6e94411f5
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 115:87f2f5183dfb 1 /**
Kojto 115:87f2f5183dfb 2 ******************************************************************************
Kojto 115:87f2f5183dfb 3 * @file stm32f7xx_hal_dcmi.h
Kojto 115:87f2f5183dfb 4 * @author MCD Application Team
Kojto 116:c0f6e94411f5 5 * @version V1.0.4
Kojto 116:c0f6e94411f5 6 * @date 09-December-2015
Kojto 115:87f2f5183dfb 7 * @brief Header file of DCMI HAL module.
Kojto 115:87f2f5183dfb 8 ******************************************************************************
Kojto 115:87f2f5183dfb 9 * @attention
Kojto 115:87f2f5183dfb 10 *
Kojto 115:87f2f5183dfb 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 115:87f2f5183dfb 12 *
Kojto 115:87f2f5183dfb 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 115:87f2f5183dfb 14 * are permitted provided that the following conditions are met:
Kojto 115:87f2f5183dfb 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 115:87f2f5183dfb 16 * this list of conditions and the following disclaimer.
Kojto 115:87f2f5183dfb 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 115:87f2f5183dfb 18 * this list of conditions and the following disclaimer in the documentation
Kojto 115:87f2f5183dfb 19 * and/or other materials provided with the distribution.
Kojto 115:87f2f5183dfb 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 115:87f2f5183dfb 21 * may be used to endorse or promote products derived from this software
Kojto 115:87f2f5183dfb 22 * without specific prior written permission.
Kojto 115:87f2f5183dfb 23 *
Kojto 115:87f2f5183dfb 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 115:87f2f5183dfb 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 115:87f2f5183dfb 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 115:87f2f5183dfb 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 115:87f2f5183dfb 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 115:87f2f5183dfb 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 115:87f2f5183dfb 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 115:87f2f5183dfb 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 115:87f2f5183dfb 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 115:87f2f5183dfb 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 115:87f2f5183dfb 34 *
Kojto 115:87f2f5183dfb 35 ******************************************************************************
Kojto 115:87f2f5183dfb 36 */
Kojto 115:87f2f5183dfb 37
Kojto 115:87f2f5183dfb 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 115:87f2f5183dfb 39 #ifndef __STM32F7xx_HAL_DCMI_H
Kojto 115:87f2f5183dfb 40 #define __STM32F7xx_HAL_DCMI_H
Kojto 115:87f2f5183dfb 41
Kojto 115:87f2f5183dfb 42 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 43 extern "C" {
Kojto 115:87f2f5183dfb 44 #endif
Kojto 115:87f2f5183dfb 45
Kojto 115:87f2f5183dfb 46 /* Includes ------------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 47 #include "stm32f7xx_hal_def.h"
Kojto 115:87f2f5183dfb 48
Kojto 115:87f2f5183dfb 49 /* Include DCMI HAL Extended module */
Kojto 115:87f2f5183dfb 50 /* (include on top of file since DCMI structures are defined in extended file) */
Kojto 115:87f2f5183dfb 51 #include "stm32f7xx_hal_dcmi_ex.h"
Kojto 115:87f2f5183dfb 52
Kojto 115:87f2f5183dfb 53 /** @addtogroup STM32F7xx_HAL_Driver
Kojto 115:87f2f5183dfb 54 * @{
Kojto 115:87f2f5183dfb 55 */
Kojto 115:87f2f5183dfb 56
Kojto 115:87f2f5183dfb 57 /** @addtogroup DCMI DCMI
Kojto 115:87f2f5183dfb 58 * @brief DCMI HAL module driver
Kojto 115:87f2f5183dfb 59 * @{
Kojto 115:87f2f5183dfb 60 */
Kojto 115:87f2f5183dfb 61
Kojto 115:87f2f5183dfb 62 /* Exported types ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 63 /** @defgroup DCMI_Exported_Types DCMI Exported Types
Kojto 115:87f2f5183dfb 64 * @{
Kojto 115:87f2f5183dfb 65 */
Kojto 115:87f2f5183dfb 66 /**
Kojto 115:87f2f5183dfb 67 * @brief HAL DCMI State structures definition
Kojto 115:87f2f5183dfb 68 */
Kojto 115:87f2f5183dfb 69 typedef enum
Kojto 115:87f2f5183dfb 70 {
Kojto 115:87f2f5183dfb 71 HAL_DCMI_STATE_RESET = 0x00, /*!< DCMI not yet initialized or disabled */
Kojto 115:87f2f5183dfb 72 HAL_DCMI_STATE_READY = 0x01, /*!< DCMI initialized and ready for use */
Kojto 115:87f2f5183dfb 73 HAL_DCMI_STATE_BUSY = 0x02, /*!< DCMI internal processing is ongoing */
Kojto 115:87f2f5183dfb 74 HAL_DCMI_STATE_TIMEOUT = 0x03, /*!< DCMI timeout state */
Kojto 115:87f2f5183dfb 75 HAL_DCMI_STATE_ERROR = 0x04 /*!< DCMI error state */
Kojto 115:87f2f5183dfb 76 }HAL_DCMI_StateTypeDef;
Kojto 115:87f2f5183dfb 77
Kojto 115:87f2f5183dfb 78 /**
Kojto 115:87f2f5183dfb 79 * @brief DCMI handle Structure definition
Kojto 115:87f2f5183dfb 80 */
Kojto 115:87f2f5183dfb 81 typedef struct
Kojto 115:87f2f5183dfb 82 {
Kojto 115:87f2f5183dfb 83 DCMI_TypeDef *Instance; /*!< DCMI Register base address */
Kojto 115:87f2f5183dfb 84
Kojto 115:87f2f5183dfb 85 DCMI_InitTypeDef Init; /*!< DCMI parameters */
Kojto 115:87f2f5183dfb 86
Kojto 115:87f2f5183dfb 87 HAL_LockTypeDef Lock; /*!< DCMI locking object */
Kojto 115:87f2f5183dfb 88
Kojto 115:87f2f5183dfb 89 __IO HAL_DCMI_StateTypeDef State; /*!< DCMI state */
Kojto 115:87f2f5183dfb 90
Kojto 115:87f2f5183dfb 91 __IO uint32_t XferCount; /*!< DMA transfer counter */
Kojto 115:87f2f5183dfb 92
Kojto 115:87f2f5183dfb 93 __IO uint32_t XferSize; /*!< DMA transfer size */
Kojto 115:87f2f5183dfb 94
Kojto 115:87f2f5183dfb 95 uint32_t XferTransferNumber; /*!< DMA transfer number */
Kojto 115:87f2f5183dfb 96
Kojto 115:87f2f5183dfb 97 uint32_t pBuffPtr; /*!< Pointer to DMA output buffer */
Kojto 115:87f2f5183dfb 98
Kojto 115:87f2f5183dfb 99 DMA_HandleTypeDef *DMA_Handle; /*!< Pointer to the DMA handler */
Kojto 115:87f2f5183dfb 100
Kojto 115:87f2f5183dfb 101 __IO uint32_t ErrorCode; /*!< DCMI Error code */
Kojto 115:87f2f5183dfb 102
Kojto 115:87f2f5183dfb 103 }DCMI_HandleTypeDef;
Kojto 115:87f2f5183dfb 104 /**
Kojto 115:87f2f5183dfb 105 * @}
Kojto 115:87f2f5183dfb 106 */
Kojto 115:87f2f5183dfb 107 /* Exported constants --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 108
Kojto 115:87f2f5183dfb 109 /** @defgroup DCMI_Exported_Constants DCMI Exported Constants
Kojto 115:87f2f5183dfb 110 * @{
Kojto 115:87f2f5183dfb 111 */
Kojto 115:87f2f5183dfb 112
Kojto 115:87f2f5183dfb 113 /** @defgroup DCMI_Error_Code DCMI Error Code
Kojto 115:87f2f5183dfb 114 * @{
Kojto 115:87f2f5183dfb 115 */
Kojto 115:87f2f5183dfb 116 #define HAL_DCMI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
Kojto 115:87f2f5183dfb 117 #define HAL_DCMI_ERROR_OVF ((uint32_t)0x00000001) /*!< Overflow error */
Kojto 115:87f2f5183dfb 118 #define HAL_DCMI_ERROR_SYNC ((uint32_t)0x00000002) /*!< Synchronization error */
Kojto 115:87f2f5183dfb 119 #define HAL_DCMI_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */
Kojto 115:87f2f5183dfb 120 /**
Kojto 115:87f2f5183dfb 121 * @}
Kojto 115:87f2f5183dfb 122 */
Kojto 115:87f2f5183dfb 123
Kojto 115:87f2f5183dfb 124 /** @defgroup DCMI_Capture_Mode DCMI Capture Mode
Kojto 115:87f2f5183dfb 125 * @{
Kojto 115:87f2f5183dfb 126 */
Kojto 115:87f2f5183dfb 127 #define DCMI_MODE_CONTINUOUS ((uint32_t)0x00000000) /*!< The received data are transferred continuously
Kojto 115:87f2f5183dfb 128 into the destination memory through the DMA */
Kojto 115:87f2f5183dfb 129 #define DCMI_MODE_SNAPSHOT ((uint32_t)DCMI_CR_CM) /*!< Once activated, the interface waits for the start of
Kojto 115:87f2f5183dfb 130 frame and then transfers a single frame through the DMA */
Kojto 115:87f2f5183dfb 131 /**
Kojto 115:87f2f5183dfb 132 * @}
Kojto 115:87f2f5183dfb 133 */
Kojto 115:87f2f5183dfb 134
Kojto 115:87f2f5183dfb 135 /** @defgroup DCMI_Synchronization_Mode DCMI Synchronization Mode
Kojto 115:87f2f5183dfb 136 * @{
Kojto 115:87f2f5183dfb 137 */
Kojto 115:87f2f5183dfb 138 #define DCMI_SYNCHRO_HARDWARE ((uint32_t)0x00000000) /*!< Hardware synchronization data capture (frame/line start/stop)
Kojto 115:87f2f5183dfb 139 is synchronized with the HSYNC/VSYNC signals */
Kojto 115:87f2f5183dfb 140 #define DCMI_SYNCHRO_EMBEDDED ((uint32_t)DCMI_CR_ESS) /*!< Embedded synchronization data capture is synchronized with
Kojto 115:87f2f5183dfb 141 synchronization codes embedded in the data flow */
Kojto 115:87f2f5183dfb 142
Kojto 115:87f2f5183dfb 143 /**
Kojto 115:87f2f5183dfb 144 * @}
Kojto 115:87f2f5183dfb 145 */
Kojto 115:87f2f5183dfb 146
Kojto 115:87f2f5183dfb 147 /** @defgroup DCMI_PIXCK_Polarity DCMI PIXCK Polarity
Kojto 115:87f2f5183dfb 148 * @{
Kojto 115:87f2f5183dfb 149 */
Kojto 115:87f2f5183dfb 150 #define DCMI_PCKPOLARITY_FALLING ((uint32_t)0x00000000) /*!< Pixel clock active on Falling edge */
Kojto 115:87f2f5183dfb 151 #define DCMI_PCKPOLARITY_RISING ((uint32_t)DCMI_CR_PCKPOL) /*!< Pixel clock active on Rising edge */
Kojto 115:87f2f5183dfb 152
Kojto 115:87f2f5183dfb 153 /**
Kojto 115:87f2f5183dfb 154 * @}
Kojto 115:87f2f5183dfb 155 */
Kojto 115:87f2f5183dfb 156
Kojto 115:87f2f5183dfb 157 /** @defgroup DCMI_VSYNC_Polarity DCMI VSYNC Polarity
Kojto 115:87f2f5183dfb 158 * @{
Kojto 115:87f2f5183dfb 159 */
Kojto 115:87f2f5183dfb 160 #define DCMI_VSPOLARITY_LOW ((uint32_t)0x00000000) /*!< Vertical synchronization active Low */
Kojto 115:87f2f5183dfb 161 #define DCMI_VSPOLARITY_HIGH ((uint32_t)DCMI_CR_VSPOL) /*!< Vertical synchronization active High */
Kojto 115:87f2f5183dfb 162
Kojto 115:87f2f5183dfb 163 /**
Kojto 115:87f2f5183dfb 164 * @}
Kojto 115:87f2f5183dfb 165 */
Kojto 115:87f2f5183dfb 166
Kojto 115:87f2f5183dfb 167 /** @defgroup DCMI_HSYNC_Polarity DCMI HSYNC Polarity
Kojto 115:87f2f5183dfb 168 * @{
Kojto 115:87f2f5183dfb 169 */
Kojto 115:87f2f5183dfb 170 #define DCMI_HSPOLARITY_LOW ((uint32_t)0x00000000) /*!< Horizontal synchronization active Low */
Kojto 115:87f2f5183dfb 171 #define DCMI_HSPOLARITY_HIGH ((uint32_t)DCMI_CR_HSPOL) /*!< Horizontal synchronization active High */
Kojto 115:87f2f5183dfb 172
Kojto 115:87f2f5183dfb 173 /**
Kojto 115:87f2f5183dfb 174 * @}
Kojto 115:87f2f5183dfb 175 */
Kojto 115:87f2f5183dfb 176
Kojto 115:87f2f5183dfb 177 /** @defgroup DCMI_MODE_JPEG DCMI MODE JPEG
Kojto 115:87f2f5183dfb 178 * @{
Kojto 115:87f2f5183dfb 179 */
Kojto 115:87f2f5183dfb 180 #define DCMI_JPEG_DISABLE ((uint32_t)0x00000000) /*!< Mode JPEG Disabled */
Kojto 115:87f2f5183dfb 181 #define DCMI_JPEG_ENABLE ((uint32_t)DCMI_CR_JPEG) /*!< Mode JPEG Enabled */
Kojto 115:87f2f5183dfb 182
Kojto 115:87f2f5183dfb 183 /**
Kojto 115:87f2f5183dfb 184 * @}
Kojto 115:87f2f5183dfb 185 */
Kojto 115:87f2f5183dfb 186
Kojto 115:87f2f5183dfb 187 /** @defgroup DCMI_Capture_Rate DCMI Capture Rate
Kojto 115:87f2f5183dfb 188 * @{
Kojto 115:87f2f5183dfb 189 */
Kojto 115:87f2f5183dfb 190 #define DCMI_CR_ALL_FRAME ((uint32_t)0x00000000) /*!< All frames are captured */
Kojto 115:87f2f5183dfb 191 #define DCMI_CR_ALTERNATE_2_FRAME ((uint32_t)DCMI_CR_FCRC_0) /*!< Every alternate frame captured */
Kojto 115:87f2f5183dfb 192 #define DCMI_CR_ALTERNATE_4_FRAME ((uint32_t)DCMI_CR_FCRC_1) /*!< One frame in 4 frames captured */
Kojto 115:87f2f5183dfb 193
Kojto 115:87f2f5183dfb 194 /**
Kojto 115:87f2f5183dfb 195 * @}
Kojto 115:87f2f5183dfb 196 */
Kojto 115:87f2f5183dfb 197
Kojto 115:87f2f5183dfb 198 /** @defgroup DCMI_Extended_Data_Mode DCMI Extended Data Mode
Kojto 115:87f2f5183dfb 199 * @{
Kojto 115:87f2f5183dfb 200 */
Kojto 115:87f2f5183dfb 201 #define DCMI_EXTEND_DATA_8B ((uint32_t)0x00000000) /*!< Interface captures 8-bit data on every pixel clock */
Kojto 115:87f2f5183dfb 202 #define DCMI_EXTEND_DATA_10B ((uint32_t)DCMI_CR_EDM_0) /*!< Interface captures 10-bit data on every pixel clock */
Kojto 115:87f2f5183dfb 203 #define DCMI_EXTEND_DATA_12B ((uint32_t)DCMI_CR_EDM_1) /*!< Interface captures 12-bit data on every pixel clock */
Kojto 115:87f2f5183dfb 204 #define DCMI_EXTEND_DATA_14B ((uint32_t)(DCMI_CR_EDM_0 | DCMI_CR_EDM_1)) /*!< Interface captures 14-bit data on every pixel clock */
Kojto 115:87f2f5183dfb 205
Kojto 115:87f2f5183dfb 206 /**
Kojto 115:87f2f5183dfb 207 * @}
Kojto 115:87f2f5183dfb 208 */
Kojto 115:87f2f5183dfb 209
Kojto 115:87f2f5183dfb 210 /** @defgroup DCMI_Window_Coordinate DCMI Window Coordinate
Kojto 115:87f2f5183dfb 211 * @{
Kojto 115:87f2f5183dfb 212 */
Kojto 115:87f2f5183dfb 213 #define DCMI_WINDOW_COORDINATE ((uint32_t)0x3FFF) /*!< Window coordinate */
Kojto 115:87f2f5183dfb 214
Kojto 115:87f2f5183dfb 215 /**
Kojto 115:87f2f5183dfb 216 * @}
Kojto 115:87f2f5183dfb 217 */
Kojto 115:87f2f5183dfb 218
Kojto 115:87f2f5183dfb 219 /** @defgroup DCMI_Window_Height DCMI Window Height
Kojto 115:87f2f5183dfb 220 * @{
Kojto 115:87f2f5183dfb 221 */
Kojto 115:87f2f5183dfb 222 #define DCMI_WINDOW_HEIGHT ((uint32_t)0x1FFF) /*!< Window Height */
Kojto 115:87f2f5183dfb 223
Kojto 115:87f2f5183dfb 224 /**
Kojto 115:87f2f5183dfb 225 * @}
Kojto 115:87f2f5183dfb 226 */
Kojto 115:87f2f5183dfb 227
Kojto 115:87f2f5183dfb 228 /** @defgroup DCMI_interrupt_sources DCMI interrupt sources
Kojto 115:87f2f5183dfb 229 * @{
Kojto 115:87f2f5183dfb 230 */
Kojto 115:87f2f5183dfb 231 #define DCMI_IT_FRAME ((uint32_t)DCMI_IER_FRAME_IE)
Kojto 115:87f2f5183dfb 232 #define DCMI_IT_OVF ((uint32_t)DCMI_IER_OVF_IE)
Kojto 115:87f2f5183dfb 233 #define DCMI_IT_ERR ((uint32_t)DCMI_IER_ERR_IE)
Kojto 115:87f2f5183dfb 234 #define DCMI_IT_VSYNC ((uint32_t)DCMI_IER_VSYNC_IE)
Kojto 115:87f2f5183dfb 235 #define DCMI_IT_LINE ((uint32_t)DCMI_IER_LINE_IE)
Kojto 115:87f2f5183dfb 236 /**
Kojto 115:87f2f5183dfb 237 * @}
Kojto 115:87f2f5183dfb 238 */
Kojto 115:87f2f5183dfb 239
Kojto 115:87f2f5183dfb 240 /** @defgroup DCMI_Flags DCMI Flags
Kojto 115:87f2f5183dfb 241 * @{
Kojto 115:87f2f5183dfb 242 */
Kojto 115:87f2f5183dfb 243
Kojto 115:87f2f5183dfb 244 /**
Kojto 115:87f2f5183dfb 245 * @brief DCMI SR register
Kojto 115:87f2f5183dfb 246 */
Kojto 115:87f2f5183dfb 247 #define DCMI_FLAG_HSYNC ((uint32_t)0x2001)
Kojto 115:87f2f5183dfb 248 #define DCMI_FLAG_VSYNC ((uint32_t)0x2002)
Kojto 115:87f2f5183dfb 249 #define DCMI_FLAG_FNE ((uint32_t)0x2004)
Kojto 115:87f2f5183dfb 250 /**
Kojto 115:87f2f5183dfb 251 * @brief DCMI RISR register
Kojto 115:87f2f5183dfb 252 */
Kojto 115:87f2f5183dfb 253 #define DCMI_FLAG_FRAMERI ((uint32_t)DCMI_RISR_FRAME_RIS)
Kojto 115:87f2f5183dfb 254 #define DCMI_FLAG_OVFRI ((uint32_t)DCMI_RISR_OVF_RIS)
Kojto 115:87f2f5183dfb 255 #define DCMI_FLAG_ERRRI ((uint32_t)DCMI_RISR_ERR_RIS)
Kojto 115:87f2f5183dfb 256 #define DCMI_FLAG_VSYNCRI ((uint32_t)DCMI_RISR_VSYNC_RIS)
Kojto 115:87f2f5183dfb 257 #define DCMI_FLAG_LINERI ((uint32_t)DCMI_RISR_LINE_RIS)
Kojto 115:87f2f5183dfb 258 /**
Kojto 115:87f2f5183dfb 259 * @brief DCMI MISR register
Kojto 115:87f2f5183dfb 260 */
Kojto 115:87f2f5183dfb 261 #define DCMI_FLAG_FRAMEMI ((uint32_t)0x1001)
Kojto 115:87f2f5183dfb 262 #define DCMI_FLAG_OVFMI ((uint32_t)0x1002)
Kojto 115:87f2f5183dfb 263 #define DCMI_FLAG_ERRMI ((uint32_t)0x1004)
Kojto 115:87f2f5183dfb 264 #define DCMI_FLAG_VSYNCMI ((uint32_t)0x1008)
Kojto 115:87f2f5183dfb 265 #define DCMI_FLAG_LINEMI ((uint32_t)0x1010)
Kojto 115:87f2f5183dfb 266 /**
Kojto 115:87f2f5183dfb 267 * @}
Kojto 115:87f2f5183dfb 268 */
Kojto 115:87f2f5183dfb 269
Kojto 115:87f2f5183dfb 270 /**
Kojto 115:87f2f5183dfb 271 * @}
Kojto 115:87f2f5183dfb 272 */
Kojto 115:87f2f5183dfb 273
Kojto 115:87f2f5183dfb 274 /* Exported macro ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 275 /** @defgroup DCMI_Exported_Macros DCMI Exported Macros
Kojto 115:87f2f5183dfb 276 * @{
Kojto 115:87f2f5183dfb 277 */
Kojto 115:87f2f5183dfb 278
Kojto 115:87f2f5183dfb 279 /** @brief Reset DCMI handle state
Kojto 115:87f2f5183dfb 280 * @param __HANDLE__: specifies the DCMI handle.
Kojto 115:87f2f5183dfb 281 * @retval None
Kojto 115:87f2f5183dfb 282 */
Kojto 115:87f2f5183dfb 283 #define __HAL_DCMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DCMI_STATE_RESET)
Kojto 115:87f2f5183dfb 284
Kojto 115:87f2f5183dfb 285 /**
Kojto 115:87f2f5183dfb 286 * @brief Enable the DCMI.
Kojto 115:87f2f5183dfb 287 * @param __HANDLE__: DCMI handle
Kojto 115:87f2f5183dfb 288 * @retval None
Kojto 115:87f2f5183dfb 289 */
Kojto 115:87f2f5183dfb 290 #define __HAL_DCMI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DCMI_CR_ENABLE)
Kojto 115:87f2f5183dfb 291
Kojto 115:87f2f5183dfb 292 /**
Kojto 115:87f2f5183dfb 293 * @brief Disable the DCMI.
Kojto 115:87f2f5183dfb 294 * @param __HANDLE__: DCMI handle
Kojto 115:87f2f5183dfb 295 * @retval None
Kojto 115:87f2f5183dfb 296 */
Kojto 115:87f2f5183dfb 297 #define __HAL_DCMI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(DCMI_CR_ENABLE))
Kojto 115:87f2f5183dfb 298
Kojto 115:87f2f5183dfb 299 /* Interrupt & Flag management */
Kojto 115:87f2f5183dfb 300 /**
Kojto 115:87f2f5183dfb 301 * @brief Get the DCMI pending flags.
Kojto 115:87f2f5183dfb 302 * @param __HANDLE__: DCMI handle
Kojto 115:87f2f5183dfb 303 * @param __FLAG__: Get the specified flag.
Kojto 115:87f2f5183dfb 304 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 305 * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
Kojto 115:87f2f5183dfb 306 * @arg DCMI_FLAG_OVFRI: Overflow flag mask
Kojto 115:87f2f5183dfb 307 * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
Kojto 115:87f2f5183dfb 308 * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
Kojto 115:87f2f5183dfb 309 * @arg DCMI_FLAG_LINERI: Line flag mask
Kojto 115:87f2f5183dfb 310 * @retval The state of FLAG.
Kojto 115:87f2f5183dfb 311 */
Kojto 115:87f2f5183dfb 312 #define __HAL_DCMI_GET_FLAG(__HANDLE__, __FLAG__)\
Kojto 115:87f2f5183dfb 313 ((((__FLAG__) & 0x3000) == 0x0)? ((__HANDLE__)->Instance->RISR & (__FLAG__)) :\
Kojto 115:87f2f5183dfb 314 (((__FLAG__) & 0x2000) == 0x0)? ((__HANDLE__)->Instance->MISR & (__FLAG__)) : ((__HANDLE__)->Instance->SR & (__FLAG__)))
Kojto 115:87f2f5183dfb 315
Kojto 115:87f2f5183dfb 316 /**
Kojto 115:87f2f5183dfb 317 * @brief Clear the DCMI pending flags.
Kojto 115:87f2f5183dfb 318 * @param __HANDLE__: DCMI handle
Kojto 115:87f2f5183dfb 319 * @param __FLAG__: specifies the flag to clear.
Kojto 115:87f2f5183dfb 320 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 321 * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
Kojto 115:87f2f5183dfb 322 * @arg DCMI_FLAG_OVFRI: Overflow flag mask
Kojto 115:87f2f5183dfb 323 * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
Kojto 115:87f2f5183dfb 324 * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
Kojto 115:87f2f5183dfb 325 * @arg DCMI_FLAG_LINERI: Line flag mask
Kojto 115:87f2f5183dfb 326 * @retval None
Kojto 115:87f2f5183dfb 327 */
Kojto 115:87f2f5183dfb 328 #define __HAL_DCMI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
Kojto 115:87f2f5183dfb 329
Kojto 115:87f2f5183dfb 330 /**
Kojto 115:87f2f5183dfb 331 * @brief Enable the specified DCMI interrupts.
Kojto 115:87f2f5183dfb 332 * @param __HANDLE__: DCMI handle
Kojto 115:87f2f5183dfb 333 * @param __INTERRUPT__: specifies the DCMI interrupt sources to be enabled.
Kojto 115:87f2f5183dfb 334 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 335 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
Kojto 115:87f2f5183dfb 336 * @arg DCMI_IT_OVF: Overflow interrupt mask
Kojto 115:87f2f5183dfb 337 * @arg DCMI_IT_ERR: Synchronization error interrupt mask
Kojto 115:87f2f5183dfb 338 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
Kojto 115:87f2f5183dfb 339 * @arg DCMI_IT_LINE: Line interrupt mask
Kojto 115:87f2f5183dfb 340 * @retval None
Kojto 115:87f2f5183dfb 341 */
Kojto 115:87f2f5183dfb 342 #define __HAL_DCMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
Kojto 115:87f2f5183dfb 343
Kojto 115:87f2f5183dfb 344 /**
Kojto 115:87f2f5183dfb 345 * @brief Disable the specified DCMI interrupts.
Kojto 115:87f2f5183dfb 346 * @param __HANDLE__: DCMI handle
Kojto 115:87f2f5183dfb 347 * @param __INTERRUPT__: specifies the DCMI interrupt sources to be enabled.
Kojto 115:87f2f5183dfb 348 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 349 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
Kojto 115:87f2f5183dfb 350 * @arg DCMI_IT_OVF: Overflow interrupt mask
Kojto 115:87f2f5183dfb 351 * @arg DCMI_IT_ERR: Synchronization error interrupt mask
Kojto 115:87f2f5183dfb 352 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
Kojto 115:87f2f5183dfb 353 * @arg DCMI_IT_LINE: Line interrupt mask
Kojto 115:87f2f5183dfb 354 * @retval None
Kojto 115:87f2f5183dfb 355 */
Kojto 115:87f2f5183dfb 356 #define __HAL_DCMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
Kojto 115:87f2f5183dfb 357
Kojto 115:87f2f5183dfb 358 /**
Kojto 115:87f2f5183dfb 359 * @brief Check whether the specified DCMI interrupt has occurred or not.
Kojto 115:87f2f5183dfb 360 * @param __HANDLE__: DCMI handle
Kojto 115:87f2f5183dfb 361 * @param __INTERRUPT__: specifies the DCMI interrupt source to check.
Kojto 115:87f2f5183dfb 362 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 363 * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
Kojto 115:87f2f5183dfb 364 * @arg DCMI_IT_OVF: Overflow interrupt mask
Kojto 115:87f2f5183dfb 365 * @arg DCMI_IT_ERR: Synchronization error interrupt mask
Kojto 115:87f2f5183dfb 366 * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
Kojto 115:87f2f5183dfb 367 * @arg DCMI_IT_LINE: Line interrupt mask
Kojto 115:87f2f5183dfb 368 * @retval The state of INTERRUPT.
Kojto 115:87f2f5183dfb 369 */
Kojto 115:87f2f5183dfb 370 #define __HAL_DCMI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__))
Kojto 115:87f2f5183dfb 371
Kojto 115:87f2f5183dfb 372 /**
Kojto 115:87f2f5183dfb 373 * @}
Kojto 115:87f2f5183dfb 374 */
Kojto 115:87f2f5183dfb 375
Kojto 115:87f2f5183dfb 376 /* Exported functions --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 377 /** @addtogroup DCMI_Exported_Functions DCMI Exported Functions
Kojto 115:87f2f5183dfb 378 * @{
Kojto 115:87f2f5183dfb 379 */
Kojto 115:87f2f5183dfb 380
Kojto 115:87f2f5183dfb 381 /** @addtogroup DCMI_Exported_Functions_Group1 Initialization and Configuration functions
Kojto 115:87f2f5183dfb 382 * @{
Kojto 115:87f2f5183dfb 383 */
Kojto 115:87f2f5183dfb 384 /* Initialization and de-initialization functions *****************************/
Kojto 115:87f2f5183dfb 385 HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 386 HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 387 void HAL_DCMI_MspInit(DCMI_HandleTypeDef* hdcmi);
Kojto 115:87f2f5183dfb 388 void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi);
Kojto 115:87f2f5183dfb 389 /**
Kojto 115:87f2f5183dfb 390 * @}
Kojto 115:87f2f5183dfb 391 */
Kojto 115:87f2f5183dfb 392
Kojto 115:87f2f5183dfb 393 /** @addtogroup DCMI_Exported_Functions_Group2 IO operation functions
Kojto 115:87f2f5183dfb 394 * @{
Kojto 115:87f2f5183dfb 395 */
Kojto 115:87f2f5183dfb 396 /* IO operation functions *****************************************************/
Kojto 115:87f2f5183dfb 397 HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length);
Kojto 115:87f2f5183dfb 398 HAL_StatusTypeDef HAL_DCMI_Stop(DCMI_HandleTypeDef* hdcmi);
Kojto 115:87f2f5183dfb 399 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 400 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 401 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 402 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 403 void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 404 /**
Kojto 115:87f2f5183dfb 405 * @}
Kojto 115:87f2f5183dfb 406 */
Kojto 115:87f2f5183dfb 407
Kojto 115:87f2f5183dfb 408 /** @addtogroup DCMI_Exported_Functions_Group3 Peripheral Control functions
Kojto 115:87f2f5183dfb 409 * @{
Kojto 115:87f2f5183dfb 410 */
Kojto 115:87f2f5183dfb 411 /* Peripheral Control functions ***********************************************/
Kojto 115:87f2f5183dfb 412 HAL_StatusTypeDef HAL_DCMI_ConfigCROP(DCMI_HandleTypeDef *hdcmi, uint32_t X0, uint32_t Y0, uint32_t XSize, uint32_t YSize);
Kojto 115:87f2f5183dfb 413 HAL_StatusTypeDef HAL_DCMI_EnableCROP(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 414 HAL_StatusTypeDef HAL_DCMI_DisableCROP(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 415 /**
Kojto 115:87f2f5183dfb 416 * @}
Kojto 115:87f2f5183dfb 417 */
Kojto 115:87f2f5183dfb 418
Kojto 115:87f2f5183dfb 419 /** @addtogroup DCMI_Exported_Functions_Group4 Peripheral State functions
Kojto 115:87f2f5183dfb 420 * @{
Kojto 115:87f2f5183dfb 421 */
Kojto 115:87f2f5183dfb 422 /* Peripheral State functions *************************************************/
Kojto 115:87f2f5183dfb 423 HAL_DCMI_StateTypeDef HAL_DCMI_GetState(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 424 uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef *hdcmi);
Kojto 115:87f2f5183dfb 425 /**
Kojto 115:87f2f5183dfb 426 * @}
Kojto 115:87f2f5183dfb 427 */
Kojto 115:87f2f5183dfb 428
Kojto 115:87f2f5183dfb 429 /**
Kojto 115:87f2f5183dfb 430 * @}
Kojto 115:87f2f5183dfb 431 */
Kojto 115:87f2f5183dfb 432
Kojto 115:87f2f5183dfb 433 /* Private types -------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 434 /* Private variables ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 435 /* Private constants ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 436 /* Private macro -------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 437 /** @defgroup DCMI_Private_Macros DCMI Private Macros
Kojto 115:87f2f5183dfb 438 * @{
Kojto 115:87f2f5183dfb 439 */
Kojto 115:87f2f5183dfb 440 #define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_MODE_CONTINUOUS) || \
Kojto 115:87f2f5183dfb 441 ((MODE) == DCMI_MODE_SNAPSHOT))
Kojto 115:87f2f5183dfb 442
Kojto 115:87f2f5183dfb 443 #define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SYNCHRO_HARDWARE) || \
Kojto 115:87f2f5183dfb 444 ((MODE) == DCMI_SYNCHRO_EMBEDDED))
Kojto 115:87f2f5183dfb 445
Kojto 115:87f2f5183dfb 446 #define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPOLARITY_FALLING) || \
Kojto 115:87f2f5183dfb 447 ((POLARITY) == DCMI_PCKPOLARITY_RISING))
Kojto 115:87f2f5183dfb 448
Kojto 115:87f2f5183dfb 449 #define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPOLARITY_LOW) || \
Kojto 115:87f2f5183dfb 450 ((POLARITY) == DCMI_VSPOLARITY_HIGH))
Kojto 115:87f2f5183dfb 451
Kojto 115:87f2f5183dfb 452 #define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPOLARITY_LOW) || \
Kojto 115:87f2f5183dfb 453 ((POLARITY) == DCMI_HSPOLARITY_HIGH))
Kojto 115:87f2f5183dfb 454
Kojto 115:87f2f5183dfb 455 #define IS_DCMI_MODE_JPEG(JPEG_MODE)(((JPEG_MODE) == DCMI_JPEG_DISABLE) || \
Kojto 115:87f2f5183dfb 456 ((JPEG_MODE) == DCMI_JPEG_ENABLE))
Kojto 115:87f2f5183dfb 457
Kojto 115:87f2f5183dfb 458 #define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CR_ALL_FRAME) || \
Kojto 115:87f2f5183dfb 459 ((RATE) == DCMI_CR_ALTERNATE_2_FRAME) || \
Kojto 115:87f2f5183dfb 460 ((RATE) == DCMI_CR_ALTERNATE_4_FRAME))
Kojto 115:87f2f5183dfb 461
Kojto 115:87f2f5183dfb 462 #define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_EXTEND_DATA_8B) || \
Kojto 115:87f2f5183dfb 463 ((DATA) == DCMI_EXTEND_DATA_10B) || \
Kojto 115:87f2f5183dfb 464 ((DATA) == DCMI_EXTEND_DATA_12B) || \
Kojto 115:87f2f5183dfb 465 ((DATA) == DCMI_EXTEND_DATA_14B))
Kojto 115:87f2f5183dfb 466
Kojto 115:87f2f5183dfb 467 #define IS_DCMI_WINDOW_COORDINATE(COORDINATE) ((COORDINATE) <= DCMI_WINDOW_COORDINATE)
Kojto 115:87f2f5183dfb 468
Kojto 115:87f2f5183dfb 469 #define IS_DCMI_WINDOW_HEIGHT(HEIGHT) ((HEIGHT) <= DCMI_WINDOW_HEIGHT)
Kojto 115:87f2f5183dfb 470
Kojto 115:87f2f5183dfb 471 /**
Kojto 115:87f2f5183dfb 472 * @}
Kojto 115:87f2f5183dfb 473 */
Kojto 115:87f2f5183dfb 474
Kojto 115:87f2f5183dfb 475 /* Private functions ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 476 /** @addtogroup DCMI_Private_Functions DCMI Private Functions
Kojto 115:87f2f5183dfb 477 * @{
Kojto 115:87f2f5183dfb 478 */
Kojto 115:87f2f5183dfb 479
Kojto 115:87f2f5183dfb 480 /**
Kojto 115:87f2f5183dfb 481 * @}
Kojto 115:87f2f5183dfb 482 */
Kojto 115:87f2f5183dfb 483
Kojto 115:87f2f5183dfb 484 /**
Kojto 115:87f2f5183dfb 485 * @}
Kojto 115:87f2f5183dfb 486 */
Kojto 115:87f2f5183dfb 487 /**
Kojto 115:87f2f5183dfb 488 * @}
Kojto 115:87f2f5183dfb 489 */
Kojto 115:87f2f5183dfb 490
Kojto 115:87f2f5183dfb 491 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 492 }
Kojto 115:87f2f5183dfb 493 #endif
Kojto 115:87f2f5183dfb 494
Kojto 115:87f2f5183dfb 495 #endif /* __STM32F7xx_HAL_DCMI_H */
Kojto 115:87f2f5183dfb 496
Kojto 115:87f2f5183dfb 497 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/