Skip to content

Commit

Permalink
Added four lane SDIO SD card support (for BTT SKR 2.0 - only tested w…
Browse files Browse the repository at this point in the history
…ith a NUCLEO-F446ZE dev board). Issue #123.
  • Loading branch information
terjeio committed Jul 8, 2023
1 parent 4ab94a2 commit f5ad3e1
Show file tree
Hide file tree
Showing 38 changed files with 27,416 additions and 1,030 deletions.
116 changes: 116 additions & 0 deletions .cproject

Large diffs are not rendered by default.

57 changes: 33 additions & 24 deletions .settings/language.settings.xml

Large diffs are not rendered by default.

17,185 changes: 17,185 additions & 0 deletions Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f429xx.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* is using in the C source code, usually in main.c. This file contains:
* - Configuration section that allows to select:
* - The STM32F4xx device used in the target application
* - To use or not the peripherals drivers in application code(i.e.
* code will be based on direct access to peripherals registers
* - To use or not the peripherals drivers in application code(i.e.
* code will be based on direct access to peripherals registers
* rather than drivers API), this option is controlled by
* "#define USE_HAL_DRIVER"
*
Expand Down
38 changes: 38 additions & 0 deletions Drivers/FATFS/App/fatfs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file fatfs.c
* @brief Code for fatfs applications
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
#include "fatfs.h"

uint8_t retSD; /* Return value for SD */
char SDPath[4]; /* SD logical drive path */
FATFS SDFatFS; /* File system object for SD logical drive */
FIL SDFile; /* File object for SD */

/* USER CODE BEGIN Variables */

/* USER CODE END Variables */

void MX_FATFS_Init(void)
{
/*## FatFS: Link the SD driver ###########################*/
retSD = FATFS_LinkDriver(&SD_Driver, SDPath);

/* USER CODE BEGIN Init */
/* additional user code for init */
/* USER CODE END Init */
}
47 changes: 47 additions & 0 deletions Drivers/FATFS/App/fatfs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file fatfs.h
* @brief Header for fatfs applications
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __fatfs_H
#define __fatfs_H
#ifdef __cplusplus
extern "C" {
#endif

#include "ff.h"
#include "ff_gen_drv.h"
#include "sd_diskio.h" /* defines SD_Driver as external */

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

extern uint8_t retSD; /* Return value for SD */
extern char SDPath[4]; /* SD logical drive path */
extern FATFS SDFatFS; /* File system object for SD logical drive */
extern FIL SDFile; /* File object for SD */

void MX_FATFS_Init(void);

/* USER CODE BEGIN Prototypes */

/* USER CODE END Prototypes */
#ifdef __cplusplus
}
#endif
#endif /*__fatfs_H */
Loading

0 comments on commit f5ad3e1

Please sign in to comment.