Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards: complete SD Card MTD definition for several bords #19914

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
20 changes: 20 additions & 0 deletions boards/seeedstudio-gd32/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define BOARD_H

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

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -67,6 +68,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 */
benpicco marked this conversation as resolved.
Show resolved Hide resolved
/** @} */

/**
* @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
16 changes: 14 additions & 2 deletions boards/sipeed-longan-nano/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define BOARD_H

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

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -62,13 +63,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
Loading