Merge pull request #11270 from haslinghuis/rename_attr
[betaflight.git] / lib / main / STM32H7 / Drivers / STM32H7xx_HAL_Driver / Inc / stm32h7xx_hal_jpeg.h
blob846609a29a32d522abaf8a0a7e81ad556bc3a39c
1 /**
2 ******************************************************************************
3 * @file stm32h7xx_hal_jpeg.h
4 * @author MCD Application Team
5 * @brief Header file of JPEG HAL module.
6 ******************************************************************************
7 * @attention
9 * <h2><center>&copy; 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 STM32H7xx_HAL_JPEG_H
22 #define STM32H7xx_HAL_JPEG_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32h7xx_hal_def.h"
31 #if defined (JPEG)
33 /** @addtogroup STM32H7xx_HAL_Driver
34 * @{
37 /** @addtogroup JPEG
38 * @{
41 /* Exported types ------------------------------------------------------------*/
42 /** @defgroup JPEG_Exported_Types JPEG Exported Types
43 * @{
46 /** @defgroup JPEG_Configuration_Structure_definition JPEG Configuration for encoding Structure definition
47 * @brief JPEG encoding configuration Structure definition
48 * @{
50 typedef struct
52 uint32_t ColorSpace; /*!< Image Color space : gray-scale, YCBCR, RGB or CMYK
53 This parameter can be a value of @ref JPEG_ColorSpace */
55 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
56 This parameter can be a value of @ref JPEG_ChromaSubsampling */
58 uint32_t ImageHeight; /*!< Image height : number of lines */
60 uint32_t ImageWidth; /*!< Image width : number of pixels per line */
62 uint32_t ImageQuality; /*!< Quality of the JPEG encoding : from 1 to 100 */
64 } JPEG_ConfTypeDef;
65 /**
66 * @}
69 /** @defgroup HAL_JPEG_state_structure_definition HAL JPEG state structure definition
70 * @brief HAL JPEG State structure definition
71 * @{
73 typedef enum
75 HAL_JPEG_STATE_RESET = 0x00U, /*!< JPEG not yet initialized or disabled */
76 HAL_JPEG_STATE_READY = 0x01U, /*!< JPEG initialized and ready for use */
77 HAL_JPEG_STATE_BUSY = 0x02U, /*!< JPEG internal processing is ongoing */
78 HAL_JPEG_STATE_BUSY_ENCODING = 0x03U, /*!< JPEG encoding processing is ongoing */
79 HAL_JPEG_STATE_BUSY_DECODING = 0x04U, /*!< JPEG decoding processing is ongoing */
80 HAL_JPEG_STATE_TIMEOUT = 0x05U, /*!< JPEG timeout state */
81 HAL_JPEG_STATE_ERROR = 0x06U /*!< JPEG error state */
82 } HAL_JPEG_STATETypeDef;
84 /**
85 * @}
89 /** @defgroup JPEG_handle_Structure_definition JPEG handle Structure definition
90 * @brief JPEG handle Structure definition
91 * @{
93 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
94 typedef struct __JPEG_HandleTypeDef
95 #else
96 typedef struct
97 #endif /* (USE_HAL_JPEG_REGISTER_CALLBACKS) */
99 JPEG_TypeDef *Instance; /*!< JPEG peripheral register base address */
101 JPEG_ConfTypeDef Conf; /*!< Current JPEG encoding/decoding parameters */
103 uint8_t *pJpegInBuffPtr; /*!< Pointer to JPEG processing (encoding, decoding,...) input buffer */
105 uint8_t *pJpegOutBuffPtr; /*!< Pointer to JPEG processing (encoding, decoding,...) output buffer */
107 __IO uint32_t JpegInCount; /*!< Internal Counter of input data */
109 __IO uint32_t JpegOutCount; /*!< Internal Counter of output data */
111 uint32_t InDataLength; /*!< Input Buffer Length in Bytes */
113 uint32_t OutDataLength; /*!< Output Buffer Length in Bytes */
115 MDMA_HandleTypeDef *hdmain; /*!< JPEG In MDMA handle parameters */
117 MDMA_HandleTypeDef *hdmaout; /*!< JPEG Out MDMA handle parameters */
119 uint8_t CustomQuanTable; /*!< If set to 1 specify that user customized quantization tables are used */
121 uint8_t *QuantTable0; /*!< Basic Quantization Table for component 0 */
123 uint8_t *QuantTable1; /*!< Basic Quantization Table for component 1 */
125 uint8_t *QuantTable2; /*!< Basic Quantization Table for component 2 */
127 uint8_t *QuantTable3; /*!< Basic Quantization Table for component 3 */
129 HAL_LockTypeDef Lock; /*!< JPEG locking object */
131 __IO HAL_JPEG_STATETypeDef State; /*!< JPEG peripheral state */
133 __IO uint32_t ErrorCode; /*!< JPEG Error code */
135 __IO uint32_t Context; /*!< JPEG Internal context */
137 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
138 void (*InfoReadyCallback)(struct __JPEG_HandleTypeDef *hjpeg,
139 JPEG_ConfTypeDef *pInfo); /*!< JPEG Info ready callback */
140 void (*EncodeCpltCallback)(struct __JPEG_HandleTypeDef
141 *hjpeg); /*!< JPEG Encode complete callback */
142 void (*DecodeCpltCallback)(struct __JPEG_HandleTypeDef
143 *hjpeg); /*!< JPEG Decode complete callback */
144 void (*ErrorCallback)(struct __JPEG_HandleTypeDef
145 *hjpeg); /*!< JPEG Error callback */
146 void (*GetDataCallback)(struct __JPEG_HandleTypeDef *hjpeg,
147 uint32_t NbDecodedData); /*!< JPEG Get Data callback */
148 void (*DataReadyCallback)(struct __JPEG_HandleTypeDef *hjpeg, uint8_t *pDataOut,
149 uint32_t OutDataLength); /*!< JPEG Data ready callback */
151 void (* MspInitCallback)(struct __JPEG_HandleTypeDef *hjpeg); /*!< JPEG Msp Init callback */
152 void (* MspDeInitCallback)(struct __JPEG_HandleTypeDef
153 *hjpeg); /*!< JPEG Msp DeInit callback */
156 #endif /* (USE_HAL_JPEG_REGISTER_CALLBACKS) */
159 } JPEG_HandleTypeDef;
161 * @}
165 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
166 /** @defgroup HAL_JPEG_Callback_ID_enumeration_definition HAL JPEG Callback ID enumeration definition
167 * @brief HAL JPEG Callback ID enumeration definition
168 * @{
170 typedef enum
172 HAL_JPEG_ENCODE_CPLT_CB_ID = 0x01U, /*!< JPEG Encode Complete callback ID */
173 HAL_JPEG_DECODE_CPLT_CB_ID = 0x02U, /*!< JPEG Decode Complete callback ID */
174 HAL_JPEG_ERROR_CB_ID = 0x03U, /*!< JPEG Error callback ID */
176 HAL_JPEG_MSPINIT_CB_ID = 0x04U, /*!< JPEG MspInit callback ID */
177 HAL_JPEG_MSPDEINIT_CB_ID = 0x05U /*!< JPEG MspDeInit callback ID */
179 } HAL_JPEG_CallbackIDTypeDef;
181 * @}
184 /** @defgroup HAL_JPEG_Callback_pointer_definition HAL JPEG Callback pointer definition
185 * @brief HAL JPEG Callback pointer definition
186 * @{
188 typedef void (*pJPEG_CallbackTypeDef)(JPEG_HandleTypeDef *hjpeg); /*!< pointer to a common JPEG callback function */
189 typedef void (*pJPEG_InfoReadyCallbackTypeDef)(JPEG_HandleTypeDef *hjpeg,
190 JPEG_ConfTypeDef *pInfo); /*!< pointer to an Info ready JPEG callback function */
191 typedef void (*pJPEG_GetDataCallbackTypeDef)(JPEG_HandleTypeDef *hjpeg,
192 uint32_t NbDecodedData); /*!< pointer to a Get data JPEG callback function */
193 typedef void (*pJPEG_DataReadyCallbackTypeDef)(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataOut,
194 uint32_t OutDataLength); /*!< pointer to a Data ready JPEG callback function */
196 * @}
199 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
202 * @}
205 /* Exported constants --------------------------------------------------------*/
207 /** @defgroup JPEG_Exported_Constants JPEG Exported Constants
208 * @{
211 /** @defgroup JPEG_Error_Code_definition JPEG Error Code definition
212 * @brief JPEG Error Code definition
213 * @{
216 #define HAL_JPEG_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
217 #define HAL_JPEG_ERROR_HUFF_TABLE ((uint32_t)0x00000001U) /*!< HUffman Table programming error */
218 #define HAL_JPEG_ERROR_QUANT_TABLE ((uint32_t)0x00000002U) /*!< Quantization Table programming error */
219 #define HAL_JPEG_ERROR_DMA ((uint32_t)0x00000004U) /*!< DMA transfer error */
220 #define HAL_JPEG_ERROR_TIMEOUT ((uint32_t)0x00000008U) /*!< Timeout error */
221 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
222 #define HAL_JPEG_ERROR_INVALID_CALLBACK ((uint32_t)0x00000010U) /*!< Invalid Callback error */
223 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
225 * @}
228 /** @defgroup JPEG_Quantization_Table_Size JPEG Quantization Table Size
229 * @brief JPEG Quantization Table Size
230 * @{
232 #define JPEG_QUANT_TABLE_SIZE ((uint32_t)64U) /*!< JPEG Quantization Table Size in bytes */
234 * @}
238 /** @defgroup JPEG_ColorSpace JPEG ColorSpace
239 * @brief JPEG Color Space
240 * @{
242 #define JPEG_GRAYSCALE_COLORSPACE ((uint32_t)0x00000000U)
243 #define JPEG_YCBCR_COLORSPACE JPEG_CONFR1_COLORSPACE_0
244 #define JPEG_CMYK_COLORSPACE JPEG_CONFR1_COLORSPACE
248 * @}
252 /** @defgroup JPEG_ChromaSubsampling JPEG Chrominance Sampling
253 * @brief JPEG Chrominance Sampling
254 * @{
256 #define JPEG_444_SUBSAMPLING ((uint32_t)0x00000000U) /*!< Chroma Subsampling 4:4:4 */
257 #define JPEG_420_SUBSAMPLING ((uint32_t)0x00000001U) /*!< Chroma Subsampling 4:2:0 */
258 #define JPEG_422_SUBSAMPLING ((uint32_t)0x00000002U) /*!< Chroma Subsampling 4:2:2 */
261 * @}
264 /** @defgroup JPEG_ImageQuality JPEG Image Quality
265 * @brief JPEG Min and Max Image Quality
266 * @{
268 #define JPEG_IMAGE_QUALITY_MIN ((uint32_t)1U) /*!< Minimum JPEG quality */
269 #define JPEG_IMAGE_QUALITY_MAX ((uint32_t)100U) /*!< Maximum JPEG quality */
272 * @}
275 /** @defgroup JPEG_Interrupt_configuration_definition JPEG Interrupt configuration definition
276 * @brief JPEG Interrupt definition
277 * @{
279 #define JPEG_IT_IFT ((uint32_t)JPEG_CR_IFTIE) /*!< Input FIFO Threshold Interrupt */
280 #define JPEG_IT_IFNF ((uint32_t)JPEG_CR_IFNFIE) /*!< Input FIFO Not Full Interrupt */
281 #define JPEG_IT_OFT ((uint32_t)JPEG_CR_OFTIE) /*!< Output FIFO Threshold Interrupt */
282 #define JPEG_IT_OFNE ((uint32_t)JPEG_CR_OFTIE) /*!< Output FIFO Not Empty Interrupt */
283 #define JPEG_IT_EOC ((uint32_t)JPEG_CR_EOCIE) /*!< End of Conversion Interrupt */
284 #define JPEG_IT_HPD ((uint32_t)JPEG_CR_HPDIE) /*!< Header Parsing Done Interrupt */
286 * @}
289 /** @defgroup JPEG_Flag_definition JPEG Flag definition
290 * @brief JPEG Flags definition
291 * @{
293 #define JPEG_FLAG_IFTF ((uint32_t)JPEG_SR_IFTF) /*!< Input FIFO is not full and is bellow its threshold flag */
294 #define JPEG_FLAG_IFNFF ((uint32_t)JPEG_SR_IFNFF) /*!< Input FIFO Not Full Flag, a data can be written */
295 #define JPEG_FLAG_OFTF ((uint32_t)JPEG_SR_OFTF) /*!< Output FIFO is not empty and has reach its threshold */
296 #define JPEG_FLAG_OFNEF ((uint32_t)JPEG_SR_OFNEF) /*!< Output FIFO is not empty, a data is available */
297 #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 */
298 #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 */
299 #define JPEG_FLAG_COF ((uint32_t)JPEG_SR_COF) /*!< JPEG Codec operation on going flag*/
301 #define JPEG_FLAG_ALL ((uint32_t)0x000000FEU) /*!< JPEG Codec All previous flag*/
303 * @}
306 /** @defgroup JPEG_PROCESS_PAUSE_RESUME_definition JPEG Process Pause Resume definition
307 * @brief JPEG process pause, resume definition
308 * @{
310 #define JPEG_PAUSE_RESUME_INPUT ((uint32_t)0x00000001U) /*!< Pause/Resume Input FIFO Xfer*/
311 #define JPEG_PAUSE_RESUME_OUTPUT ((uint32_t)0x00000002U) /*!< Pause/Resume Output FIFO Xfer*/
312 #define JPEG_PAUSE_RESUME_INPUT_OUTPUT ((uint32_t)0x00000003U) /*!< Pause/Resume Input and Output FIFO Xfer*/
314 * @}
318 * @}
320 /* Exported macro ------------------------------------------------------------*/
322 /** @defgroup JPEG_Exported_Macros JPEG Exported Macros
323 * @{
326 /** @brief Reset JPEG handle state
327 * @param __HANDLE__ specifies the JPEG handle.
328 * @retval None
330 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
331 #define __HAL_JPEG_RESET_HANDLE_STATE(__HANDLE__) do{\
332 (__HANDLE__)->State = HAL_JPEG_STATE_RESET;\
333 (__HANDLE__)->MspInitCallback = NULL;\
334 (__HANDLE__)->MspDeInitCallback = NULL;\
335 }while(0)
336 #else
337 #define __HAL_JPEG_RESET_HANDLE_STATE(__HANDLE__) ( (__HANDLE__)->State = HAL_JPEG_STATE_RESET)
338 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
342 * @brief Enable the JPEG peripheral.
343 * @param __HANDLE__ specifies the JPEG handle.
344 * @retval None
346 #define __HAL_JPEG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= JPEG_CR_JCEN)
349 * @brief Disable the JPEG peripheral.
350 * @param __HANDLE__ specifies the JPEG handle.
351 * @retval None
353 #define __HAL_JPEG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~JPEG_CR_JCEN)
357 * @brief Check the specified JPEG status flag.
358 * @param __HANDLE__ specifies the JPEG handle.
359 * @param __FLAG__ specifies the flag to check
360 * This parameter can be one of the following values:
361 * @arg JPEG_FLAG_IFTF : The input FIFO is not full and is bellow its threshold flag
362 * @arg JPEG_FLAG_IFNFF : The input FIFO Not Full Flag, a data can be written
363 * @arg JPEG_FLAG_OFTF : The output FIFO is not empty and has reach its threshold
364 * @arg JPEG_FLAG_OFNEF : The output FIFO is not empty, a data is available
365 * @arg JPEG_FLAG_EOCF : JPEG Codec core has finished the encoding or the decoding process
366 * and than last data has been sent to the output FIFO
367 * @arg JPEG_FLAG_HPDF : JPEG Codec has finished the parsing of the headers
368 * and the internal registers have been updated
369 * @arg JPEG_FLAG_COF : JPEG Codec operation on going flag
371 * @retval __HAL_JPEG_GET_FLAG : returns The new state of __FLAG__ (TRUE or FALSE)
374 #define __HAL_JPEG_GET_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)))
377 * @brief Clear the specified JPEG status flag.
378 * @param __HANDLE__ specifies the JPEG handle.
379 * @param __FLAG__ specifies the flag to clear
380 * This parameter can be one of the following values:
381 * @arg JPEG_FLAG_EOCF : JPEG Codec core has finished the encoding or the decoding process
382 * and than last data has been sent to the output FIFO
383 * @arg JPEG_FLAG_HPDF : JPEG Codec has finished the parsing of the headers
384 * @retval None
387 #define __HAL_JPEG_CLEAR_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->CFR |= ((__FLAG__) & (JPEG_FLAG_EOCF | JPEG_FLAG_HPDF))))
391 * @brief Enable Interrupt.
392 * @param __HANDLE__ specifies the JPEG handle.
393 * @param __INTERRUPT__ specifies the interrupt to enable
394 * This parameter can be one of the following values:
395 * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
396 * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
397 * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
398 * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
399 * @arg JPEG_IT_EOC : End of Conversion Interrupt
400 * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
402 * @retval No retrun
404 #define __HAL_JPEG_ENABLE_IT(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__) )
407 * @brief Disable Interrupt.
408 * @param __HANDLE__ specifies the JPEG handle.
409 * @param __INTERRUPT__ specifies the interrupt to disable
410 * This parameter can be one of the following values:
411 * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
412 * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
413 * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
414 * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
415 * @arg JPEG_IT_EOC : End of Conversion Interrupt
416 * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
418 * @note To disable an IT we must use MODIFY_REG macro to avoid writing "1" to the FIFO flush bits
419 * located in the same IT enable register (CR register).
420 * @retval No retrun
422 #define __HAL_JPEG_DISABLE_IT(__HANDLE__,__INTERRUPT__) MODIFY_REG((__HANDLE__)->Instance->CR, (__INTERRUPT__), 0UL)
426 * @brief Get Interrupt state.
427 * @param __HANDLE__ specifies the JPEG handle.
428 * @param __INTERRUPT__ specifies the interrupt to check
429 * This parameter can be one of the following values:
430 * @arg JPEG_IT_IFT : Input FIFO Threshold Interrupt
431 * @arg JPEG_IT_IFNF : Input FIFO Not Full Interrupt
432 * @arg JPEG_IT_OFT : Output FIFO Threshold Interrupt
433 * @arg JPEG_IT_OFNE : Output FIFO Not empty Interrupt
434 * @arg JPEG_IT_EOC : End of Conversion Interrupt
435 * @arg JPEG_IT_HPD : Header Parsing Done Interrupt
437 * @retval returns The new state of __INTERRUPT__ (Enabled or disabled)
439 #define __HAL_JPEG_GET_IT_SOURCE(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
442 * @}
445 /* Exported functions --------------------------------------------------------*/
446 /** @addtogroup JPEG_Exported_Functions
447 * @{
450 /** @addtogroup JPEG_Exported_Functions_Group1
451 * @{
453 /* Initialization/de-initialization functions ********************************/
454 HAL_StatusTypeDef HAL_JPEG_Init(JPEG_HandleTypeDef *hjpeg);
455 HAL_StatusTypeDef HAL_JPEG_DeInit(JPEG_HandleTypeDef *hjpeg);
456 void HAL_JPEG_MspInit(JPEG_HandleTypeDef *hjpeg);
457 void HAL_JPEG_MspDeInit(JPEG_HandleTypeDef *hjpeg);
459 #if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
460 HAL_StatusTypeDef HAL_JPEG_RegisterCallback(JPEG_HandleTypeDef *hjpeg, HAL_JPEG_CallbackIDTypeDef CallbackID,
461 pJPEG_CallbackTypeDef pCallback);
462 HAL_StatusTypeDef HAL_JPEG_UnRegisterCallback(JPEG_HandleTypeDef *hjpeg, HAL_JPEG_CallbackIDTypeDef CallbackID);
464 HAL_StatusTypeDef HAL_JPEG_RegisterInfoReadyCallback(JPEG_HandleTypeDef *hjpeg,
465 pJPEG_InfoReadyCallbackTypeDef pCallback);
466 HAL_StatusTypeDef HAL_JPEG_UnRegisterInfoReadyCallback(JPEG_HandleTypeDef *hjpeg);
468 HAL_StatusTypeDef HAL_JPEG_RegisterGetDataCallback(JPEG_HandleTypeDef *hjpeg, pJPEG_GetDataCallbackTypeDef pCallback);
469 HAL_StatusTypeDef HAL_JPEG_UnRegisterGetDataCallback(JPEG_HandleTypeDef *hjpeg);
471 HAL_StatusTypeDef HAL_JPEG_RegisterDataReadyCallback(JPEG_HandleTypeDef *hjpeg,
472 pJPEG_DataReadyCallbackTypeDef pCallback);
473 HAL_StatusTypeDef HAL_JPEG_UnRegisterDataReadyCallback(JPEG_HandleTypeDef *hjpeg);
475 #endif /* USE_HAL_JPEG_REGISTER_CALLBACKS */
478 * @}
481 /** @addtogroup JPEG_Exported_Functions_Group2
482 * @{
484 /* Encoding/Decoding Configuration functions ********************************/
485 HAL_StatusTypeDef HAL_JPEG_ConfigEncoding(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pConf);
486 HAL_StatusTypeDef HAL_JPEG_GetInfo(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pInfo);
487 HAL_StatusTypeDef HAL_JPEG_EnableHeaderParsing(JPEG_HandleTypeDef *hjpeg);
488 HAL_StatusTypeDef HAL_JPEG_DisableHeaderParsing(JPEG_HandleTypeDef *hjpeg);
489 HAL_StatusTypeDef HAL_JPEG_SetUserQuantTables(JPEG_HandleTypeDef *hjpeg, uint8_t *QTable0, uint8_t *QTable1,
490 uint8_t *QTable2, uint8_t *QTable3);
493 * @}
496 /** @addtogroup JPEG_Exported_Functions_Group3
497 * @{
499 /* JPEG processing functions **************************************/
500 HAL_StatusTypeDef HAL_JPEG_Encode(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength,
501 uint8_t *pDataOut, uint32_t OutDataLength, uint32_t Timeout);
502 HAL_StatusTypeDef HAL_JPEG_Decode(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataIn, uint32_t InDataLength,
503 uint8_t *pDataOutMCU, uint32_t OutDataLength, uint32_t Timeout);
504 HAL_StatusTypeDef HAL_JPEG_Encode_IT(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength,
505 uint8_t *pDataOut, uint32_t OutDataLength);
506 HAL_StatusTypeDef HAL_JPEG_Decode_IT(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataIn, uint32_t InDataLength,
507 uint8_t *pDataOutMCU, uint32_t OutDataLength);
508 HAL_StatusTypeDef HAL_JPEG_Encode_DMA(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength,
509 uint8_t *pDataOut, uint32_t OutDataLength);
510 HAL_StatusTypeDef HAL_JPEG_Decode_DMA(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataIn, uint32_t InDataLength,
511 uint8_t *pDataOutMCU, uint32_t OutDataLength);
512 HAL_StatusTypeDef HAL_JPEG_Pause(JPEG_HandleTypeDef *hjpeg, uint32_t XferSelection);
513 HAL_StatusTypeDef HAL_JPEG_Resume(JPEG_HandleTypeDef *hjpeg, uint32_t XferSelection);
514 void HAL_JPEG_ConfigInputBuffer(JPEG_HandleTypeDef *hjpeg, uint8_t *pNewInputBuffer, uint32_t InDataLength);
515 void HAL_JPEG_ConfigOutputBuffer(JPEG_HandleTypeDef *hjpeg, uint8_t *pNewOutputBuffer, uint32_t OutDataLength);
516 HAL_StatusTypeDef HAL_JPEG_Abort(JPEG_HandleTypeDef *hjpeg);
519 * @}
522 /** @addtogroup JPEG_Exported_Functions_Group4
523 * @{
525 /* JPEG Decode/Encode callback functions ********************************************************/
526 void HAL_JPEG_InfoReadyCallback(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pInfo);
527 void HAL_JPEG_EncodeCpltCallback(JPEG_HandleTypeDef *hjpeg);
528 void HAL_JPEG_DecodeCpltCallback(JPEG_HandleTypeDef *hjpeg);
529 void HAL_JPEG_ErrorCallback(JPEG_HandleTypeDef *hjpeg);
530 void HAL_JPEG_GetDataCallback(JPEG_HandleTypeDef *hjpeg, uint32_t NbDecodedData);
531 void HAL_JPEG_DataReadyCallback(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataOut, uint32_t OutDataLength);
534 * @}
537 /** @addtogroup JPEG_Exported_Functions_Group5
538 * @{
540 /* JPEG IRQ handler management ******************************************************/
541 void HAL_JPEG_IRQHandler(JPEG_HandleTypeDef *hjpeg);
544 * @}
547 /** @addtogroup JPEG_Exported_Functions_Group6
548 * @{
550 /* Peripheral State and Error functions ************************************************/
551 HAL_JPEG_STATETypeDef HAL_JPEG_GetState(JPEG_HandleTypeDef *hjpeg);
552 uint32_t HAL_JPEG_GetError(JPEG_HandleTypeDef *hjpeg);
555 * @}
559 * @}
562 /* Private types -------------------------------------------------------------*/
563 /** @defgroup JPEG_Private_Types JPEG Private Types
564 * @{
568 * @}
571 /* Private defines -----------------------------------------------------------*/
572 /** @defgroup JPEG_Private_Defines JPEG Private Defines
573 * @{
577 * @}
580 /* Private variables ---------------------------------------------------------*/
581 /** @defgroup JPEG_Private_Variables JPEG Private Variables
582 * @{
586 * @}
589 /* Private constants ---------------------------------------------------------*/
590 /** @defgroup JPEG_Private_Constants JPEG Private Constants
591 * @{
595 * @}
598 /* Private macros ------------------------------------------------------------*/
599 /** @defgroup JPEG_Private_Macros JPEG Private Macros
600 * @{
603 #define IS_JPEG_CHROMASUBSAMPLING(SUBSAMPLING) (((SUBSAMPLING) == JPEG_444_SUBSAMPLING) || \
604 ((SUBSAMPLING) == JPEG_420_SUBSAMPLING) || \
605 ((SUBSAMPLING) == JPEG_422_SUBSAMPLING))
607 #define IS_JPEG_IMAGE_QUALITY(NUMBER) (((NUMBER) >= JPEG_IMAGE_QUALITY_MIN) && ((NUMBER) <= JPEG_IMAGE_QUALITY_MAX))
609 #define IS_JPEG_COLORSPACE(COLORSPACE) (((COLORSPACE) == JPEG_GRAYSCALE_COLORSPACE) || \
610 ((COLORSPACE) == JPEG_YCBCR_COLORSPACE) || \
611 ((COLORSPACE) == JPEG_CMYK_COLORSPACE))
613 #define IS_JPEG_PAUSE_RESUME_STATE(VALUE) (((VALUE) == JPEG_PAUSE_RESUME_INPUT) || \
614 ((VALUE) == JPEG_PAUSE_RESUME_OUTPUT)|| \
615 ((VALUE) == JPEG_PAUSE_RESUME_INPUT_OUTPUT))
618 * @}
621 /* Private functions prototypes ----------------------------------------------*/
622 /** @defgroup JPEG_Private_Functions_Prototypes JPEG Private Functions Prototypes
623 * @{
627 * @}
630 /* Private functions ---------------------------------------------------------*/
631 /** @defgroup JPEG_Private_Functions JPEG Private Functions
632 * @{
636 * @}
640 * @}
644 * @}
647 #endif /* JPEG */
649 #ifdef __cplusplus
651 #endif
653 #endif /* STM32H7xx_HAL_JPEG_H */
655 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/