20#ifndef STM32H7xx_HAL_JPEG_H
21#define STM32H7xx_HAL_JPEG_H
56 uint32_t ChromaSubsampling;
63 uint32_t ImageQuality;
77 HAL_JPEG_STATE_RESET = 0x00U,
78 HAL_JPEG_STATE_READY = 0x01U,
79 HAL_JPEG_STATE_BUSY = 0x02U,
80 HAL_JPEG_STATE_BUSY_ENCODING = 0x03U,
81 HAL_JPEG_STATE_BUSY_DECODING = 0x04U,
82 HAL_JPEG_STATE_TIMEOUT = 0x05U,
83 HAL_JPEG_STATE_ERROR = 0x06U
84} HAL_JPEG_STATETypeDef;
96#if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
97typedef struct __JPEG_HandleTypeDef
104 JPEG_ConfTypeDef Conf;
106 uint8_t *pJpegInBuffPtr;
108 uint8_t *pJpegOutBuffPtr;
110 __IO uint32_t JpegInCount;
112 __IO uint32_t JpegOutCount;
114 uint32_t InDataLength;
116 uint32_t OutDataLength;
122 uint8_t CustomQuanTable;
124 uint8_t *QuantTable0;
126 uint8_t *QuantTable1;
128 uint8_t *QuantTable2;
130 uint8_t *QuantTable3;
134 __IO HAL_JPEG_STATETypeDef State;
136 __IO uint32_t ErrorCode;
140#if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
141 void (*InfoReadyCallback)(
struct __JPEG_HandleTypeDef *hjpeg,
142 JPEG_ConfTypeDef *pInfo);
143 void (*EncodeCpltCallback)(
struct __JPEG_HandleTypeDef
145 void (*DecodeCpltCallback)(
struct __JPEG_HandleTypeDef
147 void (*ErrorCallback)(
struct __JPEG_HandleTypeDef
149 void (*GetDataCallback)(
struct __JPEG_HandleTypeDef *hjpeg,
150 uint32_t NbDecodedData);
151 void (*DataReadyCallback)(
struct __JPEG_HandleTypeDef *hjpeg, uint8_t *pDataOut,
152 uint32_t OutDataLength);
154 void (* MspInitCallback)(
struct __JPEG_HandleTypeDef *hjpeg);
155 void (* MspDeInitCallback)(
struct __JPEG_HandleTypeDef
168#if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
176 HAL_JPEG_ENCODE_CPLT_CB_ID = 0x01U,
177 HAL_JPEG_DECODE_CPLT_CB_ID = 0x02U,
178 HAL_JPEG_ERROR_CB_ID = 0x03U,
180 HAL_JPEG_MSPINIT_CB_ID = 0x04U,
181 HAL_JPEG_MSPDEINIT_CB_ID = 0x05U
183} HAL_JPEG_CallbackIDTypeDef;
193typedef void (*pJPEG_CallbackTypeDef)(JPEG_HandleTypeDef *hjpeg);
194typedef void (*pJPEG_InfoReadyCallbackTypeDef)(JPEG_HandleTypeDef *hjpeg,
195 JPEG_ConfTypeDef *pInfo);
196typedef void (*pJPEG_GetDataCallbackTypeDef)(JPEG_HandleTypeDef *hjpeg,
197 uint32_t NbDecodedData);
198typedef void (*pJPEG_DataReadyCallbackTypeDef)(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataOut,
199 uint32_t OutDataLength);
223#define HAL_JPEG_ERROR_NONE ((uint32_t)0x00000000U)
224#define HAL_JPEG_ERROR_HUFF_TABLE ((uint32_t)0x00000001U)
225#define HAL_JPEG_ERROR_QUANT_TABLE ((uint32_t)0x00000002U)
226#define HAL_JPEG_ERROR_DMA ((uint32_t)0x00000004U)
227#define HAL_JPEG_ERROR_TIMEOUT ((uint32_t)0x00000008U)
228#if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
229#define HAL_JPEG_ERROR_INVALID_CALLBACK ((uint32_t)0x00000010U)
240#define JPEG_QUANT_TABLE_SIZE ((uint32_t)64U)
251#define JPEG_GRAYSCALE_COLORSPACE ((uint32_t)0x00000000U)
252#define JPEG_YCBCR_COLORSPACE JPEG_CONFR1_COLORSPACE_0
253#define JPEG_CMYK_COLORSPACE JPEG_CONFR1_COLORSPACE
266#define JPEG_444_SUBSAMPLING ((uint32_t)0x00000000U)
267#define JPEG_420_SUBSAMPLING ((uint32_t)0x00000001U)
268#define JPEG_422_SUBSAMPLING ((uint32_t)0x00000002U)
279#define JPEG_IMAGE_QUALITY_MIN ((uint32_t)1U)
280#define JPEG_IMAGE_QUALITY_MAX ((uint32_t)100U)
291#define JPEG_IT_IFT ((uint32_t)JPEG_CR_IFTIE)
292#define JPEG_IT_IFNF ((uint32_t)JPEG_CR_IFNFIE)
293#define JPEG_IT_OFT ((uint32_t)JPEG_CR_OFTIE)
294#define JPEG_IT_OFNE ((uint32_t)JPEG_CR_OFTIE)
295#define JPEG_IT_EOC ((uint32_t)JPEG_CR_EOCIE)
296#define JPEG_IT_HPD ((uint32_t)JPEG_CR_HPDIE)
306#define JPEG_FLAG_IFTF ((uint32_t)JPEG_SR_IFTF)
307#define JPEG_FLAG_IFNFF ((uint32_t)JPEG_SR_IFNFF)
308#define JPEG_FLAG_OFTF ((uint32_t)JPEG_SR_OFTF)
309#define JPEG_FLAG_OFNEF ((uint32_t)JPEG_SR_OFNEF)
310#define JPEG_FLAG_EOCF ((uint32_t)JPEG_SR_EOCF)
311#define JPEG_FLAG_HPDF ((uint32_t)JPEG_SR_HPDF)
312#define JPEG_FLAG_COF ((uint32_t)JPEG_SR_COF)
314#define JPEG_FLAG_ALL ((uint32_t)0x000000FEU)
324#define JPEG_PAUSE_RESUME_INPUT ((uint32_t)0x00000001U)
325#define JPEG_PAUSE_RESUME_OUTPUT ((uint32_t)0x00000002U)
326#define JPEG_PAUSE_RESUME_INPUT_OUTPUT ((uint32_t)0x00000003U)
345#if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
346#define __HAL_JPEG_RESET_HANDLE_STATE(__HANDLE__) do{\
347 (__HANDLE__)->State = HAL_JPEG_STATE_RESET;\
348 (__HANDLE__)->MspInitCallback = NULL;\
349 (__HANDLE__)->MspDeInitCallback = NULL;\
352#define __HAL_JPEG_RESET_HANDLE_STATE(__HANDLE__) ( (__HANDLE__)->State = HAL_JPEG_STATE_RESET)
361#define __HAL_JPEG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= JPEG_CR_JCEN)
368#define __HAL_JPEG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~JPEG_CR_JCEN)
389#define __HAL_JPEG_GET_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)))
402#define __HAL_JPEG_CLEAR_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->CFR |= ((__FLAG__) & (JPEG_FLAG_EOCF | JPEG_FLAG_HPDF))))
419#define __HAL_JPEG_ENABLE_IT(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__) )
437#define __HAL_JPEG_DISABLE_IT(__HANDLE__,__INTERRUPT__) MODIFY_REG((__HANDLE__)->Instance->CR, (__INTERRUPT__), 0UL)
454#define __HAL_JPEG_GET_IT_SOURCE(__HANDLE__,__INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
471void HAL_JPEG_MspInit(JPEG_HandleTypeDef *hjpeg);
472void HAL_JPEG_MspDeInit(JPEG_HandleTypeDef *hjpeg);
474#if (USE_HAL_JPEG_REGISTER_CALLBACKS == 1)
475HAL_StatusTypeDef HAL_JPEG_RegisterCallback(JPEG_HandleTypeDef *hjpeg, HAL_JPEG_CallbackIDTypeDef CallbackID,
476 pJPEG_CallbackTypeDef pCallback);
477HAL_StatusTypeDef HAL_JPEG_UnRegisterCallback(JPEG_HandleTypeDef *hjpeg, HAL_JPEG_CallbackIDTypeDef CallbackID);
480 pJPEG_InfoReadyCallbackTypeDef pCallback);
481HAL_StatusTypeDef HAL_JPEG_UnRegisterInfoReadyCallback(JPEG_HandleTypeDef *hjpeg);
483HAL_StatusTypeDef HAL_JPEG_RegisterGetDataCallback(JPEG_HandleTypeDef *hjpeg, pJPEG_GetDataCallbackTypeDef pCallback);
487 pJPEG_DataReadyCallbackTypeDef pCallback);
488HAL_StatusTypeDef HAL_JPEG_UnRegisterDataReadyCallback(JPEG_HandleTypeDef *hjpeg);
500HAL_StatusTypeDef HAL_JPEG_ConfigEncoding(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pConf);
501HAL_StatusTypeDef HAL_JPEG_GetInfo(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pInfo);
504HAL_StatusTypeDef HAL_JPEG_SetUserQuantTables(JPEG_HandleTypeDef *hjpeg, uint8_t *QTable0, uint8_t *QTable1,
505 uint8_t *QTable2, uint8_t *QTable3);
515HAL_StatusTypeDef HAL_JPEG_Encode(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength,
516 uint8_t *pDataOut, uint32_t OutDataLength, uint32_t Timeout);
517HAL_StatusTypeDef HAL_JPEG_Decode(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataIn, uint32_t InDataLength,
518 uint8_t *pDataOutMCU, uint32_t OutDataLength, uint32_t Timeout);
519HAL_StatusTypeDef HAL_JPEG_Encode_IT(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength,
520 uint8_t *pDataOut, uint32_t OutDataLength);
521HAL_StatusTypeDef HAL_JPEG_Decode_IT(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataIn, uint32_t InDataLength,
522 uint8_t *pDataOutMCU, uint32_t OutDataLength);
523HAL_StatusTypeDef HAL_JPEG_Encode_DMA(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataInMCU, uint32_t InDataLength,
524 uint8_t *pDataOut, uint32_t OutDataLength);
525HAL_StatusTypeDef HAL_JPEG_Decode_DMA(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataIn, uint32_t InDataLength,
526 uint8_t *pDataOutMCU, uint32_t OutDataLength);
527HAL_StatusTypeDef HAL_JPEG_Pause(JPEG_HandleTypeDef *hjpeg, uint32_t XferSelection);
528HAL_StatusTypeDef HAL_JPEG_Resume(JPEG_HandleTypeDef *hjpeg, uint32_t XferSelection);
529void HAL_JPEG_ConfigInputBuffer(JPEG_HandleTypeDef *hjpeg, uint8_t *pNewInputBuffer, uint32_t InDataLength);
530void HAL_JPEG_ConfigOutputBuffer(JPEG_HandleTypeDef *hjpeg, uint8_t *pNewOutputBuffer, uint32_t OutDataLength);
541void HAL_JPEG_InfoReadyCallback(JPEG_HandleTypeDef *hjpeg, JPEG_ConfTypeDef *pInfo);
542void HAL_JPEG_EncodeCpltCallback(JPEG_HandleTypeDef *hjpeg);
543void HAL_JPEG_DecodeCpltCallback(JPEG_HandleTypeDef *hjpeg);
544void HAL_JPEG_ErrorCallback(JPEG_HandleTypeDef *hjpeg);
545void HAL_JPEG_GetDataCallback(JPEG_HandleTypeDef *hjpeg, uint32_t NbDecodedData);
546void HAL_JPEG_DataReadyCallback(JPEG_HandleTypeDef *hjpeg, uint8_t *pDataOut, uint32_t OutDataLength);
556void HAL_JPEG_IRQHandler(JPEG_HandleTypeDef *hjpeg);
566HAL_JPEG_STATETypeDef HAL_JPEG_GetState(JPEG_HandleTypeDef *hjpeg);
567uint32_t HAL_JPEG_GetError(JPEG_HandleTypeDef *hjpeg);
623#define IS_JPEG_CHROMASUBSAMPLING(SUBSAMPLING) (((SUBSAMPLING) == JPEG_444_SUBSAMPLING) || \
624 ((SUBSAMPLING) == JPEG_420_SUBSAMPLING) || \
625 ((SUBSAMPLING) == JPEG_422_SUBSAMPLING))
627#define IS_JPEG_IMAGE_QUALITY(NUMBER) (((NUMBER) >= JPEG_IMAGE_QUALITY_MIN) && ((NUMBER) <= JPEG_IMAGE_QUALITY_MAX))
629#define IS_JPEG_COLORSPACE(COLORSPACE) (((COLORSPACE) == JPEG_GRAYSCALE_COLORSPACE) || \
630 ((COLORSPACE) == JPEG_YCBCR_COLORSPACE) || \
631 ((COLORSPACE) == JPEG_CMYK_COLORSPACE))
633#define IS_JPEG_PAUSE_RESUME_STATE(VALUE) (((VALUE) == JPEG_PAUSE_RESUME_INPUT) || \
634 ((VALUE) == JPEG_PAUSE_RESUME_OUTPUT)|| \
635 ((VALUE) == JPEG_PAUSE_RESUME_INPUT_OUTPUT))
#define __IO
Definition: core_cm4.h:239
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
HAL_LockTypeDef
HAL Lock structures definition.
Definition: stm32h7xx_hal_def.h:58
JPEG Codec.
Definition: stm32h743xx.h:1125
Test context for spec:/rtems/barrier/req/create test case.
Definition: tc-barrier-create.c:144
MDMA handle Structure definition.
Definition: stm32h7xx_hal_mdma.h:204