Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eil.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: i2cdev
description: ESP-IDF I2C master thread-safe utilities
version: 2.1.3
version: 2.2.0
groups:
- common
code_owners:
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ eil_check_idf_has_esp_drivers()
# List of common ESP-IDF components required by this component
set(REQUIRED_COMPONENTS log freertos esp_idf_lib_helpers)

# Add version-specific required componenets
# Add version-specific required components.
#
# NOTE: "driver" must be listed unconditionally on ESP-IDF versions that also
# provide the split esp_driver_* components. i2cdev_legacy.c includes
# <driver/i2c.h> (provided by "driver") whenever CONFIG_I2CDEV_USE_LEGACY_DRIVER
# is enabled. That Kconfig option is not yet visible during the first CMake
# configure pass of a clean project, so deriving the requirement list from it
# would leave the legacy build without the "driver" include path.
if(EIL_IDF_HAS_ESP_DRIVERS)
list(APPEND REQUIRED_COMPONENTS esp_driver_gpio esp_driver_i2c)
list(APPEND REQUIRED_COMPONENTS driver esp_driver_gpio esp_driver_i2c)
else()
list(APPEND REQUIRED_COMPONENTS driver)
endif()
Expand Down
23 changes: 16 additions & 7 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,32 @@ config I2CDEV_DEFAULT_SCL_PIN
Default SCL pin for I2C devices.

config I2CDEV_MAX_DEVICES_PER_PORT
int "Maximum number of devices per I2C port"
int "Maximum number of devices per I2C port (legacy driver only)"
default 8
help
Maximum number of devices that can be registered on a single I2C port.
Maximum number of devices that can be tracked on a single I2C port.
Used by the legacy driver only: the new i2c_master based driver keeps a
dynamic list and accepts any number of devices per port.

config I2CDEV_TIMEOUT
int "I2C transaction timeout, milliseconds"
default 1000
range 10 5000

config I2CDEV_NOLOCK
bool "Disable the use of mutexes"
bool "Disable per-device mutexes"
default n
help
Attention! After enabling this option, all I2C device
drivers will become non-thread safe.
Use this option if you need to access your I2C devices
from interrupt handlers.
Disables the per-device mutex (dev->mutex) and makes
i2c_dev_take_mutex()/i2c_dev_give_mutex(), as well as the
I2C_DEV_TAKE_MUTEX/I2C_DEV_GIVE_MUTEX macros, no-ops.

Bus-level management is not affected: the port mutex, device
handles and bus teardown in i2cdev_done() still run, so devices
are removed from the bus and the bus is released as usual.

Use this option only when all access to each device is already
serialized by the caller, or when devices must be accessed from
interrupt context where taking a mutex is not allowed.

endmenu
Loading
Loading