SD class for DISCO_F746NG platform

Dependents:   Joerg_turbo_ede DISCO-F746NG_Monttory_Base DISCO-F746NG_Monttory_Base Loco_10_17_SD ... more

deprecated lib

Files at this revision

API Documentation at this revision

Comitter:
adustm
Date:
Fri Jun 09 08:35:08 2017 +0000
Parent:
0:9f8c87fd3af5
Commit message:
Align the class with BSP_DISCO_F746NG library

Changed in this revision

SD_DISCO_F746NG.cpp Show annotated file Show diff for this revision Revisions of this file
SD_DISCO_F746NG.h Show annotated file Show diff for this revision Revisions of this file
diff -r 9f8c87fd3af5 -r cf12f3d37081 SD_DISCO_F746NG.cpp
--- a/SD_DISCO_F746NG.cpp	Mon Mar 21 13:28:53 2016 +0000
+++ b/SD_DISCO_F746NG.cpp	Fri Jun 09 08:35:08 2017 +0000
@@ -55,24 +55,24 @@
   return BSP_SD_IsDetected();
 }
 
-uint8_t SD_DISCO_F746NG::ReadBlocks(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks)
+uint8_t SD_DISCO_F746NG::ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
 {
-  return BSP_SD_ReadBlocks(pData, ReadAddr, BlockSize, NumOfBlocks);
+  return BSP_SD_ReadBlocks(pData, ReadAddr, NumOfBlocks, Timeout);
 }
 
-uint8_t SD_DISCO_F746NG::WriteBlocks(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumOfBlocks)
+uint8_t SD_DISCO_F746NG::WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
 {
-  return BSP_SD_WriteBlocks(pData, WriteAddr, BlockSize, NumOfBlocks);
+  return BSP_SD_WriteBlocks(pData, WriteAddr, NumOfBlocks, Timeout);
 }
 
-uint8_t SD_DISCO_F746NG::ReadBlocks_DMA(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks)
+uint8_t SD_DISCO_F746NG::ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
 {
-  return BSP_SD_ReadBlocks_DMA(pData, ReadAddr, BlockSize, NumOfBlocks);
+  return BSP_SD_ReadBlocks_DMA(pData, ReadAddr, NumOfBlocks);
 }
 
-uint8_t SD_DISCO_F746NG::WriteBlocks_DMA(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumOfBlocks)
+uint8_t SD_DISCO_F746NG::WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
 {
-  return BSP_SD_WriteBlocks_DMA(pData, WriteAddr, BlockSize, NumOfBlocks);
+  return BSP_SD_WriteBlocks_DMA(pData, WriteAddr, NumOfBlocks);
 }
 
 uint8_t SD_DISCO_F746NG::Erase(uint64_t StartAddr, uint64_t EndAddr)
@@ -80,12 +80,12 @@
   return BSP_SD_Erase(StartAddr, EndAddr);
 }
 
-HAL_SD_TransferStateTypedef SD_DISCO_F746NG::GetStatus(void)
+uint8_t SD_DISCO_F746NG::GetCardState(void)
 {
-  return BSP_SD_GetStatus();
+  return BSP_SD_GetCardState();
 }
 
-void SD_DISCO_F746NG::GetCardInfo(HAL_SD_CardInfoTypedef *CardInfo)
+void SD_DISCO_F746NG::GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
 {
   BSP_SD_GetCardInfo(CardInfo);
 }
diff -r 9f8c87fd3af5 -r cf12f3d37081 SD_DISCO_F746NG.h
--- a/SD_DISCO_F746NG.h	Mon Mar 21 13:28:53 2016 +0000
+++ b/SD_DISCO_F746NG.h	Fri Jun 09 08:35:08 2017 +0000
@@ -85,7 +85,7 @@
     * @param  NumOfBlocks: Number of SD blocks to read 
     * @retval SD status
     */
-  uint8_t ReadBlocks(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks);
+  uint8_t ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
 
   /**
     * @brief  Writes block(s); to a specified address in an SD card, in polling mode. 
@@ -95,7 +95,7 @@
     * @param  NumOfBlocks: Number of SD blocks to write
     * @retval SD status
     */
-  uint8_t WriteBlocks(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumOfBlocks);
+  uint8_t WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
 
   /**
     * @brief  Reads block(s); from a specified address in an SD card, in DMA mode.
@@ -105,7 +105,7 @@
     * @param  NumOfBlocks: Number of SD blocks to read 
     * @retval SD status
     */
-  uint8_t ReadBlocks_DMA(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks);
+  uint8_t ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
 
   /**
     * @brief  Writes block(s); to a specified address in an SD card, in DMA mode.
@@ -115,7 +115,7 @@
     * @param  NumOfBlocks: Number of SD blocks to write 
     * @retval SD status
     */
-  uint8_t WriteBlocks_DMA(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumOfBlocks);
+  uint8_t WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
 
   /**
     * @brief  Erases the specified memory area of the given SD card. 
@@ -133,14 +133,14 @@
     *            @arg  SD_TRANSFER_BUSY: Data transfer is acting
     *            @arg  SD_TRANSFER_ERROR: Data transfer error 
     */
-  HAL_SD_TransferStateTypedef GetStatus(void);
+  uint8_t GetCardState(void);
 
   /**
     * @brief  Get SD information about specific SD card.
     * @param  CardInfo: Pointer to HAL_SD_CardInfoTypedef structure
     * @retval None 
     */
-  void GetCardInfo(HAL_SD_CardInfoTypedef *CardInfo);
+  void GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo);
 
 private: