From bc66d987a9578cfb6d5886452f51c567fab0417a Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 28 Feb 2018 17:43:28 +0100 Subject: [PATCH] drivers/sdcard_spi: use new driver params scheme --- .../sdcard_spi/include/sdcard_spi_params.h | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/sdcard_spi/include/sdcard_spi_params.h b/drivers/sdcard_spi/include/sdcard_spi_params.h index 56265d3f3e..75bdca659b 100644 --- a/drivers/sdcard_spi/include/sdcard_spi_params.h +++ b/drivers/sdcard_spi/include/sdcard_spi_params.h @@ -30,19 +30,19 @@ extern "C" { * @{ */ #ifndef SDCARD_SPI_PARAM_SPI -#define SDCARD_SPI_PARAM_SPI (SPI_DEV(0)) +#define SDCARD_SPI_PARAM_SPI SPI_DEV(0) #endif #ifndef SDCARD_SPI_PARAM_CS -#define SDCARD_SPI_PARAM_CS (GPIO_PIN(2,4)) +#define SDCARD_SPI_PARAM_CS GPIO_PIN(2,4) #endif #ifndef SDCARD_SPI_PARAM_CLK -#define SDCARD_SPI_PARAM_CLK (GPIO_PIN(2,5)) +#define SDCARD_SPI_PARAM_CLK GPIO_PIN(2,5) #endif #ifndef SDCARD_SPI_PARAM_MOSI -#define SDCARD_SPI_PARAM_MOSI (GPIO_PIN(2,6)) +#define SDCARD_SPI_PARAM_MOSI GPIO_PIN(2,6) #endif #ifndef SDCARD_SPI_PARAM_MISO -#define SDCARD_SPI_PARAM_MISO (GPIO_PIN(2,7)) +#define SDCARD_SPI_PARAM_MISO GPIO_PIN(2,7) #endif #ifndef SDCARD_SPI_PARAM_POWER #define SDCARD_SPI_PARAM_POWER (GPIO_UNDEF) @@ -51,21 +51,23 @@ extern "C" { /** treated as 'don't care' if SDCARD_SPI_PARAM_POWER is GPIO_UNDEF */ #define SDCARD_SPI_PARAM_POWER_AH (true) #endif + +#ifndef SDCARD_SPI_PARAMS +#define SDCARD_SPI_PARAMS { .spi_dev = SDCARD_SPI_PARAM_SPI, \ + .cs = SDCARD_SPI_PARAM_CS, \ + .clk = SDCARD_SPI_PARAM_CLK, \ + .mosi = SDCARD_SPI_PARAM_MOSI, \ + .miso = SDCARD_SPI_PARAM_MISO, \ + .power = SDCARD_SPI_PARAM_POWER, \ + .power_act_high = SDCARD_SPI_PARAM_POWER_AH } +#endif /** @} */ /** * @brief sdcard_spi configuration */ static const sdcard_spi_params_t sdcard_spi_params[] = { - { - .spi_dev = SDCARD_SPI_PARAM_SPI, - .cs = SDCARD_SPI_PARAM_CS, - .clk = SDCARD_SPI_PARAM_CLK, - .mosi = SDCARD_SPI_PARAM_MOSI, - .miso = SDCARD_SPI_PARAM_MISO, - .power = SDCARD_SPI_PARAM_POWER, - .power_act_high = SDCARD_SPI_PARAM_POWER_AH - }, + SDCARD_SPI_PARAMS }; #ifdef __cplusplus