stm32f4xx_hal_dcmi.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_dcmi.h
  4. * @author MCD Application Team
  5. * @version V1.3.0
  6. * @date 09-March-2015
  7. * @brief Header file of DCMI HAL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2015 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. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32F4xx_HAL_DCMI_H
  39. #define __STM32F4xx_HAL_DCMI_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\
  44. defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx)
  45. /* Includes ------------------------------------------------------------------*/
  46. #include "stm32f4xx_hal_def.h"
  47. /* Include DCMI HAL Extended module */
  48. /* (include on top of file since DCMI structures are defined in extended file) */
  49. #include "stm32f4xx_hal_dcmi_ex.h"
  50. /** @addtogroup STM32F4xx_HAL_Driver
  51. * @{
  52. */
  53. /** @addtogroup DCMI DCMI
  54. * @brief DCMI HAL module driver
  55. * @{
  56. */
  57. /* Exported types ------------------------------------------------------------*/
  58. /** @defgroup DCMI_Exported_Types DCMI Exported Types
  59. * @{
  60. */
  61. /**
  62. * @brief DCMI Error source
  63. */
  64. typedef enum
  65. {
  66. DCMI_ERROR_SYNC = 1, /*!< Synchronisation error */
  67. DCMI_OVERRUN = 2, /*!< DCMI Overrun */
  68. }DCMI_ErrorTypeDef;
  69. /**
  70. * @brief HAL DCMI State structures definition
  71. */
  72. typedef enum
  73. {
  74. HAL_DCMI_STATE_RESET = 0x00, /*!< DCMI not yet initialized or disabled */
  75. HAL_DCMI_STATE_READY = 0x01, /*!< DCMI initialized and ready for use */
  76. HAL_DCMI_STATE_BUSY = 0x02, /*!< DCMI internal processing is ongoing */
  77. HAL_DCMI_STATE_TIMEOUT = 0x03, /*!< DCMI timeout state */
  78. HAL_DCMI_STATE_ERROR = 0x04 /*!< DCMI error state */
  79. }HAL_DCMI_StateTypeDef;
  80. /**
  81. * @brief DCMI handle Structure definition
  82. */
  83. typedef struct
  84. {
  85. DCMI_TypeDef *Instance; /*!< DCMI Register base address */
  86. DCMI_InitTypeDef Init; /*!< DCMI parameters */
  87. HAL_LockTypeDef Lock; /*!< DCMI locking object */
  88. __IO HAL_DCMI_StateTypeDef State; /*!< DCMI state */
  89. __IO uint32_t XferCount; /*!< DMA transfer counter */
  90. __IO uint32_t XferSize; /*!< DMA transfer size */
  91. uint32_t XferTransferNumber; /*!< DMA transfer number */
  92. uint32_t pBuffPtr; /*!< Pointer to DMA output buffer */
  93. DMA_HandleTypeDef *DMA_Handle; /*!< Pointer to the DMA handler */
  94. __IO uint32_t ErrorCode; /*!< DCMI Error code */
  95. }DCMI_HandleTypeDef;
  96. /**
  97. * @}
  98. */
  99. /* Exported constants --------------------------------------------------------*/
  100. /** @defgroup DCMI_Exported_Constants DCMI Exported Constants
  101. * @{
  102. */
  103. /** @defgroup DCMI_Error_Code DCMI Error Code
  104. * @{
  105. */
  106. #define HAL_DCMI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
  107. #define HAL_DCMI_ERROR_OVF ((uint32_t)0x00000001) /*!< Overflow error */
  108. #define HAL_DCMI_ERROR_SYNC ((uint32_t)0x00000002) /*!< Synchronization error */
  109. #define HAL_DCMI_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */
  110. /**
  111. * @}
  112. */
  113. /** @defgroup DCMI_Capture_Mode DCMI Capture Mode
  114. * @{
  115. */
  116. #define DCMI_MODE_CONTINUOUS ((uint32_t)0x00000000) /*!< The received data are transferred continuously
  117. into the destination memory through the DMA */
  118. #define DCMI_MODE_SNAPSHOT ((uint32_t)DCMI_CR_CM) /*!< Once activated, the interface waits for the start of
  119. frame and then transfers a single frame through the DMA */
  120. /**
  121. * @}
  122. */
  123. /** @defgroup DCMI_Synchronization_Mode DCMI Synchronization Mode
  124. * @{
  125. */
  126. #define DCMI_SYNCHRO_HARDWARE ((uint32_t)0x00000000) /*!< Hardware synchronization data capture (frame/line start/stop)
  127. is synchronized with the HSYNC/VSYNC signals */
  128. #define DCMI_SYNCHRO_EMBEDDED ((uint32_t)DCMI_CR_ESS) /*!< Embedded synchronization data capture is synchronized with
  129. synchronization codes embedded in the data flow */
  130. /**
  131. * @}
  132. */
  133. /** @defgroup DCMI_PIXCK_Polarity DCMI PIXCK Polarity
  134. * @{
  135. */
  136. #define DCMI_PCKPOLARITY_FALLING ((uint32_t)0x00000000) /*!< Pixel clock active on Falling edge */
  137. #define DCMI_PCKPOLARITY_RISING ((uint32_t)DCMI_CR_PCKPOL) /*!< Pixel clock active on Rising edge */
  138. /**
  139. * @}
  140. */
  141. /** @defgroup DCMI_VSYNC_Polarity DCMI VSYNC Polarity
  142. * @{
  143. */
  144. #define DCMI_VSPOLARITY_LOW ((uint32_t)0x00000000) /*!< Vertical synchronization active Low */
  145. #define DCMI_VSPOLARITY_HIGH ((uint32_t)DCMI_CR_VSPOL) /*!< Vertical synchronization active High */
  146. /**
  147. * @}
  148. */
  149. /** @defgroup DCMI_HSYNC_Polarity DCMI HSYNC Polarity
  150. * @{
  151. */
  152. #define DCMI_HSPOLARITY_LOW ((uint32_t)0x00000000) /*!< Horizontal synchronization active Low */
  153. #define DCMI_HSPOLARITY_HIGH ((uint32_t)DCMI_CR_HSPOL) /*!< Horizontal synchronization active High */
  154. /**
  155. * @}
  156. */
  157. /** @defgroup DCMI_MODE_JPEG DCMI MODE JPEG
  158. * @{
  159. */
  160. #define DCMI_JPEG_DISABLE ((uint32_t)0x00000000) /*!< Mode JPEG Disabled */
  161. #define DCMI_JPEG_ENABLE ((uint32_t)DCMI_CR_JPEG) /*!< Mode JPEG Enabled */
  162. /**
  163. * @}
  164. */
  165. /** @defgroup DCMI_Capture_Rate DCMI Capture Rate
  166. * @{
  167. */
  168. #define DCMI_CR_ALL_FRAME ((uint32_t)0x00000000) /*!< All frames are captured */
  169. #define DCMI_CR_ALTERNATE_2_FRAME ((uint32_t)DCMI_CR_FCRC_0) /*!< Every alternate frame captured */
  170. #define DCMI_CR_ALTERNATE_4_FRAME ((uint32_t)DCMI_CR_FCRC_1) /*!< One frame in 4 frames captured */
  171. /**
  172. * @}
  173. */
  174. /** @defgroup DCMI_Extended_Data_Mode DCMI Extended Data Mode
  175. * @{
  176. */
  177. #define DCMI_EXTEND_DATA_8B ((uint32_t)0x00000000) /*!< Interface captures 8-bit data on every pixel clock */
  178. #define DCMI_EXTEND_DATA_10B ((uint32_t)DCMI_CR_EDM_0) /*!< Interface captures 10-bit data on every pixel clock */
  179. #define DCMI_EXTEND_DATA_12B ((uint32_t)DCMI_CR_EDM_1) /*!< Interface captures 12-bit data on every pixel clock */
  180. #define DCMI_EXTEND_DATA_14B ((uint32_t)(DCMI_CR_EDM_0 | DCMI_CR_EDM_1)) /*!< Interface captures 14-bit data on every pixel clock */
  181. /**
  182. * @}
  183. */
  184. /** @defgroup DCMI_Window_Coordinate DCMI Window Coordinate
  185. * @{
  186. */
  187. #define DCMI_WINDOW_COORDINATE ((uint32_t)0x3FFF) /*!< Window coordinate */
  188. /**
  189. * @}
  190. */
  191. /** @defgroup DCMI_Window_Height DCMI Window Height
  192. * @{
  193. */
  194. #define DCMI_WINDOW_HEIGHT ((uint32_t)0x1FFF) /*!< Window Height */
  195. /**
  196. * @}
  197. */
  198. /** @defgroup DCMI_interrupt_sources DCMI interrupt sources
  199. * @{
  200. */
  201. #define DCMI_IT_FRAME ((uint32_t)DCMI_IER_FRAME_IE)
  202. #define DCMI_IT_OVF ((uint32_t)DCMI_IER_OVF_IE)
  203. #define DCMI_IT_ERR ((uint32_t)DCMI_IER_ERR_IE)
  204. #define DCMI_IT_VSYNC ((uint32_t)DCMI_IER_VSYNC_IE)
  205. #define DCMI_IT_LINE ((uint32_t)DCMI_IER_LINE_IE)
  206. /**
  207. * @}
  208. */
  209. /** @defgroup DCMI_Flags DCMI Flags
  210. * @{
  211. */
  212. /**
  213. * @brief DCMI SR register
  214. */
  215. #define DCMI_FLAG_HSYNC ((uint32_t)0x2001)
  216. #define DCMI_FLAG_VSYNC ((uint32_t)0x2002)
  217. #define DCMI_FLAG_FNE ((uint32_t)0x2004)
  218. /**
  219. * @brief DCMI RISR register
  220. */
  221. #define DCMI_FLAG_FRAMERI ((uint32_t)DCMI_RISR_FRAME_RIS)
  222. #define DCMI_FLAG_OVFRI ((uint32_t)DCMI_RISR_OVF_RIS)
  223. #define DCMI_FLAG_ERRRI ((uint32_t)DCMI_RISR_ERR_RIS)
  224. #define DCMI_FLAG_VSYNCRI ((uint32_t)DCMI_RISR_VSYNC_RIS)
  225. #define DCMI_FLAG_LINERI ((uint32_t)DCMI_RISR_LINE_RIS)
  226. /**
  227. * @brief DCMI MISR register
  228. */
  229. #define DCMI_FLAG_FRAMEMI ((uint32_t)0x1001)
  230. #define DCMI_FLAG_OVFMI ((uint32_t)0x1002)
  231. #define DCMI_FLAG_ERRMI ((uint32_t)0x1004)
  232. #define DCMI_FLAG_VSYNCMI ((uint32_t)0x1008)
  233. #define DCMI_FLAG_LINEMI ((uint32_t)0x1010)
  234. /**
  235. * @}
  236. */
  237. /**
  238. * @}
  239. */
  240. /* Exported macro ------------------------------------------------------------*/
  241. /** @defgroup DCMI_Exported_Macros DCMI Exported Macros
  242. * @{
  243. */
  244. /** @brief Reset DCMI handle state
  245. * @param __HANDLE__: specifies the DCMI handle.
  246. * @retval None
  247. */
  248. #define __HAL_DCMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DCMI_STATE_RESET)
  249. /**
  250. * @brief Enable the DCMI.
  251. * @param __HANDLE__: DCMI handle
  252. * @retval None
  253. */
  254. #define __HAL_DCMI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DCMI_CR_ENABLE)
  255. /**
  256. * @brief Disable the DCMI.
  257. * @param __HANDLE__: DCMI handle
  258. * @retval None
  259. */
  260. #define __HAL_DCMI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(DCMI_CR_ENABLE))
  261. /* Interrupt & Flag management */
  262. /**
  263. * @brief Get the DCMI pending flags.
  264. * @param __HANDLE__: DCMI handle
  265. * @param __FLAG__: Get the specified flag.
  266. * This parameter can be any combination of the following values:
  267. * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
  268. * @arg DCMI_FLAG_OVFRI: Overflow flag mask
  269. * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
  270. * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
  271. * @arg DCMI_FLAG_LINERI: Line flag mask
  272. * @retval The state of FLAG.
  273. */
  274. #define __HAL_DCMI_GET_FLAG(__HANDLE__, __FLAG__)\
  275. ((((__FLAG__) & 0x3000) == 0x0)? ((__HANDLE__)->Instance->RISR & (__FLAG__)) :\
  276. (((__FLAG__) & 0x2000) == 0x0)? ((__HANDLE__)->Instance->MISR & (__FLAG__)) : ((__HANDLE__)->Instance->SR & (__FLAG__)))
  277. /**
  278. * @brief Clear the DCMI pending flags.
  279. * @param __HANDLE__: DCMI handle
  280. * @param __FLAG__: specifies the flag to clear.
  281. * This parameter can be any combination of the following values:
  282. * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
  283. * @arg DCMI_FLAG_OVFRI: Overflow flag mask
  284. * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
  285. * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
  286. * @arg DCMI_FLAG_LINERI: Line flag mask
  287. * @retval None
  288. */
  289. #define __HAL_DCMI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
  290. /**
  291. * @brief Enable the specified DCMI interrupts.
  292. * @param __HANDLE__: DCMI handle
  293. * @param __INTERRUPT__: specifies the DCMI interrupt sources to be enabled.
  294. * This parameter can be any combination of the following values:
  295. * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
  296. * @arg DCMI_IT_OVF: Overflow interrupt mask
  297. * @arg DCMI_IT_ERR: Synchronization error interrupt mask
  298. * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
  299. * @arg DCMI_IT_LINE: Line interrupt mask
  300. * @retval None
  301. */
  302. #define __HAL_DCMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
  303. /**
  304. * @brief Disable the specified DCMI interrupts.
  305. * @param __HANDLE__: DCMI handle
  306. * @param __INTERRUPT__: specifies the DCMI interrupt sources to be enabled.
  307. * This parameter can be any combination of the following values:
  308. * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
  309. * @arg DCMI_IT_OVF: Overflow interrupt mask
  310. * @arg DCMI_IT_ERR: Synchronization error interrupt mask
  311. * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
  312. * @arg DCMI_IT_LINE: Line interrupt mask
  313. * @retval None
  314. */
  315. #define __HAL_DCMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
  316. /**
  317. * @brief Check whether the specified DCMI interrupt has occurred or not.
  318. * @param __HANDLE__: DCMI handle
  319. * @param __INTERRUPT__: specifies the DCMI interrupt source to check.
  320. * This parameter can be one of the following values:
  321. * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
  322. * @arg DCMI_IT_OVF: Overflow interrupt mask
  323. * @arg DCMI_IT_ERR: Synchronization error interrupt mask
  324. * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
  325. * @arg DCMI_IT_LINE: Line interrupt mask
  326. * @retval The state of INTERRUPT.
  327. */
  328. #define __HAL_DCMI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__))
  329. /**
  330. * @}
  331. */
  332. /* Exported functions --------------------------------------------------------*/
  333. /** @addtogroup DCMI_Exported_Functions
  334. * @{
  335. */
  336. /** @addtogroup DCMI_Exported_Functions_Group1
  337. * @{
  338. */
  339. /* Initialization and de-initialization functions *****************************/
  340. HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi);
  341. HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi);
  342. void HAL_DCMI_MspInit(DCMI_HandleTypeDef* hdcmi);
  343. void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi);
  344. /**
  345. * @}
  346. */
  347. /** @addtogroup DCMI_Exported_Functions_Group2
  348. * @{
  349. */
  350. /* IO operation functions *****************************************************/
  351. HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length);
  352. HAL_StatusTypeDef HAL_DCMI_Stop(DCMI_HandleTypeDef* hdcmi);
  353. void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi);
  354. void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi);
  355. void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi);
  356. void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi);
  357. void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi);
  358. /**
  359. * @}
  360. */
  361. /** @addtogroup DCMI_Exported_Functions_Group3
  362. * @{
  363. */
  364. /* Peripheral Control functions ***********************************************/
  365. HAL_StatusTypeDef HAL_DCMI_ConfigCROP(DCMI_HandleTypeDef *hdcmi, uint32_t X0, uint32_t Y0, uint32_t XSize, uint32_t YSize);
  366. HAL_StatusTypeDef HAL_DCMI_EnableCROP(DCMI_HandleTypeDef *hdcmi);
  367. HAL_StatusTypeDef HAL_DCMI_DisableCROP(DCMI_HandleTypeDef *hdcmi);
  368. /**
  369. * @}
  370. */
  371. /** @addtogroup DCMI_Exported_Functions_Group4
  372. * @{
  373. */
  374. /* Peripheral State functions *************************************************/
  375. HAL_DCMI_StateTypeDef HAL_DCMI_GetState(DCMI_HandleTypeDef *hdcmi);
  376. uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef *hdcmi);
  377. /**
  378. * @}
  379. */
  380. /**
  381. * @}
  382. */
  383. /* Private types -------------------------------------------------------------*/
  384. /* Private variables ---------------------------------------------------------*/
  385. /* Private constants ---------------------------------------------------------*/
  386. /* Private macro -------------------------------------------------------------*/
  387. /** @defgroup DCMI_Private_Macros DCMI Private Macros
  388. * @{
  389. */
  390. #define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_MODE_CONTINUOUS) || \
  391. ((MODE) == DCMI_MODE_SNAPSHOT))
  392. #define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SYNCHRO_HARDWARE) || \
  393. ((MODE) == DCMI_SYNCHRO_EMBEDDED))
  394. #define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPOLARITY_FALLING) || \
  395. ((POLARITY) == DCMI_PCKPOLARITY_RISING))
  396. #define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPOLARITY_LOW) || \
  397. ((POLARITY) == DCMI_VSPOLARITY_HIGH))
  398. #define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPOLARITY_LOW) || \
  399. ((POLARITY) == DCMI_HSPOLARITY_HIGH))
  400. #define IS_DCMI_MODE_JPEG(JPEG_MODE)(((JPEG_MODE) == DCMI_JPEG_DISABLE) || \
  401. ((JPEG_MODE) == DCMI_JPEG_ENABLE))
  402. #define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CR_ALL_FRAME) || \
  403. ((RATE) == DCMI_CR_ALTERNATE_2_FRAME) || \
  404. ((RATE) == DCMI_CR_ALTERNATE_4_FRAME))
  405. #define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_EXTEND_DATA_8B) || \
  406. ((DATA) == DCMI_EXTEND_DATA_10B) || \
  407. ((DATA) == DCMI_EXTEND_DATA_12B) || \
  408. ((DATA) == DCMI_EXTEND_DATA_14B))
  409. #define IS_DCMI_WINDOW_COORDINATE(COORDINATE) ((COORDINATE) <= DCMI_WINDOW_COORDINATE)
  410. #define IS_DCMI_WINDOW_HEIGHT(HEIGHT) ((HEIGHT) <= DCMI_WINDOW_HEIGHT)
  411. /**
  412. * @}
  413. */
  414. /* Private functions ---------------------------------------------------------*/
  415. /** @addtogroup DCMI_Private_Functions DCMI Private Functions
  416. * @{
  417. */
  418. /**
  419. * @}
  420. */
  421. #endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\
  422. STM32F429xx || STM32F439xx || STM32F446xx */
  423. /**
  424. * @}
  425. */
  426. /**
  427. * @}
  428. */
  429. #ifdef __cplusplus
  430. }
  431. #endif
  432. #endif /* __STM32F4xx_HAL_DCMI_H */
  433. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/