Page 1 of 1

How to get the sdcard handler in the ADF read MP3 from sdcard example

Posted: Mon Jan 04, 2021 1:38 pm
by ihouses
Hi,

I am working with the ADF example play_sdcard_mp3_example in the Lyrat board.
I can play the test.mp3 but now I want to do operations with the SDcard like open files, list files... etc. Since the SDcard was initialized in
audio_board_sdcard_init(), how can I get the sdcard handler that is used in the IDF example? sdmmc_card_t

Re: How to get the sdcard handler in the ADF read MP3 from sdcard example

Posted: Tue May 10, 2022 4:45 pm
by Altivecer
Hi,

did you ever figure this out?
I'm running into the same issue.

Doug

Re: How to get the sdcard handler in the ADF read MP3 from sdcard example

Posted: Wed Jun 22, 2022 12:46 pm
by tempo.tian
You do not need to get sdcard handle.
You can call function in <stdio.h> directly to operate open, read, close file action using fopen, fclose etc.

Re: How to get the sdcard handler in the ADF read MP3 from sdcard example

Posted: Mon Jun 27, 2022 11:39 pm
by Altivecer
Just a note, you have to but "/sdcard/" in front of the file name

FILE *demo = fopen("/sdcard/demo.txt", "w+");

printf("demo = %u\n", (uint32_t)demo);
fprintf(demo, "This is a test");
fclose(demo);

works and creates a file on the SD Card.

Thank you so much.

Doug