2 ******************************************************************************
3 * @file stm32f7xx_hal_jpeg.h
4 * @author MCD Application Team
5 * @brief Header file of JPEG HAL module.
6 ******************************************************************************
9 * <h2><center>© Copyright (c) 2017 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32F7xx_HAL_JPEG_H
22 #define STM32F7xx_HAL_JPEG_H
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f7xx_hal_def.h"
31 /** @addtogroup STM32F7xx_HAL_Driver
39 /* Exported types ------------------------------------------------------------*/
40 /** @defgroup JPEG_Exported_Types JPEG Exported Types
44 /** @defgroup JPEG_Configuration_Structure_definition JPEG Configuration for encoding Structure definition
45 * @brief JPEG encoding configuration Structure definition
50 uint32_t ColorSpace
; /*!< Image Color space : gray-scale, YCBCR, RGB or CMYK
51 This parameter can be a value of @ref JPEG_ColorSpace */
53 uint32_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
54 This parameter can be a value of @ref JPEG_ChromaSubsampling */
56 uint32_t ImageHeight
; /*!< Image height : number of lines */
58 uint32_t ImageWidth
; /*!< Image width : number of pixels per line */
60 uint32_t ImageQuality
; /*!< Quality of the JPEG encoding : from 1 to 100 */
67 /** @defgroup HAL_JPEG_state_structure_definition HAL JPEG state structure definition
68 * @brief HAL JPEG State structure definition
73 HAL_JPEG_STATE_RESET
= 0x00U
, /*!< JPEG not yet initialized or disabled */
74 HAL_JPEG_STATE_READY
= 0x01U
, /*!< JPEG initialized and ready for use */
75 HAL_JPEG_STATE_BUSY
= 0x02U
, /*!< JPEG internal processing is ongoing */
76 HAL_JPEG_STATE_BUSY_ENCODING
= 0x03U
, /*!< JPEG encoding processing is ongoing */
77 HAL_JPEG_STATE_BUSY_DECODING
= 0x04U
, /*!< JPEG decoding processing is ongoing */
78 HAL_JPEG_STATE_TIMEOUT
= 0x05U
, /*!< JPEG timeout state */
79 HAL_JPEG_STATE_ERROR
= 0x06U
/*!< JPEG error state */
80 } HAL_JPEG_STATETypeDef
;
87 /** @defgroup JPEG_handle_Structure_definition JPEG handle Structure definition
88 * @brief JPEG handle Structure definition
91 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
92 typedef struct __JPEG_HandleTypeDef
95 #endif /* (USE_HAL_JPEG_REGISTER_CALLBACKS) */
97 JPEG_TypeDef
*Instance
; /*!< JPEG peripheral register base address */
99 JPEG_ConfTypeDef Conf
; /*!< Current JPEG encoding/decoding parameters */
101 uint8_t *pJpegInBuffPtr
; /*!< Pointer to JPEG processing (encoding, decoding,...) input buffer */
103 uint8_t *pJpegOutBuffPtr
; /*!< Pointer to JPEG processing (encoding, decoding,...) output buffer */
105 __IO
uint32_t JpegInCount
; /*!< Internal Counter of input data */
107 __IO
uint32_t JpegOutCount
; /*!< Internal Counter of output data */
109 uint32_t InDataLength
; /*!< Input Buffer Length in Bytes */
111 uint32_t OutDataLength
; /*!< Output Buffer Length in Bytes */
113 DMA_HandleTypeDef
*hdmain
; /*!< JPEG In DMA handle parameters */
115 DMA_HandleTypeDef
*hdmaout
; /*!< JPEG Out DMA handle parameters */
117 uint8_t CustomQuanTable
; /*!< If set to 1 specify that user customized quantization tables are used */
119 uint8_t *QuantTable0
; /*!< Basic Quantization Table for component 0 */
121 uint8_t *QuantTable1
; /*!< Basic Quantization Table for component 1 */
123 uint8_t *QuantTable2
; /*!< Basic Quantization Table for component 2 */
125 uint8_t *QuantTable3
; /*!< Basic Quantization Table for component 3 */
127 HAL_LockTypeDef Lock
; /*!< JPEG locking object */
129 __IO HAL_JPEG_STATETypeDef State
; /*!< JPEG peripheral state */
131 __IO
uint32_t ErrorCode
; /*!< JPEG Error code */
133 __IO
uint32_t Context
; /*!< JPEG Internal context */
135 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
136 void (*InfoReadyCallback
)(struct __JPEG_HandleTypeDef
*hjpeg
,
137 JPEG_ConfTypeDef
*pInfo
); /*!< JPEG Info ready callback */
138 void (*EncodeCpltCallback
)(struct __JPEG_HandleTypeDef
139 *hjpeg
); /*!< JPEG Encode complete callback */
140 void (*DecodeCpltCallback
)(struct __JPEG_HandleTypeDef
141 *hjpeg
); /*!< JPEG Decode complete callback */
142 void (*ErrorCallback
)(struct __JPEG_HandleTypeDef
143 *hjpeg
); /*!< JPEG Error callback */
144 void (*GetDataCallback
)(struct __JPEG_HandleTypeDef
*hjpeg
,
145 uint32_t NbDecodedData
); /*!< JPEG Get Data callback */
146 void (*DataReadyCallback
)(struct __JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataOut
,
147 uint32_t OutDataLength
); /*!< JPEG Data ready callback */
149 void (* MspInitCallback
)(struct __JPEG_HandleTypeDef
*hjpeg
); /*!< JPEG Msp Init callback */
150 void (* MspDeInitCallback
)(struct __JPEG_HandleTypeDef
151 *hjpeg
); /*!< JPEG Msp DeInit callback */
154 #endif /* (USE_HAL_JPEG_REGISTER_CALLBACKS) */
157 } JPEG_HandleTypeDef
;
163 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
164 /** @defgroup HAL_JPEG_Callback_ID_enumeration_definition HAL JPEG Callback ID enumeration definition
165 * @brief HAL JPEG Callback ID enumeration definition
170 HAL_JPEG_ENCODE_CPLT_CB_ID
= 0x01U
, /*!< JPEG Encode Complete callback ID */
171 HAL_JPEG_DECODE_CPLT_CB_ID
= 0x02U
, /*!< JPEG Decode Complete callback ID */
172 HAL_JPEG_ERROR_CB_ID
= 0x03U
, /*!< JPEG Error callback ID */
174 HAL_JPEG_MSPINIT_CB_ID
= 0x04U
, /*!< JPEG MspInit callback ID */
175 HAL_JPEG_MSPDEINIT_CB_ID
= 0x05U
/*!< JPEG MspDeInit callback ID */
177 } HAL_JPEG_CallbackIDTypeDef
;
182 /** @defgroup HAL_JPEG_Callback_pointer_definition HAL JPEG Callback pointer definition
183 * @brief HAL JPEG Callback pointer definition
186 typedef void (*pJPEG_CallbackTypeDef
)(JPEG_HandleTypeDef
*hjpeg
); /*!< pointer to a common JPEG callback function */
187 typedef void (*pJPEG_InfoReadyCallbackTypeDef
)(JPEG_HandleTypeDef
*hjpeg
,
188 JPEG_ConfTypeDef
*pInfo
); /*!< pointer to an Info ready JPEG callback function */
189 typedef void (*pJPEG_GetDataCallbackTypeDef
)(JPEG_HandleTypeDef
*hjpeg
,
190 uint32_t NbDecodedData
); /*!< pointer to a Get data JPEG callback function */
191 typedef void (*pJPEG_DataReadyCallbackTypeDef
)(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataOut
,
192 uint32_t OutDataLength
); /*!< pointer to a Data ready JPEG callback function */
197 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
203 /* Exported constants --------------------------------------------------------*/
205 /** @defgroup JPEG_Exported_Constants JPEG Exported Constants
209 /** @defgroup JPEG_Error_Code_definition JPEG Error Code definition
210 * @brief JPEG Error Code definition
214 #define HAL_JPEG_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
215 #define HAL_JPEG_ERROR_HUFF_TABLE ((uint32_t)0x00000001U) /*!< HUffman Table programming error */
216 #define HAL_JPEG_ERROR_QUANT_TABLE ((uint32_t)0x00000002U) /*!< Quantization Table programming error */
217 #define HAL_JPEG_ERROR_DMA ((uint32_t)0x00000004U) /*!< DMA transfer error */
218 #define HAL_JPEG_ERROR_TIMEOUT ((uint32_t)0x00000008U) /*!< Timeout error */
219 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
220 #define HAL_JPEG_ERROR_INVALID_CALLBACK ((uint32_t)0x00000010U) /*!< Invalid Callback error */
221 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
226 /** @defgroup JPEG_Quantization_Table_Size JPEG Quantization Table Size
227 * @brief JPEG Quantization Table Size
230 #define JPEG_QUANT_TABLE_SIZE ((uint32_t)64U) /*!< JPEG Quantization Table Size in bytes */
236 /** @defgroup JPEG_ColorSpace JPEG ColorSpace
237 * @brief JPEG Color Space
240 #define JPEG_GRAYSCALE_COLORSPACE ((uint32_t)0x00000000U)
241 #define JPEG_YCBCR_COLORSPACE JPEG_CONFR1_COLORSPACE_0
242 #define JPEG_CMYK_COLORSPACE JPEG_CONFR1_COLORSPACE
250 /** @defgroup JPEG_ChromaSubsampling JPEG Chrominance Sampling
251 * @brief JPEG Chrominance Sampling
254 #define JPEG_444_SUBSAMPLING ((uint32_t)0x00000000U) /*!< Chroma Subsampling 4:4:4 */
255 #define JPEG_420_SUBSAMPLING ((uint32_t)0x00000001U) /*!< Chroma Subsampling 4:2:0 */
256 #define JPEG_422_SUBSAMPLING ((uint32_t)0x00000002U) /*!< Chroma Subsampling 4:2:2 */
262 /** @defgroup JPEG_ImageQuality JPEG Image Quality
263 * @brief JPEG Min and Max Image Quality
266 #define JPEG_IMAGE_QUALITY_MIN ((uint32_t)1U) /*!< Minimum JPEG quality */
267 #define JPEG_IMAGE_QUALITY_MAX ((uint32_t)100U) /*!< Maximum JPEG quality */
273 /** @defgroup JPEG_Interrupt_configuration_definition JPEG Interrupt configuration definition
274 * @brief JPEG Interrupt definition
277 #define JPEG_IT_IFT ((uint32_t)JPEG_CR_IFTIE) /*!< Input FIFO Threshold Interrupt */
278 #define JPEG_IT_IFNF ((uint32_t)JPEG_CR_IFNFIE) /*!< Input FIFO Not Full Interrupt */
279 #define JPEG_IT_OFT ((uint32_t)JPEG_CR_OFTIE) /*!< Output FIFO Threshold Interrupt */
280 #define JPEG_IT_OFNE ((uint32_t)JPEG_CR_OFTIE) /*!< Output FIFO Not Empty Interrupt */
281 #define JPEG_IT_EOC ((uint32_t)JPEG_CR_EOCIE) /*!< End of Conversion Interrupt */
282 #define JPEG_IT_HPD ((uint32_t)JPEG_CR_HPDIE) /*!< Header Parsing Done Interrupt */
287 /** @defgroup JPEG_Flag_definition JPEG Flag definition
288 * @brief JPEG Flags definition
291 #define JPEG_FLAG_IFTF ((uint32_t)JPEG_SR_IFTF) /*!< Input FIFO is not full and is bellow its threshold flag */
292 #define JPEG_FLAG_IFNFF ((uint32_t)JPEG_SR_IFNFF) /*!< Input FIFO Not Full Flag, a data can be written */
293 #define JPEG_FLAG_OFTF ((uint32_t)JPEG_SR_OFTF) /*!< Output FIFO is not empty and has reach its threshold */
294 #define JPEG_FLAG_OFNEF ((uint32_t)JPEG_SR_OFNEF) /*!< Output FIFO is not empty, a data is available */
295 #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 */
296 #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 */
297 #define JPEG_FLAG_COF ((uint32_t)JPEG_SR_COF) /*!< JPEG Codec operation on going flag*/
299 #define JPEG_FLAG_ALL ((uint32_t)0x000000FEU) /*!< JPEG Codec All previous flag*/
304 /** @defgroup JPEG_PROCESS_PAUSE_RESUME_definition JPEG Process Pause Resume definition
305 * @brief JPEG process pause, resume definition
308 #define JPEG_PAUSE_RESUME_INPUT ((uint32_t)0x00000001U) /*!< Pause/Resume Input FIFO Xfer*/
309 #define JPEG_PAUSE_RESUME_OUTPUT ((uint32_t)0x00000002U) /*!< Pause/Resume Output FIFO Xfer*/
310 #define JPEG_PAUSE_RESUME_INPUT_OUTPUT ((uint32_t)0x00000003U) /*!< Pause/Resume Input and Output FIFO Xfer*/
318 /* Exported macro ------------------------------------------------------------*/
320 /** @defgroup JPEG_Exported_Macros JPEG Exported Macros
324 /** @brief Reset JPEG handle state
325 * @param __HANDLE__ specifies the JPEG handle.
328 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
329 #define __HAL_JPEG_RESET_HANDLE_STATE(__HANDLE__) do{\
330 (__HANDLE__)->State = HAL_JPEG_STATE_RESET;\
331 (__HANDLE__)->MspInitCallback = NULL;\
332 (__HANDLE__)->MspDeInitCallback = NULL;\
335 #define __HAL_JPEG_RESET_HANDLE_STATE(__HANDLE__) ( (__HANDLE__)->State = HAL_JPEG_STATE_RESET)
336 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
340 * @brief Enable the JPEG peripheral.
341 * @param __HANDLE__ specifies the JPEG handle.
344 #define __HAL_JPEG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= JPEG_CR_JCEN)
347 * @brief Disable the JPEG peripheral.
348 * @param __HANDLE__ specifies the JPEG handle.
351 #define __HAL_JPEG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~JPEG_CR_JCEN)
355 * @brief Check the specified JPEG status flag.
356 * @param __HANDLE__ specifies the JPEG handle.
357 * @param __FLAG__ specifies the flag to check
358 * This parameter can be one of the following values:
359 * @arg JPEG_FLAG_IFTF : The input FIFO is not full and is bellow its threshold flag
360 * @arg JPEG_FLAG_IFNFF : The input FIFO Not Full Flag, a data can be written
361 * @arg JPEG_FLAG_OFTF : The output FIFO is not empty and has reach its threshold
362 * @arg JPEG_FLAG_OFNEF : The output FIFO is not empty, a data is available
363 * @arg JPEG_FLAG_EOCF : JPEG Codec core has finished the encoding or the decoding process
364 * and than last data has been sent to the output FIFO
365 * @arg JPEG_FLAG_HPDF : JPEG Codec has finished the parsing of the headers
366 * and the internal registers have been updated
367 * @arg JPEG_FLAG_COF : JPEG Codec operation on going flag
369 * @retval __HAL_JPEG_GET_FLAG : returns The new state of __FLAG__ (TRUE or FALSE)
372 #define __HAL_JPEG_GET_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)))
375 * @brief Clear the specified JPEG status flag.
376 * @param __HANDLE__ specifies the JPEG handle.
377 * @param __FLAG__ specifies the flag to clear
378 * This parameter can be one of the following values:
379 * @arg JPEG_FLAG_EOCF : JPEG Codec core has finished the encoding or the decoding process
380 * and than last data has been sent to the output FIFO
381 * @arg JPEG_FLAG_HPDF : JPEG Codec has finished the parsing of the headers
385 #define __HAL_JPEG_CLEAR_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->CFR |= ((__FLAG__) & (JPEG_FLAG_EOCF | JPEG_FLAG_HPDF))))
389 * @brief Enable Interrupt.
390 * @param __HANDLE__ specifies the JPEG handle.
391 * @param __INTERRUPT__ specifies the interrupt to enable
392 * This parameter can be one of the following values:
393 * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
394 * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
395 * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
396 * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
397 * @arg JPEG_IT_EOC : End of Conversion Interrupt
398 * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
402 #define __HAL_JPEG_ENABLE_IT(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__) )
405 * @brief Disable Interrupt.
406 * @param __HANDLE__ specifies the JPEG handle.
407 * @param __INTERRUPT__ specifies the interrupt to disable
408 * This parameter can be one of the following values:
409 * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
410 * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
411 * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
412 * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
413 * @arg JPEG_IT_EOC : End of Conversion Interrupt
414 * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
416 * @note To disable an IT we must use MODIFY_REG macro to avoid writing "1" to the FIFO flush bits
417 * located in the same IT enable register (CR register).
420 #define __HAL_JPEG_DISABLE_IT(__HANDLE__,__INTERRUPT__) MODIFY_REG((__HANDLE__)->Instance->CR, (__INTERRUPT__), 0UL)
424 * @brief Get Interrupt state.
425 * @param __HANDLE__ specifies the JPEG handle.
426 * @param __INTERRUPT__ specifies the interrupt to check
427 * This parameter can be one of the following values:
428 * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
429 * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
430 * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
431 * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
432 * @arg JPEG_IT_EOC : End of Conversion Interrupt
433 * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
435 * @retval returns The new state of __INTERRUPT__ (Enabled or disabled)
437 #define __HAL_JPEG_GET_IT_SOURCE(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
443 /* Exported functions --------------------------------------------------------*/
444 /** @addtogroup JPEG_Exported_Functions
448 /** @addtogroup JPEG_Exported_Functions_Group1
451 /* Initialization/de-initialization functions ********************************/
452 HAL_StatusTypeDef
HAL_JPEG_Init(JPEG_HandleTypeDef
*hjpeg
);
453 HAL_StatusTypeDef
HAL_JPEG_DeInit(JPEG_HandleTypeDef
*hjpeg
);
454 void HAL_JPEG_MspInit(JPEG_HandleTypeDef
*hjpeg
);
455 void HAL_JPEG_MspDeInit(JPEG_HandleTypeDef
*hjpeg
);
457 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
458 HAL_StatusTypeDef
HAL_JPEG_RegisterCallback(JPEG_HandleTypeDef
*hjpeg
, HAL_JPEG_CallbackIDTypeDef CallbackID
,
459 pJPEG_CallbackTypeDef pCallback
);
460 HAL_StatusTypeDef
HAL_JPEG_UnRegisterCallback(JPEG_HandleTypeDef
*hjpeg
, HAL_JPEG_CallbackIDTypeDef CallbackID
);
462 HAL_StatusTypeDef
HAL_JPEG_RegisterInfoReadyCallback(JPEG_HandleTypeDef
*hjpeg
,
463 pJPEG_InfoReadyCallbackTypeDef pCallback
);
464 HAL_StatusTypeDef
HAL_JPEG_UnRegisterInfoReadyCallback(JPEG_HandleTypeDef
*hjpeg
);
466 HAL_StatusTypeDef
HAL_JPEG_RegisterGetDataCallback(JPEG_HandleTypeDef
*hjpeg
, pJPEG_GetDataCallbackTypeDef pCallback
);
467 HAL_StatusTypeDef
HAL_JPEG_UnRegisterGetDataCallback(JPEG_HandleTypeDef
*hjpeg
);
469 HAL_StatusTypeDef
HAL_JPEG_RegisterDataReadyCallback(JPEG_HandleTypeDef
*hjpeg
,
470 pJPEG_DataReadyCallbackTypeDef pCallback
);
471 HAL_StatusTypeDef
HAL_JPEG_UnRegisterDataReadyCallback(JPEG_HandleTypeDef
*hjpeg
);
473 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
479 /** @addtogroup JPEG_Exported_Functions_Group2
482 /* Encoding/Decoding Configuration functions ********************************/
483 HAL_StatusTypeDef
HAL_JPEG_ConfigEncoding(JPEG_HandleTypeDef
*hjpeg
, JPEG_ConfTypeDef
*pConf
);
484 HAL_StatusTypeDef
HAL_JPEG_GetInfo(JPEG_HandleTypeDef
*hjpeg
, JPEG_ConfTypeDef
*pInfo
);
485 HAL_StatusTypeDef
HAL_JPEG_EnableHeaderParsing(JPEG_HandleTypeDef
*hjpeg
);
486 HAL_StatusTypeDef
HAL_JPEG_DisableHeaderParsing(JPEG_HandleTypeDef
*hjpeg
);
487 HAL_StatusTypeDef
HAL_JPEG_SetUserQuantTables(JPEG_HandleTypeDef
*hjpeg
, uint8_t *QTable0
, uint8_t *QTable1
,
488 uint8_t *QTable2
, uint8_t *QTable3
);
494 /** @addtogroup JPEG_Exported_Functions_Group3
497 /* JPEG processing functions **************************************/
498 HAL_StatusTypeDef
HAL_JPEG_Encode(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataInMCU
, uint32_t InDataLength
,
499 uint8_t *pDataOut
, uint32_t OutDataLength
, uint32_t Timeout
);
500 HAL_StatusTypeDef
HAL_JPEG_Decode(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataIn
, uint32_t InDataLength
,
501 uint8_t *pDataOutMCU
, uint32_t OutDataLength
, uint32_t Timeout
);
502 HAL_StatusTypeDef
HAL_JPEG_Encode_IT(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataInMCU
, uint32_t InDataLength
,
503 uint8_t *pDataOut
, uint32_t OutDataLength
);
504 HAL_StatusTypeDef
HAL_JPEG_Decode_IT(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataIn
, uint32_t InDataLength
,
505 uint8_t *pDataOutMCU
, uint32_t OutDataLength
);
506 HAL_StatusTypeDef
HAL_JPEG_Encode_DMA(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataInMCU
, uint32_t InDataLength
,
507 uint8_t *pDataOut
, uint32_t OutDataLength
);
508 HAL_StatusTypeDef
HAL_JPEG_Decode_DMA(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataIn
, uint32_t InDataLength
,
509 uint8_t *pDataOutMCU
, uint32_t OutDataLength
);
510 HAL_StatusTypeDef
HAL_JPEG_Pause(JPEG_HandleTypeDef
*hjpeg
, uint32_t XferSelection
);
511 HAL_StatusTypeDef
HAL_JPEG_Resume(JPEG_HandleTypeDef
*hjpeg
, uint32_t XferSelection
);
512 void HAL_JPEG_ConfigInputBuffer(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pNewInputBuffer
, uint32_t InDataLength
);
513 void HAL_JPEG_ConfigOutputBuffer(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pNewOutputBuffer
, uint32_t OutDataLength
);
514 HAL_StatusTypeDef
HAL_JPEG_Abort(JPEG_HandleTypeDef
*hjpeg
);
520 /** @addtogroup JPEG_Exported_Functions_Group4
523 /* JPEG Decode/Encode callback functions ********************************************************/
524 void HAL_JPEG_InfoReadyCallback(JPEG_HandleTypeDef
*hjpeg
, JPEG_ConfTypeDef
*pInfo
);
525 void HAL_JPEG_EncodeCpltCallback(JPEG_HandleTypeDef
*hjpeg
);
526 void HAL_JPEG_DecodeCpltCallback(JPEG_HandleTypeDef
*hjpeg
);
527 void HAL_JPEG_ErrorCallback(JPEG_HandleTypeDef
*hjpeg
);
528 void HAL_JPEG_GetDataCallback(JPEG_HandleTypeDef
*hjpeg
, uint32_t NbDecodedData
);
529 void HAL_JPEG_DataReadyCallback(JPEG_HandleTypeDef
*hjpeg
, uint8_t *pDataOut
, uint32_t OutDataLength
);
535 /** @addtogroup JPEG_Exported_Functions_Group5
538 /* JPEG IRQ handler management ******************************************************/
539 void HAL_JPEG_IRQHandler(JPEG_HandleTypeDef
*hjpeg
);
545 /** @addtogroup JPEG_Exported_Functions_Group6
548 /* Peripheral State and Error functions ************************************************/
549 HAL_JPEG_STATETypeDef
HAL_JPEG_GetState(JPEG_HandleTypeDef
*hjpeg
);
550 uint32_t HAL_JPEG_GetError(JPEG_HandleTypeDef
*hjpeg
);
560 /* Private types -------------------------------------------------------------*/
561 /** @defgroup JPEG_Private_Types JPEG Private Types
569 /* Private defines -----------------------------------------------------------*/
570 /** @defgroup JPEG_Private_Defines JPEG Private Defines
578 /* Private variables ---------------------------------------------------------*/
579 /** @defgroup JPEG_Private_Variables JPEG Private Variables
587 /* Private constants ---------------------------------------------------------*/
588 /** @defgroup JPEG_Private_Constants JPEG Private Constants
596 /* Private macros ------------------------------------------------------------*/
597 /** @defgroup JPEG_Private_Macros JPEG Private Macros
601 #define IS_JPEG_CHROMASUBSAMPLING(SUBSAMPLING) (((SUBSAMPLING) == JPEG_444_SUBSAMPLING) || \
602 ((SUBSAMPLING) == JPEG_420_SUBSAMPLING) || \
603 ((SUBSAMPLING) == JPEG_422_SUBSAMPLING))
605 #define IS_JPEG_IMAGE_QUALITY(NUMBER) (((NUMBER) >= JPEG_IMAGE_QUALITY_MIN) && ((NUMBER) <= JPEG_IMAGE_QUALITY_MAX))
607 #define IS_JPEG_COLORSPACE(COLORSPACE) (((COLORSPACE) == JPEG_GRAYSCALE_COLORSPACE) || \
608 ((COLORSPACE) == JPEG_YCBCR_COLORSPACE) || \
609 ((COLORSPACE) == JPEG_CMYK_COLORSPACE))
611 #define IS_JPEG_PAUSE_RESUME_STATE(VALUE) (((VALUE) == JPEG_PAUSE_RESUME_INPUT) || \
612 ((VALUE) == JPEG_PAUSE_RESUME_OUTPUT)|| \
613 ((VALUE) == JPEG_PAUSE_RESUME_INPUT_OUTPUT))
619 /* Private functions prototypes ----------------------------------------------*/
620 /** @defgroup JPEG_Private_Functions_Prototypes JPEG Private Functions Prototypes
628 /* Private functions ---------------------------------------------------------*/
629 /** @defgroup JPEG_Private_Functions JPEG Private Functions
650 #endif /* STM32F7xx_HAL_JPEG_H */
652 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/