stm32f7xx_hal_jpeg.h 22 KB

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