Skip to content

Commit

Permalink
Merge branch 'feature/add_esp_new_jpeg_breaking_change' into 'master'
Browse files Browse the repository at this point in the history
Update esp_jpeg to esp_new_jpeg (breaking change)

See merge request adf/esp-adf-internal!1341
  • Loading branch information
jason-mao committed Sep 29, 2024
2 parents c2221be + 706cdc1 commit 3b6e59b
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 126 deletions.
2 changes: 1 addition & 1 deletion components/esp-adf-libs
Submodule esp-adf-libs updated 69 files
+1 −0 .github/workflows/upload_component.yml
+6 −2 CMakeLists.txt
+ esp_audio/lib/esp32/libesp_audio.a
+ esp_audio/lib/esp32c2/libesp_audio.a
+ esp_audio/lib/esp32c3/libesp_audio.a
+ esp_audio/lib/esp32c5/libesp_audio.a
+ esp_audio/lib/esp32c6/libesp_audio.a
+ esp_audio/lib/esp32p4/libesp_audio.a
+ esp_audio/lib/esp32s2/libesp_audio.a
+ esp_audio/lib/esp32s3/libesp_audio.a
+0 −121 esp_codec/include/codec/esp_jpeg_common.h
+0 −201 esp_codec/include/codec/esp_jpeg_dec.h
+0 −223 esp_codec/include/codec/esp_jpeg_enc.h
+0 −58 esp_codec/include/codec/esp_jpeg_version.h
+ esp_codec/lib/esp32/libesp_codec.a
+ esp_codec/lib/esp32/libesp_processing.a
+ esp_codec/lib/esp32c2/libesp_codec.a
+ esp_codec/lib/esp32c2/libesp_processing.a
+ esp_codec/lib/esp32c3/libesp_codec.a
+ esp_codec/lib/esp32c3/libesp_processing.a
+ esp_codec/lib/esp32c5/libesp_codec.a
+ esp_codec/lib/esp32c5/libesp_processing.a
+ esp_codec/lib/esp32c6/libesp_codec.a
+ esp_codec/lib/esp32c6/libesp_processing.a
+ esp_codec/lib/esp32p4/libesp_codec.a
+ esp_codec/lib/esp32p4/libesp_processing.a
+ esp_codec/lib/esp32s2/libesp_codec.a
+ esp_codec/lib/esp32s2/libesp_processing.a
+ esp_codec/lib/esp32s3/libesp_codec.a
+ esp_codec/lib/esp32s3/libesp_processing.a
+ esp_media_protocols/lib/esp32/libesp_media_protocols.a
+ esp_media_protocols/lib/esp32c2/libesp_media_protocols.a
+ esp_media_protocols/lib/esp32c3/libesp_media_protocols.a
+ esp_media_protocols/lib/esp32c5/libesp_media_protocols.a
+ esp_media_protocols/lib/esp32c6/libesp_media_protocols.a
+ esp_media_protocols/lib/esp32p4/libesp_media_protocols.a
+ esp_media_protocols/lib/esp32s2/libesp_media_protocols.a
+ esp_media_protocols/lib/esp32s3/libesp_media_protocols.a
+8 −0 esp_new_jpeg/CHANGELOG.md
+6 −0 esp_new_jpeg/CMakeLists.txt
+20 −0 esp_new_jpeg/LICENSE
+189 −0 esp_new_jpeg/README.md
+15 −0 esp_new_jpeg/idf_component.yml
+97 −0 esp_new_jpeg/include/esp_jpeg_common.h
+162 −0 esp_new_jpeg/include/esp_jpeg_dec.h
+129 −0 esp_new_jpeg/include/esp_jpeg_enc.h
+46 −0 esp_new_jpeg/include/esp_jpeg_version.h
+ esp_new_jpeg/lib/esp32/libesp_new_jpeg.a
+ esp_new_jpeg/lib/esp32c2/libesp_new_jpeg.a
+ esp_new_jpeg/lib/esp32c3/libesp_new_jpeg.a
+ esp_new_jpeg/lib/esp32c5/libesp_new_jpeg.a
+ esp_new_jpeg/lib/esp32c6/libesp_new_jpeg.a
+ esp_new_jpeg/lib/esp32p4/libesp_new_jpeg.a
+ esp_new_jpeg/lib/esp32s2/libesp_new_jpeg.a
+ esp_new_jpeg/lib/esp32s3/libesp_new_jpeg.a
+9 −0 esp_new_jpeg/test_app/CMakeLists.txt
+12 −0 esp_new_jpeg/test_app/main/CMakeLists.txt
+3 −0 esp_new_jpeg/test_app/main/idf_component.yml
+142 −0 esp_new_jpeg/test_app/main/image_io.c
+191 −0 esp_new_jpeg/test_app/main/image_io.h
+35 −0 esp_new_jpeg/test_app/main/test_app_main.c
+158 −0 esp_new_jpeg/test_app/main/test_case.c
+310 −0 esp_new_jpeg/test_app/main/test_decoder.c
+87 −0 esp_new_jpeg/test_app/main/test_decoder.h
+148 −0 esp_new_jpeg/test_app/main/test_encoder.c
+33 −0 esp_new_jpeg/test_app/main/test_encoder.h
+16 −0 esp_new_jpeg/test_app/pytest_esp_new_jpeg.py
+24 −0 esp_new_jpeg/test_app/sdkconfig.defaults
+13 −0 esp_new_jpeg/test_app/sdkconfig.defaults.esp32s3
188 changes: 94 additions & 94 deletions components/esp_peripherals/driver/i2c_bus/i2c_bus.h
Original file line number Diff line number Diff line change
@@ -1,212 +1,212 @@
/*
* ESPRESSIF MIT License
*
* Copyright (c) 2017 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
*
* Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case,
* it is free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
* ESPRESSIF MIT License
*
* Copyright (c) 2017 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
*
* Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case,
* it is free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef _IOT_I2C_BUS_H_
#define _IOT_I2C_BUS_H_

#ifdef __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */

#include "audio_idf_version.h"

#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0))
#include "driver/i2c_master.h"
#endif
#endif /* (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)) */

#include "driver/i2c.h"

typedef void *i2c_bus_handle_t;
typedef void (*i2c_run_cb_t)(i2c_port_t port, void *arg);

/**
* @brief Create and init I2C bus and return a I2C bus handle
* @brief Create and init I2C bus and return a I2C bus handle
*
* @param port I2C port number
* @param conf Pointer to I2C parameters
* @param port I2C port number
* @param conf Pointer to I2C parameters
*
* @return
* - I2C bus handle
* - I2C bus handle
*/
i2c_bus_handle_t i2c_bus_create(i2c_port_t port, i2c_config_t *conf);

#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0))
/**
* @brief Set I2S master bus handle
*
* @param port I2C port number
* @param master_handle I2C master bus handle.
* @param port I2C port number
* @param master_handle I2C master bus handle.
*
* @return
* - ESP_OK on success
* - ESP_OK on success
*/
esp_err_t i2c_bus_set_master_handle(i2c_port_t port, i2c_master_bus_handle_t master_handle);

/**
* @brief Get I2S master bus handle
*
* @param port I2C port number
* @param port I2C port number
*
* @return
* - I2C master bus handle.
* - I2C master bus handle.
*/
i2c_master_bus_handle_t i2c_bus_get_master_handle(i2c_port_t port);

/**
* @brief Read certain bytes of data from I2C bus by address
*
* ___________________________________________________
* | start | slave_addr + rd_bit + ack | ..... | stop |
* --------|---------------------------|-- -----|------|
* ___________________________________________________
* | start | slave_addr + rd_bit + ack | ..... | stop |
* --------|---------------------------|-- -----|------|
*
* @note Directly reads the data in the registers address without a write action
*
* @param bus I2C bus handle
* @param addr The address of the device
* @param outdata The outdata pointer
* @param datalen The length of outdata
* @param bus I2C bus handle
* @param addr The address of the device
* @param outdata The outdata pointer
* @param datalen The length of outdata
*
* @return
* - ESP_OK Success
* - ESP_FAIL Fail
*/
esp_err_t i2c_bus_read_bytes_directly(i2c_bus_handle_t bus, int addr, uint8_t *outdata, int datalen);
esp_err_t i2c_bus_read_bytes_directly(i2c_bus_handle_t bus, int addr, uint8_t *outdata, int datalen);

/**
* @brief Set I2C bus clock frequency
*
* @note This function need called before any i2c bus read or write operation
*
* @param bus I2C bus handle
* @param clk_speed I2C clk frequency
* @param bus I2C bus handle
* @param clk_speed I2C clk frequency
*
* @return
* - ESP_OK Success
* - ESP_FAIL Fail
* - ESP_OK Success
* - ESP_FAIL Fail
*/
esp_err_t i2c_bus_set_clk(i2c_bus_handle_t bus, uint32_t clk_speed);

#else

/**
* @brief I2C start sending buffered commands
* @brief I2C start sending buffered commands
*
* @param bus I2C bus handle
* @param cmd I2C cmd handle
* @param ticks_to_wait Maximum blocking time
* @param bus I2C bus handle
* @param cmd I2C cmd handle
* @param ticks_to_wait Maximum blocking time
*
* @return
* - ESP_OK Success
* - ESP_FAIL Fail
* - ESP_OK Success
* - ESP_FAIL Fail
*/
esp_err_t i2c_bus_cmd_begin(i2c_bus_handle_t bus, i2c_cmd_handle_t cmd, portBASE_TYPE ticks_to_wait);

#endif /* ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0) */
#endif /* (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)) */

/**
* @brief Write bytes to I2C bus
* @brief Write bytes to I2C bus
*
* @param bus I2C bus handle
* @param addr The address of the device
* @param reg The register of the device
* @param regLen The length of register
* @param data The data pointer
* @param datalen The length of data
* @param bus I2C bus handle
* @param addr The address of the device
* @param reg The register of the device
* @param regLen The length of register
* @param data The data pointer
* @param datalen The length of data
*
* @return
* - NULL Fail
* - Others Success
* - NULL Fail
* - Others Success
*/
esp_err_t i2c_bus_write_bytes(i2c_bus_handle_t bus, int addr, uint8_t *reg, int regLen, uint8_t *data, int datalen);

/**
* @brief Write data to I2C bus
* @brief Write data to I2C bus
*
* @param bus I2C bus handle
* @param addr The address of the device
* @param data The data pointer
* @param datalen The length of data
* @param bus I2C bus handle
* @param addr The address of the device
* @param data The data pointer
* @param datalen The length of data
*
* @return
* - NULL Fail
* - Others Success
* - NULL Fail
* - Others Success
*/
esp_err_t i2c_bus_write_data(i2c_bus_handle_t bus, int addr, uint8_t *data, int datalen);

/**
* @brief Read bytes to I2C bus
* @brief Read bytes to I2C bus
*
* @param bus I2C bus handle
* @param addr The address of the device
* @param reg The register of the device
* @param regLen The length of register
* @param outdata The outdata pointer
* @param datalen The length of outdata
* @param bus I2C bus handle
* @param addr The address of the device
* @param reg The register of the device
* @param regLen The length of register
* @param outdata The outdata pointer
* @param datalen The length of outdata
*
* @return
* - NULL Fail
* - Others Success
* - NULL Fail
* - Others Success
*/
esp_err_t i2c_bus_read_bytes(i2c_bus_handle_t bus, int addr, uint8_t *reg, int reglen, uint8_t *outdata, int datalen);

/**
* @brief Delete and release the I2C bus object
* @brief Delete and release the I2C bus object
*
* @param bus I2C bus handle
* @param bus I2C bus handle
*
* @return
* - ESP_OK Success
* - ESP_FAIL Fail
* - ESP_OK Success
* - ESP_FAIL Fail
*/
esp_err_t i2c_bus_delete(i2c_bus_handle_t bus);

/**
* @brief Auto probe the I2C device
* @brief Auto probe the I2C device
*
* @param bus I2C bus handle
* @param addr I2C adress
* @param bus I2C bus handle
* @param addr I2C 8bit address
*
* @return
* - ESP_OK Found a I2C device
* - ESP_FAIL Fail
* - ESP_OK Found a I2C device
* - ESP_FAIL Fail
*/
esp_err_t i2c_bus_probe_addr(i2c_bus_handle_t bus, uint8_t addr);

/**
* @brief Lock the I2C bus while executing the given callback
* @brief Lock the I2C bus while executing the given callback
*
* @param bus I2C bus handle
* @param cb The callback to execute
* @param arg The argument for the callback
* @param bus I2C bus handle
* @param cb The callback to execute
* @param arg The argument for the callback
*
* @return
* - ESP_OK Done calling callback function
* - ESP_FAIL Fail
* - ESP_OK Done calling callback function
* - ESP_FAIL Fail
*/
esp_err_t i2c_bus_run_cb(i2c_bus_handle_t bus, i2c_run_cb_t cb, void *arg);

#ifdef __cplusplus
}
#endif
#endif /* __cplusplus */

#endif
#endif /* _IOT_I2C_BUS_H_ */
2 changes: 1 addition & 1 deletion components/esp_peripherals/driver/i2c_bus/i2c_bus_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ esp_err_t i2c_bus_probe_addr(i2c_bus_handle_t bus, uint8_t addr)
i2c_bus_info_t *bus_info = (i2c_bus_info_t *)bus;
esp_err_t ret = ESP_OK;
mutex_lock(master[bus_info->port].bus_lock);
ret = i2c_master_probe(master[bus_info->port].master_handle, addr, DEFAULT_I2C_TRANS_TIMEOUT);
ret = i2c_master_probe(master[bus_info->port].master_handle, addr >> 1, DEFAULT_I2C_TRANS_TIMEOUT);
mutex_unlock(master[bus_info->port].bus_lock);
return ret;
}
Expand Down
1 change: 1 addition & 0 deletions examples/display/lcd_camera/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
idf_component_register(
SRCS
"lcd_camera_main.c"
"img_convert.c"
INCLUDE_DIRS
".")
Loading

0 comments on commit 3b6e59b

Please sign in to comment.