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:
Kojto
Date:
Wed Sep 02 14:17:43 2015 +0100
Revision:
106:ba1f97679dad
Parent:
99:dbbf35b96557
Child:
110:165afa46840b
Release 106  of the mbed library

Changes:
- new platform - Nucleo F446RE
- STM32F4 Cube driver update v2.3.2
- ST cmsis driver v2.3.2
- nordic bugfix gcc linker start address
- lpc11u68 - bugfix for serial ports

Who changed what in which revision?

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