QUERY · ISSUE
[docs] clarify functions available in `esp32` per chip type
docs
Various functions of the esp32 module are not available, depending on the chip type, e.g. hall_sensor and raw_temperature are not available on a C3 chip.
The ESP32 module documentation should be clarified to cover these differences.
(this is a reminder to myself, to send some contributions here)
CANDIDATE · PULL REQUEST
esp32: Improve machine.SDCard support on newer chips
port-esp32
Summary
Updating the esp32 port machine.SDCard support for other chips:
- Added support for configuring pins in SD/MMC mode on ESP32-S3. Closes #8514. Closes #16526.
- Added support for SDCard in SPI mode on ESP32-S2, C3 and C6. This is a little restrictive on C3 and C6 as they only have one available SPI bus, so can't use this and
machine.SPItogether. Have enabled on all boards by default (the code size impact is about 4KB). - Explicitly disable slot 0 on original ESP32 (and document this). There are effectively zero ESP32 boards in the world that can use slot 0 for SDMMC.
This work was funded through GitHub sponsors
TODO
- Final docs pass
[ ] ESP32-S3 SDCard object should print the additonal pin configEDIT: Actually SDCard has no print support on esp32, so leaving this off.
Testing
Manual testing with SD card breakout module:
- ESP32-S3 in SDMMC mode with custom pins.
- ESP32-S3 in SPI mode on both hosts.
- ESP32-C3 in SPI mode.
- ESP32-C6 in SPI mode.
- ESP32-S2 in SPI mode on both hosts.
- ESP32 in SDMMC and SPI modes.
Note that testing is easier if cherry-picking #16700 fix into the branch.
Trade-offs and Alternatives
- Could drop the commit that enables SDCard on SPI-only chips if preferable, and update docs to suit. Although on balance I think it's still potentially useful.