Skip to content

Commit bf981c8

Browse files
committed
boards: complete SD Card MTD definition
1 parent da7deb5 commit bf981c8

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

boards/common/esp32x/include/board_common.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,15 @@ extern "C" {
103103
#define SPI_FLASH_DRIVE_START 0
104104
#endif
105105

106-
/** Default MTD drive definition */
107-
#define MTD_0 mtd0
106+
#define MTD_0 mtd0 /**< Flash MTD device */
107+
extern mtd_dev_t *mtd0; /**< Flash MTD device pointer */
108108

109-
/** Pointer to the default MTD drive structure */
110-
extern mtd_dev_t *mtd0;
109+
#if MODULE_MTD_SDCARD_DEFAULT || DOXYGEN
110+
111+
#define MTD_1 mtd1 /**< SD Card MTD device */
112+
extern mtd_dev_t *mtd1; /**< SD Card MTD device pointer */
113+
114+
#endif /* MODULE_MTD_SDCARD_DEFAULT || DOXYGEN */
111115

112116
/**
113117
* @brief MTD offset for SD Card interfaces

boards/seeedstudio-gd32/include/board.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define BOARD_H
2323

2424
#include "board_common.h"
25+
#include "mtd.h"
2526

2627
#ifdef __cplusplus
2728
extern "C" {
@@ -67,6 +68,25 @@ extern "C" {
6768
#define LED_BLUE_PIN LED2_PIN /**< LED2 is blue */
6869
/** @} */
6970

71+
/**
72+
* @name MTD configuration
73+
* @{
74+
*/
75+
#define MTD_0 mtd0 /**< MTD device for SD Card */
76+
extern mtd_dev_t *mtd0; /**< MTD device pointer for SD Card */
77+
/** @} */
78+
79+
/**
80+
* @name SD-Card interface configuration
81+
* @{
82+
*/
83+
#define SDCARD_SPI_PARAM_SPI SPI_DEV(0)
84+
#define SDCARD_SPI_PARAM_CS GPIO_PIN(PORT_B, 12)
85+
#define SDCARD_SPI_PARAM_CLK GPIO_PIN(PORT_B, 13)
86+
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(PORT_B, 14)
87+
#define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15)
88+
/** @} */
89+
7090
#ifdef __cplusplus
7191
}
7292
#endif

boards/sipeed-longan-nano/include/board.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define BOARD_H
2222

2323
#include "board_common.h"
24+
#include "mtd.h"
2425

2526
#ifdef __cplusplus
2627
extern "C" {
@@ -62,13 +63,24 @@ extern "C" {
6263
#define LED_BLUE_PIN LED2_PIN /**< LED2 is blue */
6364
/** @} */
6465

65-
#if defined(MODULE_SDCARD_SPI)
66+
/**
67+
* @name MTD configuration
68+
* @{
69+
*/
70+
#define MTD_0 mtd0 /**< MTD device for SD Card */
71+
extern mtd_dev_t *mtd0; /**< MTD device pointer for SD Card */
72+
/** @} */
73+
74+
/**
75+
* @name SD-Card interface configuration
76+
* @{
77+
*/
6678
#define SDCARD_SPI_PARAM_SPI SPI_DEV(0)
6779
#define SDCARD_SPI_PARAM_CS GPIO_PIN(PORT_B, 12)
6880
#define SDCARD_SPI_PARAM_CLK GPIO_PIN(PORT_B, 13)
6981
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(PORT_B, 14)
7082
#define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15)
71-
#endif
83+
/** @} */
7284

7385
#if defined(MODULE_ST7735) && defined(BOARD_SIPEED_LONGAN_NANO_TFT)
7486
#define ST7735_PARAM_SPI SPI_DEV(1) /**< SPI device */

boards/waveshare-nrf52840-eval-kit/include/board.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#define BOARD_H
2121

2222
#include "board_common.h"
23+
#include "mtd.h"
2324

2425
#ifdef __cplusplus
2526
extern "C" {
@@ -82,6 +83,14 @@ extern "C" {
8283
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(0, 20)
8384
/** @} */
8485

86+
/**
87+
* @name MTD configuration
88+
* @{
89+
*/
90+
#define MTD_0 mtd0 /**< MTD device for SD Card */
91+
extern mtd_dev_t *mtd0; /**< MTD device pointer for SD Card */
92+
/** @} */
93+
8594
#ifdef __cplusplus
8695
}
8796
#endif

0 commit comments

Comments
 (0)