Skip to content

Commit

Permalink
boards/sam54-xpro: enable SDMMC support
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Jul 3, 2023
1 parent 6defbaf commit 4366fb9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions boards/same54-xpro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config BOARD_SAME54_XPRO
select HAS_PERIPH_RTC
select HAS_PERIPH_RTT
select HAS_PERIPH_PWM
select HAS_PERIPH_SDMMC
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
Expand All @@ -31,6 +32,7 @@ config BOARD_SAME54_XPRO
select HAVE_SAM0_ETH
select HAVE_SAM0_SDHC
select HAVE_MTD_AT24CXXX
select HAVE_MTD_SDMMC_DEFAULT

# This specific board requires SPI_ON_QSPI for the MTD_SPI_NOR
select MODULE_PERIPH_SPI_ON_QSPI if MODULE_MTD_SPI_NOR
5 changes: 4 additions & 1 deletion boards/same54-xpro/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ ifneq (,$(filter mtd,$(USEMODULE)))
FEATURES_REQUIRED += periph_spi_on_qspi
USEMODULE += mtd_spi_nor
USEMODULE += mtd_at24cxxx at24mac
USEMODULE += sam0_sdhc
ifeq (,$(filter sam0_sdhc,$(USEMODULE)))
USEMODULE += mtd_sdmmc_default
USEMODULE += periph_sdmmc
endif
endif

# enables sam0_eth as default network device
Expand Down
1 change: 1 addition & 0 deletions boards/same54-xpro/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_sdmmc
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
Expand Down
2 changes: 2 additions & 0 deletions boards/same54-xpro/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ extern mtd_dev_t *mtd0, *mtd1, *mtd2;
#define MTD_1 mtd1
#define MTD_2 mtd2
#define MTD_NUMOF 3

#define CONFIG_SDMMC_GENERIC_MTD_OFFSET 2 /**< mtd2 is used for SD Card */
/** @} */

/**
Expand Down
12 changes: 12 additions & 0 deletions boards/same54-xpro/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,18 @@ static const adc_conf_chan_t adc_channels[] = {
*/
#define SDHC_DEV SDHC1 /**< The SDHC instance to use */
#define SDHC_DEV_ISR isr_sdhc1 /**< Interrupt service routing for SDHC1 */

/** SDHC devices */
static const sdhc_conf_t sdhc_config[] = {
{
.sdmmc = SDHC1,
.cd = GPIO_PIN(PD, 20),
.wp = GPIO_UNDEF,
},
};

/** Number of configured SDHC devices */
#define SDHC_NUMOF ARRAY_SIZE(sdhc_config)
/** @} */

/**
Expand Down

0 comments on commit 4366fb9

Please sign in to comment.