STSW-STLKT01: SENSORTILE_SD Exported Functions

STSW-STLKT01

STSW-STLKT01
SENSORTILE_SD Exported Functions

Functions

uint8_t BSP_SD_Init (void)
 Initialize the SD card. More...
 
uint8_t BSP_SD_IsDetected (void)
 
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...
 
uint8_t BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
 Erases the specified memory area of the given SD card. More...
 
uint8_t BSP_SD_GetStatus (void)
 Returns the SD status. More...
 
uint8_t BSP_SD_GetCardInfo (SD_CardInfo *pCardInfo)
 Returns information about specific card. More...
 
void SD_IO_Init (void)
 Initializes the SD Card and put it into StandBy State (Ready for data transfer). More...
 
void SD_IO_Init_LS (void)
 Initializes the SD Card and put it into StandBy State (Ready for data transfer). Low baundrate. More...
 
void SD_IO_WriteByte (uint8_t Data)
 Writes a byte on the SD. More...
 
uint8_t SD_IO_ReadByte (void)
 Reads a byte from the SD. More...
 
HAL_StatusTypeDef SD_IO_WriteCmd (uint8_t Cmd, uint32_t Arg, uint8_t Crc, uint8_t Response)
 Sends 5 bytes command to the SD card and get response. More...
 
uint8_t SD_IO_WriteCmd_wResp (uint8_t Cmd, uint32_t Arg, uint8_t Crc)
 Sends 5 bytes command to the SD card and get response. More...
 
HAL_StatusTypeDef SD_IO_WaitResponse (uint8_t Response)
 Waits response from the SD card. More...
 
void SD_IO_WriteDummy (void)
 Sends dummy byte with CS High. More...
 
void SD_IO_WriteDMA (uint8_t *pData, uint16_t Size)
 Writes a block by DMA on the SD. 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
StartAddrStart byte address
EndAddrEnd byte address
Return values
SDstatus

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
cardinfopointer to a SD_CardInfo structure that contains all SD card information.
Return values
TheSD 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
TheSD 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
TheSD 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
pDataPointer to the buffer that will contain the data to transmit
ReadAddrAddress from where data is to be read
BlockSizeSD card data block size, that should be 512
NumOfBlocksNumber of SD blocks to read
Return values
SDstatus

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
pDataPointer to the buffer that will contain the data to transmit
WriteAddrAddress from where data is to be written
BlockSizeSD card data block size, that should be 512
NumOfBlocksNumber of SD blocks to write
Return values
SDstatus

Definition at line 287 of file SensorTile_sd.c.

◆ SD_IO_Init()

void SD_IO_Init ( void  )

Initializes the SD Card and put it into StandBy State (Ready for data transfer).

Parameters
None
Return values
None

Definition at line 1140 of file SensorTile.c.

◆ SD_IO_Init_LS()

void SD_IO_Init_LS ( void  )

Initializes the SD Card and put it into StandBy State (Ready for data transfer). Low baundrate.

Parameters
None
Return values
None

Definition at line 1167 of file SensorTile.c.

◆ SD_IO_ReadByte()

uint8_t SD_IO_ReadByte ( void  )

Reads a byte from the SD.

Parameters
None
Return values
Thereceived byte.

Definition at line 1253 of file SensorTile.c.

◆ SD_IO_WaitResponse()

HAL_StatusTypeDef SD_IO_WaitResponse ( uint8_t  Response)

Waits response from the SD card.

Parameters
ResponseExpected response from the SD card
Return values
HAL_StatusTypeDefHAL Status

Definition at line 1347 of file SensorTile.c.

◆ SD_IO_WriteByte()

void SD_IO_WriteByte ( uint8_t  Data)

Writes a byte on the SD.

Parameters
Databyte to send.
Return values
None

Definition at line 1224 of file SensorTile.c.

◆ SD_IO_WriteCmd()

HAL_StatusTypeDef SD_IO_WriteCmd ( uint8_t  Cmd,
uint32_t  Arg,
uint8_t  Crc,
uint8_t  Response 
)

Sends 5 bytes command to the SD card and get response.

Parameters
CmdThe user expected command to send to SD card.
ArgThe command argument.
CrcThe CRC.
ResponseExpected response from the SD card
Return values
HAL_StatusTypeDefHAL Status

Definition at line 1312 of file SensorTile.c.

◆ SD_IO_WriteCmd_wResp()

uint8_t SD_IO_WriteCmd_wResp ( uint8_t  Cmd,
uint32_t  Arg,
uint8_t  Crc 
)

Sends 5 bytes command to the SD card and get response.

Parameters
CmdThe user expected command to send to SD card.
ArgThe command argument.
CrcThe CRC.
ResponseExpected response from the SD card
Return values
HAL_StatusTypeDefHAL Status

Definition at line 1273 of file SensorTile.c.

◆ SD_IO_WriteDMA()

void SD_IO_WriteDMA ( uint8_t *  pData,
uint16_t  Size 
)

Writes a block by DMA on the SD.

Parameters
Databyte to send.
Return values
None

Definition at line 1237 of file SensorTile.c.

◆ SD_IO_WriteDummy()

void SD_IO_WriteDummy ( void  )

Sends dummy byte with CS High.

Parameters
None
Return values
None

Definition at line 1374 of file SensorTile.c.

Generated by   doxygen 1.8.13