HAL JPEG Functions ¶
Initialization de-initialization functions ¶
- group JPEG_Exported_Functions_Group1
-
This section provides a set of functions allowing to initialize and deinitialize the JPEG peripheral:
-
HAL_JPEG_Init() : Initialize the JPEG peripheral and creates the associated handle.
-
HAL_JPEG_DeInit() : DeInitialize the JPEG peripheral.
Functions
-
hal_status_t
HAL_JPEG_Init
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_t
instance
)
¶
-
Initialize the HAL JPEG handle and associate instance.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
instance – HAL JPEG instance hal_jpeg_t .
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hjpeg pointer is NULL.
-
HAL_OK – JPEG instance has been correctly Initialized.
-
-
void
HAL_JPEG_DeInit
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
DeInitializes the JPEG peripheral.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
Encoding/Decoding Configuration functions ¶
- group JPEG_Exported_Functions_Group2
-
This section provides a set of functions allowing to manage the JPEG Core configuration:
-
HAL_JPEG_SetConfigEncoding() : JPEG encoding configuration.
-
HAL_JPEG_GetLastDecodeInfo() : Get the image configuration from the JPEG header during the decoding.
-
HAL_JPEG_EnableHeaderProcessing() : Enable JPEG Header parsing and generation.
-
HAL_JPEG_DisableHeaderProcessing() : Disable JPEG Header parsing and generation.
-
HAL_JPEG_SetUserQuantTables1() : Modify the default quantization tables_1 used for JPEG encoding.
-
HAL_JPEG_SetUserQuantTables2() : Modify the default quantization tables_2 used for JPEG encoding.
-
HAL_JPEG_SetUserQuantTables3() : Modify the default quantization tables_3 used for JPEG encoding.
-
HAL_JPEG_SetUserQuantTables4() : Modify the default quantization tables_4 used for JPEG encoding.
Functions
-
hal_status_t
HAL_JPEG_SetConfigEncoding
(
hal_jpeg_handle_t
*
hjpeg
,
const
hal_jpeg_config_t
*
p_config
)
¶
-
Set the JPEG encoding configuration.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_config – Pointer to a hal_jpeg_config_t structure that contains the encoding configuration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_config structure pointer is NULL.
-
HAL_ERROR – Failed to initialize the default Huffman tables or failed to configure the JPEG Core registers according to the color space.
-
HAL_OK – The configuration of the JPEG Core according to the asserted configuration structure is successfully Done.
-
-
hal_status_t
HAL_JPEG_GetLastDecodeInfo
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_config_t
*
p_info
)
¶
-
Extract the image configuration from the JPEG header during the decoding.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_info – Pointer to a hal_jpeg_config_t structure to be filled with the JPEG decoded header information.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_info structure pointer is NULL.
-
HAL_ERROR – Failed to read the configuration parameters from the JPEG registers.
-
HAL_OK – Extract the image configuration is successfully done.
-
-
hal_status_t
HAL_JPEG_EnableHeaderProcessing
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Enable JPEG Header parsing and generation.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hjpeg pointer is NULL.
-
HAL_OK – The header processing is successfully enabled.
-
-
hal_status_t
HAL_JPEG_DisableHeaderProcessing
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Disable JPEG Header parsing and generation.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hjpeg pointer is NULL.
-
HAL_OK – The header processing is successfully Disabled.
-
-
hal_status_t
HAL_JPEG_SetUserQuantTables1
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_qtable1
)
¶
-
Modify the default quantization tables for color component 1 used for JPEG encoding.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_qtable1 – Pointer to uint8_t , define the user quantification table for color component 1.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_qtable1 pointer is NULL.
-
HAL_OK – The user quantification table for color component 1 is successfully registered.
-
-
hal_status_t
HAL_JPEG_SetUserQuantTables2
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_qtable2
)
¶
-
Modify the default quantization tables for color component 2 used for JPEG encoding.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_qtable2 – Pointer to uint8_t , define the user quantification table for color component 2.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_qtable2 pointer is NULL.
-
HAL_OK – The user quantification table for color component 2 is successfully registered.
-
-
hal_status_t
HAL_JPEG_SetUserQuantTables3
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_qtable3
)
¶
-
Modify the default quantization tables for color component 3 used for JPEG encoding.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_qtable3 – Pointer to uint8_t , define the user quantification table for color component 3.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_qtable3 pointer is NULL.
-
HAL_OK – The user quantification table for color component 3 is successfully registered.
-
-
hal_status_t
HAL_JPEG_SetUserQuantTables4
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_qtable4
)
¶
-
Modify the default quantization tables for color component 4 used for JPEG encoding.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_qtable4 – Pointer to uint8_t , define the user quantification table for color component 4.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_qtable4 pointer is NULL.
-
HAL_OK – The user quantification table for color component 4 is successfully registered.
-
-
JPEG processing functions ¶
- group JPEG_Exported_Functions_Group3
-
This section provides a set of functions allowing to manage the JPEG processing operations:
-
HAL_JPEG_Encode() : JPEG encoding with polling process.
-
HAL_JPEG_Decode() : JPEG decoding with polling process.
-
HAL_JPEG_Encode_IT() : JPEG encoding with interrupt process.
-
HAL_JPEG_Decode_IT() : JPEG decoding with interrupt process.
-
HAL_JPEG_Encode_DMA() : JPEG encoding with DMA process.
-
HAL_JPEG_Decode_DMA() : JPEG decoding with DMA process.
-
HAL_JPEG_PauseInputBuffer() : Pause the Input processing.
-
HAL_JPEG_PauseOutputBuffer() : Pause the Output processing.
-
HAL_JPEG_ResumeInputBuffer() : Resume the JPEG Input processing.
-
HAL_JPEG_ResumeOutputBuffer() : Resume the JPEG Output processing.
-
HAL_JPEG_UpdateInputBuffer() : Configure Encoding/Decoding Input Buffer.
-
HAL_JPEG_UpdateOutputBuffer() : Configure Encoding/Decoding Output Buffer.
-
HAL_JPEG_Abort() : Aborts the JPEG Encoding/Decoding.
Functions
-
hal_status_t
HAL_JPEG_Encode
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_data_in_mcu
,
uint32_t
in_data_length_byte
,
uint8_t
*
p_data_out
,
uint32_t
out_data_length_byte
,
uint32_t
timeout_ms
)
¶
-
Starts JPEG encoding with polling processing.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_data_in_mcu – Pointer to the Input buffer.
-
in_data_length_byte – Size in bytes of the input buffer.
-
p_data_out – Pointer to the jpeg output data buffer.
-
out_data_length_byte – Size in bytes of the Output buffer.
-
timeout_ms – Specify timeout value.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_data_in_mcu/p_data_out pointer is NULL.
-
HAL_TIMEOUT – Operation exceeds user timeout.
-
HAL_OK – JPEG encoding with polling processing is successfully completed.
-
-
hal_status_t
HAL_JPEG_Decode
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_data_in
,
uint32_t
in_data_length_byte
,
uint8_t
*
p_data_out_mcu
,
uint32_t
out_data_length_byte
,
uint32_t
timeout_ms
)
¶
-
Starts JPEG decoding with polling processing.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_data_in – Pointer to the input data buffer.
-
in_data_length_byte – Size in bytes of the Input buffer.
-
p_data_out_mcu – Pointer to the Output data buffer.
-
out_data_length_byte – Size in bytes of the Output buffer.
-
timeout_ms – Specify timeout value.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_data_out_mcu/p_data_in pointer is NULL.
-
HAL_TIMEOUT – Operation exceeds user timeout.
-
HAL_OK – JPEG decoding with polling processing is successfully completed.
-
-
hal_status_t
HAL_JPEG_Encode_IT
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_data_in_mcu
,
uint32_t
in_data_length_byte
,
uint8_t
*
p_data_out
,
uint32_t
out_data_length_byte
)
¶
-
Starts JPEG encoding with interrupt processing.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_data_in_mcu – Pointer to the Input buffer.
-
in_data_length_byte – Size in bytes of the Input buffer.
-
p_data_out – Pointer to the jpeg output data buffer.
-
out_data_length_byte – Size in bytes of the output buffer.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_data_in_mcu/p_data_out pointer is NULL.
-
HAL_OK – JPEG Encoding with interrupt processing is successfully initialized.
-
-
hal_status_t
HAL_JPEG_Decode_IT
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_data_in
,
uint32_t
in_data_length_byte
,
uint8_t
*
p_data_out_mcu
,
uint32_t
out_data_length_byte
)
¶
-
Starts JPEG decoding with interrupt processing.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_data_in – Pointer to the input data buffer.
-
in_data_length_byte – Size in bytes of the Input buffer.
-
p_data_out_mcu – Pointer to the Output data buffer.
-
out_data_length_byte – Size in bytes of the Output buffer.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_data_out_mcu/p_data_in pointer is NULL.
-
HAL_OK – JPEG decoding with interrupt processing is successfully Initialized.
-
-
hal_status_t
HAL_JPEG_Encode_DMA
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_data_in_mcu
,
uint32_t
in_data_length_byte
,
uint8_t
*
p_data_out
,
uint32_t
out_data_length_byte
)
¶
-
Starts JPEG encoding with DMA processing.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_data_in_mcu – Pointer to the Input buffer.
-
in_data_length_byte – Size in bytes of the Input buffer.
-
p_data_out – Pointer to the jpeg output data buffer.
-
out_data_length_byte – Size in bytes of the Output buffer.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_data_in_mcu/p_data_out/ pointer is NULL or in_data_length_byte/out_data_length_byte < 4 byte.
-
HAL_ERROR – DMA FIFO In/out transfer failed.
-
HAL_OK – JPEG encoding with DMA processing is successfully finished.
-
-
hal_status_t
HAL_JPEG_Decode_DMA
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_data_in
,
uint32_t
in_data_length_byte
,
uint8_t
*
p_data_out_mcu
,
uint32_t
out_data_length_byte
)
¶
-
Starts JPEG decoding with DMA processing.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_data_in – Pointer to the input data buffer.
-
in_data_length_byte – Size in bytes of the Input buffer.
-
p_data_out_mcu – Pointer to the Output data buffer.
-
out_data_length_byte – Size in bytes of the Output buffer.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when p_data_in/p_data_out_mcu pointer is NULL or in_data_length_byte/out_data_length_byte < 4 byte.
-
HAL_ERROR – DMA FIFO In/out transfer failed.
-
HAL_OK – JPEG decoding with DMA processing is successfully finished.
-
-
hal_status_t
HAL_JPEG_SetTxDMA
(
hal_jpeg_handle_t
*
hjpeg
,
hal_dma_handle_t
*
hdma
)
¶
-
link/store Tx HAL DMA handle into the HAL JPEG handle.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t .
-
hdma – Pointer to a hal_dma_handle_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – Invalid parameter.
-
-
hal_status_t
HAL_JPEG_SetRxDMA
(
hal_jpeg_handle_t
*
hjpeg
,
hal_dma_handle_t
*
hdma
)
¶
-
link/store Rx HAL DMA handle into the HAL JPEG handle.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t .
-
hdma – Pointer to a hal_dma_handle_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – Invalid parameter.
-
-
hal_status_t
HAL_JPEG_PauseInputBuffer
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Pause the JPEG input processing.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
HAL_OK – The JPEG input processing is paused.
-
hal_status_t
HAL_JPEG_PauseOutputBuffer
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Pause the JPEG output processing.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
HAL_OK – The JPEG output processing is paused.
-
hal_status_t
HAL_JPEG_ResumeInputBuffer
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Resume the JPEG input processing.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
-
HAL_ERROR – The JPEG input processing is not paused or the DMA FIFO In transfer failed.
-
HAL_OK – The JPEG input processing is Resumed.
-
-
hal_status_t
HAL_JPEG_ResumeOutputBuffer
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Resume the JPEG output processing.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
-
HAL_ERROR – The JPEG output processing is not paused or the DMA FIFO Out transfer failed.
-
HAL_OK – The JPEG output processing is Resumed.
-
-
hal_status_t
HAL_JPEG_UpdateInputBuffer
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_new_input_buffer
,
uint32_t
in_data_length_byte
)
¶
-
Configure encoding/decoding input buffer.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_new_input_buffer – Pointer to the new input data buffer.
-
in_data_length_byte – Size in bytes of the new Input data buffer.
-
- Return values :
-
HAL_OK – The encoding/decoding input buffer is successfully updated.
-
hal_status_t
HAL_JPEG_UpdateOutputBuffer
(
hal_jpeg_handle_t
*
hjpeg
,
uint8_t
*
p_new_output_buffer
,
uint32_t
out_data_length_byte
)
¶
-
Configure encoding/decoding output Buffer.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_new_output_buffer – Pointer to the new output data buffer.
-
out_data_length_byte – Size in bytes of the new Output data buffer.
-
- Return values :
-
HAL_OK – The encoding/decoding output buffer is successfully updated.
-
hal_status_t
HAL_JPEG_Abort
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Aborts the JPEG Encoding/Decoding.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
-
HAL_ERROR – The JPEG Codec not yet disabled when JPEG_TIMEOUT_VALUE reached.
-
HAL_OK – The JPEG encoding/decoding operation is successfully Aborted.
-
-
JPEG Decode/Encode callback functions ¶
- group JPEG_Exported_Functions_Group4
-
This section provides callback functions:
-
HAL_JPEG_InfoReadyCallback() : Decoding JPEG info ready callback
-
HAL_JPEG_EncodeCpltCallback() : Encoding complete callback.
-
HAL_JPEG_DecodeCpltCallback() : Decoding complete callback.
-
HAL_JPEG_ErrorCallback() : JPEG error callback.
-
HAL_JPEG_GetDataCallback() : Get new data chunk callback.
-
HAL_JPEG_DataReadyCallback() : Decoded/Encoded data ready callback.
Functions
-
void
HAL_JPEG_InfoReadyCallback
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Decoding JPEG Info ready callback.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
void
HAL_JPEG_EncodeCpltCallback
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Encoding complete callback.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
void
HAL_JPEG_DecodeCpltCallback
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Decoding complete callback.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
void
HAL_JPEG_ErrorCallback
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
JPEG error callback.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
void
HAL_JPEG_GetDataCallback
(
hal_jpeg_handle_t
*
hjpeg
,
uint32_t
nb_decoded_data_byte
)
¶
-
Get new data chunk callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
nb_decoded_data_byte – Number of consumed data in the previous chunk in bytes.
-
-
void
HAL_JPEG_DataReadyCallback
(
hal_jpeg_handle_t
*
hjpeg
,
const
uint8_t
*
p_data_out
,
uint32_t
out_data_length_byte
)
¶
-
Decoded/Encoded Data ready callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure
-
p_data_out – Pointer to the output data buffer.
-
out_data_length_byte – Number in bytes of data available in the specified output buffer.
-
-
JPEG IRQ handler management and callbacks functions registration ¶
- group JPEG_Exported_Functions_Group5
-
This section provides function allowing to manage the JPEG interrupt request:
-
HAL_JPEG_IRQHandler() : Handles JPEG interrupt request.
This section provides also a set of functions allowing to register callbacks:
-
HAL_JPEG_RegisterInfoReadyCallback() : Function to register info ready user callbacks.
-
HAL_JPEG_RegisterGetDataCallback() : Function to register get data user callbacks.
-
HAL_JPEG_RegisterDataReadyCallback() : Function to register data ready user callbacks.
-
HAL_JPEG_RegisterEncodeCpltCallback() : Function to register encode complete user callbacks.
-
HAL_JPEG_RegisterDecodeCpltCallback() : Function to register decode complete user callbacks.
-
HAL_JPEG_RegisterErrorCallback() : Function to register error user callbacks.
Functions
-
void
HAL_JPEG_IRQHandler
(
hal_jpeg_handle_t
*
hjpeg
)
¶
-
This function handles JPEG interrupt request.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
hal_status_t
HAL_JPEG_RegisterEncodeCpltCallback
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_cb_t
callback
)
¶
-
Register Encode Complete JPEG Callback. To be used instead of the weak HAL_JPEG_RegisterEncodeCpltCallback() predefined callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
callback – Pointer to the Encode Complete Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when callback pointer is NULL.
-
HAL_OK – JPEG Encode Complete Callback is successfully registered.
-
-
hal_status_t
HAL_JPEG_RegisterDecodeCpltCallback
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_cb_t
callback
)
¶
-
Register Decode Complete JPEG Callback. To be used instead of the weak HAL_JPEG_RegisterDecodeCpltCallback() predefined callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
callback – Pointer to the Decode Complete Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when callback pointer is NULL.
-
HAL_OK – JPEG decode complete callback is successfully registered.
-
-
hal_status_t
HAL_JPEG_RegisterErrorCallback
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_cb_t
callback
)
¶
-
Register Error JPEG Callback. To be used instead of the weak HAL_JPEG_RegisterErrorCallback() predefined callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
callback – Pointer to the Error JPEG Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when callback pointer is NULL.
-
HAL_OK – JPEG Error Callback is successfully registered.
-
-
hal_status_t
HAL_JPEG_RegisterInfoReadyCallback
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_cb_t
callback
)
¶
-
Register Info Ready JPEG Callback. To be used instead of the weak HAL_JPEG_InfoReadyCallback() predefined callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
callback – Pointer to the Info Ready Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when callback pointer is NULL.
-
HAL_OK – JPEG Info Ready Callback is successfully registered.
-
-
hal_status_t
HAL_JPEG_RegisterGetDataCallback
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_get_data_cb_t
callback
)
¶
-
Register Get Data JPEG Callback. To be used instead of the weak HAL_JPEG_GetDataCallback() predefined callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
callback – Pointer to the Get Data Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when callback pointer is NULL.
-
HAL_OK – JPEG Get Data Callback is successfully registered.
-
-
hal_status_t
HAL_JPEG_RegisterDataReadyCallback
(
hal_jpeg_handle_t
*
hjpeg
,
hal_jpeg_data_ready_cb_t
callback
)
¶
-
Register Data Ready JPEG Callback. To be used instead of the weak HAL_JPEG_DataReadyCallback() predefined callback.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
callback – Pointer to the Data Ready Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when callback pointer is NULL.
-
HAL_OK – JPEG Data Ready Callback is successfully registered.
-
-
Peripheral State and Error functions ¶
- group JPEG_Exported_Functions_Group6
-
This section provides JPEG global_state and Errors function :
-
HAL_JPEG_GetState() : permits to get in run-time the JPEG global_state.
-
HAL_JPEG_GetEncoderState() : permits to get in run-time the JPEG encoder_state.
-
HAL_JPEG_GetHeaderProcessingState : permits to get in run-time the JPEG header_processing_state.
-
HAL_JPEG_GetLastErrorCodes() : Returns last occurred error code.
Functions
-
hal_jpeg_state_t
HAL_JPEG_GetState
(
const
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Returns the JPEG global_state.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
hal_jpeg_state_t – Global state hal_jpeg_state_t .
-
hal_jpeg_encode_config_state_t
HAL_JPEG_GetEncoderState
(
const
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Returns the JPEG encoder state.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
hal_jpeg_encode_config_state_t – Encoder state hal_jpeg_encode_config_state_t .
-
hal_jpeg_header_processing_state_t
HAL_JPEG_GetHeaderProcessingState
(
const
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Returns the header processing state.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
hal_jpeg_header_processing_state_t – The status of the header processing feature hal_jpeg_header_processing_state_t .
-
uint32_t
HAL_JPEG_GetLastErrorCodes
(
const
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Return the JPEG error code.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
JPEG – last Error Code.
-
Set/Get user data functions ¶
- group JPEG_Exported_Functions_Group7
-
This section provides JPEG global_state and Errors function :
-
HAL_JPEG_SetUserData() : permits to Store the user data into the JPEG handle.
-
HAL_JPEG_GetUserData() : permits to get the user data from the JPEG handle.
Functions
-
void
HAL_JPEG_SetUserData
(
hal_jpeg_handle_t
*
hjpeg
,
const
void
*
p_user_data
)
¶
-
Store the user data into the JPEG handle.
- Parameters :
-
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_JPEG_GetUserData
(
const
hal_jpeg_handle_t
*
hjpeg
)
¶
-
Retrieve the user data from the JPEG handle.
- Parameters :
-
hjpeg – Pointer to a hal_jpeg_handle_t structure.
- Return values :
-
void* – Pointer to user data structure.
-
JPEG Flags management functions ¶
- group JPEG_Exported_Functions_Group8
-
Functions
-
uint32_t
HAL_JPEG_IsActiveFlag
(
const
hal_jpeg_handle_t
*
hjpeg
,
uint32_t
flag
)
¶
-
Check the specified JPEG status flag.
- Parameters :
-
-
hjpeg – Specifies the JPEG handle.
-
flag – Specifies the flag to check This parameter can be one of the following values:
-
HAL_JPEG_FLAG_IFT : Input FIFO threshold reached flag
-
HAL_JPEG_FLAG_IFNF : Input FIFO not full flag
-
HAL_JPEG_FLAG_OFT : Output FIFO threshold reached flag
-
HAL_JPEG_FLAG_OFNE : Output FIFO not empty flag
-
HAL_JPEG_FLAG_EOC : End of conversion flag; converted data sent to the output FIFO
-
HAL_JPEG_FLAG_HPD : Header parsing done flag ,header data in internal registers
-
HAL_JPEG_FLAG_CO : JPEG conversion in progress flag
-
-
- Return values :
-
The – status of JPEG flag (ACTIVE or NOT ACTIVE)
-
void
HAL_JPEG_ClearFlag
(
hal_jpeg_handle_t
*
hjpeg
,
uint32_t
flag
)
¶
-
Clear the specified JPEG status flag.
- Parameters :
-
-
hjpeg – Specifies the JPEG handle.
-
flag – Specifies the flag to clear This parameter can be a combination of the following values:
-
HAL_JPEG_FLAG_IFT : Input FIFO threshold reached flag
-
HAL_JPEG_FLAG_IFNF : Input FIFO not full flag
-
HAL_JPEG_FLAG_OFT : Output FIFO threshold reached flag
-
HAL_JPEG_FLAG_OFNE : Output FIFO not empty flag
-
HAL_JPEG_FLAG_EOC : End of conversion flag; converted data sent to the output FIFO
-
HAL_JPEG_FLAG_HPD : Header parsing done flag ,header data in internal registers
-
HAL_JPEG_FLAG_CO : JPEG conversion in progress flag
-
HAL_JPEG_FLAG_ALL : All JPEG flags
-
-
-
void
HAL_JPEG_EnableIT
(
hal_jpeg_handle_t
*
hjpeg
,
uint32_t
it_source
)
¶
-
Enable Interrupt.
- Parameters :
-
-
hjpeg – Specifies the JPEG handle.
-
it_source – Specifies the interrupt to enable This parameter can be a combination of the following values:
-
HAL_JPEG_IT_IFT : Input FIFO threshold interrupt
-
HAL_JPEG_IT_IFNF : Input FIFO not Full interrupt
-
HAL_JPEG_IT_OFT : Output FIFO threshold interrupt
-
HAL_JPEG_IT_OFNE : Output FIFO not empty interrupt
-
HAL_JPEG_IT_EOC : End of conversion interrupt
-
HAL_JPEG_IT_HPD : Header parsing done interrupt
-
HAL_JPEG_IT_ALL : All JPEG interrupt sources
-
-
-
void
HAL_JPEG_DisableIT
(
hal_jpeg_handle_t
*
hjpeg
,
uint32_t
it_source
)
¶
-
Disable Interrupt.
- Parameters :
-
-
hjpeg – Specifies the JPEG handle.
-
it_source – Specifies the interrupt to disable This parameter can be a combination of the following values:
-
HAL_JPEG_IT_IFT : Input FIFO threshold interrupt
-
HAL_JPEG_IT_IFNF : Input FIFO not Full interrupt
-
HAL_JPEG_IT_OFT : Output FIFO threshold interrupt
-
HAL_JPEG_IT_OFNE : Output FIFO not empty interrupt
-
HAL_JPEG_IT_EOC : End of conversion interrupt
-
HAL_JPEG_IT_HPD : Header parsing done interrupt
-
HAL_JPEG_IT_ALL : All JPEG interrupt sources
-
-
-
uint32_t
HAL_JPEG_IsEnabledIT
(
const
hal_jpeg_handle_t
*
hjpeg
,
uint32_t
it_source
)
¶
-
Get Interrupt state.
- Parameters :
-
-
hjpeg – Specifies the JPEG handle.
-
it_source – Specifies the interrupt to check This parameter can be a combination of the following values:
-
HAL_JPEG_IT_IFT : Input FIFO threshold interrupt
-
HAL_JPEG_IT_IFNF : Input FIFO not Full interrupt
-
HAL_JPEG_IT_OFT : Output FIFO threshold interrupt
-
HAL_JPEG_IT_OFNE : Output FIFO not empty interrupt
-
HAL_JPEG_IT_EOC : End of conversion interrupt
-
HAL_JPEG_IT_HPD : Header parsing done interrupt
-
-
- Return values :
-
returns – The new state of it_source (Enabled or disabled)
-
uint32_t
HAL_JPEG_IsActiveFlag
(
const
hal_jpeg_handle_t
*
hjpeg
,
uint32_t
flag
)
¶