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