![]() |
cueOS
2.4
cueOS - Universal Show Control OS for ARM
|
This file contains the common defines and functions prototypes for the bsp_driver_sd.c driver. More...


Go to the source code of this file.
Macros | |
| #define | BSP_SD_CardInfo HAL_SD_CardInfoTypeDef |
| SD Card information structure. More... | |
| #define | MSD_OK ((uint8_t)0x00) |
| SD status structure definition More... | |
| #define | MSD_ERROR ((uint8_t)0x01) |
| #define | SD_TRANSFER_OK ((uint8_t)0x00) |
| SD transfer state definition More... | |
| #define | SD_TRANSFER_BUSY ((uint8_t)0x01) |
| #define | SD_PRESENT ((uint8_t)0x01) |
| #define | SD_NOT_PRESENT ((uint8_t)0x00) |
| #define | SD_DATATIMEOUT ((uint32_t)100000000) |
Functions | |
| uint8_t | BSP_SD_Init (void) |
| Initializes the SD card device. More... | |
| uint8_t | BSP_SD_ITConfig (void) |
| Configures Interrupt mode for SD detection pin. More... | |
| void | BSP_SD_DetectIT (void) |
| SD detect IT treatment. More... | |
| void | BSP_SD_DetectCallback (void) |
| uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout) |
| Reads block(s) from a specified address in an SD card, in polling mode. More... | |
| uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout) |
| Writes block(s) to a specified address in an SD card, in polling mode. More... | |
| uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks) |
| Reads block(s) from a specified address in an SD card, in DMA mode. More... | |
| uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks) |
| Writes block(s) to a specified address in an SD card, in DMA mode. More... | |
| uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr) |
| Erases the specified memory area of the given SD card. More... | |
| void | BSP_SD_IRQHandler (void) |
| void | BSP_SD_DMA_Tx_IRQHandler (void) |
| void | BSP_SD_DMA_Rx_IRQHandler (void) |
| uint8_t | BSP_SD_GetCardState (void) |
| Gets the current SD card data status. More... | |
| void | BSP_SD_GetCardInfo (HAL_SD_CardInfoTypeDef *CardInfo) |
| Get SD information about specific SD card. More... | |
| uint8_t | BSP_SD_IsDetected (void) |
| Detects if SD card is correctly plugged in the memory slot or not. More... | |
| void | BSP_SD_AbortCallback (void) |
| BSP SD Abort callback. More... | |
| void | BSP_SD_WriteCpltCallback (void) |
| BSP Tx Transfer completed callback. More... | |
| void | BSP_SD_ReadCpltCallback (void) |
| BSP Rx Transfer completed callback. More... | |
This file contains the common defines and functions prototypes for the bsp_driver_sd.c driver.
for F4 (based on stm324x9i_eval_sd.h)
This software component is licensed by ST under Ultimate Liberty license SLA0044, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: www.st.com/SLA0044
Definition in file bsp_driver_sd.h.
| #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef |
SD Card information structure.
Definition at line 36 of file bsp_driver_sd.h.
| #define MSD_ERROR ((uint8_t)0x01) |
Definition at line 43 of file bsp_driver_sd.h.
| #define MSD_OK ((uint8_t)0x00) |
SD status structure definition
Definition at line 42 of file bsp_driver_sd.h.
| #define SD_DATATIMEOUT ((uint32_t)100000000) |
Definition at line 53 of file bsp_driver_sd.h.
| #define SD_NOT_PRESENT ((uint8_t)0x00) |
Definition at line 52 of file bsp_driver_sd.h.
| #define SD_PRESENT ((uint8_t)0x01) |
Definition at line 51 of file bsp_driver_sd.h.
| #define SD_TRANSFER_BUSY ((uint8_t)0x01) |
Definition at line 49 of file bsp_driver_sd.h.
| #define SD_TRANSFER_OK ((uint8_t)0x00) |
SD transfer state definition
Definition at line 48 of file bsp_driver_sd.h.
| void BSP_SD_AbortCallback | ( | void | ) |
BSP SD Abort callback.
| None |
Definition at line 269 of file bsp_driver_sd.c.
| void BSP_SD_DetectIT | ( | void | ) |
SD detect IT treatment.
Definition at line 87 of file bsp_driver_sd.c.
| uint8_t BSP_SD_Erase | ( | uint32_t | StartAddr, |
| uint32_t | EndAddr | ||
| ) |
Erases the specified memory area of the given SD card.
| StartAddr | Start byte address |
| EndAddr | End byte address |
| SD | status |
Definition at line 194 of file bsp_driver_sd.c.
| void BSP_SD_GetCardInfo | ( | HAL_SD_CardInfoTypeDef * | CardInfo | ) |
Get SD information about specific SD card.
| CardInfo | Pointer to HAL_SD_CardInfoTypedef structure |
| None |
Definition at line 224 of file bsp_driver_sd.c.
| uint8_t BSP_SD_GetCardState | ( | void | ) |
Gets the current SD card data status.
| None |
| Data | transfer state. This value can be one of the following values:
|
Definition at line 214 of file bsp_driver_sd.c.
| uint8_t BSP_SD_Init | ( | void | ) |
Initializes the SD card device.
| SD | status |
Definition at line 47 of file bsp_driver_sd.c.
| uint8_t BSP_SD_IsDetected | ( | void | ) |
Detects if SD card is correctly plugged in the memory slot or not.
| None |
| Returns | if SD is detected or not |
Definition at line 301 of file bsp_driver_sd.c.
| uint8_t BSP_SD_ITConfig | ( | void | ) |
Configures Interrupt mode for SD detection pin.
| Returns | 0 |
Definition at line 78 of file bsp_driver_sd.c.
| uint8_t BSP_SD_ReadBlocks | ( | uint32_t * | pData, |
| uint32_t | ReadAddr, | ||
| uint32_t | NumOfBlocks, | ||
| uint32_t | Timeout | ||
| ) |
Reads block(s) from a specified address in an SD card, in polling mode.
| pData | Pointer to the buffer that will contain the data to transmit |
| ReadAddr | Address from where data is to be read |
| NumOfBlocks | Number of SD blocks to read |
| Timeout | Timeout for read operation |
| SD | status |
Definition at line 104 of file bsp_driver_sd.c.
| uint8_t BSP_SD_ReadBlocks_DMA | ( | uint32_t * | pData, |
| uint32_t | ReadAddr, | ||
| uint32_t | NumOfBlocks | ||
| ) |
Reads block(s) from a specified address in an SD card, in DMA mode.
| pData | Pointer to the buffer that will contain the data to transmit |
| ReadAddr | Address from where data is to be read |
| NumOfBlocks | Number of SD blocks to read |
| SD | status |
Definition at line 149 of file bsp_driver_sd.c.
| void BSP_SD_ReadCpltCallback | ( | void | ) |
BSP Rx Transfer completed callback.
| None |
BSP Rx Transfer completed callback.
| hsd | SD handle |
| None |
Definition at line 289 of file bsp_driver_sd.c.
| uint8_t BSP_SD_WriteBlocks | ( | uint32_t * | pData, |
| uint32_t | WriteAddr, | ||
| uint32_t | NumOfBlocks, | ||
| uint32_t | Timeout | ||
| ) |
Writes block(s) to a specified address in an SD card, in polling mode.
| pData | Pointer to the buffer that will contain the data to transmit |
| WriteAddr | Address from where data is to be written |
| NumOfBlocks | Number of SD blocks to write |
| Timeout | Timeout for write operation |
| SD | status |
Definition at line 127 of file bsp_driver_sd.c.
| uint8_t BSP_SD_WriteBlocks_DMA | ( | uint32_t * | pData, |
| uint32_t | WriteAddr, | ||
| uint32_t | NumOfBlocks | ||
| ) |
Writes block(s) to a specified address in an SD card, in DMA mode.
| pData | Pointer to the buffer that will contain the data to transmit |
| WriteAddr | Address from where data is to be written |
| NumOfBlocks | Number of SD blocks to write |
| SD | status |
Definition at line 172 of file bsp_driver_sd.c.
| void BSP_SD_WriteCpltCallback | ( | void | ) |
BSP Tx Transfer completed callback.
| None |
BSP Tx Transfer completed callback.
| lun | : not used |
| *buff | Data to be written |
| sector | Sector address (LBA) |
| count | Number of sectors to write (1..128) |
| DRESULT | Operation result |
I/O control operation
| lun | : not used |
| cmd | Control code |
| *buff | Buffer to send/receive control data |
| DRESULT | Operation result |
Tx Transfer completed callbacks
| hsd | SD handle |
| None |
Definition at line 279 of file bsp_driver_sd.c.