WebRadioApp  0.1
sd_diskio.c File Reference

SD Disk I/O driver. More...

#include "ff_gen_drv.h"
#include "sd_diskio.h"
Include dependency graph for sd_diskio.c:

Macros

#define SD_TIMEOUT   SD_DATATIMEOUT
 
#define SD_DEFAULT_BLOCK_SIZE   512
 

Functions

static DSTATUS SD_CheckStatus (BYTE lun)
 
DSTATUS SD_initialize (BYTE lun)
 Initializes a Drive. More...
 
DSTATUS SD_status (BYTE lun)
 Gets Disk Status. More...
 
DRESULT SD_read (BYTE lun, BYTE *buff, DWORD sector, UINT count)
 Reads Sector(s) More...
 

Variables

static volatile DSTATUS Stat = STA_NOINIT
 
const Diskio_drvTypeDef SD_Driver
 

Detailed Description

SD Disk I/O driver.

Attention

© Copyright (c) 2021 STMicroelectronics. All rights reserved.

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

Macro Definition Documentation

◆ SD_DEFAULT_BLOCK_SIZE

#define SD_DEFAULT_BLOCK_SIZE   512

◆ SD_TIMEOUT

#define SD_TIMEOUT   SD_DATATIMEOUT

Function Documentation

◆ SD_CheckStatus()

static DSTATUS SD_CheckStatus ( BYTE  lun)
static

References BSP_SD_GetCardState(), MSD_OK, and Stat.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SD_initialize()

DSTATUS SD_initialize ( BYTE  lun)

Initializes a Drive.

Parameters
lun: not used
Return values
DSTATUSOperation status

References BSP_SD_Init(), MSD_OK, SD_CheckStatus(), and Stat.

Here is the call graph for this function:

◆ SD_read()

DRESULT SD_read ( BYTE  lun,
BYTE *  buff,
DWORD  sector,
UINT  count 
)

Reads Sector(s)

Parameters
lun: not used
*buffData buffer to store read data
sectorSector address (LBA)
countNumber of sectors to read (1..128)
Return values
DRESULTOperation result

References BSP_SD_GetCardState(), BSP_SD_ReadBlocks(), MSD_OK, res, and SD_TIMEOUT.

Here is the call graph for this function:

◆ SD_status()

DSTATUS SD_status ( BYTE  lun)

Gets Disk Status.

Parameters
lun: not used
Return values
DSTATUSOperation status

References SD_CheckStatus().

Here is the call graph for this function:

Variable Documentation

◆ SD_Driver

const Diskio_drvTypeDef SD_Driver
Initial value:

◆ Stat

volatile DSTATUS Stat = STA_NOINIT
static
SD_read
DRESULT SD_read(BYTE, BYTE *, DWORD, UINT)
Reads Sector(s)
Definition: sd_diskio.c:144
SD_initialize
DSTATUS SD_initialize(BYTE)
Initializes a Drive.
Definition: sd_diskio.c:104
SD_status
DSTATUS SD_status(BYTE)
Gets Disk Status.
Definition: sd_diskio.c:126