Data Structures | Typedefs | Enumerations | Functions | Variables
SDWFF3.h File Reference

Go to the source code of this file.

Data Structures

struct  SDWFF3_Object
 SDWFF3 driver object. More...
 
struct  SDWFF3_HwAttrs
 
struct  SDWFF3_Param
 

Typedefs

typedef void(* SDWFF3_EventCB) (uint8_t event)
 Callback function supplied by the application. More...
 

Enumerations

enum  Event_Type {
  SDWFF3_NULL = 0, SDWFF3_CARD_INSERTED = 1, SDWFF3_CARD_REMOVED = 2, SDWFF3_CARD_WRITE_PROTECTED = 3,
  SDWFF3_STATUS_ERR = 4
}
 

Functions

void SDWFF3_close (SD_Handle handle)
 Function to close a SD peripheral specified by the SD handle. More...
 
int_fast16_t SDWFF3_control (SD_Handle handle, uint_fast16_t cmd, void *arg)
 Function for setting control parameters of the SDWFF3 driver after it has been opened. More...
 
uint_fast32_t SDWFF3_getNumSectors (SD_Handle handle)
 Function to obtain the total number of sectors on the SD card. Note: Total Card capacity is the (NumberOfSectors * SectorSize). More...
 
uint_fast32_t SDWFF3_getSectorSize (SD_Handle handle)
 
void SDWFF3_init (SD_Handle handle)
 This function initializes the SD driver. More...
 
int_fast16_t SDWFF3_initialize (SD_Handle handle)
 Function to initialize the SD card. More...
 
SD_Handle SDWFF3_open (SD_Handle handle, SD_Params *params)
 Function to open the SD peripheral with the index and parameters specified. More...
 
int_fast16_t SDWFF3_read (SD_Handle handle, void *buf, int_fast32_t sector, uint_fast32_t secCount)
 Function that reads the specified sectors from the SD card. The destination is specified by buf. The starting sector is specified by sector and the total number of sectors to read is provided by secCount. More...
 
int_fast16_t SDWFF3_write (SD_Handle handle, const void *buf, int_fast32_t sector, uint_fast32_t secCount)
 Function that writes data to the specified sectors of the SD card. The source is specified by buf. The starting sector to write is specified by sector and the total number of sectors to write is provided by secCount. More...
 

Variables

const SD_FxnTable SDWFF3_fxnTable
 

Typedef Documentation

§ SDWFF3_EventCB

typedef void(* SDWFF3_EventCB) (uint8_t event)

Callback function supplied by the application.

Enumeration Type Documentation

§ Event_Type

enum Event_Type
Enumerator
SDWFF3_NULL 
SDWFF3_CARD_INSERTED 
SDWFF3_CARD_REMOVED 
SDWFF3_CARD_WRITE_PROTECTED 
SDWFF3_STATUS_ERR 

Function Documentation

§ SDWFF3_close()

void SDWFF3_close ( SD_Handle  handle)

Function to close a SD peripheral specified by the SD handle.

The functions are based on SD.h Descriptions will appear there, and expanded here where relevant for WFF3.

======== SDWFF3_close ======== When closing the peripheral, IOs will be reset to what is configured by SysConfig. If power-off while sleep defined in Sys-Config then card must be initialized too.

Precondition
SD_open() had to be called first.
Parameters
[in]handleA SD_Handle returned from SD_open()
See also
SD_open()

§ SDWFF3_control()

int_fast16_t SDWFF3_control ( SD_Handle  handle,
uint_fast16_t  cmd,
void *  arg 
)

Function for setting control parameters of the SDWFF3 driver after it has been opened.

======== SDWFF3_control ========

Precondition
SDWFF3_open() has to be called first.
Parameters
handleA SDWFF3 handle returned from SDWFF3_open()
cmdThe command to execute, supported commands are:
Command SD_STATUS_SUCCESS SD_STATUS_ERROR
SDWFF3_CMD_IS_CARD_CONNECTED Card is connected Card is NOT connected
SDWFF3_CMD_IS_CARD_WRITE_PROTECTEDCard is write protectedCard is write protected
argNot used in SDWFF3.
Returns
Status code
Return values
SD_STATUS_SUCCESSThe call was successful.
SD_STATUS_ERRORThe call was unsuccessful.

§ SDWFF3_getNumSectors()

uint_fast32_t SDWFF3_getNumSectors ( SD_Handle  handle)

Function to obtain the total number of sectors on the SD card. Note: Total Card capacity is the (NumberOfSectors * SectorSize).

Precondition
SD Card has been initialized using SD_initialize().
Parameters
handleA SD_Handle returned from SD_open().
Returns
The total number of sectors on the SD card, or 0 if an error occurred.
See also
SD_initialize()

§ SDWFF3_getSectorSize()

uint_fast32_t SDWFF3_getSectorSize ( SD_Handle  handle)

The sector size of SD card is always 512 bytes

§ SDWFF3_init()

void SDWFF3_init ( SD_Handle  handle)

This function initializes the SD driver.

Precondition
The #SD_config[] array must exist and be persistent before this function can be called. This function must also be called before any other SD driver APIs. This function call does not modify any peripheral registers.
Note
For initializing the driver correctly, review the example for using the driver above.

§ SDWFF3_initialize()

int_fast16_t SDWFF3_initialize ( SD_Handle  handle)

Function to initialize the SD card.

Precondition
SD controller has been opened by calling SD_open().
Parameters
handleA SD_Handle returned from SD_open().
Returns
SD_STATUS_SUCCESS if no errors occurred during the initialization, SD_STATUS_ERROR otherwise.

§ SDWFF3_open()

SD_Handle SDWFF3_open ( SD_Handle  handle,
SD_Params params 
)

Function to open the SD peripheral with the index and parameters specified.

Precondition
SD controller has been initialized using SD_init().
Parameters
indexThere is one SDWFF3 so index = 0.
paramsPointer to a SDWFF3_Param block. SDWFF3CallbackFxn - call-back function for the application. The function must be SDWFF3EventCB type. See example above for template. minDmaTransferSize - Define the threshold for using DMA in transaction. If the number of sector is bigger than minDmaTransferSize, DMA will be used.
Returns
A SD_Handle on success or a NULL on an error or if it has been opened already.
See also
SD_init()
SD_close()

§ SDWFF3_read()

int_fast16_t SDWFF3_read ( SD_Handle  handle,
void *  buf,
int_fast32_t  sector,
uint_fast32_t  secCount 
)

Function that reads the specified sectors from the SD card. The destination is specified by buf. The starting sector is specified by sector and the total number of sectors to read is provided by secCount.

Precondition
SD controller has been opened and initialized by calling SD_open() followed by SD_initialize().
Parameters
handleA SD_Handle returned from SD_open().
bufPointer to a buffer to read data into.
sectorStarting sector on the disk to read from.
secCountNumber of sectors to be read.
Returns
SD_STATUS_SUCCESS if no errors occurred during the write, SD_STATUS_ERROR otherwise.
See also
SD_initialize()

§ SDWFF3_write()

int_fast16_t SDWFF3_write ( SD_Handle  handle,
const void *  buf,
int_fast32_t  sector,
uint_fast32_t  secCount 
)

Function that writes data to the specified sectors of the SD card. The source is specified by buf. The starting sector to write is specified by sector and the total number of sectors to write is provided by secCount.

Precondition
SD controller has been opened and initialized by calling SD_open() followed by SD_initialize().
Parameters
handleA SD_Handle returned from SD_open().
bufPointer to a buffer containing data to write to disk.
sectorStarting sector on the disk to write to.
secCountNumber of sectors to be written.
Returns
SD_STATUS_SUCCESS if no errors occurred during the write, SD_STATUS_ERROR otherwise.
See also
SD_initialize()

Variable Documentation

§ SDWFF3_fxnTable

const SD_FxnTable SDWFF3_fxnTable
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale