Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

SD - Secure Digital Library


Files

file  otSD.h
 Secure Digital Library for BF51x.

Modules

 Version History
 FatFs - Low level driver
 SD - Code example

Data Structures

struct  _ADI_RSI_SD_CID_REGISTER
 < Card Identification More...

Typedefs

typedef _ADI_RSI_SD_CID_REGISTER ADI_RSI_SD_CID_REGISTER
 < Card Identification

Enumerations

enum  SD_MMC_CARD_TYPE {
  SD_MMC_CARD_TYPE_SD_V1X, SD_MMC_CARD_TYPE_SD_V2X, SD_MMC_CARD_TYPE_SD_V2X_HIGH_CAPACITY, SD_MMC_CARD_TYPE_MMC,
  SD_MMC_CARD_TYPE_MMC_CARD_HIGH_CAPACITY, UNUSABLE_CARD, CARD_SLOT_NOT_INITIALIZED
}

Functions

void SdPower (bool ena)
 Turn on/off the SD power supply.
int SdOpen (int timer)
 Init the RSI.
void SdClose ()
 Off RSI.
U32 SdSize ()
 return the SD size as Kbyte (1024 byte)
U32 SdSectorCount ()
 return the number of sectors
U32 SdSectorSize ()
 Return the size of a sector in bytes.
U32 SdEraseSectorSize ()
 Return the size of sector in byte for erase operation.
bool SdSectorErase (U32 startBlock, U32 endBlock)
 Erase a block of sectors.
ADI_RSI_SD_CID_REGISTERSdGetCID ()
 Return the SD Card Information, see _ADI_RSI_SD_CID_REGISTER.
bool SdReadBlock (U32 block_num, void *pReadBuffer)
 Read a sector.
bool SdWriteBlock (U32 block_num, void *pWriteBuffer)
 Write a sector.
bool SdReadMultipleBlocks (U32 block_num, void *pReadBuffer, U32 num_blocks)
 Read multiple sectors.
bool SdWriteMultipleBlocks (U32 block_num, void *pWriteBuffer, U32 num_blocks)
 Write multiple sectors.
int SdGetMaxBusWidth ()
 Return the number of bit(s) of the SD bus.
bool SdSetMaxBusWidth (U8 width)
 Set the number of bit(s) of the SD bus.

Detailed Description

Dependency:
PORT - Procedure for parallel port usage
TIMER - Procedure for timer usage

Typedef Documentation

typedef struct _ADI_RSI_SD_CID_REGISTER ADI_RSI_SD_CID_REGISTER
 


Enumeration Type Documentation

enum SD_MMC_CARD_TYPE
 

Enumeration values:
SD_MMC_CARD_TYPE_SD_V1X  Card types.
SD_MMC_CARD_TYPE_SD_V2X  Card types.
SD_MMC_CARD_TYPE_SD_V2X_HIGH_CAPACITY  Card types.
SD_MMC_CARD_TYPE_MMC  Card types.
SD_MMC_CARD_TYPE_MMC_CARD_HIGH_CAPACITY  Card types.
UNUSABLE_CARD  Card types.
CARD_SLOT_NOT_INITIALIZED  Card types.


Function Documentation

void SdClose  ) 
 

U32 SdEraseSectorSize  ) 
 

ADI_RSI_SD_CID_REGISTER* SdGetCID  ) 
 

int SdGetMaxBusWidth  ) 
 

int SdOpen int  timer  ) 
 

Parameters:
timer Timer identifier used to evaluate timeouts
Returns:
Type of card detected

void SdPower bool  ena  ) 
 

Parameters:
ena If true turn on the power else turn off.

bool SdReadBlock U32  block_num,
void *  pReadBuffer
 

Parameters:
block_num Sector number
pReadBuffer Pointer to store read data
Returns:
false for no errors

bool SdReadMultipleBlocks U32  block_num,
void *  pReadBuffer,
U32  num_blocks
 

Parameters:
block_num Sector number
pReadBuffer Pointer to store read data
num_blocks Number of sectors to read
Returns:
false for no errors

U32 SdSectorCount  ) 
 

bool SdSectorErase U32  startBlock,
U32  endBlock
 

Parameters:
startBlock Start sector
endBlock End sector
Returns:
false for no errors

U32 SdSectorSize  ) 
 

bool SdSetMaxBusWidth U8  width  ) 
 

Parameters:
width Number of bits 1:4

U32 SdSize  ) 
 

bool SdWriteBlock U32  block_num,
void *  pWriteBuffer
 

Parameters:
block_num Sector number
pWriteBuffer Data pointer for data to write
Returns:
false for no errors

bool SdWriteMultipleBlocks U32  block_num,
void *  pWriteBuffer,
U32  num_blocks
 

Parameters:
block_num Sector number
pWriteBuffer Data pointer for data to write
num_blocks Number of sectors to write
Returns:
false for no errors
footer

otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0