diff --git a/README.md b/README.md index bb9d2e0ad5..38217227d5 100644 --- a/README.md +++ b/README.md @@ -538,7 +538,7 @@ The following sample code illustrates how to use the sd-driver Block Device API: // MISO (Master In Slave Out) // SCLK (Serial Clock) // CS (Chip Select) - SDBlockDevice sd(p5, p6, p7, p12); // mosi, miso, sclk, cs + SDBlockDevice sd(MBED_CONF_SD_SPI_MOSI, MBED_CONF_SD_SPI_MISO, MBED_CONF_SD_SPI_CLK, MBED_CONF_SD_SPI_CS); uint8_t block[512] = "Hello World!\n"; int main() diff --git a/config/mbed_app.json b/config/mbed_lib.json similarity index 99% rename from config/mbed_app.json rename to config/mbed_lib.json index b19ac3b6fc..67e12014d4 100644 --- a/config/mbed_app.json +++ b/config/mbed_lib.json @@ -1,4 +1,5 @@ { + "name": "sd", "config": { "UART_RX": "D0", "UART_TX": "D1", diff --git a/features/TESTS/examples/example1/example1.cpp b/features/TESTS/examples/example1/example1.cpp index 7f9786c2d1..684f392460 100644 --- a/features/TESTS/examples/example1/example1.cpp +++ b/features/TESTS/examples/example1/example1.cpp @@ -8,7 +8,7 @@ #include "platform/mbed_retarget.h" -SDBlockDevice sd(MBED_CONF_APP_SPI_MOSI, MBED_CONF_APP_SPI_MISO, MBED_CONF_APP_SPI_CLK, MBED_CONF_APP_SPI_CS); +SDBlockDevice sd(MBED_CONF_SD_SPI_MOSI, MBED_CONF_SD_SPI_MISO, MBED_CONF_SD_SPI_CLK, MBED_CONF_SD_SPI_CS); FATFileSystem fs("sd", &sd); void return_error(int ret_val){ diff --git a/features/TESTS/filesystem/basic/basic.cpp b/features/TESTS/filesystem/basic/basic.cpp index 8f914ed1cd..d0658b4a2d 100644 --- a/features/TESTS/filesystem/basic/basic.cpp +++ b/features/TESTS/filesystem/basic/basic.cpp @@ -120,7 +120,7 @@ static const char *fsfat_basic_bin_filename_test_10 = "0:testfile.bin"; -SDBlockDevice sd(MBED_CONF_APP_SPI_MOSI, MBED_CONF_APP_SPI_MISO, MBED_CONF_APP_SPI_CLK, MBED_CONF_APP_SPI_CS); +SDBlockDevice sd(MBED_CONF_SD_SPI_MOSI, MBED_CONF_SD_SPI_MISO, MBED_CONF_SD_SPI_CLK, MBED_CONF_SD_SPI_CS); FATFileSystem fs(sd_mount_pt, &sd); #define FSFAT_BASIC_MSG(_buf, _max_len, _fmt, ...) \ diff --git a/features/TESTS/filesystem/fopen/fopen.cpp b/features/TESTS/filesystem/fopen/fopen.cpp index 28ae3a2c48..276d626cc0 100644 --- a/features/TESTS/filesystem/fopen/fopen.cpp +++ b/features/TESTS/filesystem/fopen/fopen.cpp @@ -85,7 +85,7 @@ static char fsfat_fopen_utest_msg_g[FSFAT_UTEST_MSG_BUF_SIZE]; static const char *sd_badfile_path = "/sd/badfile.txt"; static const char *sd_testfile_path = "/sd/test.txt"; -SDBlockDevice sd(MBED_CONF_APP_SPI_MOSI, MBED_CONF_APP_SPI_MISO, MBED_CONF_APP_SPI_CLK, MBED_CONF_APP_SPI_CS); +SDBlockDevice sd(MBED_CONF_SD_SPI_MOSI, MBED_CONF_SD_SPI_MISO, MBED_CONF_SD_SPI_CLK, MBED_CONF_SD_SPI_CS); FATFileSystem fs("sd", &sd); #define FSFAT_FOPEN_TEST_01 fsfat_fopen_test_01