ESP-IoT-Solution Choose version... Get Started Basic Component Bluetooth Display USB Host&Device Audio Multimedia AI Input Device IR Low Power Solution Sensors Touch Storage Motor Solution Security&Encryption Electrical&Lighting Other Resources Contribute ESP-IoT-Solution » ESP-IoT-Solution Programming Guide Edit on GitHub ESP-IoT-Solution Programming Guide [中文] This is the documentation for ESP-IoT-Solution Development Framework. ESP-IoT-Solution contains device drivers and code frameworks for the development of IoT system, which works as extra components of ESP-IDF and much easier to start. Get Started Display USB Host&Device GUI Input Sensors Audio Security&Encryption Contribute Provide feedback about this document Next © Copyright 2016 - 2026, Espressif Systems (Shanghai) CO., LTD. Built with Sphinx using a theme based on Read the Docs Sphinx Theme. Download PDF ESP-IoT-Solution Choose version... Get Started ESP-IoT-Solution Version Description Development Environment Setup Hardware Preparation How to Obtain and Use Components How to Use Example Programs Basic Component Bluetooth Display USB Host&Device Audio Multimedia AI Input Device IR Low Power Solution Sensors Touch Storage Motor Solution Security&Encryption Electrical&Lighting Other Resources Contribute ESP-IoT-Solution » Get Started Edit on GitHub Get Started [中文] This document briefly introduces how to obtain and use components in ESP-IoT-Solution, how to compile and run examples, helping beginners get started quickly. ESP-IoT-Solution Version Description ESP-IoT-Solution has adopted component-based management since release/v2.0, with each component and example independently iterating. Please check the component’s idf_component.yml file for the dependent ESP-IDF version. Release branches only maintain historical major versions, while the master branch continuously integrates new features. It is recommended that new projects obtain required components through the component registry. Different version descriptions are as follows. For details and component lists, please see README_CN.md: ESP-IoT-Solution Version Support ESP-IoT-Solution Dependent ESP-IDF Main Changes Support Status master >= v5.3 New chip support New feature development branch release/v2.0 <= v5.3, >= v4.4 Component manager support Historical version maintenance release/v1.1 v4.0.1 IDF version update, code migration Backup, maintenance stopped release/v1.0 v3.2.2 Historical version Backup, maintenance stopped Note The recommended ESP-IDF version varies for different chips. For details, please refer to Compatibility Between ESP-IDF Releases and Revisions of Espressif SoCs. Development Environment Setup ESP-IDF is the IoT development framework provided by Espressif for ESP series chips: ESP-IDF includes a series of libraries and header files, providing core components required for building software projects based on ESP SoC ESP-IDF also provides the most commonly used tools and functions during development and mass production, such as: build, flash, debug and measurement. Note Please refer to: ESP-IDF Programming Guide to complete the ESP-IDF development environment setup. Hardware Preparation You can choose any ESP series development board, or refer to the supported development boards in esp-bsp for a quick start. For specifications of each series chip, please see ESP Product Selector. ESP series SoCs support the following features: Wi-Fi (2.4 GHz/5 GHz dual-band) Bluetooth 5.x (BLE/Mesh) High-performance multi-core processor, maximum frequency up to 400 MHz Ultra-low power coprocessor and deep sleep mode Rich peripheral interfaces: General interfaces: GPIO, UART, I2C, I2S, SPI, SDIO, USB OTG, etc. Dedicated interfaces: LCD, camera, Ethernet, CAN, Touch, LED PWM, temperature sensor, etc. Large capacity memory: Internal RAM up to 768 KB Support for external PSRAM expansion Support for external Flash storage Enhanced security features: Hardware encryption engine Secure boot Flash encryption Digital signature ESP series SoCs use advanced process technology, providing industry-leading RF performance, low power consumption characteristics and stable reliability, suitable for IoT, industrial control, smart home, wearable devices and other application scenarios. Note For specific specifications and functions of each series chip, please refer to ESP Product Selector. How to Obtain and Use Components It is recommended to obtain ESP-IoT-Solution components through ESP Component Registry. Taking the button component as an example, the steps to add dependencies are as follows: Execute in the project root directory: idf.py add-dependency "espressif/button" Reference header files in code and call APIs, for example: #include "iot_button.h" // For specific API usage, please refer to component documentation For more information on component manager usage, please refer to ESP Registry Docs. How to Use Example Programs ESP-IoT-Solution provides rich example programs to help users get started quickly. Taking the button_power_save example: Ensure that the ESP-IDF development environment setup has been completed and environment variables have been successfully configured Download the ESP-IoT-Solution code repository: git clone https://github.com/espressif/esp-iot-solution.git Enter the example directory or copy it to your working directory: cd examples/get-started/button_power_save Note If you copy the example to another directory, due to file path changes, please delete all override_path configurations in main/idf_component.yml. Select target chip (such as ESP32, required when using for the first time or switching chips): idf.py set-target esp32 Configure project (optional): idf.py menuconfig Compile and flash to development board: idf.py build idf.py -p flash Monitor output through serial port: idf.py -p monitor For more examples, please see the examples/ directory. For specific usage methods, please refer to the README files under each example. Provide feedback about this document Previous Next © Copyright 2016 - 2026, Espressif Systems (Shanghai) CO., LTD. Built with Sphinx using a theme based on Read the Docs Sphinx Theme. Download PDF ESP-IoT-Solution Choose version... Get Started Basic Component Communication Bus I2S LCD Driver Boards Support CMake Utilities Bluetooth Display USB Host&Device Audio Multimedia AI Input Device IR Low Power Solution Sensors Touch Storage Motor Solution Security&Encryption Electrical&Lighting Other Resources Contribute ESP-IoT-Solution » Basic Component Edit on GitHub Basic Component [中文] Communication Bus I2S LCD Driver Boards Support CMake Utilities Provide feedback about this document Previous Next © Copyright 2016 - 2026, Espressif Systems (Shanghai) CO., LTD. Built with Sphinx using a theme based on Read the Docs Sphinx Theme. Download PDF ESP-IoT-Solution Choose version... Get Started Basic Component Communication Bus i2c_bus spi_bus I2S LCD Driver Boards Support CMake Utilities Bluetooth Display USB Host&Device Audio Multimedia AI Input Device IR Low Power Solution Sensors Touch Storage Motor Solution Security&Encryption Electrical&Lighting Other Resources Contribute ESP-IoT-Solution » Basic Component » Boards Component Edit on GitHub Boards Component [中文] i2c_bus spi_bus The communication bus component (Bus) is a set of application-layer code built on top of the ESP-IDF peripheral driver code, including i2c_bus, spi_bus and etc. It is mainly used for bus communication between ESP chips and external devices. From the point of application development, this component has the following features: Simplified peripheral initialization processes Thread-safe device operations Simple and flexible RW operations This component abstracts the following concepts: Bus: the resource and configuration option shared between devices during communication Device: device specific resource and configuration option during communication Each physical peripheral bus can mount one or more devices if the electrical condition allows, with the SPI bus addressing devices based on CS pins and the I2C bus addressing devices based on their addresses, thus achieving software independence between different devices on the same bus. i2c_bus Connection Diagram spi_bus Connection Diagram Provide feedback about this document Previous Next © Copyright 2016 - 2026, Espressif Systems (Shanghai) CO., LTD. Built with Sphinx using a theme based on Read the Docs Sphinx Theme. Download PDF ESP-IoT-Solution Choose version... Get Started Basic Component Communication Bus i2c_bus How to Use i2c_bus Adapted IDF Versions API Reference spi_bus I2S LCD Driver Boards Support CMake Utilities Bluetooth Display USB Host&Device Audio Multimedia AI Input Device IR Low Power Solution Sensors Touch Storage Motor Solution Security&Encryption Electrical&Lighting Other Resources Contribute ESP-IoT-Solution » Basic Component » Boards Component » i2c_bus Edit on GitHub i2c_bus [中文] How to Use i2c_bus Create a bus: create a bus object using i2c_bus_create(). During the process, you need to specify the I2C port number and the bus configuration option i2c_config_t, which includes SDA and SCL pin numbers, pull-up and pull-down modes, as these are determined when the system is designed and normally will not be changed at runtime. The bus configuration option also includes the default clock frequency of the bus, which is used when the device does not specify a frequency. Create a device: use i2c_bus_device_create() to create a device on the bus object created in the first step. During the process, you need to specify bus handle, the I2C address of the device, and the clock frequency when the device is running. The frequency will be dynamically changed during I2C transmission based on device configuration options. The device clock frequency can be configured as 0, indicating the current bus frequency is used by default. Data reading: use i2c_bus_read_byte() or i2c_bus_read_bytes() to read