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.
 
 
 

582 lines
22 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_hal_jpeg.h
  4. * @author MCD Application Team
  5. * @version V1.1.2
  6. * @date 23-September-2016
  7. * @brief Header file of JPEG HAL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2016 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 __STM32F7xx_HAL_JPEG_H
  39. #define __STM32F7xx_HAL_JPEG_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #if defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)
  44. /* Includes ------------------------------------------------------------------*/
  45. #include "stm32f7xx_hal_def.h"
  46. /** @addtogroup STM32F7xx_HAL_Driver
  47. * @{
  48. */
  49. /** @addtogroup JPEG
  50. * @{
  51. */
  52. /* Exported types ------------------------------------------------------------*/
  53. /** @defgroup JPEG_Exported_Types JPEG Exported Types
  54. * @{
  55. */
  56. /** @defgroup JPEG_Configuration_Structure_definition JPEG Configuration for encoding Structure definition
  57. * @brief JPEG encoding configuration Structure definition
  58. * @{
  59. */
  60. typedef struct
  61. {
  62. uint8_t ColorSpace; /*!< Image Color space : gray-scale, YCBCR, RGB or CMYK
  63. This parameter can be a value of @ref JPEG_ColorSpace_Type */
  64. uint8_t ChromaSubsampling; /*!< Chroma Subsampling in case of YCBCR or CMYK color space, 0-> 4:4:4 , 1-> 4:2:2, 2 -> 4:1:1, 3 -> 4:2:0
  65. This parameter can be a value of @ref JPEG_ChromaSubsampling_Type */
  66. uint32_t ImageHeight; /*!< Image height : number of lines */
  67. uint32_t ImageWidth; /*!< Image width : number of pixels per line */
  68. uint8_t ImageQuality; /*!< Quality of the JPEG encoding : from 1 to 100 */
  69. }JPEG_ConfTypeDef;
  70. /**
  71. * @}
  72. */
  73. /** @defgroup HAL_JPEG_state_structure_definition HAL JPEG state structure definition
  74. * @brief HAL JPEG State structure definition
  75. * @{
  76. */
  77. typedef enum
  78. {
  79. HAL_JPEG_STATE_RESET = 0x00U, /*!< JPEG not yet initialized or disabled */
  80. HAL_JPEG_STATE_READY = 0x01U, /*!< JPEG initialized and ready for use */
  81. HAL_JPEG_STATE_BUSY = 0x02U, /*!< JPEG internal processing is ongoing */
  82. HAL_JPEG_STATE_BUSY_ENCODING = 0x03U, /*!< JPEG encoding processing is ongoing */
  83. HAL_JPEG_STATE_BUSY_DECODING = 0x04U, /*!< JPEG decoding processing is ongoing */
  84. HAL_JPEG_STATE_TIMEOUT = 0x05U, /*!< JPEG timeout state */
  85. HAL_JPEG_STATE_ERROR = 0x06U /*!< JPEG error state */
  86. }HAL_JPEG_STATETypeDef;
  87. /**
  88. * @}
  89. */
  90. /** @defgroup JPEG_handle_Structure_definition JPEG handle Structure definition
  91. * @brief JPEG handle Structure definition
  92. * @{
  93. */
  94. typedef struct
  95. {
  96. JPEG_TypeDef *Instance; /*!< JPEG peripheral register base address */
  97. JPEG_ConfTypeDef Conf; /*!< Current JPEG encoding/decoding parameters */
  98. uint8_t *pJpegInBuffPtr; /*!< Pointer to JPEG processing (encoding, decoding,...) input buffer */
  99. uint8_t *pJpegOutBuffPtr; /*!< Pointer to JPEG processing (encoding, decoding,...) output buffer */
  100. __IO uint32_t JpegInCount; /*!< Internal Counter of input data */
  101. __IO uint32_t JpegOutCount; /*!< Internal Counter of output data */
  102. uint32_t InDataLength; /*!< Input Buffer Length in Bytes */
  103. uint32_t OutDataLength; /*!< Output Buffer Length in Bytes */
  104. DMA_HandleTypeDef *hdmain; /*!< JPEG In DMA handle parameters */
  105. DMA_HandleTypeDef *hdmaout; /*!< JPEG Out DMA handle parameters */
  106. uint8_t CustomQuanTable; /*!< If set to 1 specify that user customized quantization tables are used */
  107. uint8_t *QuantTable0; /*!< Basic Quantization Table for component 0 */
  108. uint8_t *QuantTable1; /*!< Basic Quantization Table for component 1 */
  109. uint8_t *QuantTable2; /*!< Basic Quantization Table for component 2 */
  110. uint8_t *QuantTable3; /*!< Basic Quantization Table for component 3 */
  111. HAL_LockTypeDef Lock; /*!< JPEG locking object */
  112. __IO HAL_JPEG_STATETypeDef State; /*!< JPEG peripheral state */
  113. __IO uint32_t ErrorCode; /*!< JPEG Error code */
  114. __IO uint32_t Context; /*!< JPEG Internal context */
  115. }JPEG_HandleTypeDef;
  116. /**
  117. * @}
  118. */
  119. /**
  120. * @}
  121. */
  122. /* Exported constants --------------------------------------------------------*/
  123. /** @defgroup JPEG_Exported_Constants JPEG Exported Constants
  124. * @{
  125. */
  126. /** @defgroup JPEG_Error_Code_definition JPEG Error Code definition
  127. * @brief JPEG Error Code definition
  128. * @{
  129. */
  130. #define HAL_JPEG_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
  131. #define HAL_JPEG_ERROR_HUFF_TABLE ((uint32_t)0x00000001U) /*!< HUffman Table programming error */
  132. #define HAL_JPEG_ERROR_QUANT_TABLE ((uint32_t)0x00000002U) /*!< Quantization Table programming error */
  133. #define HAL_JPEG_ERROR_DMA ((uint32_t)0x00000004U) /*!< DMA transfer error */
  134. #define HAL_JPEG_ERROR_TIMEOUT ((uint32_t)0x00000008U) /*!< Timeout error */
  135. /**
  136. * @}
  137. */
  138. /** @defgroup JPEG_Quantization_Table_Size JPEG Quantization Table Size
  139. * @brief JPEG Quantization Table Size
  140. * @{
  141. */
  142. #define JPEG_QUANT_TABLE_SIZE ((uint32_t)64U)
  143. /**
  144. * @}
  145. */
  146. /** @defgroup JPEG_ColorSpace_Type JPEG ColorSpace
  147. * @brief JPEG Color Space
  148. * @{
  149. */
  150. #define JPEG_GRAYSCALE_COLORSPACE ((uint32_t)0x00000000U)
  151. #define JPEG_YCBCR_COLORSPACE JPEG_CONFR1_COLORSPACE_0
  152. #define JPEG_CMYK_COLORSPACE JPEG_CONFR1_COLORSPACE
  153. /**
  154. * @}
  155. */
  156. /** @defgroup JPEG_ChromaSubsampling_Type JPEG Chrominance Sampling
  157. * @brief JPEG Chrominance Sampling
  158. * @{
  159. */
  160. #define JPEG_444_SUBSAMPLING ((uint32_t)0x00000000U) /*!< Chroma Subsampling 4:4:4 */
  161. #define JPEG_420_SUBSAMPLING ((uint32_t)0x00000001U) /*!< Chroma Subsampling 4:2:0 */
  162. #define JPEG_422_SUBSAMPLING ((uint32_t)0x00000002U) /*!< Chroma Subsampling 4:2:2 */
  163. /**
  164. * @}
  165. */
  166. /** @defgroup JPEG_ImageQuality JPEG Image Quality
  167. * @brief JPEG Min and Max Image Quality
  168. * @{
  169. */
  170. #define JPEG_IMAGE_QUALITY_MIN ((uint32_t)1U) /*!< Minimum JPEG quality */
  171. #define JPEG_IMAGE_QUALITY_MAX ((uint32_t)100U) /*!< Maximum JPEG quality */
  172. /**
  173. * @}
  174. */
  175. /** @defgroup JPEG_Interrupt_configuration_definition JPEG Interrupt configuration definition
  176. * @brief JPEG Interrupt definition
  177. * @{
  178. */
  179. #define JPEG_IT_IFT ((uint32_t)JPEG_CR_IFTIE) /*!< Input FIFO Threshold Interrupt */
  180. #define JPEG_IT_IFNF ((uint32_t)JPEG_CR_IFNFIE) /*!< Input FIFO Not Full Interrupt */
  181. #define JPEG_IT_OFT ((uint32_t)JPEG_CR_OFTIE) /*!< Output FIFO Threshold Interrupt */
  182. #define JPEG_IT_OFNE ((uint32_t)JPEG_CR_OFTIE) /*!< Output FIFO Not Empty Interrupt */
  183. #define JPEG_IT_EOC ((uint32_t)JPEG_CR_EOCIE) /*!< End of Conversion Interrupt */
  184. #define JPEG_IT_HPD ((uint32_t)JPEG_CR_HPDIE) /*!< Header Parsing Done Interrupt */
  185. /**
  186. * @}
  187. */
  188. /** @defgroup JPEG_Flag_definition JPEG Flag definition
  189. * @brief JPEG Flags definition
  190. * @{
  191. */
  192. #define JPEG_FLAG_IFTF ((uint32_t)JPEG_SR_IFTF) /*!< Input FIFO is not full and is bellow its threshold flag */
  193. #define JPEG_FLAG_IFNFF ((uint32_t)JPEG_SR_IFNFF) /*!< Input FIFO Not Full Flag, a data can be written */
  194. #define JPEG_FLAG_OFTF ((uint32_t)JPEG_SR_OFTF) /*!< Output FIFO is not empty and has reach its threshold */
  195. #define JPEG_FLAG_OFNEF ((uint32_t)JPEG_SR_OFNEF) /*!< Output FIFO is not empty, a data is available */
  196. #define JPEG_FLAG_EOCF ((uint32_t)JPEG_SR_EOCF) /*!< JPEG Codec core has finished the encoding or the decoding process and than last data has been sent to the output FIFO */
  197. #define JPEG_FLAG_HPDF ((uint32_t)JPEG_SR_HPDF) /*!< JPEG Codec has finished the parsing of the headers and the internal registers have been updated */
  198. #define JPEG_FLAG_COF ((uint32_t)JPEG_SR_COF) /*!< JPEG Codec operation on going flag*/
  199. #define JPEG_FLAG_ALL ((uint32_t)0x000000FEU) /*!< JPEG Codec All previous flag*/
  200. /**
  201. * @}
  202. */
  203. /** @defgroup JPEG_PROCESS_PAUSE_RESUME_definition JPEG Process Pause Resume definition
  204. * @brief JPEG process pause, resume definition
  205. * @{
  206. */
  207. #define JPEG_PAUSE_RESUME_INPUT ((uint32_t)0x00000001U) /*!< Pause/Resume Input FIFO Xfer*/
  208. #define JPEG_PAUSE_RESUME_OUTPUT ((uint32_t)0x00000002U) /*!< Pause/Resume Output FIFO Xfer*/
  209. #define JPEG_PAUSE_RESUME_INPUT_OUTPUT ((uint32_t)0x00000003U) /*!< Pause/Resume Input and Output FIFO Xfer*/
  210. /**
  211. * @}
  212. */
  213. /**
  214. * @}
  215. */
  216. /* Exported macro ------------------------------------------------------------*/
  217. /** @defgroup JPEG_Exported_Macros JPEG Exported Macros
  218. * @{
  219. */
  220. /** @brief Reset JPEG handle state
  221. * @param __HANDLE__: specifies the JPEG handle.
  222. * @retval None
  223. */
  224. #define __HAL_JPEG_RESET_HANDLE_STATE(__HANDLE__) ( (__HANDLE__)->State = HAL_JPEG_STATE_RESET)
  225. /**
  226. * @brief Enable the JPEG peripheral.
  227. * @param __HANDLE__: specifies the JPEG handle.
  228. * @retval None
  229. */
  230. #define __HAL_JPEG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= JPEG_CR_JCEN)
  231. /**
  232. * @brief Disable the JPEG peripheral.
  233. * @param __HANDLE__: specifies the JPEG handle.
  234. * @retval None
  235. */
  236. #define __HAL_JPEG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~JPEG_CR_JCEN)
  237. /**
  238. * @brief Check the specified JPEG status flag.
  239. * @param __HANDLE__: specifies the JPEG handle.
  240. * @param __FLAG__ : specifies the flag to check
  241. * This parameter can be one of the following values:
  242. * @arg JPEG_FLAG_IFTF : The input FIFO is not full and is bellow its threshold flag
  243. * @arg JPEG_FLAG_IFNFF : The input FIFO Not Full Flag, a data can be written
  244. * @arg JPEG_FLAG_OFTF : The output FIFO is not empty and has reach its threshold
  245. * @arg JPEG_FLAG_OFNEF : The output FIFO is not empty, a data is available
  246. * @arg JPEG_FLAG_EOCF : JPEG Codec core has finished the encoding or the decoding process
  247. * and than last data has been sent to the output FIFO
  248. * @arg JPEG_FLAG_HPDF : JPEG Codec has finished the parsing of the headers
  249. * and the internal registers have been updated
  250. * @arg JPEG_FLAG_COF : JPEG Codec operation on going flag
  251. *
  252. * @retval : __HAL_JPEG_GET_FLAG : returns The new state of __FLAG__ (TRUE or FALSE)
  253. */
  254. #define __HAL_JPEG_GET_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)))
  255. /**
  256. * @brief Clear the specified JPEG status flag.
  257. * @param __HANDLE__: specifies the JPEG handle.
  258. * @param __FLAG__ : specifies the flag to clear
  259. * This parameter can be one of the following values:
  260. * @arg JPEG_FLAG_EOCF : JPEG Codec core has finished the encoding or the decoding process
  261. * and than last data has been sent to the output FIFO
  262. * @arg JPEG_FLAG_HPDF : JPEG Codec has finished the parsing of the headers
  263. * @retval : None
  264. */
  265. #define __HAL_JPEG_CLEAR_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->CFR |= ((__FLAG__) & (JPEG_FLAG_EOCF | JPEG_FLAG_HPDF))))
  266. /**
  267. * @brief Enable Interrupt.
  268. * @param __HANDLE__: specifies the JPEG handle.
  269. * @param __INTERRUPT__ : specifies the interrupt to enable
  270. * This parameter can be one of the following values:
  271. * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
  272. * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
  273. * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
  274. * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
  275. * @arg JPEG_IT_EOC : End of Conversion Interrupt
  276. * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
  277. *
  278. * @retval : No retrun
  279. */
  280. #define __HAL_JPEG_ENABLE_IT(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__) )
  281. /**
  282. * @brief Disable Interrupt.
  283. * @param __HANDLE__: specifies the JPEG handle.
  284. * @param __INTERRUPT__ : specifies the interrupt to disable
  285. * This parameter can be one of the following values:
  286. * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
  287. * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
  288. * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
  289. * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
  290. * @arg JPEG_IT_EOC : End of Conversion Interrupt
  291. * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
  292. *
  293. * @note : To disable an IT we must use MODIFY_REG macro to avoid writing "1" to the FIFO flush bits
  294. * located in the same IT enable register (CR register).
  295. * @retval : No retrun
  296. */
  297. #define __HAL_JPEG_DISABLE_IT(__HANDLE__,__INTERRUPT__) MODIFY_REG((__HANDLE__)->Instance->CR, (__INTERRUPT__), 0)
  298. /**
  299. * @brief Get Interrupt state.
  300. * @param __HANDLE__: specifies the JPEG handle.
  301. * @param __INTERRUPT__ : specifies the interrupt to check
  302. * This parameter can be one of the following values:
  303. * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
  304. * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
  305. * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
  306. * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
  307. * @arg JPEG_IT_EOC : End of Conversion Interrupt
  308. * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
  309. *
  310. * @retval : returns The new state of __INTERRUPT__ (Enabled or disabled)
  311. */
  312. #define __HAL_JPEG_GET_IT_SOURCE(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
  313. /**
  314. * @}
  315. */
  316. /* Exported functions --------------------------------------------------------*/
  317. /** @addtogroup JPEG_Exported_Functions
  318. * @{
  319. */
  320. /** @addtogroup JPEG_Exported_Functions_Group1
  321. * @{
  322. */
  323. /* Initialization/de-initialization functions ********************************/
  324. HAL_StatusTypeDef HAL_JPEG_Init(JPEG_HandleTypeDef *hjpeg);
  325. HAL_StatusTypeDef HAL_JPEG_DeInit(JPEG_HandleTypeDef *hjpeg);
  326. void HAL_JPEG_MspInit(JPEG_HandleTypeDef *hjpeg);
  327. void HAL_JPEG_MspDeInit(JPEG_HandleTypeDef *hjpeg);
  328. /**
  329. * @}
  330. */
  331. /** @addtogroup JPEG_Exported_Functions_Group2
  332. * @{
  333. */
  334. /* Encoding/Decoding Configuration functions ********************************/
  335. HAL_StatusTypeDef HAL_JPEG_ConfigEncoding(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pConf);
  336. HAL_StatusTypeDef HAL_JPEG_GetInfo(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pInfo);
  337. HAL_StatusTypeDef HAL_JPEG_EnableHeaderParsing(JPEG_HandleTypeDef *hjpeg);
  338. HAL_StatusTypeDef HAL_JPEG_DisableHeaderParsing(JPEG_HandleTypeDef *hjpeg);
  339. HAL_StatusTypeDef HAL_JPEG_SetUserQuantTables(JPEG_HandleTypeDef *hjpeg, uint8_t *QTable0, uint8_t *QTable1, uint8_t *QTable2, uint8_t *QTable3);
  340. /**
  341. * @}
  342. */
  343. /** @addtogroup JPEG_Exported_Functions_Group3
  344. * @{
  345. */
  346. /* JPEG processing functions **************************************/
  347. HAL_StatusTypeDef HAL_JPEG_Encode(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength, uint8_t *pDataOut, uint32_t OutDataLength, uint32_t Timeout);
  348. HAL_StatusTypeDef HAL_JPEG_Decode(JPEG_HandleTypeDef *hjpeg ,uint8_t *pDataIn ,uint32_t InDataLength ,uint8_t *pDataOutMCU ,uint32_t OutDataLength, uint32_t Timeout);
  349. HAL_StatusTypeDef HAL_JPEG_Encode_IT(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength, uint8_t *pDataOut, uint32_t OutDataLength);
  350. HAL_StatusTypeDef HAL_JPEG_Decode_IT(JPEG_HandleTypeDef *hjpeg ,uint8_t *pDataIn ,uint32_t InDataLength ,uint8_t *pDataOutMCU ,uint32_t OutDataLength);
  351. HAL_StatusTypeDef HAL_JPEG_Encode_DMA(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength, uint8_t *pDataOut, uint32_t OutDataLength);
  352. HAL_StatusTypeDef HAL_JPEG_Decode_DMA(JPEG_HandleTypeDef *hjpeg ,uint8_t *pDataIn ,uint32_t InDataLength ,uint8_t *pDataOutMCU ,uint32_t OutDataLength);
  353. HAL_StatusTypeDef HAL_JPEG_Pause(JPEG_HandleTypeDef *hjpeg, uint32_t XferSelection);
  354. HAL_StatusTypeDef HAL_JPEG_Resume(JPEG_HandleTypeDef *hjpeg, uint32_t XferSelection);
  355. void HAL_JPEG_ConfigInputBuffer(JPEG_HandleTypeDef *hjpeg, uint8_t *pNewInputBuffer, uint32_t InDataLength);
  356. void HAL_JPEG_ConfigOutputBuffer(JPEG_HandleTypeDef *hjpeg, uint8_t *pNewOutputBuffer, uint32_t OutDataLength);
  357. HAL_StatusTypeDef HAL_JPEG_Abort(JPEG_HandleTypeDef *hjpeg);
  358. /**
  359. * @}
  360. */
  361. /** @addtogroup JPEG_Exported_Functions_Group4
  362. * @{
  363. */
  364. /* JPEG Decode/Encode callback functions ********************************************************/
  365. void HAL_JPEG_InfoReadyCallback(JPEG_HandleTypeDef *hjpeg,JPEG_ConfTypeDef *pInfo);
  366. void HAL_JPEG_EncodeCpltCallback(JPEG_HandleTypeDef *hjpeg);
  367. void HAL_JPEG_DecodeCpltCallback(JPEG_HandleTypeDef *hjpeg);
  368. void HAL_JPEG_ErrorCallback(JPEG_HandleTypeDef *hjpeg);
  369. void HAL_JPEG_GetDataCallback(JPEG_HandleTypeDef *hjpeg, uint32_t NbDecodedData);
  370. void HAL_JPEG_DataReadyCallback (JPEG_HandleTypeDef *hjpeg, uint8_t *pDataOut, uint32_t OutDataLength);
  371. /**
  372. * @}
  373. */
  374. /** @addtogroup JPEG_Exported_Functions_Group5
  375. * @{
  376. */
  377. /* JPEG IRQ handler management ******************************************************/
  378. void HAL_JPEG_IRQHandler(JPEG_HandleTypeDef *hjpeg);
  379. /**
  380. * @}
  381. */
  382. /** @addtogroup JPEG_Exported_Functions_Group6
  383. * @{
  384. */
  385. /* Peripheral State and Error functions ************************************************/
  386. HAL_JPEG_STATETypeDef HAL_JPEG_GetState(JPEG_HandleTypeDef *hjpeg);
  387. uint32_t HAL_JPEG_GetError(JPEG_HandleTypeDef *hjpeg);
  388. /**
  389. * @}
  390. */
  391. /**
  392. * @}
  393. */
  394. /* Private types -------------------------------------------------------------*/
  395. /** @defgroup JPEG_Private_Types JPEG Private Types
  396. * @{
  397. */
  398. /**
  399. * @}
  400. */
  401. /* Private defines -----------------------------------------------------------*/
  402. /** @defgroup JPEG_Private_Defines JPEG Private Defines
  403. * @{
  404. */
  405. /**
  406. * @}
  407. */
  408. /* Private variables ---------------------------------------------------------*/
  409. /** @defgroup JPEG_Private_Variables JPEG Private Variables
  410. * @{
  411. */
  412. /**
  413. * @}
  414. */
  415. /* Private constants ---------------------------------------------------------*/
  416. /** @defgroup JPEG_Private_Constants JPEG Private Constants
  417. * @{
  418. */
  419. /**
  420. * @}
  421. */
  422. /* Private macros ------------------------------------------------------------*/
  423. /** @defgroup JPEG_Private_Macros JPEG Private Macros
  424. * @{
  425. */
  426. /** @defgroup JPEG_IS_Definitions JPEG Private macros to check input parameters
  427. * @{
  428. */
  429. #define IS_JPEG_CHROMASUBSAMPLING(SUBSAMPLING) (((SUBSAMPLING) == JPEG_444_SUBSAMPLING) || \
  430. ((SUBSAMPLING) == JPEG_420_SUBSAMPLING) || \
  431. ((SUBSAMPLING) == JPEG_422_SUBSAMPLING))
  432. #define IS_JPEG_IMAGE_QUALITY(NUMBER) (((NUMBER) >= JPEG_IMAGE_QUALITY_MIN) && ((NUMBER) <= JPEG_IMAGE_QUALITY_MAX))
  433. #define IS_JPEG_COLORSPACE(COLORSPACE) (((COLORSPACE) == JPEG_GRAYSCALE_COLORSPACE) || \
  434. ((COLORSPACE) == JPEG_YCBCR_COLORSPACE) || \
  435. ((COLORSPACE) == JPEG_CMYK_COLORSPACE))
  436. #define IS_JPEG_PAUSE_RESUME_STATE(VALUE) (((VALUE) == JPEG_PAUSE_RESUME_INPUT) || \
  437. ((VALUE) == JPEG_PAUSE_RESUME_OUTPUT)|| \
  438. ((VALUE) == JPEG_PAUSE_RESUME_INPUT_OUTPUT))
  439. /**
  440. * @}
  441. */
  442. /**
  443. * @}
  444. */
  445. /* Private functions prototypes ----------------------------------------------*/
  446. /** @defgroup JPEG_Private_Functions_Prototypes JPEG Private Functions Prototypes
  447. * @{
  448. */
  449. /**
  450. * @}
  451. */
  452. /* Private functions ---------------------------------------------------------*/
  453. /** @defgroup JPEG_Private_Functions JPEG Private Functions
  454. * @{
  455. */
  456. /**
  457. * @}
  458. */
  459. /**
  460. * @}
  461. */
  462. /**
  463. * @}
  464. */
  465. #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
  466. #ifdef __cplusplus
  467. }
  468. #endif
  469. #endif /* __STM32F7xx_HAL_JPEG_H */
  470. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/