fatfs.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. ******************************************************************************
  3. * @file fatfs.c
  4. * @brief Code for fatfs applications
  5. ******************************************************************************
  6. * @attention
  7. *
  8. * <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
  9. * All rights reserved.</center></h2>
  10. *
  11. * This software component is licensed by ST under Ultimate Liberty license
  12. * SLA0044, the "License"; You may not use this file except in compliance with
  13. * the License. You may obtain a copy of the License at:
  14. * www.st.com/SLA0044
  15. *
  16. ******************************************************************************
  17. */
  18. #include "fatfs.h"
  19. uint8_t retUSER; /* Return value for USER */
  20. char USERPath[4]; /* USER logical drive path */
  21. FATFS USERFatFS; /* File system object for USER logical drive */
  22. FIL USERFile; /* File object for USER */
  23. /* USER CODE BEGIN Variables */
  24. /* USER CODE END Variables */
  25. void FATFS_Init(void)
  26. {
  27. /*## FatFS: Link the USER driver ###########################*/
  28. #if USE_SPI_FLASH>0 //SPI FLASH W25QXX¹¦ÄÜ
  29. retUSER = FATFS_LinkDriverEx(&W25Q_Driver, USERPath, 1);
  30. #elif USE_SPI_SD>0 //SPI FLASH W25QXX¹¦ÄÜ
  31. retUSER = FATFS_LinkDriverEx(&sdcard_Driver, USERPath, 1);
  32. #endif
  33. /* USER CODE BEGIN Init */
  34. /* additional user code for init */
  35. /* USER CODE END Init */
  36. }
  37. /**
  38. * @brief Gets Time from RTC
  39. * @param None
  40. * @retval Time in DWORD
  41. */
  42. DWORD get_fattime(void)
  43. {
  44. /* USER CODE BEGIN get_fattime */
  45. return 0;
  46. /* USER CODE END get_fattime */
  47. }
  48. /* USER CODE BEGIN Application */
  49. /* USER CODE END Application */
  50. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/