STM32756G_EVAL BSP User Manual: stm32756g_eval_sd.c Source File

STM32756G EVAL BSP Drivers

stm32756g_eval_sd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_sd.c
00004   * @author  MCD Application Team
00005   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes the uSD card driver mounted on STM32756G-EVAL and
00008   *          STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive the micro SD external card mounted on STM32756G-EVAL
00013      evaluation board.
00014    - This driver does not need a specific component driver for the micro SD device
00015      to be included with.
00016 
00017   Driver description:
00018   ------------------
00019   + Initialization steps:
00020      o Initialize the micro SD card using the BSP_SD_Init() function. This 
00021        function includes the MSP layer hardware resources initialization and the
00022        SDIO interface configuration to interface with the external micro SD. It 
00023        also includes the micro SD initialization sequence.
00024      o To check the SD card presence you can use the function BSP_SD_IsDetected() which 
00025        returns the detection status 
00026      o If SD presence detection interrupt mode is desired, you must configure the 
00027        SD detection interrupt mode by calling the function BSP_SD_ITConfig(). The interrupt 
00028        is generated as an external interrupt whenever the micro SD card is 
00029        plugged/unplugged in/from the evaluation board. The SD detection is managed by MFX,
00030        so the SD detection interrupt has to be treated by MFX_IRQOUT gpio pin IRQ handler.
00031      o The function BSP_SD_GetCardInfo() is used to get the micro SD card information 
00032        which is stored in the structure "HAL_SD_CardInfoTypedef".
00033   
00034   + Micro SD card operations
00035      o The micro SD card can be accessed with read/write block(s) operations once 
00036        it is ready for access. The access can be performed whether using the polling
00037        mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(), or by DMA 
00038        transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA()
00039      o The DMA transfer complete is used with interrupt mode. Once the SD transfer
00040        is complete, the SD interrupt is handled using the function BSP_SD_IRQHandler(),
00041        the DMA Tx/Rx transfer complete are handled using the functions
00042        BSP_SD_DMA_Tx_IRQHandler()/BSP_SD_DMA_Rx_IRQHandler(). The corresponding user callbacks 
00043        are implemented by the user at application level. 
00044      o The SD erase block(s) is performed using the function BSP_SD_Erase() with specifying
00045        the number of blocks to erase.
00046      o The SD runtime status is returned when calling the function BSP_SD_GetCardState().
00047 
00048          
00049   @endverbatim
00050   ******************************************************************************
00051   * @attention
00052   *
00053   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00054   *
00055   * Redistribution and use in source and binary forms, with or without modification,
00056   * are permitted provided that the following conditions are met:
00057   *   1. Redistributions of source code must retain the above copyright notice,
00058   *      this list of conditions and the following disclaimer.
00059   *   2. Redistributions in binary form must reproduce the above copyright notice,
00060   *      this list of conditions and the following disclaimer in the documentation
00061   *      and/or other materials provided with the distribution.
00062   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00063   *      may be used to endorse or promote products derived from this software
00064   *      without specific prior written permission.
00065   *
00066   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00067   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00068   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00069   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00070   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00071   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00072   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00073   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00074   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00075   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00076   *
00077   ******************************************************************************
00078   */ 
00079 
00080 /* Includes ------------------------------------------------------------------*/
00081 #include "stm32756g_eval_sd.h"
00082 
00083 /** @addtogroup BSP
00084   * @{
00085   */
00086 
00087 /** @addtogroup STM32756G_EVAL
00088   * @{
00089   */ 
00090   
00091 /** @defgroup STM32756G_EVAL_SD STM32756G_EVAL SD
00092   * @{
00093   */ 
00094 
00095 
00096 /** @defgroup STM32756G_EVAL_SD_Private_TypesDefinitions SD Private TypesDefinitions
00097   * @{
00098   */
00099 /**
00100   * @}
00101   */ 
00102 
00103 /** @defgroup STM32756G_EVAL_SD_Private_Defines SD Private Defines
00104   * @{
00105   */
00106 /**
00107   * @}
00108   */ 
00109   
00110 /** @defgroup STM32756G_EVAL_SD_Private_Macros SD Private Macros
00111   * @{
00112   */    
00113 /**
00114   * @}
00115   */  
00116 
00117 /** @defgroup STM32756G_EVAL_SD_Private_Variables SD Private Variables
00118   * @{
00119   */
00120 SD_HandleTypeDef uSdHandle;
00121 static uint8_t UseExtiModeDetection = 0;
00122 
00123 /**
00124   * @}
00125   */ 
00126   
00127 /** @defgroup STM32756G_EVAL_SD_Private_FunctionPrototypes SD Private Functions Prototypes
00128   * @{
00129   */
00130 /**
00131   * @}
00132   */ 
00133   
00134 /** @defgroup STM32756G_EVAL_SD_Private_Functions SD Private Functions
00135   * @{
00136   */
00137 
00138 /**
00139   * @brief  Initializes the SD card device.
00140   * @retval SD status
00141   */
00142 uint8_t BSP_SD_Init(void)
00143 { 
00144   uint8_t sd_state = MSD_OK;
00145   
00146   /* uSD device interface configuration */
00147   uSdHandle.Instance = SDMMC1;
00148 
00149   uSdHandle.Init.ClockEdge           = SDMMC_CLOCK_EDGE_RISING;
00150   uSdHandle.Init.ClockBypass         = SDMMC_CLOCK_BYPASS_DISABLE;
00151   uSdHandle.Init.ClockPowerSave      = SDMMC_CLOCK_POWER_SAVE_DISABLE;
00152   uSdHandle.Init.BusWide             = SDMMC_BUS_WIDE_1B;
00153   uSdHandle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
00154   uSdHandle.Init.ClockDiv            = SDMMC_TRANSFER_CLK_DIV;
00155   
00156   /* Initialize IO functionalities (MFX) used by SD detect pin */
00157   BSP_IO_Init(); 
00158   
00159   /* Check if the SD card is plugged in the slot */
00160   BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_INPUT_PU);
00161   if(BSP_SD_IsDetected() != SD_PRESENT)
00162   {
00163     return MSD_ERROR_SD_NOT_PRESENT;
00164   }
00165   
00166   /* Msp SD initialization */
00167   BSP_SD_MspInit(&uSdHandle, NULL);
00168 
00169   /* HAL SD initialization */
00170   if(HAL_SD_Init(&uSdHandle) != MSD_OK)
00171   {
00172     sd_state = MSD_ERROR;
00173   }
00174   
00175   /* Configure SD Bus width */
00176   if(sd_state == MSD_OK)
00177   {
00178     /* Enable wide operation */
00179     if(HAL_SD_ConfigWideBusOperation(&uSdHandle, SDMMC_BUS_WIDE_4B) != HAL_OK)
00180     {
00181       sd_state = MSD_ERROR;
00182     }
00183     else
00184     {
00185       sd_state = MSD_OK;
00186     }
00187   }
00188   
00189   return  sd_state;
00190 }
00191 
00192 /**
00193   * @brief  DeInitializes the SD card device.
00194   * @retval SD status
00195   */
00196 uint8_t BSP_SD_DeInit(void)
00197 { 
00198   uint8_t sd_state = MSD_OK;
00199  
00200   uSdHandle.Instance = SDMMC1;
00201   
00202   /* Set back Mfx pin to INPUT mode in case it was in exti */
00203   UseExtiModeDetection = 0;
00204   BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_INPUT_PU);
00205 
00206   /* HAL SD deinitialization */
00207   if(HAL_SD_DeInit(&uSdHandle) != HAL_OK)
00208   {
00209     sd_state = MSD_ERROR;
00210   }
00211 
00212   /* Msp SD deinitialization */
00213   uSdHandle.Instance = SDMMC1;
00214   BSP_SD_MspDeInit(&uSdHandle, NULL);
00215   
00216   return  sd_state;
00217 }
00218 
00219 /**
00220   * @brief  Configures Interrupt mode for SD detection pin.
00221   * @retval Returns 0
00222   */
00223 uint8_t BSP_SD_ITConfig(void)
00224 {  
00225   /* Configure Interrupt mode for SD detection pin */  
00226   /* Note: disabling exti mode can be done calling SD_DeInit() */
00227   UseExtiModeDetection = 1;  
00228   BSP_SD_IsDetected();
00229 
00230   return 0;
00231 }
00232 
00233 /**
00234  * @brief  Detects if SD card is correctly plugged in the memory slot or not.
00235  * @retval Returns if SD is detected or not
00236  */
00237 uint8_t BSP_SD_IsDetected(void)
00238 {
00239   __IO uint8_t status = SD_PRESENT;
00240   
00241   /* Check SD card detect pin */
00242   if((BSP_IO_ReadPin(SD_DETECT_PIN)&SD_DETECT_PIN) != SD_DETECT_PIN)
00243   {
00244      if (UseExtiModeDetection)
00245      {
00246       BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_IT_RISING_EDGE_PU);
00247      }
00248   }
00249   else
00250   {
00251     status = SD_NOT_PRESENT;
00252     if (UseExtiModeDetection)
00253     {
00254       BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_IT_FALLING_EDGE_PU);
00255     }
00256   }
00257   return status;
00258 }
00259 
00260 /**
00261   * @brief  Reads block(s) from a specified address in an SD card, in polling mode.
00262   * @param  pData: Pointer to the buffer that will contain the data to transmit
00263   * @param  ReadAddr: Address from where data is to be read
00264   * @param  NumOfBlocks: Number of SD blocks to read
00265   * @param  Timeout: Timeout for read operation
00266   * @retval SD status
00267   */
00268 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00269 {
00270   if(HAL_SD_ReadBlocks(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks, Timeout) != HAL_OK)
00271   {
00272     return MSD_ERROR;
00273   }
00274   else
00275   {
00276     return MSD_OK;
00277   }
00278 }
00279 
00280 /**
00281   * @brief  Writes block(s) to a specified address in an SD card, in polling mode. 
00282   * @param  pData: Pointer to the buffer that will contain the data to transmit
00283   * @param  WriteAddr: Address from where data is to be written
00284   * @param  NumOfBlocks: Number of SD blocks to write
00285   * @param  Timeout: Timeout for write operation
00286   * @retval SD status
00287   */
00288 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00289 {
00290   if(HAL_SD_WriteBlocks(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks, Timeout) != HAL_OK)
00291   {
00292     return MSD_ERROR;
00293   }
00294   else
00295   {
00296     return MSD_OK;
00297   }
00298 }
00299 
00300 /**
00301   * @brief  Reads block(s) from a specified address in an SD card, in DMA mode.
00302   * @param  pData: Pointer to the buffer that will contain the data to transmit
00303   * @param  ReadAddr: Address from where data is to be read
00304   * @param  NumOfBlocks: Number of SD blocks to read 
00305   * @retval SD status
00306   */
00307 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
00308 {  
00309   /* Read block(s) in DMA transfer mode */
00310   if(HAL_SD_ReadBlocks_DMA(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks) != HAL_OK)
00311   {
00312     return MSD_ERROR;
00313   }
00314   else
00315   {
00316     return MSD_OK;
00317   }
00318 }
00319 
00320 /**
00321   * @brief  Writes block(s) to a specified address in an SD card, in DMA mode.
00322   * @param  pData: Pointer to the buffer that will contain the data to transmit
00323   * @param  WriteAddr: Address from where data is to be written
00324   * @param  NumOfBlocks: Number of SD blocks to write 
00325   * @retval SD status
00326   */
00327 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
00328 { 
00329   /* Write block(s) in DMA transfer mode */
00330   if(HAL_SD_WriteBlocks_DMA(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks) != HAL_OK)
00331   {
00332     return MSD_ERROR;
00333   }
00334   else
00335   {
00336     return MSD_OK;
00337   }
00338 }
00339 
00340 /**
00341   * @brief  Erases the specified memory area of the given SD card. 
00342   * @param  StartAddr: Start byte address
00343   * @param  EndAddr: End byte address
00344   * @retval SD status
00345   */
00346 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
00347 {
00348   if(HAL_SD_Erase(&uSdHandle, StartAddr, EndAddr) != HAL_OK)
00349   {
00350     return MSD_ERROR;
00351   }
00352   else
00353   {
00354     return MSD_OK;
00355   }
00356 }
00357 
00358 /**
00359   * @brief  Initializes the SD MSP.
00360   * @param  hsd: SD handle
00361   * @param  Params  
00362   * @retval None
00363   */
00364 __weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
00365 {
00366   static DMA_HandleTypeDef dma_rx_handle;
00367   static DMA_HandleTypeDef dma_tx_handle;
00368   GPIO_InitTypeDef gpio_init_structure;
00369 
00370   /* Camera has to be powered down as some signals use same GPIOs between 
00371    * SD card and camera bus. Camera drives its signals to low impedance 
00372    * when powered ON. So the camera is powered off to let its signals
00373    * in high impedance */
00374 
00375   /* Camera power down sequence */
00376   BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
00377   BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);
00378   /* De-assert the camera STANDBY pin (active high) */
00379   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);
00380   /* Assert the camera RSTI pin (active low) */
00381   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);
00382   
00383   /* Enable SDIO clock */
00384   __HAL_RCC_SDMMC1_CLK_ENABLE();
00385   
00386   /* Enable DMA2 clocks */
00387   __DMAx_TxRx_CLK_ENABLE();
00388 
00389   /* Enable GPIOs clock */
00390   __HAL_RCC_GPIOC_CLK_ENABLE();
00391   __HAL_RCC_GPIOD_CLK_ENABLE();
00392   
00393   /* Common GPIO configuration */
00394   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00395   gpio_init_structure.Pull      = GPIO_PULLUP;
00396   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00397   gpio_init_structure.Alternate = GPIO_AF12_SDMMC1;
00398   
00399   /* GPIOC configuration */
00400   gpio_init_structure.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00401    
00402   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00403 
00404   /* GPIOD configuration */
00405   gpio_init_structure.Pin = GPIO_PIN_2;
00406   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00407 
00408   /* NVIC configuration for SDIO interrupts */
00409   HAL_NVIC_SetPriority(SDMMC1_IRQn, 0x0E, 0);
00410   HAL_NVIC_EnableIRQ(SDMMC1_IRQn);
00411     
00412   /* Configure DMA Rx parameters */
00413   dma_rx_handle.Init.Channel             = SD_DMAx_Rx_CHANNEL;
00414   dma_rx_handle.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00415   dma_rx_handle.Init.PeriphInc           = DMA_PINC_DISABLE;
00416   dma_rx_handle.Init.MemInc              = DMA_MINC_ENABLE;
00417   dma_rx_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00418   dma_rx_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00419   dma_rx_handle.Init.Mode                = DMA_PFCTRL;
00420   dma_rx_handle.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00421   dma_rx_handle.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00422   dma_rx_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00423   dma_rx_handle.Init.MemBurst            = DMA_MBURST_INC4;
00424   dma_rx_handle.Init.PeriphBurst         = DMA_PBURST_INC4;
00425   
00426   dma_rx_handle.Instance = SD_DMAx_Rx_STREAM;
00427   
00428   /* Associate the DMA handle */
00429   __HAL_LINKDMA(hsd, hdmarx, dma_rx_handle);
00430   
00431   /* Deinitialize the stream for new transfer */
00432   HAL_DMA_DeInit(&dma_rx_handle);
00433   
00434   /* Configure the DMA stream */
00435   HAL_DMA_Init(&dma_rx_handle);
00436   
00437   /* Configure DMA Tx parameters */
00438   dma_tx_handle.Init.Channel             = SD_DMAx_Tx_CHANNEL;
00439   dma_tx_handle.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00440   dma_tx_handle.Init.PeriphInc           = DMA_PINC_DISABLE;
00441   dma_tx_handle.Init.MemInc              = DMA_MINC_ENABLE;
00442   dma_tx_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00443   dma_tx_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00444   dma_tx_handle.Init.Mode                = DMA_PFCTRL;
00445   dma_tx_handle.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00446   dma_tx_handle.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00447   dma_tx_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00448   dma_tx_handle.Init.MemBurst            = DMA_MBURST_INC4;
00449   dma_tx_handle.Init.PeriphBurst         = DMA_PBURST_INC4;
00450   
00451   dma_tx_handle.Instance = SD_DMAx_Tx_STREAM;
00452   
00453   /* Associate the DMA handle */
00454   __HAL_LINKDMA(hsd, hdmatx, dma_tx_handle);
00455   
00456   /* Deinitialize the stream for new transfer */
00457   HAL_DMA_DeInit(&dma_tx_handle);
00458   
00459   /* Configure the DMA stream */
00460   HAL_DMA_Init(&dma_tx_handle); 
00461   
00462   /* NVIC configuration for DMA transfer complete interrupt */
00463   HAL_NVIC_SetPriority(SD_DMAx_Rx_IRQn, 0x0F, 0);
00464   HAL_NVIC_EnableIRQ(SD_DMAx_Rx_IRQn);
00465   
00466   /* NVIC configuration for DMA transfer complete interrupt */
00467   HAL_NVIC_SetPriority(SD_DMAx_Tx_IRQn, 0x0F, 0);
00468   HAL_NVIC_EnableIRQ(SD_DMAx_Tx_IRQn);
00469 }
00470 
00471 /**
00472   * @brief  DeInitializes the SD MSP.
00473   * @param  hsd: SD handle
00474   * @param  Params  
00475   * @retval None
00476   */
00477 __weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
00478 {
00479     static DMA_HandleTypeDef dma_rx_handle;
00480     static DMA_HandleTypeDef dma_tx_handle;
00481 
00482     /* Disable NVIC for DMA transfer complete interrupts */
00483     HAL_NVIC_DisableIRQ(SD_DMAx_Rx_IRQn);
00484     HAL_NVIC_DisableIRQ(SD_DMAx_Tx_IRQn);
00485   
00486     /* Deinitialize the stream for new transfer */
00487     dma_rx_handle.Instance = SD_DMAx_Rx_STREAM;
00488     HAL_DMA_DeInit(&dma_rx_handle);
00489   
00490     /* Deinitialize the stream for new transfer */
00491     dma_tx_handle.Instance = SD_DMAx_Tx_STREAM;
00492     HAL_DMA_DeInit(&dma_tx_handle);
00493   
00494     /* Disable NVIC for SDIO interrupts */
00495     HAL_NVIC_DisableIRQ(SDMMC1_IRQn);
00496 
00497     /* DeInit GPIO pins can be done in the application 
00498        (by surcharging this __weak function) */
00499 
00500     /* Disable SDMMC1 clock */
00501     __HAL_RCC_SDMMC1_CLK_DISABLE();
00502 
00503     /* GPIO pins clock and DMA clocks can be shut down in the application
00504        by surcharging this __weak function */ 
00505 }
00506 
00507 /**
00508   * @brief  Gets the current SD card data status.
00509   * @retval Data transfer state.
00510   *          This value can be one of the following values:
00511   *            @arg  SD_TRANSFER_OK: No data transfer is acting
00512   *            @arg  SD_TRANSFER_BUSY: Data transfer is acting
00513   */
00514 uint8_t BSP_SD_GetCardState(void)
00515 {
00516   return((HAL_SD_GetCardState(&uSdHandle) == HAL_SD_CARD_TRANSFER ) ? SD_TRANSFER_OK : SD_TRANSFER_BUSY);
00517 }
00518   
00519 
00520 /**
00521   * @brief  Get SD information about specific SD card.
00522   * @param  CardInfo: Pointer to HAL_SD_CardInfoTypedef structure
00523   * @retval None 
00524   */
00525 void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
00526 {
00527   /* Get SD card Information */
00528   HAL_SD_GetCardInfo(&uSdHandle, CardInfo);
00529 }
00530 
00531 /**
00532   * @brief SD Abort callbacks
00533   * @param hsd: SD handle
00534   * @retval None
00535   */
00536 void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)
00537 {
00538   BSP_SD_AbortCallback();
00539 }
00540 
00541 /**
00542   * @brief Tx Transfer completed callbacks
00543   * @param hsd: SD handle
00544   * @retval None
00545   */
00546 void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
00547 {
00548   BSP_SD_WriteCpltCallback();
00549 }
00550 
00551 /**
00552   * @brief Rx Transfer completed callbacks
00553   * @param hsd: SD handle
00554   * @retval None
00555   */
00556 void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
00557 {
00558   BSP_SD_ReadCpltCallback();
00559 }
00560 
00561 /**
00562   * @brief BSP SD Abort callbacks
00563   * @retval None
00564   */
00565 __weak void BSP_SD_AbortCallback(void)
00566 {
00567 
00568 }
00569 
00570 /**
00571   * @brief BSP Tx Transfer completed callbacks
00572   * @retval None
00573   */
00574 __weak void BSP_SD_WriteCpltCallback(void)
00575 {
00576 
00577 }
00578 
00579 /**
00580   * @brief BSP Rx Transfer completed callbacks
00581   * @retval None
00582   */
00583 __weak void BSP_SD_ReadCpltCallback(void)
00584 {
00585 
00586 }
00587 
00588 /**
00589   * @}
00590   */ 
00591 
00592 /**
00593   * @}
00594   */ 
00595 
00596 /**
00597   * @}
00598   */ 
00599 
00600 /**
00601   * @}
00602   */
00603  
00604 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Fri Dec 30 2016 19:47:41 for STM32756G_EVAL BSP User Manual by   doxygen 1.7.6.1