Working on my first project with the ESP32 using ESP-IDF; the peripheral API documentation have a Thread safety section for each peripheral listing the thread safe functions. There is no such section on the GPIO API. Is gpio_set_level() function thread safe when called for different pins?
Example :TaskA controlling GPIO16 and TaskB controlling GPIO22
NB: The example uses the gpio_set_level() in one task and gpio_get_level() in separate task
GPIO functions thread safe
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: GPIO functions thread safe
Yes. The function uses the W1TS/W1TC registers specifically provided by the hardware for atomic updates to the GPIO outputs.Is gpio_set_level() function thread safe when called for different pins?
Who is online
Users browsing this forum: No registered users and 83 guests