arduino-esp32/cores/esp32/esp32-hal-i2c-slave.c

882 lines
27 KiB
C
Raw Normal View History

2021-10-09 11:30:20 +00:00
// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
#include "soc/soc_caps.h"
#if SOC_I2C_SUPPORT_SLAVE
2021-10-09 11:30:20 +00:00
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <inttypes.h>
#include <string.h>
#include <math.h>
#include "sdkconfig.h"
#include "esp_attr.h"
#include "rom/gpio.h"
#include "soc/gpio_sig_map.h"
#include "hal/gpio_types.h"
#include "driver/gpio.h"
#include "esp_err.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "freertos/ringbuf.h"
#include "esp_intr_alloc.h"
#include "soc/i2c_reg.h"
#include "soc/i2c_struct.h"
#include "hal/i2c_ll.h"
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
#include "hal/clk_gate_ll.h"
2021-10-09 11:30:20 +00:00
#include "esp32-hal-log.h"
#include "esp32-hal-i2c-slave.h"
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
#include "esp32-hal-periman.h"
2021-10-09 11:30:20 +00:00
#define I2C_SLAVE_USE_RX_QUEUE 0 // 1: Queue, 0: RingBuffer
#if SOC_I2C_NUM > 1
#define I2C_SCL_IDX(p) ((p==0)?I2CEXT0_SCL_OUT_IDX:((p==1)?I2CEXT1_SCL_OUT_IDX:0))
#define I2C_SDA_IDX(p) ((p==0)?I2CEXT0_SDA_OUT_IDX:((p==1)?I2CEXT1_SDA_OUT_IDX:0))
#else
#define I2C_SCL_IDX(p) I2CEXT0_SCL_OUT_IDX
#define I2C_SDA_IDX(p) I2CEXT0_SDA_OUT_IDX
#endif
#if CONFIG_IDF_TARGET_ESP32
#define I2C_TXFIFO_WM_INT_ENA I2C_TXFIFO_EMPTY_INT_ENA
#define I2C_RXFIFO_WM_INT_ENA I2C_RXFIFO_FULL_INT_ENA
#endif
enum {
I2C_SLAVE_EVT_RX, I2C_SLAVE_EVT_TX
};
typedef struct i2c_slave_struct_t {
i2c_dev_t * dev;
uint8_t num;
int8_t sda;
int8_t scl;
i2c_slave_request_cb_t request_callback;
i2c_slave_receive_cb_t receive_callback;
void * arg;
intr_handle_t intr_handle;
TaskHandle_t task_handle;
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
QueueHandle_t event_queue;
2021-10-09 11:30:20 +00:00
#if I2C_SLAVE_USE_RX_QUEUE
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
QueueHandle_t rx_queue;
2021-10-09 11:30:20 +00:00
#else
RingbufHandle_t rx_ring_buf;
#endif
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
QueueHandle_t tx_queue;
2021-10-09 11:30:20 +00:00
uint32_t rx_data_count;
#if !CONFIG_DISABLE_HAL_LOCKS
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
SemaphoreHandle_t lock;
2021-10-09 11:30:20 +00:00
#endif
} i2c_slave_struct_t;
typedef union {
struct {
uint32_t event : 2;
uint32_t stop : 1;
uint32_t param : 29;
};
uint32_t val;
} i2c_slave_queue_event_t;
static i2c_slave_struct_t _i2c_bus_array[SOC_I2C_NUM] = {
{ &I2C0, 0, -1, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
#if !CONFIG_DISABLE_HAL_LOCKS
, NULL
#endif
},
#if SOC_I2C_NUM > 1
{ &I2C1, 1, -1, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
#if !CONFIG_DISABLE_HAL_LOCKS
, NULL
#endif
}
#endif
};
#if CONFIG_DISABLE_HAL_LOCKS
#define I2C_SLAVE_MUTEX_LOCK()
#define I2C_SLAVE_MUTEX_UNLOCK()
#else
#define I2C_SLAVE_MUTEX_LOCK() if(i2c->lock){xSemaphoreTake(i2c->lock, portMAX_DELAY);}
#define I2C_SLAVE_MUTEX_UNLOCK() if(i2c->lock){xSemaphoreGive(i2c->lock);}
#endif
//-------------------------------------- HAL_LL (Missing Functions) ------------------------------------------------
typedef enum {
I2C_STRETCH_CAUSE_MASTER_READ,
I2C_STRETCH_CAUSE_TX_FIFO_EMPTY,
I2C_STRETCH_CAUSE_RX_FIFO_FULL,
I2C_STRETCH_CAUSE_MAX
} i2c_stretch_cause_t;
static inline i2c_stretch_cause_t i2c_ll_stretch_cause(i2c_dev_t *hw)
{
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3
2021-10-09 11:30:20 +00:00
return hw->sr.stretch_cause;
#elif CONFIG_IDF_TARGET_ESP32S2
return hw->status_reg.stretch_cause;
#else
return I2C_STRETCH_CAUSE_MAX;
#endif
}
static inline void i2c_ll_set_stretch(i2c_dev_t *hw, uint16_t time)
{
#ifndef CONFIG_IDF_TARGET_ESP32
typeof(hw->scl_stretch_conf) scl_stretch_conf;
scl_stretch_conf.val = 0;
scl_stretch_conf.slave_scl_stretch_en = (time > 0);
scl_stretch_conf.stretch_protect_num = time;
scl_stretch_conf.slave_scl_stretch_clr = 1;
hw->scl_stretch_conf.val = scl_stretch_conf.val;
if(time > 0){
//enable interrupt
hw->int_ena.val |= I2C_SLAVE_STRETCH_INT_ENA;
} else {
//disable interrupt
hw->int_ena.val &= (~I2C_SLAVE_STRETCH_INT_ENA);
}
#endif
}
static inline void i2c_ll_stretch_clr(i2c_dev_t *hw)
{
#ifndef CONFIG_IDF_TARGET_ESP32
hw->scl_stretch_conf.slave_scl_stretch_clr = 1;
#endif
}
static inline bool i2c_ll_slave_addressed(i2c_dev_t *hw)
{
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2
2021-10-09 11:30:20 +00:00
return hw->sr.slave_addressed;
#else
return hw->status_reg.slave_addressed;
#endif
}
static inline bool i2c_ll_slave_rw(i2c_dev_t *hw)//not exposed by hal_ll
{
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2
2021-10-09 11:30:20 +00:00
return hw->sr.slave_rw;
#else
return hw->status_reg.slave_rw;
#endif
}
//-------------------------------------- PRIVATE (Function Prototypes) ------------------------------------------------
static void i2c_slave_free_resources(i2c_slave_struct_t * i2c);
2021-10-09 11:30:20 +00:00
static void i2c_slave_delay_us(uint64_t us);
static void i2c_slave_gpio_mode(int8_t pin, gpio_mode_t mode);
static bool i2c_slave_check_line_state(int8_t sda, int8_t scl);
static bool i2c_slave_attach_gpio(i2c_slave_struct_t * i2c, int8_t sda, int8_t scl);
static bool i2c_slave_detach_gpio(i2c_slave_struct_t * i2c);
static bool i2c_slave_set_frequency(i2c_slave_struct_t * i2c, uint32_t clk_speed);
static bool i2c_slave_send_event(i2c_slave_struct_t * i2c, i2c_slave_queue_event_t* event);
static bool i2c_slave_handle_tx_fifo_empty(i2c_slave_struct_t * i2c);
static bool i2c_slave_handle_rx_fifo_full(i2c_slave_struct_t * i2c, uint32_t len);
static size_t i2c_slave_read_rx(i2c_slave_struct_t * i2c, uint8_t * data, size_t len);
static void i2c_slave_isr_handler(void* arg);
static void i2c_slave_task(void *pv_args);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
static bool i2cSlaveDetachBus(void * bus_i2c_num);
2021-10-09 11:30:20 +00:00
//=====================================================================================================================
//-------------------------------------- Public Functions -------------------------------------------------------------
//=====================================================================================================================
esp_err_t i2cSlaveAttachCallbacks(uint8_t num, i2c_slave_request_cb_t request_callback, i2c_slave_receive_cb_t receive_callback, void * arg){
2021-10-09 11:30:20 +00:00
if(num >= SOC_I2C_NUM){
log_e("Invalid port num: %u", num);
return ESP_ERR_INVALID_ARG;
}
i2c_slave_struct_t * i2c = &_i2c_bus_array[num];
I2C_SLAVE_MUTEX_LOCK();
i2c->request_callback = request_callback;
i2c->receive_callback = receive_callback;
i2c->arg = arg;
I2C_SLAVE_MUTEX_UNLOCK();
return ESP_OK;
}
esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t frequency, size_t rx_len, size_t tx_len) {
2021-10-09 11:30:20 +00:00
if(num >= SOC_I2C_NUM){
log_e("Invalid port num: %u", num);
return ESP_ERR_INVALID_ARG;
}
if (sda < 0 || scl < 0) {
log_e("invalid pins sda=%d, scl=%d", sda, scl);
return ESP_ERR_INVALID_ARG;
}
if(!frequency){
frequency = 100000;
} else if(frequency > 1000000){
frequency = 1000000;
}
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
perimanSetBusDeinit(ESP32_BUS_TYPE_I2C_SLAVE, i2cSlaveDetachBus);
if(!perimanSetPinBus(sda, ESP32_BUS_TYPE_INIT, NULL) || !perimanSetPinBus(scl, ESP32_BUS_TYPE_INIT, NULL)){
return false;
}
2021-10-09 11:30:20 +00:00
log_i("Initialising I2C Slave: sda=%d scl=%d freq=%d, addr=0x%x", sda, scl, frequency, slaveID);
i2c_slave_struct_t * i2c = &_i2c_bus_array[num];
esp_err_t ret = ESP_OK;
#if !CONFIG_DISABLE_HAL_LOCKS
if(!i2c->lock){
i2c->lock = xSemaphoreCreateMutex();
if (i2c->lock == NULL) {
log_e("RX queue create failed");
return ESP_ERR_NO_MEM;
}
}
#endif
I2C_SLAVE_MUTEX_LOCK();
i2c_slave_free_resources(i2c);
2021-10-09 11:30:20 +00:00
#if I2C_SLAVE_USE_RX_QUEUE
i2c->rx_queue = xQueueCreate(rx_len, sizeof(uint8_t));
if (i2c->rx_queue == NULL) {
log_e("RX queue create failed");
ret = ESP_ERR_NO_MEM;
goto fail;
}
#else
i2c->rx_ring_buf = xRingbufferCreate(rx_len, RINGBUF_TYPE_BYTEBUF);
if (i2c->rx_ring_buf == NULL) {
log_e("RX RingBuf create failed");
ret = ESP_ERR_NO_MEM;
goto fail;
}
#endif
i2c->tx_queue = xQueueCreate(tx_len, sizeof(uint8_t));
if (i2c->tx_queue == NULL) {
log_e("TX queue create failed");
ret = ESP_ERR_NO_MEM;
goto fail;
}
i2c->event_queue = xQueueCreate(16, sizeof(i2c_slave_queue_event_t));
if (i2c->event_queue == NULL) {
log_e("Event queue create failed");
ret = ESP_ERR_NO_MEM;
goto fail;
}
xTaskCreate(i2c_slave_task, "i2c_slave_task", 4096, i2c, 20, &i2c->task_handle);
if(i2c->task_handle == NULL){
log_e("Event thread create failed");
ret = ESP_ERR_NO_MEM;
goto fail;
}
if (frequency == 0) {
frequency = 100000L;
}
frequency = (frequency * 5) / 4;
if (i2c->num == 0) {
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
periph_ll_enable_clk_clear_rst(PERIPH_I2C0_MODULE);
2021-10-09 11:30:20 +00:00
#if SOC_I2C_NUM > 1
} else {
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
periph_ll_enable_clk_clear_rst(PERIPH_I2C1_MODULE);
2021-10-09 11:30:20 +00:00
#endif
}
i2c_ll_slave_init(i2c->dev);
i2c_ll_set_fifo_mode(i2c->dev, true);
i2c_ll_set_slave_addr(i2c->dev, slaveID, false);
i2c_ll_set_tout(i2c->dev, I2C_LL_MAX_TIMEOUT);
2021-10-09 11:30:20 +00:00
i2c_slave_set_frequency(i2c, frequency);
if (!i2c_slave_check_line_state(sda, scl)) {
log_e("bad pin state");
ret = ESP_FAIL;
goto fail;
}
i2c_slave_attach_gpio(i2c, sda, scl);
if (i2c_ll_is_bus_busy(i2c->dev)) {
log_w("Bus busy, reinit");
ret = ESP_FAIL;
goto fail;
}
i2c_ll_disable_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
i2c_ll_clear_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
2021-10-09 11:30:20 +00:00
i2c_ll_set_fifo_mode(i2c->dev, true);
if (!i2c->intr_handle) {
uint32_t flags = ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED;
if(i2c->num == 0) {
ret = esp_intr_alloc(ETS_I2C_EXT0_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
#if SOC_I2C_NUM > 1
} else {
ret = esp_intr_alloc(ETS_I2C_EXT1_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
#endif
}
if (ret != ESP_OK) {
log_e("install interrupt handler Failed=%d", ret);
goto fail;
}
}
i2c_ll_txfifo_rst(i2c->dev);
i2c_ll_rxfifo_rst(i2c->dev);
i2c_ll_slave_enable_rx_it(i2c->dev);
i2c_ll_set_stretch(i2c->dev, 0x3FF);
i2c_ll_update(i2c->dev);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
if(!perimanSetPinBus(sda, ESP32_BUS_TYPE_I2C_SLAVE, (void *)(i2c->num+1)) || !perimanSetPinBus(scl, ESP32_BUS_TYPE_I2C_SLAVE, (void *)(i2c->num+1))){
i2cSlaveDetachBus((void *)(i2c->num+1));
ret = ESP_FAIL;
}
2021-10-09 11:30:20 +00:00
I2C_SLAVE_MUTEX_UNLOCK();
return ret;
fail:
i2c_slave_free_resources(i2c);
2021-10-09 11:30:20 +00:00
I2C_SLAVE_MUTEX_UNLOCK();
return ret;
}
esp_err_t i2cSlaveDeinit(uint8_t num){
if(num >= SOC_I2C_NUM){
log_e("Invalid port num: %u", num);
return ESP_ERR_INVALID_ARG;
}
i2c_slave_struct_t * i2c = &_i2c_bus_array[num];
#if !CONFIG_DISABLE_HAL_LOCKS
if(!i2c->lock){
log_e("Lock is not initialized! Did you call i2c_slave_init()?");
return ESP_ERR_NO_MEM;
}
#endif
I2C_SLAVE_MUTEX_LOCK();
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
int scl = i2c->scl;
int sda = i2c->sda;
i2c_slave_free_resources(i2c);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
perimanSetPinBus(scl, ESP32_BUS_TYPE_INIT, NULL);
perimanSetPinBus(sda, ESP32_BUS_TYPE_INIT, NULL);
I2C_SLAVE_MUTEX_UNLOCK();
return ESP_OK;
}
size_t i2cSlaveWrite(uint8_t num, const uint8_t *buf, uint32_t len, uint32_t timeout_ms) {
2021-10-09 11:30:20 +00:00
if(num >= SOC_I2C_NUM){
log_e("Invalid port num: %u", num);
return 0;
}
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
uint32_t to_queue = 0, to_fifo = 0;
2021-10-09 11:30:20 +00:00
i2c_slave_struct_t * i2c = &_i2c_bus_array[num];
#if !CONFIG_DISABLE_HAL_LOCKS
if(!i2c->lock){
log_e("Lock is not initialized! Did you call i2c_slave_init()?");
return ESP_ERR_NO_MEM;
}
#endif
2021-10-09 11:30:20 +00:00
if(!i2c->tx_queue){
return 0;
}
I2C_SLAVE_MUTEX_LOCK();
#if CONFIG_IDF_TARGET_ESP32
i2c_ll_slave_disable_tx_it(i2c->dev);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
uint32_t txfifo_len = 0;
i2c_ll_get_txfifo_len(i2c->dev, &txfifo_len);
if (txfifo_len < SOC_I2C_FIFO_LEN) {
2021-10-09 11:30:20 +00:00
i2c_ll_txfifo_rst(i2c->dev);
}
#endif
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
i2c_ll_get_txfifo_len(i2c->dev, &to_fifo);
if(to_fifo){
if(len < to_fifo){
to_fifo = len;
2021-10-09 11:30:20 +00:00
}
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
i2c_ll_write_txfifo(i2c->dev, (uint8_t*)buf, to_fifo);
buf += to_fifo;
len -= to_fifo;
//reset tx_queue
xQueueReset(i2c->tx_queue);
//write the rest of the bytes to the queue
if(len){
to_queue = uxQueueSpacesAvailable(i2c->tx_queue);
if(len < to_queue){
to_queue = len;
}
for (size_t i = 0; i < to_queue; i++) {
if (xQueueSend(i2c->tx_queue, &buf[i], timeout_ms / portTICK_PERIOD_MS) != pdTRUE) {
xQueueReset(i2c->tx_queue);
to_queue = 0;
break;
}
}
//no need to enable TX_EMPTY if tx_queue is empty
if(to_queue){
i2c_ll_slave_enable_tx_it(i2c->dev);
2021-10-09 11:30:20 +00:00
}
}
}
I2C_SLAVE_MUTEX_UNLOCK();
return to_queue + to_fifo;
}
//=====================================================================================================================
//-------------------------------------- Private Functions ------------------------------------------------------------
//=====================================================================================================================
static void i2c_slave_free_resources(i2c_slave_struct_t * i2c){
i2c_slave_detach_gpio(i2c);
i2c_ll_set_slave_addr(i2c->dev, 0, false);
i2c_ll_disable_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
i2c_ll_clear_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
if (i2c->intr_handle) {
esp_intr_free(i2c->intr_handle);
i2c->intr_handle = NULL;
}
if(i2c->task_handle){
vTaskDelete(i2c->task_handle);
i2c->task_handle = NULL;
}
#if I2C_SLAVE_USE_RX_QUEUE
if (i2c->rx_queue) {
vQueueDelete(i2c->rx_queue);
i2c->rx_queue = NULL;
}
#else
if (i2c->rx_ring_buf) {
vRingbufferDelete(i2c->rx_ring_buf);
i2c->rx_ring_buf = NULL;
}
#endif
if (i2c->tx_queue) {
vQueueDelete(i2c->tx_queue);
i2c->tx_queue = NULL;
}
if (i2c->event_queue) {
vQueueDelete(i2c->event_queue);
i2c->event_queue = NULL;
}
i2c->rx_data_count = 0;
}
2021-10-09 11:30:20 +00:00
static bool i2c_slave_set_frequency(i2c_slave_struct_t * i2c, uint32_t clk_speed)
{
if (i2c == NULL) {
log_e("no control buffer");
return false;
}
if(clk_speed > 1100000UL){
clk_speed = 1100000UL;
}
// Adjust Fifo thresholds based on frequency
uint32_t a = (clk_speed / 50000L) + 2;
log_d("Fifo thresholds: rx_fifo_full = %d, tx_fifo_empty = %d", SOC_I2C_FIFO_LEN - a, a);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
i2c_hal_clk_config_t clk_cal;
2021-10-09 11:30:20 +00:00
#if SOC_I2C_SUPPORT_APB
i2c_ll_cal_bus_clk(APB_CLK_FREQ, clk_speed, &clk_cal);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
i2c_ll_set_source_clk(i2c->dev, SOC_MOD_CLK_APB); /*!< I2C source clock from APB, 80M*/
2021-10-09 11:30:20 +00:00
#elif SOC_I2C_SUPPORT_XTAL
i2c_ll_cal_bus_clk(XTAL_CLK_FREQ, clk_speed, &clk_cal);
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
i2c_ll_set_source_clk(i2c->dev, SOC_MOD_CLK_XTAL); /*!< I2C source clock from XTAL, 40M */
2021-10-09 11:30:20 +00:00
#endif
i2c_ll_set_txfifo_empty_thr(i2c->dev, a);
i2c_ll_set_rxfifo_full_thr(i2c->dev, SOC_I2C_FIFO_LEN - a);
i2c_ll_set_bus_timing(i2c->dev, &clk_cal);
i2c_ll_set_filter(i2c->dev, 3);
return true;
}
static void i2c_slave_delay_us(uint64_t us)
{
uint64_t m = esp_timer_get_time();
if (us) {
uint64_t e = (m + us);
if (m > e) { //overflow
while ((uint64_t)esp_timer_get_time() > e);
}
while ((uint64_t)esp_timer_get_time() < e);
}
}
static void i2c_slave_gpio_mode(int8_t pin, gpio_mode_t mode)
{
gpio_config_t conf = {
.pin_bit_mask = 1LL << pin,
.mode = mode,
.pull_up_en = GPIO_PULLUP_ENABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_DISABLE
};
gpio_config(&conf);
}
static bool i2c_slave_check_line_state(int8_t sda, int8_t scl)
{
if (sda < 0 || scl < 0) {
return false;//return false since there is nothing to do
}
// if the bus is not 'clear' try the cycling SCL until SDA goes High or 9 cycles
gpio_set_level(sda, 1);
gpio_set_level(scl, 1);
i2c_slave_gpio_mode(sda, GPIO_MODE_INPUT | GPIO_MODE_DEF_OD);
i2c_slave_gpio_mode(scl, GPIO_MODE_INPUT | GPIO_MODE_DEF_OD);
gpio_set_level(scl, 1);
if (!gpio_get_level(sda) || !gpio_get_level(scl)) { // bus in busy state
log_w("invalid state sda(%d)=%d, scl(%d)=%d", sda, gpio_get_level(sda), scl, gpio_get_level(scl));
for (uint8_t a=0; a<9; a++) {
i2c_slave_delay_us(5);
if (gpio_get_level(sda) && gpio_get_level(scl)) { // bus recovered
log_w("Recovered after %d Cycles",a);
gpio_set_level(sda,0); // start
i2c_slave_delay_us(5);
for (uint8_t a=0;a<9; a++) {
gpio_set_level(scl,1);
i2c_slave_delay_us(5);
gpio_set_level(scl,0);
i2c_slave_delay_us(5);
}
gpio_set_level(scl,1);
i2c_slave_delay_us(5);
gpio_set_level(sda,1); // stop
break;
}
gpio_set_level(scl, 0);
i2c_slave_delay_us(5);
gpio_set_level(scl, 1);
}
}
if (!gpio_get_level(sda) || !gpio_get_level(scl)) { // bus in busy state
log_e("Bus Invalid State, Can't init sda=%d, scl=%d",gpio_get_level(sda),gpio_get_level(scl));
return false; // bus is busy
}
return true;
}
static bool i2c_slave_attach_gpio(i2c_slave_struct_t * i2c, int8_t sda, int8_t scl)
{
if (i2c == NULL) {
log_e("no control block");
return false;
}
if ((sda < 0)||( scl < 0)) {
log_e("bad pins sda=%d, scl=%d",sda,scl);
return false;
}
i2c->scl = scl;
gpio_set_level(scl, 1);
i2c_slave_gpio_mode(scl, GPIO_MODE_INPUT_OUTPUT_OD);
gpio_matrix_out(scl, I2C_SCL_IDX(i2c->num), false, false);
gpio_matrix_in(scl, I2C_SCL_IDX(i2c->num), false);
i2c->sda = sda;
gpio_set_level(sda, 1);
i2c_slave_gpio_mode(sda, GPIO_MODE_INPUT_OUTPUT_OD);
gpio_matrix_out(sda, I2C_SDA_IDX(i2c->num), false, false);
gpio_matrix_in(sda, I2C_SDA_IDX(i2c->num), false);
return true;
}
static bool i2c_slave_detach_gpio(i2c_slave_struct_t * i2c)
{
if (i2c == NULL) {
log_e("no control Block");
return false;
}
if (i2c->scl >= 0) {
gpio_matrix_out(i2c->scl, 0x100, false, false);
gpio_matrix_in(0x30, I2C_SCL_IDX(i2c->num), false);
i2c_slave_gpio_mode(i2c->scl, GPIO_MODE_INPUT);
i2c->scl = -1; // un attached
}
if (i2c->sda >= 0) {
gpio_matrix_out(i2c->sda, 0x100, false, false);
gpio_matrix_in(0x30, I2C_SDA_IDX(i2c->num), false);
i2c_slave_gpio_mode(i2c->sda, GPIO_MODE_INPUT);
i2c->sda = -1; // un attached
}
return true;
}
static bool i2c_slave_send_event(i2c_slave_struct_t * i2c, i2c_slave_queue_event_t* event)
{
bool pxHigherPriorityTaskWoken = false;
if(i2c->event_queue) {
if(xQueueSendFromISR(i2c->event_queue, event, (BaseType_t * const)&pxHigherPriorityTaskWoken) != pdTRUE){
//log_e("event_queue_full");
2021-10-09 11:30:20 +00:00
}
}
return pxHigherPriorityTaskWoken;
}
static bool i2c_slave_handle_tx_fifo_empty(i2c_slave_struct_t * i2c)
{
bool pxHigherPriorityTaskWoken = false;
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
uint32_t d = 0, moveCnt = 0;
i2c_ll_get_txfifo_len(i2c->dev, &moveCnt);
2021-10-09 11:30:20 +00:00
while (moveCnt > 0) { // read tx queue until Fifo is full or queue is empty
if(xQueueReceiveFromISR(i2c->tx_queue, &d, (BaseType_t * const)&pxHigherPriorityTaskWoken) == pdTRUE){
i2c_ll_write_txfifo(i2c->dev, (uint8_t*)&d, 1);
moveCnt--;
} else {
i2c_ll_slave_disable_tx_it(i2c->dev);
break;
}
}
return pxHigherPriorityTaskWoken;
}
static bool i2c_slave_handle_rx_fifo_full(i2c_slave_struct_t * i2c, uint32_t len)
{
#if I2C_SLAVE_USE_RX_QUEUE
uint32_t d = 0;
#else
uint8_t data[SOC_I2C_FIFO_LEN];
#endif
bool pxHigherPriorityTaskWoken = false;
#if I2C_SLAVE_USE_RX_QUEUE
while (len > 0) {
i2c_ll_read_rxfifo(i2c->dev, (uint8_t*)&d, 1);
if(xQueueSendFromISR(i2c->rx_queue, &d, (BaseType_t * const)&pxHigherPriorityTaskWoken) != pdTRUE){
log_e("rx_queue_full");
} else {
i2c->rx_data_count++;
}
if (--len == 0) {
len = i2c_ll_get_rxfifo_cnt(i2c->dev);
}
#else
if(len){
i2c_ll_read_rxfifo(i2c->dev, data, len);
if(xRingbufferSendFromISR(i2c->rx_ring_buf, (void*) data, len, (BaseType_t * const)&pxHigherPriorityTaskWoken) != pdTRUE){
log_e("rx_ring_buf_full");
} else {
i2c->rx_data_count += len;
}
#endif
}
return pxHigherPriorityTaskWoken;
}
static void i2c_slave_isr_handler(void* arg)
{
bool pxHigherPriorityTaskWoken = false;
i2c_slave_struct_t * i2c = (i2c_slave_struct_t *) arg; // recover data
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
uint32_t activeInt = 0;
i2c_ll_get_intr_mask(i2c->dev, &activeInt);
i2c_ll_clear_intr_mask(i2c->dev, activeInt);
uint32_t rx_fifo_len = 0;
i2c_ll_get_rxfifo_cnt(i2c->dev, &rx_fifo_len);
2021-10-09 11:30:20 +00:00
bool slave_rw = i2c_ll_slave_rw(i2c->dev);
if(activeInt & I2C_RXFIFO_WM_INT_ENA){ // RX FiFo Full
pxHigherPriorityTaskWoken |= i2c_slave_handle_rx_fifo_full(i2c, rx_fifo_len);
i2c_ll_slave_enable_rx_it(i2c->dev);//is this necessary?
}
if(activeInt & I2C_TRANS_COMPLETE_INT_ENA){ // STOP
if(rx_fifo_len){ //READ RX FIFO
pxHigherPriorityTaskWoken |= i2c_slave_handle_rx_fifo_full(i2c, rx_fifo_len);
}
if(i2c->rx_data_count){ //WRITE or RepeatedStart
2021-10-09 11:30:20 +00:00
//SEND RX Event
i2c_slave_queue_event_t event;
event.event = I2C_SLAVE_EVT_RX;
event.stop = !slave_rw;
event.param = i2c->rx_data_count;
pxHigherPriorityTaskWoken |= i2c_slave_send_event(i2c, &event);
//Zero RX count
i2c->rx_data_count = 0;
}
if(slave_rw){ // READ
#if CONFIG_IDF_TARGET_ESP32
if(i2c->dev->status_reg.scl_main_state_last == 6){
//SEND TX Event
i2c_slave_queue_event_t event;
event.event = I2C_SLAVE_EVT_TX;
pxHigherPriorityTaskWoken |= i2c_slave_send_event(i2c, &event);
}
2021-10-09 11:30:20 +00:00
#else
//reset TX data
i2c_ll_txfifo_rst(i2c->dev);
uint8_t d;
while (xQueueReceiveFromISR(i2c->tx_queue, &d, (BaseType_t * const)&pxHigherPriorityTaskWoken) == pdTRUE) ;//flush partial write
#endif
}
}
#ifndef CONFIG_IDF_TARGET_ESP32
if(activeInt & I2C_SLAVE_STRETCH_INT_ENA){ // STRETCH
i2c_stretch_cause_t cause = i2c_ll_stretch_cause(i2c->dev);
if(cause == I2C_STRETCH_CAUSE_MASTER_READ){
//on C3 RX data dissapears with repeated start, so we need to get it here
if(rx_fifo_len){
pxHigherPriorityTaskWoken |= i2c_slave_handle_rx_fifo_full(i2c, rx_fifo_len);
}
//SEND TX Event
i2c_slave_queue_event_t event;
event.event = I2C_SLAVE_EVT_TX;
pxHigherPriorityTaskWoken |= i2c_slave_send_event(i2c, &event);
//will clear after execution
} else if(cause == I2C_STRETCH_CAUSE_TX_FIFO_EMPTY){
pxHigherPriorityTaskWoken |= i2c_slave_handle_tx_fifo_empty(i2c);
i2c_ll_stretch_clr(i2c->dev);
} else if(cause == I2C_STRETCH_CAUSE_RX_FIFO_FULL){
pxHigherPriorityTaskWoken |= i2c_slave_handle_rx_fifo_full(i2c, rx_fifo_len);
i2c_ll_stretch_clr(i2c->dev);
}
}
#endif
if(activeInt & I2C_TXFIFO_WM_INT_ENA){ // TX FiFo Empty
pxHigherPriorityTaskWoken |= i2c_slave_handle_tx_fifo_empty(i2c);
}
if(pxHigherPriorityTaskWoken){
portYIELD_FROM_ISR();
}
}
static size_t i2c_slave_read_rx(i2c_slave_struct_t * i2c, uint8_t * data, size_t len){
if(!len){
return 0;
}
#if I2C_SLAVE_USE_RX_QUEUE
uint8_t d = 0;
BaseType_t res = pdTRUE;
for(size_t i=0; i<len; i++) {
if(data){
res = xQueueReceive(i2c->rx_queue, &data[i], 0);
} else {
res = xQueueReceive(i2c->rx_queue, &d, 0);
}
if (res != pdTRUE) {
log_e("Read Queue(%u) Failed", i);
len = i;
break;
}
}
return (data)?len:0;
#else
size_t dlen = 0,
to_read = len,
so_far = 0,
available = 0;
uint8_t * rx_data = NULL;
vRingbufferGetInfo(i2c->rx_ring_buf, NULL, NULL, NULL, NULL, &available);
if(available < to_read){
log_e("Less available than requested. %u < %u", available, len);
to_read = available;
}
while(to_read){
dlen = 0;
rx_data = (uint8_t *)xRingbufferReceiveUpTo(i2c->rx_ring_buf, &dlen, 0, to_read);
if(!rx_data){
log_e("Receive %u Failed", to_read);
return so_far;
}
if(data){
memcpy(data+so_far, rx_data, dlen);
}
vRingbufferReturnItem(i2c->rx_ring_buf, rx_data);
so_far+=dlen;
to_read-=dlen;
}
return (data)?so_far:0;
#endif
}
static void i2c_slave_task(void *pv_args)
{
i2c_slave_struct_t * i2c = (i2c_slave_struct_t *)pv_args;
i2c_slave_queue_event_t event;
size_t len = 0;
bool stop = false;
uint8_t * data = NULL;
for(;;){
if(xQueueReceive(i2c->event_queue, &event, portMAX_DELAY) == pdTRUE){
// Write
if(event.event == I2C_SLAVE_EVT_RX){
len = event.param;
stop = event.stop;
data = (len > 0)?(uint8_t*)malloc(len):NULL;
if(len && data == NULL){
log_e("Malloc (%u) Failed", len);
}
len = i2c_slave_read_rx(i2c, data, len);
if(i2c->receive_callback){
i2c->receive_callback(i2c->num, data, len, stop, i2c->arg);
}
free(data);
// Read
} else if(event.event == I2C_SLAVE_EVT_TX){
if(i2c->request_callback){
i2c->request_callback(i2c->num, i2c->arg);
}
i2c_ll_stretch_clr(i2c->dev);
}
}
}
vTaskDelete(NULL);
}
ESP-IDF v5.1 (#7733) * Initial changes to compile under ESP-IDF v5.1 * Initial import for ESP-IDF v5.1 libs * Update toolchain * Update esp32-hal-psram.c * Add missing LDs * Update platform.txt * Stop some CI jobs, because they will always fail * Fix examples * Update app_httpd.cpp * Update ResetReason.ino * Warnings fixes * Added the example guideline and template (#7665) * Added the example guideline and template * PR review changes with some typos and grammar fixes * Changes according to the PR review * Added ESP32-S3 link to the datasheet (#7738) * Update HiFreq_ADC.ino * Replace periph_ctrl.h use because of deprecation * Replace esp_spi_flash.h use because of deprecation * Add includes to male mDNS::enableWorkstation compile * Fix ssl_client mbedtls_pk_parse_key callback * Update temperature sensor driver * Allow sketch_utils to compile with arduino-cli * Run CI with arduino-cli * Fix arduino-cli CI build on Windows * Refactor platform.txt to not use components installed through the board manager when running from git * Initial Peripheral Manager Implementation * Update SigmaDelta driver to use the new ESP-IDF driver API * Small improvements to peripheral manager and SigmaDelta * Remove deleted function from SigmaDelta header * Update DAC driver to use the new ESP-IDF driver API * Adds softAp(String) to make it compatible with ESP8266 (#7801) * Fix commentary (#7800) Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611 * add adafruit new board feather esp32s2 reserve tft (#7794) * bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) * Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735) * Added VALTRACK-V4-VTS-ESP32-C3 board definition Created pins_arduino.h & made changes to boards.txt with necessary changes * Modified the URL * Renamed json * renamed all auRL * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Adding VALTRACK-V4 series board definitions Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants * Reverted package_esp32_index.template.json restored package_esp32_index.template.json from edits * Reverted package_esp32_index.template.json Added new line to package_esp32_index.template.json * Update Platformio CI (#7725) * WiFiClient example fix (#7711) * Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun * Moved instructions to README * Fixed spelling * Added link to S3 datasheet --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Mirror update from Heltec repository (#7709) Heltec updated the I2C pins in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/commit/b10f4bf85d13fd01be80dcdb0eb59e6a8c8ba19a * Fixes BLE data printing (#7699) * Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call * split menu options + lora_32_V3 fix (#7697) * Change header gaurd name (#7696) * Fix Name (#7691) Wrong name in definitions. * Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686) * Update WiFiClient.cpp This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments. * Make parameter timeout_ms clear * Change connection timeout_ms name for clarity --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * fixed the function header (#7674) * fixed the function header * fixed function name and paramaters --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Ticker fix solving #6155 (#7664) * Wrapped Ticker functions with #pragma disabling -Wcast-function-type * Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type" This reverts commit 160be7e67a10d01b6e44c4bf2521c0ccd6348976. * Fixed Ticker example * Modified Ticker example * Fixed LED_BUILTIN err for ESP32 --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * setPins fix ESP32 "specified pins are not supported by this chip." (#7646) [ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.] setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working. I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> * Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643) * Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636) Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Expand path to tinuf2 image when checking existence in platformio-build.py (#7631) * Expand path to tinuf2 image when checking existence * More isFiles fixed * Remove (useless) trailing semicolon from Print.cpp (#7622) * ADD: New variant Edgebox-ESP-100 (#7771) * ADD: New variant Edgebox-ESP-100 * FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3 * Add Crabik Slot ESP32-S3 board (#7790) * Added Crabik Slot ESP32-S3 * Adding CPU frequency settings and removing excess from partition scheme settings * new variant LilyGO T-Display-S3 (#7763) * new variant LilyGO T-Display-S3 https://github.com/Xinyuan-LilyGO/T-Display-S3 * Add boards.txt definition --------- Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * Update get.py to support Apple ARM64 * Update package_esp32_index.template.json * WString Return bool (#7774) * Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne <rene.bohne@gmail.com> * Reword "ESP-IDF as Component" (#7812) I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of "ESP-IDF as Component" is more correct way to name the link. 1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around. 2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well. - Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized. * add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811) * Multi threading examples (tasks, queues, semaphores, mutexes) (#7660) * Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading * Added dummy files * Modified original example * Fixed BasicMultiThreading.ino * Added Example demonstrating use of queues * Extended info in BasicMultiThreading * Renamed Queues to singular Queue * Added Mutex example * Added Semaphore example * Moved info from example to README * Moved doc from Mutex to README * Added Queue README * Removed unecesary text * Fixed grammar * Increased stack size for Sempahore example * Added headers into .ino files * Added word Example at the end of title in README * removed unused line * Added forgotten README * Modified BasicMultiThreading example * Added missing S3 entry in README * moved location * Update ESP-IDF libs * Update CMakeLists.txt * Update esptool to v4.4 * Add function timerAttachInterruptFlag (#7809) * Update esptool to v4.5 * ADC refactoring (#7827) * Adc refactored + periman implementation Peripheral manager still needs to be checked if the implementation is right. * switched to working solution for milivolts read * Periman detachbus fix * coding style * fix CI warnings * fix FreeRTOS example * Update ETH.cpp * Update FunctionalInterruptStruct.ino * Update package_esp32_index.template.json * Update package_esp32_index.template.json * Fixes for the latest IDF v5.1 * update esp-idf libs and toolchain * Turn OFF auto crystal frequency for ESP32 (needed by TWAI) * Update examples * Switch build to mostly use flags from files Includes can not be done this way * Reorganize flag files * Optimize chip build flags further * Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand * Add support for includes and defines from file * Replace old sdk path references in platform.txt * use gcc-ar (#8013) * Makes F_CPU generic for all SoC (#8007) Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC. * TIMER refactoring (#7904) * refactor using GPtimer * Updated timer HW test * fix examples * Add v2.0.7 in issue template (#7871) * refactor using GPtimer * Updated timer HW test * fix examples * Revert "Add v2.0.7 in issue template (#7871)" This reverts commit fcc3b17d62ff57861f8913ca1f142fd5163b7457. * Update upload-artifact to v3 in HW CI * Revert "Update upload-artifact to v3 in HW CI" This reverts commit 1ba228071718ba37c4e26d98db22f77b2a7364a6. * replace resolution with frequency * remove count_down option * countup removed from examples + header * Refactored timer object * code cleanup + examples and tests fixes * TimerAlarm fix --------- Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> * [Docs] ADC and Timer API Update (+some docs fixes) (#7906) * updated docs * remove hall sensor docs Removed Hall sensor documentation as its no longer supported in IDF-5 * Fixed ESPNow examples location in docs * Last timer refactored API + gpio small fix * AlarmWrite fix * Fixes APLL/PLL with RTC Frequency (#8025) log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors. * Update IDF libs and fix OPI PSRAM on S3 * Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935) * Added setMode function to set the esp32 uart mode Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips. * Add Success (bool) return in some functions * Add Success (bool) return code to some functions * Add Success (bool) return to some functions * Add Success (bool) return to some functions * Fix uartSetRxTimeout return type --------- Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Add support for esp-elf-gdb * WFG Crashfix (#8044) * Update component libs * IDF release/v5.1 (#8061) * IDF release/v5.1 bb9200acec * Update Esp.cpp * IDF release/v5.1 420ebd208a * Update esp32-hal-psram.c * Switch SDK to be an external package * fix path (#8096) * Makes UART work at any APB Frequency (#8097) Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes. * Add required callbacks for TinyUSB DFU * Update version to 3.0.0 * Add ESP.getCoreVersion() and update ESP.getChipModel() * Update timer hal for the latest 5.1 * Use separate RX and TX buffer sizes in HTTP client optimizes download by allowing up to 4K packets to be received * Rename clock tree enum name in latest 5.1 * ESP32-H4 support was removed in ESP-IDF v5.1 * IDF release/v5.1 2004bf4e11 (#8165) * Deinit previous bus first (#8180) * TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135) * Add timer_started flag and stop before disable * Fix timer HW test * TOUCH - Peripheral manager implementation (#8129) * Touch periman implemented * Deinit previous bus first * LEDC Refactoring - Peripheral manager implemented (#8126) * LEDC periman implementation * Fix examples * Rework tone * Update ledc docs * fix missing bracket * Update analog funtions esp32-hal.h * Update CameraWebServer example * Fix HiFreq_ADC example * minor fixes - typos * Avoid calling tone/notone when tone already runs on dif. pin * Remove unused channels_resolution * GPIO - Peripheral manager implementation (#8179) * periman-implementation * fix RGB_BUILTIN and remove space * Enforces more consistency into Peripheral Manager (#8188) * Avoid log_i() message the first time a bus is assigned * Prevent operation with ESP32_BUS_TYPE_INIT * keeps coding style * do not print messages on INIT bus type * [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994) * RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API * Update PlatformIO scripts for the upcoming 3.0 core (#8183) * Update PlatformIO scripts for the upcoming 3.0 core * Dynamically select proper framework-arduinoespressif32-libs package With this change the dev-platform will be dynamically configured to pull the latest .zip package with precompiled libraries from extracted from package_esp32_index.template.json * free memory on detach (#8264) * SPI - Peripheral manager implementation (#8255) * spi periman implementation * fix header file * remove unused struct * fix missing braces * Update esp32-hal-rmt.c (#8216) Optimizing Peripheral Manager Test * I2C - Peripheral manager implementation (#8220) * i2c-master periman initial commit * i2c-master make detachbus static + comment remove * i2c-slave periman implementation * SetPinBus to INIT on i2cDeinits * Fix slave pins deinit * remove dbg logs * set ret to ESP_FAIL instead of returning * Fix warnings in hal-spi caused by pariman transition * Update esptool.py to version 4.6 * Add platform support for ESP_SR * Add USB Type and valid pin check to periman * replace bus with spi->num+1 (#8279) * Remove default pins from SPI HAL * Add commented out handlers for esptool.js in TinyUSB CDC For future use * Add build defines for host os and fqbn (for debug purposes) * Provide proper memory caps total size * Update Esp.cpp * SDMMC - Peripheral manager implementation (#8289) * sdmmc periman implemented * save pins when SOC_SDMMC_USE_IOMUX * IDF release/v5.1 4bc762621d (#8292) * Adds missing pinMode (#8312) * Adds missing pinMode The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO. * Update KeyboardLogout.ino Adds <buttonPin> to keep code standard * Update KeyboardReprogram.ino Adds <buttonPin> to keep code standard * LEDC Fade implementation (#8338) * fade API + pointer fixes * Add fade api * Add fade example * update ledc docs * remove unused variables * fix path to example * Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335) * ETHERNET - Peripheral manager implementation (#8297) * Peripheral manager implemented * remove unused variable * Add all RMII pins * fix typo * Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328) * Do not limit ETHERNET in periman to only ESP32. SPI is also an option * Initial support for ESP32-C6 (#8337) * Add checks for SOC defines (#8351) * Add checks for SOC defines * Add SoC checks to BLE library * fix i2c compilation error * fix wrong placement of include * add check to SPI library * add check to USB library * add checks to Wire library * Feature/esp32h2 support (#8373) * Initial support for ESP32H2 * Additional changes for ESP32H2 * Update libs for ESP32H2 * Fix flashing on ESP32-H2 * Fix GPIO Configs for ESP32-C6 and ESP32-H2 * Update Timer test sketch * Fix upload flash parameters * Use ets_write_char_uart instead of ets_printf in log_printfv * Print full chip report when log level is sufficient (#8282) * ESP32-C3 does not have ets_write_char_uart * Fix BLE gap event name * HW Testing - Pytest update (#8389) * update tests requirements * remove already handled components * Update version of pytest * Add missing ESP32-H2 to hil.yml * Updated FreeRTOS names (#8418) * HW Testing - ESP32-C6 + ESP32-H2 fixes (#8404) * add C6/H2 to tests cfg.json * remove , * workflow runs-on runner by matrix * Add need for arduino tag to select runner * Add cryptography to requirements.txt * Removed duplicate TX1 define for H2 (#8402) * Fix broken examples * Fixes RMT filter & idle timing and setup (#8359) * Fixes Filter and Idle parameter to uint32 * Fixes Filter and Idle setup * Fixes it to 5.1Libs branch * fix RMT CLK source and Filter API * fixes missing ; * fixes missing ; * fixes RMT example * IDF release/v5.1 a7b62bbcaf (#8438) * Add workflow to build executables from python scripts (#8290) * Add workflow to build executables from python scripts * Push binary to tools * Enable executable signing on Windows * Update get.py * Push binary to tools * Try with multiple files * Try more actions * Try powershell * Restore tools so they do not get rebuilt * Finalize scripts * Push binary to tools * App rollback should be after PSRAM is initialized * Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs. * Fixes Memory Leak (#8486) * fixes preprocessor test (#8485) * fixes preprocessor test When using `#define USE_SOFT_AP` Change `&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)` * Adds any BLE capable device in WiFiProv.ino Removing ESP32 restriction for BLE Provisioning. * fix flash mode read out for C6 * Add option for custom partitions without restrictions * SD_MMC update (#8298) * Updated SD_MMC lib and examples * Removed getter implementation and commented usage in examples * squashed updates * IDF release/v5.1 f0437b945f (#8599) * Update package_esp32_index.template.json * Fix printf format build error in BTAdvertisedDeviceSet.cpp --------- Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com> Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Ha Thach <thach@tinyusb.org> Co-authored-by: Martin Turski <quiret@vfemail.net> Co-authored-by: raviypujar <raviypujar@gmail.com> Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com> Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: Daniel Berlin <dberlin@dberlin.org> Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com> Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com> Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com> Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com> Co-authored-by: Krzysiek S <chris.streh@gmail.com> Co-authored-by: surt <carl.olsson@gmail.com> Co-authored-by: Max Scheffler <max.scheffler@pm.me> Co-authored-by: Clemens Kirchgatterer <clemens@1541.org> Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com> Co-authored-by: Roman <programmeofficemilkyway@gmail.com> Co-authored-by: Eistee <Eistee82@users.noreply.github.com> Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Co-authored-by: renebohne <rene.bohne@gmail.com> Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com> Co-authored-by: davidk88 <david.kotar@gmail.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com> Co-authored-by: James Armstrong <jamesarmstrong3@me.com> Co-authored-by: Valerii Koval <valeros@users.noreply.github.com> Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 11:54:25 +00:00
static bool i2cSlaveDetachBus(void * bus_i2c_num){
uint8_t num = (int)bus_i2c_num - 1;
i2c_slave_struct_t * i2c = &_i2c_bus_array[num];
if (i2c->scl == -1 && i2c->sda == -1) {
return true;
}
esp_err_t err = i2cSlaveDeinit(num);
if(err != ESP_OK){
log_e("i2cSlaveDeinit failed with error: %d", err);
return false;
}
return true;
}
#endif /* SOC_I2C_SUPPORT_SLAVE */