kopia lustrzana https://github.com/Aircoookie/WLED
				
				
				
			
				
					
						
							Co-authored-by: constantin wolf <constantin.wolf@pwc.com>  | 
			||
|---|---|---|
| .. | ||
| readme.md | ||
| usermod_sd_card.h | ||
		
			
				
				readme.md
			
		
		
			
			
		
	
	SD-card mod
Build
- modify 
platformio.iniand add to thebuild_flagsof your configuration the following - choose the way your SD is connected
- via 
-D WLED_USE_SD_MMCwhen connected via MMC - via 
-D WLED_USE_SD_SPIwhen connected via SPI (use usermod page to setup SPI pins) 
 - via 
 
Test
- enable 
-D SD_PRINT_HOME_DIRand-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 Cardoption effect default pinSourceSelectGPIO that is connected to SD's SS(source select) /CS(chip select)16 pinSourceClockGPIO that is connected to SD's SCLK(source clock) /CLK(clock)14 pinPociGPIO that is connected to SD's POCI☨ (Peripheral-Out-Ctrl-In) /MISO(deprecated)36 pinPicoGPIO that is connected to SD's PICO☨ (Peripheral-In-Ctrl-Out) /MOSI(deprecated)14 sdEnableEnable to read data from the SD-card true ☨Following new naming convention of OSHWA
 
Usage in other mods
- 
creates a macro
SD_ADAPTERwhich is either mapped toSDorSD_MMC(seeSD_Test.inohow to use SD / SD_MMC functions) - 
checks if the specified file is available on the SD card
bool file_onSD(const char *filepath) {...}