STSW-STLKT01
|
Functions | |
uint8_t | BSP_SD_Init (void) |
Initialize the SD card. More... | |
uint8_t | BSP_SD_GetCardInfo (SD_CardInfo *pCardInfo) |
Returns information about specific card. More... | |
uint8_t | BSP_SD_ReadBlocks (uint32_t *p32Data, uint64_t Sector, uint16_t BlockSize, uint32_t NumberOfBlocks) |
Reads block(s) from a specified address in an SD card, in polling mode. More... | |
uint8_t | BSP_SD_WriteBlocks (uint32_t *p32Data, uint64_t Sector, uint16_t BlockSize, uint32_t NumberOfBlocks) |
Writes block(s) to a specified address in an SD card, in polling mode. More... | |
void | HAL_SPI_TxCpltCallback (SPI_HandleTypeDef *hspi) |
TxRx Transfer completed callback. More... | |
uint8_t | BSP_SD_GetStatus (void) |
Returns the SD status. More... | |
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr) |
Erases the specified memory area of the given SD card. More... | |
static uint8_t | SD_GetCSDRegister (SD_CSD *Csd) |
Read the CSD card register. Reading the contents of the CSD register in SPI mode is a simple read-block transaction. More... | |
static uint8_t | SD_GetCIDRegister (SD_CID *Cid) |
Read the CID card register. Reading the contents of the CID register in SPI mode is a simple read-block transaction. More... | |
static uint8_t | SD_SendCmd_wResp (uint8_t Cmd, uint32_t Arg, uint8_t Crc) |
Send 5 bytes command to the SD card and get response. More... | |
static uint8_t | SD_SendCmd (uint8_t Cmd, uint32_t Arg, uint8_t Crc, uint8_t Response) |
Send 5 bytes command to the SD card and get response. More... | |
static SD_Info | SD_GetDataResponse (void) |
Get SD card data response. More... | |
static uint8_t | SD_GoIdleState (void) |
Put SD in Idle state. More... | |
Detailed Description
Function Documentation
◆ BSP_SD_Erase()
uint8_t BSP_SD_Erase | ( | uint32_t | StartAddr, |
uint32_t | EndAddr | ||
) |
Erases the specified memory area of the given SD card.
- Parameters
-
StartAddr Start byte address EndAddr End byte address
- Return values
-
SD status
Definition at line 756 of file SensorTile_sd.c.
◆ BSP_SD_GetCardInfo()
uint8_t BSP_SD_GetCardInfo | ( | SD_CardInfo * | pCardInfo | ) |
Returns information about specific card.
- Parameters
-
cardinfo pointer to a SD_CardInfo structure that contains all SD card information.
- Return values
-
The SD Response: - MSD_ERROR : Sequence failed
- MSD_OK : Sequence succeed
Definition at line 185 of file SensorTile_sd.c.
◆ BSP_SD_GetStatus()
uint8_t BSP_SD_GetStatus | ( | void | ) |
Returns the SD status.
- Parameters
-
None
- Return values
-
The SD status.
Definition at line 678 of file SensorTile_sd.c.
◆ BSP_SD_Init()
uint8_t BSP_SD_Init | ( | void | ) |
Initialize the SD card.
- Parameters
-
None
- Return values
-
The SD Response: - MSD_ERROR : Sequence failed
- MSD_OK : Sequence succeed
Definition at line 151 of file SensorTile_sd.c.
◆ BSP_SD_ReadBlocks()
uint8_t BSP_SD_ReadBlocks | ( | uint32_t * | p32Data, |
uint64_t | Sector, | ||
uint16_t | BlockSize, | ||
uint32_t | NumberOfBlocks | ||
) |
Reads block(s) from a specified address in an SD card, in polling mode.
- Parameters
-
pData Pointer to the buffer that will contain the data to transmit ReadAddr Address from where data is to be read BlockSize SD card data block size, that should be 512 NumOfBlocks Number of SD blocks to read
- Return values
-
SD status
Definition at line 208 of file SensorTile_sd.c.
◆ BSP_SD_WriteBlocks()
uint8_t BSP_SD_WriteBlocks | ( | uint32_t * | p32Data, |
uint64_t | Sector, | ||
uint16_t | BlockSize, | ||
uint32_t | NumberOfBlocks | ||
) |
Writes block(s) to a specified address in an SD card, in polling mode.
- Parameters
-
pData Pointer to the buffer that will contain the data to transmit WriteAddr Address from where data is to be written BlockSize SD card data block size, that should be 512 NumOfBlocks Number of SD blocks to write
- Return values
-
SD status
Definition at line 287 of file SensorTile_sd.c.
◆ HAL_SPI_TxCpltCallback()
void HAL_SPI_TxCpltCallback | ( | SPI_HandleTypeDef * | hspi | ) |
TxRx Transfer completed callback.
- Parameters
-
hspi SPI handle
- Note
- This example shows a simple way to report end of DMA TxRx transfer, and you can add your own implementation.
- Return values
-
None
Definition at line 368 of file SensorTile_sd.c.
◆ SD_GetCIDRegister()
|
static |
Read the CID card register. Reading the contents of the CID register in SPI mode is a simple read-block transaction.
- Parameters
-
Cid pointer on an CID register structure
- Return values
-
SD status
Definition at line 499 of file SensorTile_sd.c.
◆ SD_GetCSDRegister()
|
static |
Read the CSD card register. Reading the contents of the CSD register in SPI mode is a simple read-block transaction.
- Parameters
-
Csd pointer on an SCD register structure
- Return values
-
SD status
< Reserved
Definition at line 381 of file SensorTile_sd.c.
◆ SD_GetDataResponse()
|
static |
Get SD card data response.
- Parameters
-
None
- Return values
-
The SD status: Read data response xxx0<status>1 - status 010: Data accecpted
- status 101: Data rejected due to a crc error
- status 110: Data rejected due to a Write error.
- status 111: Data rejected due to other error.
Definition at line 629 of file SensorTile_sd.c.
◆ SD_GoIdleState()
|
static |
Put SD in Idle state.
- Parameters
-
None
- Return values
-
SD status
Definition at line 688 of file SensorTile_sd.c.
◆ SD_SendCmd()
|
static |
Send 5 bytes command to the SD card and get response.
- Parameters
-
Cmd The user expected command to send to SD card. Arg The command argument. Crc The CRC. Response Expected response from the SD card
- Return values
-
SD status
Definition at line 605 of file SensorTile_sd.c.
◆ SD_SendCmd_wResp()
|
static |
Send 5 bytes command to the SD card and get response.
- Parameters
-
Cmd The user expected command to send to SD card. Arg The command argument. Crc The CRC. Response Expected response from the SD card
- Return values
-
SD status
Definition at line 592 of file SensorTile_sd.c.
Generated by 1.8.13