训练营PLSR题目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

564 lines
23 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_dcmi.h
  4. * @author MCD Application Team
  5. * @brief Header file of DCMI HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file in
  13. * the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. ******************************************************************************
  16. */
  17. /* Define to prevent recursive inclusion -------------------------------------*/
  18. #ifndef __STM32F4xx_HAL_DCMI_H
  19. #define __STM32F4xx_HAL_DCMI_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\
  24. defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) || defined(STM32F469xx) ||\
  25. defined(STM32F479xx)
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32f4xx_hal_def.h"
  28. /* Include DCMI HAL Extended module */
  29. /* (include on top of file since DCMI structures are defined in extended file) */
  30. #include "stm32f4xx_hal_dcmi_ex.h"
  31. /** @addtogroup STM32F4xx_HAL_Driver
  32. * @{
  33. */
  34. /** @addtogroup DCMI DCMI
  35. * @brief DCMI HAL module driver
  36. * @{
  37. */
  38. /* Exported types ------------------------------------------------------------*/
  39. /** @defgroup DCMI_Exported_Types DCMI Exported Types
  40. * @{
  41. */
  42. /**
  43. * @brief DCMI Embedded Synchronisation CODE Init structure definition
  44. */
  45. typedef struct
  46. {
  47. uint8_t FrameStartUnmask; /*!< Specifies the frame start delimiter unmask. */
  48. uint8_t LineStartUnmask; /*!< Specifies the line start delimiter unmask. */
  49. uint8_t LineEndUnmask; /*!< Specifies the line end delimiter unmask. */
  50. uint8_t FrameEndUnmask; /*!< Specifies the frame end delimiter unmask. */
  51. }DCMI_SyncUnmaskTypeDef;
  52. /**
  53. * @brief HAL DCMI State structures definition
  54. */
  55. typedef enum
  56. {
  57. HAL_DCMI_STATE_RESET = 0x00U, /*!< DCMI not yet initialized or disabled */
  58. HAL_DCMI_STATE_READY = 0x01U, /*!< DCMI initialized and ready for use */
  59. HAL_DCMI_STATE_BUSY = 0x02U, /*!< DCMI internal processing is ongoing */
  60. HAL_DCMI_STATE_TIMEOUT = 0x03U, /*!< DCMI timeout state */
  61. HAL_DCMI_STATE_ERROR = 0x04U, /*!< DCMI error state */
  62. HAL_DCMI_STATE_SUSPENDED = 0x05U /*!< DCMI suspend state */
  63. }HAL_DCMI_StateTypeDef;
  64. /**
  65. * @brief DCMI handle Structure definition
  66. */
  67. typedef struct __DCMI_HandleTypeDef
  68. {
  69. DCMI_TypeDef *Instance; /*!< DCMI Register base address */
  70. DCMI_InitTypeDef Init; /*!< DCMI parameters */
  71. HAL_LockTypeDef Lock; /*!< DCMI locking object */
  72. __IO HAL_DCMI_StateTypeDef State; /*!< DCMI state */
  73. __IO uint32_t XferCount; /*!< DMA transfer counter */
  74. __IO uint32_t XferSize; /*!< DMA transfer size */
  75. uint32_t XferTransferNumber; /*!< DMA transfer number */
  76. uint32_t pBuffPtr; /*!< Pointer to DMA output buffer */
  77. DMA_HandleTypeDef *DMA_Handle; /*!< Pointer to the DMA handler */
  78. __IO uint32_t ErrorCode; /*!< DCMI Error code */
  79. #if (USE_HAL_DCMI_REGISTER_CALLBACKS == 1)
  80. void (* FrameEventCallback) ( struct __DCMI_HandleTypeDef *hdcmi); /*!< DCMI Frame Event Callback */
  81. void (* VsyncEventCallback) ( struct __DCMI_HandleTypeDef *hdcmi); /*!< DCMI Vsync Event Callback */
  82. void (* LineEventCallback ) ( struct __DCMI_HandleTypeDef *hdcmi); /*!< DCMI Line Event Callback */
  83. void (* ErrorCallback) ( struct __DCMI_HandleTypeDef *hdcmi); /*!< DCMI Error Callback */
  84. void (* MspInitCallback) ( struct __DCMI_HandleTypeDef *hdcmi); /*!< DCMI Msp Init callback */
  85. void (* MspDeInitCallback) ( struct __DCMI_HandleTypeDef *hdcmi); /*!< DCMI Msp DeInit callback */
  86. #endif /* USE_HAL_DCMI_REGISTER_CALLBACKS */
  87. }DCMI_HandleTypeDef;
  88. #if (USE_HAL_DCMI_REGISTER_CALLBACKS == 1)
  89. typedef enum
  90. {
  91. HAL_DCMI_FRAME_EVENT_CB_ID = 0x00U, /*!< DCMI Frame Event Callback ID */
  92. HAL_DCMI_VSYNC_EVENT_CB_ID = 0x01U, /*!< DCMI Vsync Event Callback ID */
  93. HAL_DCMI_LINE_EVENT_CB_ID = 0x02U, /*!< DCMI Line Event Callback ID */
  94. HAL_DCMI_ERROR_CB_ID = 0x03U, /*!< DCMI Error Callback ID */
  95. HAL_DCMI_MSPINIT_CB_ID = 0x04U, /*!< DCMI MspInit callback ID */
  96. HAL_DCMI_MSPDEINIT_CB_ID = 0x05U /*!< DCMI MspDeInit callback ID */
  97. }HAL_DCMI_CallbackIDTypeDef;
  98. typedef void (*pDCMI_CallbackTypeDef)(DCMI_HandleTypeDef *hdcmi);
  99. #endif /* USE_HAL_DCMI_REGISTER_CALLBACKS */
  100. /**
  101. * @}
  102. */
  103. /* Exported constants --------------------------------------------------------*/
  104. /** @defgroup DCMI_Exported_Constants DCMI Exported Constants
  105. * @{
  106. */
  107. /** @defgroup DCMI_Error_Code DCMI Error Code
  108. * @{
  109. */
  110. #define HAL_DCMI_ERROR_NONE 0x00000000U /*!< No error */
  111. #define HAL_DCMI_ERROR_OVR 0x00000001U /*!< Overrun error */
  112. #define HAL_DCMI_ERROR_SYNC 0x00000002U /*!< Synchronization error */
  113. #define HAL_DCMI_ERROR_TIMEOUT 0x00000020U /*!< Timeout error */
  114. #define HAL_DCMI_ERROR_DMA 0x00000040U /*!< DMA error */
  115. #if (USE_HAL_DCMI_REGISTER_CALLBACKS == 1)
  116. #define HAL_DCMI_ERROR_INVALID_CALLBACK ((uint32_t)0x00000080U) /*!< Invalid callback error */
  117. #endif
  118. /**
  119. * @}
  120. */
  121. /** @defgroup DCMI_Capture_Mode DCMI Capture Mode
  122. * @{
  123. */
  124. #define DCMI_MODE_CONTINUOUS 0x00000000U /*!< The received data are transferred continuously
  125. into the destination memory through the DMA */
  126. #define DCMI_MODE_SNAPSHOT ((uint32_t)DCMI_CR_CM) /*!< Once activated, the interface waits for the start of
  127. frame and then transfers a single frame through the DMA */
  128. /**
  129. * @}
  130. */
  131. /** @defgroup DCMI_Synchronization_Mode DCMI Synchronization Mode
  132. * @{
  133. */
  134. #define DCMI_SYNCHRO_HARDWARE 0x00000000U /*!< Hardware synchronization data capture (frame/line start/stop)
  135. is synchronized with the HSYNC/VSYNC signals */
  136. #define DCMI_SYNCHRO_EMBEDDED ((uint32_t)DCMI_CR_ESS) /*!< Embedded synchronization data capture is synchronized with
  137. synchronization codes embedded in the data flow */
  138. /**
  139. * @}
  140. */
  141. /** @defgroup DCMI_PIXCK_Polarity DCMI PIXCK Polarity
  142. * @{
  143. */
  144. #define DCMI_PCKPOLARITY_FALLING 0x00000000U /*!< Pixel clock active on Falling edge */
  145. #define DCMI_PCKPOLARITY_RISING ((uint32_t)DCMI_CR_PCKPOL) /*!< Pixel clock active on Rising edge */
  146. /**
  147. * @}
  148. */
  149. /** @defgroup DCMI_VSYNC_Polarity DCMI VSYNC Polarity
  150. * @{
  151. */
  152. #define DCMI_VSPOLARITY_LOW 0x00000000U /*!< Vertical synchronization active Low */
  153. #define DCMI_VSPOLARITY_HIGH ((uint32_t)DCMI_CR_VSPOL) /*!< Vertical synchronization active High */
  154. /**
  155. * @}
  156. */
  157. /** @defgroup DCMI_HSYNC_Polarity DCMI HSYNC Polarity
  158. * @{
  159. */
  160. #define DCMI_HSPOLARITY_LOW 0x00000000U /*!< Horizontal synchronization active Low */
  161. #define DCMI_HSPOLARITY_HIGH ((uint32_t)DCMI_CR_HSPOL) /*!< Horizontal synchronization active High */
  162. /**
  163. * @}
  164. */
  165. /** @defgroup DCMI_MODE_JPEG DCMI MODE JPEG
  166. * @{
  167. */
  168. #define DCMI_JPEG_DISABLE 0x00000000U /*!< Mode JPEG Disabled */
  169. #define DCMI_JPEG_ENABLE ((uint32_t)DCMI_CR_JPEG) /*!< Mode JPEG Enabled */
  170. /**
  171. * @}
  172. */
  173. /** @defgroup DCMI_Capture_Rate DCMI Capture Rate
  174. * @{
  175. */
  176. #define DCMI_CR_ALL_FRAME 0x00000000U /*!< All frames are captured */
  177. #define DCMI_CR_ALTERNATE_2_FRAME ((uint32_t)DCMI_CR_FCRC_0) /*!< Every alternate frame captured */
  178. #define DCMI_CR_ALTERNATE_4_FRAME ((uint32_t)DCMI_CR_FCRC_1) /*!< One frame in 4 frames captured */
  179. /**
  180. * @}
  181. */
  182. /** @defgroup DCMI_Extended_Data_Mode DCMI Extended Data Mode
  183. * @{
  184. */
  185. #define DCMI_EXTEND_DATA_8B 0x00000000U /*!< Interface captures 8-bit data on every pixel clock */
  186. #define DCMI_EXTEND_DATA_10B ((uint32_t)DCMI_CR_EDM_0) /*!< Interface captures 10-bit data on every pixel clock */
  187. #define DCMI_EXTEND_DATA_12B ((uint32_t)DCMI_CR_EDM_1) /*!< Interface captures 12-bit data on every pixel clock */
  188. #define DCMI_EXTEND_DATA_14B ((uint32_t)(DCMI_CR_EDM_0 | DCMI_CR_EDM_1)) /*!< Interface captures 14-bit data on every pixel clock */
  189. /**
  190. * @}
  191. */
  192. /** @defgroup DCMI_Window_Coordinate DCMI Window Coordinate
  193. * @{
  194. */
  195. #define DCMI_WINDOW_COORDINATE 0x3FFFU /*!< Window coordinate */
  196. /**
  197. * @}
  198. */
  199. /** @defgroup DCMI_Window_Height DCMI Window Height
  200. * @{
  201. */
  202. #define DCMI_WINDOW_HEIGHT 0x1FFFU /*!< Window Height */
  203. /**
  204. * @}
  205. */
  206. /** @defgroup DCMI_Window_Vertical_Line DCMI Window Vertical Line
  207. * @{
  208. */
  209. #define DCMI_POSITION_CWSIZE_VLINE (uint32_t)DCMI_CWSIZE_VLINE_Pos /*!< Required left shift to set crop window vertical line count */
  210. #define DCMI_POSITION_CWSTRT_VST (uint32_t)DCMI_CWSTRT_VST_Pos /*!< Required left shift to set crop window vertical start line count */
  211. /**
  212. * @}
  213. */
  214. /** @defgroup DCMI_interrupt_sources DCMI interrupt sources
  215. * @{
  216. */
  217. #define DCMI_IT_FRAME ((uint32_t)DCMI_IER_FRAME_IE) /*!< Capture complete interrupt */
  218. #define DCMI_IT_OVR ((uint32_t)DCMI_IER_OVR_IE) /*!< Overrun interrupt */
  219. #define DCMI_IT_ERR ((uint32_t)DCMI_IER_ERR_IE) /*!< Synchronization error interrupt */
  220. #define DCMI_IT_VSYNC ((uint32_t)DCMI_IER_VSYNC_IE) /*!< VSYNC interrupt */
  221. #define DCMI_IT_LINE ((uint32_t)DCMI_IER_LINE_IE) /*!< Line interrupt */
  222. /**
  223. * @}
  224. */
  225. /** @defgroup DCMI_Flags DCMI Flags
  226. * @{
  227. */
  228. /**
  229. * @brief DCMI SR register
  230. */
  231. #define DCMI_FLAG_HSYNC ((uint32_t)DCMI_SR_INDEX|DCMI_SR_HSYNC) /*!< HSYNC pin state (active line / synchronization between lines) */
  232. #define DCMI_FLAG_VSYNC ((uint32_t)DCMI_SR_INDEX|DCMI_SR_VSYNC) /*!< VSYNC pin state (active frame / synchronization between frames) */
  233. #define DCMI_FLAG_FNE ((uint32_t)DCMI_SR_INDEX|DCMI_SR_FNE) /*!< FIFO not empty flag */
  234. /**
  235. * @brief DCMI RIS register
  236. */
  237. #define DCMI_FLAG_FRAMERI ((uint32_t)DCMI_RISR_FRAME_RIS) /*!< Frame capture complete interrupt flag */
  238. #define DCMI_FLAG_OVRRI ((uint32_t)DCMI_RISR_OVR_RIS) /*!< Overrun interrupt flag */
  239. #define DCMI_FLAG_ERRRI ((uint32_t)DCMI_RISR_ERR_RIS) /*!< Synchronization error interrupt flag */
  240. #define DCMI_FLAG_VSYNCRI ((uint32_t)DCMI_RISR_VSYNC_RIS) /*!< VSYNC interrupt flag */
  241. #define DCMI_FLAG_LINERI ((uint32_t)DCMI_RISR_LINE_RIS) /*!< Line interrupt flag */
  242. /**
  243. * @brief DCMI MIS register
  244. */
  245. #define DCMI_FLAG_FRAMEMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_FRAME_MIS) /*!< DCMI Frame capture complete masked interrupt status */
  246. #define DCMI_FLAG_OVRMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_OVR_MIS ) /*!< DCMI Overrun masked interrupt status */
  247. #define DCMI_FLAG_ERRMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_ERR_MIS ) /*!< DCMI Synchronization error masked interrupt status */
  248. #define DCMI_FLAG_VSYNCMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_VSYNC_MIS) /*!< DCMI VSYNC masked interrupt status */
  249. #define DCMI_FLAG_LINEMI ((uint32_t)DCMI_MIS_INDEX|DCMI_MIS_LINE_MIS ) /*!< DCMI Line masked interrupt status */
  250. /**
  251. * @}
  252. */
  253. /**
  254. * @}
  255. */
  256. /* Exported macro ------------------------------------------------------------*/
  257. /** @defgroup DCMI_Exported_Macros DCMI Exported Macros
  258. * @{
  259. */
  260. /** @brief Reset DCMI handle state
  261. * @param __HANDLE__ specifies the DCMI handle.
  262. * @retval None
  263. */
  264. #define __HAL_DCMI_RESET_HANDLE_STATE(__HANDLE__) do{ \
  265. (__HANDLE__)->State = HAL_DCMI_STATE_RESET; \
  266. (__HANDLE__)->MspInitCallback = NULL; \
  267. (__HANDLE__)->MspDeInitCallback = NULL; \
  268. } while(0)
  269. /**
  270. * @brief Enable the DCMI.
  271. * @param __HANDLE__ DCMI handle
  272. * @retval None
  273. */
  274. #define __HAL_DCMI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DCMI_CR_ENABLE)
  275. /**
  276. * @brief Disable the DCMI.
  277. * @param __HANDLE__ DCMI handle
  278. * @retval None
  279. */
  280. #define __HAL_DCMI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(DCMI_CR_ENABLE))
  281. /* Interrupt & Flag management */
  282. /**
  283. * @brief Get the DCMI pending flag.
  284. * @param __HANDLE__ DCMI handle
  285. * @param __FLAG__ Get the specified flag.
  286. * This parameter can be one of the following values (no combination allowed)
  287. * @arg DCMI_FLAG_HSYNC: HSYNC pin state (active line / synchronization between lines)
  288. * @arg DCMI_FLAG_VSYNC: VSYNC pin state (active frame / synchronization between frames)
  289. * @arg DCMI_FLAG_FNE: FIFO empty flag
  290. * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
  291. * @arg DCMI_FLAG_OVRRI: Overrun flag mask
  292. * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
  293. * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
  294. * @arg DCMI_FLAG_LINERI: Line flag mask
  295. * @arg DCMI_FLAG_FRAMEMI: DCMI Capture complete masked interrupt status
  296. * @arg DCMI_FLAG_OVRMI: DCMI Overrun masked interrupt status
  297. * @arg DCMI_FLAG_ERRMI: DCMI Synchronization error masked interrupt status
  298. * @arg DCMI_FLAG_VSYNCMI: DCMI VSYNC masked interrupt status
  299. * @arg DCMI_FLAG_LINEMI: DCMI Line masked interrupt status
  300. * @retval The state of FLAG.
  301. */
  302. #define __HAL_DCMI_GET_FLAG(__HANDLE__, __FLAG__)\
  303. ((((__FLAG__) & (DCMI_SR_INDEX|DCMI_MIS_INDEX)) == 0x0U)? ((__HANDLE__)->Instance->RISR & (__FLAG__)) :\
  304. (((__FLAG__) & DCMI_SR_INDEX) == 0x0U)? ((__HANDLE__)->Instance->MISR & (__FLAG__)) : ((__HANDLE__)->Instance->SR & (__FLAG__)))
  305. /**
  306. * @brief Clear the DCMI pending flags.
  307. * @param __HANDLE__ DCMI handle
  308. * @param __FLAG__ specifies the flag to clear.
  309. * This parameter can be any combination of the following values:
  310. * @arg DCMI_FLAG_FRAMERI: Frame capture complete flag mask
  311. * @arg DCMI_FLAG_OVRRI: Overrun flag mask
  312. * @arg DCMI_FLAG_ERRRI: Synchronization error flag mask
  313. * @arg DCMI_FLAG_VSYNCRI: VSYNC flag mask
  314. * @arg DCMI_FLAG_LINERI: Line flag mask
  315. * @retval None
  316. */
  317. #define __HAL_DCMI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
  318. /**
  319. * @brief Enable the specified DCMI interrupts.
  320. * @param __HANDLE__ DCMI handle
  321. * @param __INTERRUPT__ specifies the DCMI interrupt sources to be enabled.
  322. * This parameter can be any combination of the following values:
  323. * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
  324. * @arg DCMI_IT_OVR: Overrun interrupt mask
  325. * @arg DCMI_IT_ERR: Synchronization error interrupt mask
  326. * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
  327. * @arg DCMI_IT_LINE: Line interrupt mask
  328. * @retval None
  329. */
  330. #define __HAL_DCMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
  331. /**
  332. * @brief Disable the specified DCMI interrupts.
  333. * @param __HANDLE__ DCMI handle
  334. * @param __INTERRUPT__ specifies the DCMI interrupt sources to be enabled.
  335. * This parameter can be any combination of the following values:
  336. * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
  337. * @arg DCMI_IT_OVR: Overrun interrupt mask
  338. * @arg DCMI_IT_ERR: Synchronization error interrupt mask
  339. * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
  340. * @arg DCMI_IT_LINE: Line interrupt mask
  341. * @retval None
  342. */
  343. #define __HAL_DCMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
  344. /**
  345. * @brief Check whether the specified DCMI interrupt has occurred or not.
  346. * @param __HANDLE__ DCMI handle
  347. * @param __INTERRUPT__ specifies the DCMI interrupt source to check.
  348. * This parameter can be one of the following values:
  349. * @arg DCMI_IT_FRAME: Frame capture complete interrupt mask
  350. * @arg DCMI_IT_OVR: Overrun interrupt mask
  351. * @arg DCMI_IT_ERR: Synchronization error interrupt mask
  352. * @arg DCMI_IT_VSYNC: VSYNC interrupt mask
  353. * @arg DCMI_IT_LINE: Line interrupt mask
  354. * @retval The state of INTERRUPT.
  355. */
  356. #define __HAL_DCMI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__))
  357. /**
  358. * @}
  359. */
  360. /* Exported functions --------------------------------------------------------*/
  361. /** @addtogroup DCMI_Exported_Functions DCMI Exported Functions
  362. * @{
  363. */
  364. /** @addtogroup DCMI_Exported_Functions_Group1 Initialization and Configuration functions
  365. * @{
  366. */
  367. /* Initialization and de-initialization functions *****************************/
  368. HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi);
  369. HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi);
  370. void HAL_DCMI_MspInit(DCMI_HandleTypeDef* hdcmi);
  371. void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi);
  372. /* Callbacks Register/UnRegister functions ***********************************/
  373. #if (USE_HAL_DCMI_REGISTER_CALLBACKS == 1)
  374. HAL_StatusTypeDef HAL_DCMI_RegisterCallback(DCMI_HandleTypeDef *hdcmi, HAL_DCMI_CallbackIDTypeDef CallbackID, pDCMI_CallbackTypeDef pCallback);
  375. HAL_StatusTypeDef HAL_DCMI_UnRegisterCallback(DCMI_HandleTypeDef *hdcmi, HAL_DCMI_CallbackIDTypeDef CallbackID);
  376. #endif /* USE_HAL_DCMI_REGISTER_CALLBACKS */
  377. /**
  378. * @}
  379. */
  380. /** @addtogroup DCMI_Exported_Functions_Group2 IO operation functions
  381. * @{
  382. */
  383. /* IO operation functions *****************************************************/
  384. HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length);
  385. HAL_StatusTypeDef HAL_DCMI_Stop(DCMI_HandleTypeDef* hdcmi);
  386. HAL_StatusTypeDef HAL_DCMI_Suspend(DCMI_HandleTypeDef* hdcmi);
  387. HAL_StatusTypeDef HAL_DCMI_Resume(DCMI_HandleTypeDef* hdcmi);
  388. void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi);
  389. void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi);
  390. void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi);
  391. void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi);
  392. void HAL_DCMI_VsyncCallback(DCMI_HandleTypeDef *hdcmi);
  393. void HAL_DCMI_HsyncCallback(DCMI_HandleTypeDef *hdcmi);
  394. void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi);
  395. /**
  396. * @}
  397. */
  398. /** @addtogroup DCMI_Exported_Functions_Group3 Peripheral Control functions
  399. * @{
  400. */
  401. /* Peripheral Control functions ***********************************************/
  402. HAL_StatusTypeDef HAL_DCMI_ConfigCrop(DCMI_HandleTypeDef *hdcmi, uint32_t X0, uint32_t Y0, uint32_t XSize, uint32_t YSize);
  403. HAL_StatusTypeDef HAL_DCMI_EnableCrop(DCMI_HandleTypeDef *hdcmi);
  404. HAL_StatusTypeDef HAL_DCMI_DisableCrop(DCMI_HandleTypeDef *hdcmi);
  405. HAL_StatusTypeDef HAL_DCMI_ConfigSyncUnmask(DCMI_HandleTypeDef *hdcmi, DCMI_SyncUnmaskTypeDef *SyncUnmask);
  406. /**
  407. * @}
  408. */
  409. /** @addtogroup DCMI_Exported_Functions_Group4 Peripheral State functions
  410. * @{
  411. */
  412. /* Peripheral State functions *************************************************/
  413. HAL_DCMI_StateTypeDef HAL_DCMI_GetState(DCMI_HandleTypeDef *hdcmi);
  414. uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef *hdcmi);
  415. /**
  416. * @}
  417. */
  418. /**
  419. * @}
  420. */
  421. /* Private types -------------------------------------------------------------*/
  422. /* Private variables ---------------------------------------------------------*/
  423. /* Private constants ---------------------------------------------------------*/
  424. /** @defgroup DCMI_Private_Constants DCMI Private Constants
  425. * @{
  426. */
  427. #define DCMI_MIS_INDEX 0x1000U /*!< DCMI MIS register index */
  428. #define DCMI_SR_INDEX 0x2000U /*!< DCMI SR register index */
  429. /**
  430. * @}
  431. */
  432. /* Private macro -------------------------------------------------------------*/
  433. /** @defgroup DCMI_Private_Macros DCMI Private Macros
  434. * @{
  435. */
  436. #define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_MODE_CONTINUOUS) || \
  437. ((MODE) == DCMI_MODE_SNAPSHOT))
  438. #define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SYNCHRO_HARDWARE) || \
  439. ((MODE) == DCMI_SYNCHRO_EMBEDDED))
  440. #define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPOLARITY_FALLING) || \
  441. ((POLARITY) == DCMI_PCKPOLARITY_RISING))
  442. #define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPOLARITY_LOW) || \
  443. ((POLARITY) == DCMI_VSPOLARITY_HIGH))
  444. #define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPOLARITY_LOW) || \
  445. ((POLARITY) == DCMI_HSPOLARITY_HIGH))
  446. #define IS_DCMI_MODE_JPEG(JPEG_MODE)(((JPEG_MODE) == DCMI_JPEG_DISABLE) || \
  447. ((JPEG_MODE) == DCMI_JPEG_ENABLE))
  448. #define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CR_ALL_FRAME) || \
  449. ((RATE) == DCMI_CR_ALTERNATE_2_FRAME) || \
  450. ((RATE) == DCMI_CR_ALTERNATE_4_FRAME))
  451. #define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_EXTEND_DATA_8B) || \
  452. ((DATA) == DCMI_EXTEND_DATA_10B) || \
  453. ((DATA) == DCMI_EXTEND_DATA_12B) || \
  454. ((DATA) == DCMI_EXTEND_DATA_14B))
  455. #define IS_DCMI_WINDOW_COORDINATE(COORDINATE) ((COORDINATE) <= DCMI_WINDOW_COORDINATE)
  456. #define IS_DCMI_WINDOW_HEIGHT(HEIGHT) ((HEIGHT) <= DCMI_WINDOW_HEIGHT)
  457. /**
  458. * @}
  459. */
  460. /* Private functions ---------------------------------------------------------*/
  461. /** @addtogroup DCMI_Private_Functions DCMI Private Functions
  462. * @{
  463. */
  464. /**
  465. * @}
  466. */
  467. #endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\
  468. STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\
  469. STM32F479xx */
  470. /**
  471. * @}
  472. */
  473. /**
  474. * @}
  475. */
  476. #ifdef __cplusplus
  477. }
  478. #endif
  479. #endif /* __STM32F4xx_HAL_DCMI_H */