f104fb0586
Co-authored-by: constantin wolf <constantin.wolf@pwc.com>
1.9 KiB
1.9 KiB
SD-card mod
Build
- modify
platformio.ini
and add to thebuild_flags
of your configuration the following - choose the way your SD is connected
- via
-D WLED_USE_SD_MMC
when connected via MMC - via
-D WLED_USE_SD_SPI
when connected via SPI (use usermod page to setup SPI pins)
- via
Test
- enable
-D SD_PRINT_HOME_DIR
and-D WLED_DEBUG
- this will print all files in
/
on boot via serial
Configuration
MMC
- The MMC port / pins needs no configuration as they are specified by Espressif
SPI
-
The SPI port / pins can be modified via the WLED web-UI:
Config → Usermod → SD Card
option effect default pinSourceSelect
GPIO that is connected to SD's SS
(source select) /CS
(chip select)16 pinSourceClock
GPIO that is connected to SD's SCLK
(source clock) /CLK
(clock)14 pinPoci
GPIO that is connected to SD's POCI
☨ (Peripheral-Out-Ctrl-In) /MISO
(deprecated)36 pinPico
GPIO that is connected to SD's PICO
☨ (Peripheral-In-Ctrl-Out) /MOSI
(deprecated)14 sdEnable
Enable to read data from the SD-card true ☨Following new naming convention of OSHWA
Usage in other mods
-
creates a macro
SD_ADAPTER
which is either mapped toSD
orSD_MMC
(seeSD_Test.ino
how to use SD / SD_MMC functions) -
checks if the specified file is available on the SD card
bool file_onSD(const char *filepath) {...}