@@ -321,6 +321,47 @@ uint8_t BSP_SD_IsDetected(void)
321321 return status ;
322322}
323323
324+ #ifndef STM32L1xx
325+ /**
326+ * @brief Reads block(s) from a specified address in an SD card, in polling mode.
327+ * @param pData: Pointer to the buffer that will contain the data to transmit
328+ * @param ReadAddr: Address from where data is to be read
329+ * @param NumOfBlocks: Number of SD blocks to read
330+ * @param Timeout: Timeout for read operation
331+ * @retval SD status
332+ */
333+ uint8_t BSP_SD_ReadBlocks (uint32_t * pData , uint32_t ReadAddr , uint32_t NumOfBlocks , uint32_t Timeout )
334+ {
335+ if (HAL_SD_ReadBlocks (& uSdHandle , (uint8_t * )pData , ReadAddr , NumOfBlocks , Timeout ) != HAL_OK )
336+ {
337+ return MSD_ERROR ;
338+ }
339+ else
340+ {
341+ return MSD_OK ;
342+ }
343+ }
344+
345+ /**
346+ * @brief Writes block(s) to a specified address in an SD card, in polling mode.
347+ * @param pData: Pointer to the buffer that will contain the data to transmit
348+ * @param WriteAddr: Address from where data is to be written
349+ * @param NumOfBlocks: Number of SD blocks to write
350+ * @param Timeout: Timeout for write operation
351+ * @retval SD status
352+ */
353+ uint8_t BSP_SD_WriteBlocks (uint32_t * pData , uint32_t WriteAddr , uint32_t NumOfBlocks , uint32_t Timeout )
354+ {
355+ if (HAL_SD_WriteBlocks (& uSdHandle , (uint8_t * )pData , WriteAddr , NumOfBlocks , Timeout ) != HAL_OK )
356+ {
357+ return MSD_ERROR ;
358+ }
359+ else
360+ {
361+ return MSD_OK ;
362+ }
363+ }
364+ #else /* STM32L1xx */
324365/**
325366 * @brief Reads block(s) from a specified address in an SD card, in polling mode.
326367 * @param pData: Pointer to the buffer that will contain the data to transmit
@@ -360,6 +401,7 @@ uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSi
360401 return MSD_OK ;
361402 }
362403}
404+ #endif /* !STM32L1xx */
363405
364406/**
365407 * @brief Erases the specified memory area of the given SD card.
0 commit comments