Skip to content

Commit

Permalink
boards: complete SD Card MTD definition
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Sep 20, 2023
1 parent da7deb5 commit f4c23e8
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
12 changes: 8 additions & 4 deletions boards/common/esp32x/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ extern "C" {
#define SPI_FLASH_DRIVE_START 0
#endif

/** Default MTD drive definition */
#define MTD_0 mtd0
#define MTD_0 mtd0 /**< Flash MTD device */
extern mtd_dev_t *mtd0; /**< Flash MTD device pointer */

/** Pointer to the default MTD drive structure */
extern mtd_dev_t *mtd0;
#if MODULE_MTD_SDCARD_DEFAULT || DOXYGEN

#define MTD_1 mtd1 /**< SD Card MTD device */
extern mtd_dev_t *mtd1; /**< SD Card MTD device pointer */

#endif /* MODULE_MTD_SDCARD_DEFAULT || DOXYGEN */

/**
* @brief MTD offset for SD Card interfaces
Expand Down
19 changes: 19 additions & 0 deletions boards/seeedstudio-gd32/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,25 @@ extern "C" {
#define LED_BLUE_PIN LED2_PIN /**< LED2 is blue */
/** @} */

/**
* @name MTD configuration
* @{
*/
#define MTD_0 mtd0 /**< MTD device for SD Card */
extern mtd_dev_t *mtd0; /**< MTD device pointer for SD Card */
/** @} */

/**
* @name SD-Card interface configuration
* @{
*/
#define SDCARD_SPI_PARAM_SPI SPI_DEV(0)
#define SDCARD_SPI_PARAM_CS GPIO_PIN(PORT_B, 12)
#define SDCARD_SPI_PARAM_CLK GPIO_PIN(PORT_B, 13)
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(PORT_B, 14)
#define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15)
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
15 changes: 13 additions & 2 deletions boards/sipeed-longan-nano/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,24 @@ extern "C" {
#define LED_BLUE_PIN LED2_PIN /**< LED2 is blue */
/** @} */

#if defined(MODULE_SDCARD_SPI)
/**
* @name MTD configuration
* @{
*/
#define MTD_0 mtd0 /**< MTD device for SD Card */
extern mtd_dev_t *mtd0; /**< MTD device pointer for SD Card */
/** @} */

/**
* @name SD-Card interface configuration
* @{
*/
#define SDCARD_SPI_PARAM_SPI SPI_DEV(0)
#define SDCARD_SPI_PARAM_CS GPIO_PIN(PORT_B, 12)
#define SDCARD_SPI_PARAM_CLK GPIO_PIN(PORT_B, 13)
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(PORT_B, 14)
#define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15)
#endif
/** @} */

#if defined(MODULE_ST7735) && defined(BOARD_SIPEED_LONGAN_NANO_TFT)
#define ST7735_PARAM_SPI SPI_DEV(1) /**< SPI device */
Expand Down
9 changes: 9 additions & 0 deletions boards/waveshare-nrf52840-eval-kit/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define BOARD_H

#include "board_common.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -82,6 +83,14 @@ extern "C" {
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(0, 20)
/** @} */

/**
* @name MTD configuration
* @{
*/
#define MTD_0 mtd0 /**< MTD device for SD Card */
extern mtd_dev_t *mtd0; /**< MTD device pointer for SD Card */
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit f4c23e8

Please sign in to comment.