-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gpio_matrix_in and gpio_matrix_out documentation is incorrect for esp32c3 (IDFGH-10490) #11737
Comments
The documentation for gpio_matrix_out on esp32c3 is incorrect (espressif/esp-idf#11737), and 0x80 needs to be used instead of 0x100. Add an #ifdef for all of the supported platforms and use the value listed in the TRM for each. The TRM for esp32h2 lists the GPIO Matrix documentation as "to be added later", so assume the previously used 0x100 value is correct for that platform. Fixes FastLED#1498
The MATRIX_DETACH_* values vary by platform, which is not documented in the gpio_matrix_out or gpio_matrix_in functions (espressif/esp-idf#11737). Use the correct values out of each TRM.
@colincross The |
why? doesn't this mean to connect the signal whose ID is |
Thanks for the pointers to |
Thanks for the explanation. BTW, you can switch to using the APIs provided by |
I also found |
The constants that need to be passed to gpio_matrix_in and gpio_matrix_out to detach an input or output pin from a peripheral vary by platform. Use SIG_GPIO_OUT_IDX to detach an output, and GPIO_MATRIX_CONST_ONE_INPUT and GPIO_MATRIX_CONST_ZERO_INPUT to detach an input. ESP32 before IDF 4.0 didn't define GPIO_MATRIX_CONST_*_INPUT, so add compatibility #defines for GPIO_FUNC_IN_LOW/HIGH. GPIO_FUNC_IN_LOW/HIGH exist in IDF 4.0+, but can't be used because they have the wrong values for ESP32-C3 at least in IDF 4.4.3 (espressif/esp-idf#11737).
The documentation for gpio_matrix_out on esp32c3 is incorrect (espressif/esp-idf#11737), and 0x80 needs to be used instead of 0x100. Use SIG_GPIO_OUT_IDX, which has the correct value on all platforms. Fixes FastLED#1498
The constants that need to be passed to gpio_matrix_in and gpio_matrix_out to detach an input or output pin from a peripheral vary by platform. Use SIG_GPIO_OUT_IDX to detach an output, and GPIO_MATRIX_CONST_ONE_INPUT and GPIO_MATRIX_CONST_ZERO_INPUT to detach an input. ESP32 before IDF 4.0 didn't define GPIO_MATRIX_CONST_*_INPUT, so add compatibility #defines for GPIO_FUNC_IN_LOW/HIGH. GPIO_FUNC_IN_LOW/HIGH exist in IDF 4.0+, but can't be used because they have the wrong values for ESP32-C3 at least in IDF 4.4.3 (espressif/esp-idf#11737).
@colincross Just wanted to say thank you for opening this issue. I think this may explain something that drove me nuts for weeks :) |
d:\Arduino\Sketchbook\libraries\FastLED\src\platforms\esp\32\clockless_rmt_esp32.cpp: In member function 'void ESP32RMTController::startOnChannel(int)': exit status 1 Compilation error: exit status 1 |
Answers checklist.
General issue report
The documentation for
gpio_matrix_out
states:The parameter passed here is written directly to the
GPIO_FUNCn_OUT_SEL_CFG_REG
register, which according to the ESP32-C3 TRM:The 0x100 value is correct for ESP32, but not for ESP32-C3. The same problem is also present in the ESP32-C6 copy of the file. Calling
gpio_matrix_out(pin, 0x100, 0, 0)
on ESP32-C3 results in connecting the output pin to signal 0, theSPIQ_out
peripheral, with theGPIO_FUNCn_OUT_INV_SEL
bit set.Similarly, the documentation for
gpio_matrix_in
states:but the TRM entry for
GPIO_FUNCn_IN_SEL_CFG_REG
says:Fixing the documentation would help, but even better would be to provide
#define
entries for these constants so that the same code can be used on multiple ESP32 platforms without having to#ifdef
each supported platform, and update the list of#ifdefs
each time a new ESP32 platform is released.The text was updated successfully, but these errors were encountered: