1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards: complete SD Card MTD definition

This commit is contained in:
Gunar Schorcht 2023-09-20 14:15:33 +02:00
parent da7deb518b
commit bf981c81ba
4 changed files with 51 additions and 6 deletions

View File

@ -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

View File

@ -22,6 +22,7 @@
#define BOARD_H
#include "board_common.h"
#include "mtd.h"
#ifdef __cplusplus
extern "C" {
@ -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 */
/** @} */
/**
* @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

View File

@ -21,6 +21,7 @@
#define BOARD_H
#include "board_common.h"
#include "mtd.h"
#ifdef __cplusplus
extern "C" {
@ -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 */

View File

@ -20,6 +20,7 @@
#define BOARD_H
#include "board_common.h"
#include "mtd.h"
#ifdef __cplusplus
extern "C" {
@ -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