| 1 | /* USER CODE BEGIN Header */ | 
|---|
| 2 | /** | 
|---|
| 3 | ****************************************************************************** | 
|---|
| 4 | * @file   fatfs.c | 
|---|
| 5 | * @brief  Code for fatfs applications | 
|---|
| 6 | ****************************************************************************** | 
|---|
| 7 | * @attention | 
|---|
| 8 | * | 
|---|
| 9 | * Copyright (c) 2025 STMicroelectronics. | 
|---|
| 10 | * All rights reserved. | 
|---|
| 11 | * | 
|---|
| 12 | * This software is licensed under terms that can be found in the LICENSE file | 
|---|
| 13 | * in the root directory of this software component. | 
|---|
| 14 | * If no LICENSE file comes with this software, it is provided AS-IS. | 
|---|
| 15 | * | 
|---|
| 16 | ****************************************************************************** | 
|---|
| 17 | */ | 
|---|
| 18 | /* USER CODE END Header */ | 
|---|
| 19 | #include "fatfs.h" | 
|---|
| 20 |  | 
|---|
| 21 | uint8_t retSD;    /* Return value for SD */ | 
|---|
| 22 | char SDPath[4];   /* SD logical drive path */ | 
|---|
| 23 | FATFS SDFatFS;    /* File system object for SD logical drive */ | 
|---|
| 24 | FIL SDFile;       /* File object for SD */ | 
|---|
| 25 | uint8_t retEEPROM;    /* Return value for USER */ | 
|---|
| 26 | char EEPROMPath[4];   /* USER logical drive path */ | 
|---|
| 27 | FATFS USERFatFS;    /* File system object for USER logical drive */ | 
|---|
| 28 | FIL EEPROMFile;       /* File object for USER */ | 
|---|
| 29 |  | 
|---|
| 30 | /* USER CODE BEGIN Variables */ | 
|---|
| 31 |  | 
|---|
| 32 | /* USER CODE END Variables */ | 
|---|
| 33 |  | 
|---|
| 34 | void MX_FATFS_Init(void) | 
|---|
| 35 | { | 
|---|
| 36 | /*## FatFS: Link the SD driver ###########################*/ | 
|---|
| 37 | retSD = FATFS_LinkDriver(&SD_Driver, SDPath); | 
|---|
| 38 | /*## FatFS: Link the USER driver ###########################*/ | 
|---|
| 39 | retEEPROM = FATFS_LinkDriver(&EEPROM_Driver, EEPROMPath); | 
|---|
| 40 |  | 
|---|
| 41 | /* USER CODE BEGIN Init */ | 
|---|
| 42 | /* additional user code for init */ | 
|---|
| 43 | /* USER CODE END Init */ | 
|---|
| 44 | } | 
|---|
| 45 |  | 
|---|
| 46 | /** | 
|---|
| 47 | * @brief  Gets Time from RTC | 
|---|
| 48 | * @param  None | 
|---|
| 49 | * @retval Time in DWORD | 
|---|
| 50 | */ | 
|---|
| 51 | DWORD get_fattime(void) | 
|---|
| 52 | { | 
|---|
| 53 | /* USER CODE BEGIN get_fattime */ | 
|---|
| 54 | return 0; | 
|---|
| 55 | /* USER CODE END get_fattime */ | 
|---|
| 56 | } | 
|---|
| 57 |  | 
|---|
| 58 | /* USER CODE BEGIN Application */ | 
|---|
| 59 |  | 
|---|
| 60 | /* USER CODE END Application */ | 
|---|