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