Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Sep 16 15:32:31 2015 +0100
Revision:
107:4f6c30876dfa
Child:
116:c0f6e94411f5
Release 107  of the mbed library

Changes:
- new platforms - DISCO_F746NG, DISCO_L476VG, NUCLEO_L476RG
- KL43Z - bugfix RTC init function
- K20 - SPI mode fix

Who changed what in which revision?

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