Data Structures | Macros | Typedefs | Functions
SDIO.h File Reference

Detailed Description

Secure Digital Input Output (SDIO) Driver.


Overview

The SDIO driver is designed to serve as an interface to perform basic transfers directly between Hosts.


Usage

SDIO (Secure Digital Input Output) provides a reliable and efficient method for connecting peripheral devices to a host system. It allows the host device, such as a microcontroller or processor, to communicate with various SDIO-compatible modules, including Wi-Fi, Bluetooth, GPS, and other external peripherals. The host can use standard SDIO commands to initialize and control the connected device.

Synopsis


Configuration

Refer to the Driver's Configuration section for driver configuration information.


#include <stdint.h>
Include dependency graph for SDIO.h:

Go to the source code of this file.

Data Structures

struct  SDIO_Params
 SDIO Parameters. More...
 
struct  SDIO_Config_
 SDIO Global configuration. More...
 

Macros

#define SDIO_STATUS_SUCCESS   (0)
 Successful status code returned by SDIO driver. More...
 
#define SDIO_STATUS_ERROR   (-1)
 Generic error status code returned by SDIO driver. More...
 

Typedefs

typedef struct SDIO_Config_SDIO_Handle
 A handle that is returned from a SDIO_open() call. More...
 
typedef struct SDIO_Config_ SDIO_Config
 SDIO Global configuration. More...
 

Functions

void SDIO_close (SDIO_Handle handle)
 Function to close a SDIO peripheral specified by the SDIO handle. More...
 
void SDIO_init (void)
 This function initializes the SDIO driver. More...
 
void SDIO_Params_init (SDIO_Params *params)
 Function to initialize the SDIO_Params struct to its defaults. More...
 
SDIO_Handle SDIO_open (uint_least8_t index, SDIO_Params *params)
 Function to open the SDIO peripheral with the index and parameters specified. More...
 
int_fast16_t SDIO_read (SDIO_Handle handle, void *buf, int_fast32_t numByte)
 Function that reads the data from SDIO host. The destination is specified by buf. And the total number of bytes to read is provided by numByte. More...
 
int_fast16_t SDIO_write (SDIO_Handle handle, void *buf, int_fast32_t numByte)
 Function that writes data to SDIO host. The source is specified by buf. And the total number of bytes to read is provided by numByte. More...
 

Typedef Documentation

§ SDIO_Handle

typedef struct SDIO_Config_* SDIO_Handle

A handle that is returned from a SDIO_open() call.

§ SDIO_Config

typedef struct SDIO_Config_ SDIO_Config

SDIO Global configuration.

The SDIO_Config structure contains a set of pointers used to characterize the SDIO driver implementation.

This structure needs to be defined before calling SDIO_init() and it must not be changed thereafter.

See also
SDIO_init()

Function Documentation

§ SDIO_close()

void SDIO_close ( SDIO_Handle  handle)

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

Precondition
SDIO_open() had to be called first.
Parameters
handleAn SDIO_Handle returned from SDIO_open()
See also
SDIO_open()

§ SDIO_init()

void SDIO_init ( void  )

This function initializes the SDIO driver.

Precondition
The SDIO_Config[] array must exist and be persistent before this function can be called. This function must also be called before any other SDIO driver APIs. This function call does not modify any peripheral registers.

§ SDIO_Params_init()

void SDIO_Params_init ( SDIO_Params params)

Function to initialize the SDIO_Params struct to its defaults.

Parameters
paramsA pointer to SDIO_Params structure for initialization.

§ SDIO_open()

SDIO_Handle SDIO_open ( uint_least8_t  index,
SDIO_Params params 
)

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

Precondition
SDIO driver has been initialized using SDIO_init().
Parameters
indexLogical peripheral number for the SDIO indexed into the SDIO_Config[] table.
paramsPointer to a parameter block, if NULL it will use default values. All the fields in this structure are RO (read-only).
Returns
An SDIO_Handle on success or a NULL on an error or if it has been opened already.
See also
SDIO_init()
SDIO_close()

§ SDIO_read()

int_fast16_t SDIO_read ( SDIO_Handle  handle,
void *  buf,
int_fast32_t  numByte 
)

Function that reads the data from SDIO host. The destination is specified by buf. And the total number of bytes to read is provided by numByte.

Precondition
SDIO driver has been opened and initialized by calling SDIO_open()
Parameters
handleAn SDIO_Handle returned from SDIO_open().
bufPointer to a buffer to read data into.
numByteNumber of bytes to be read.
Returns
SDIO_STATUS_SUCCESS if no errors occurred during the write, SDIO_STATUS_ERROR otherwise.
See also
SDIO host initialized the SDIO peripheral

§ SDIO_write()

int_fast16_t SDIO_write ( SDIO_Handle  handle,
void *  buf,
int_fast32_t  numByte 
)

Function that writes data to SDIO host. The source is specified by buf. And the total number of bytes to read is provided by numByte.

Precondition
SDIO driver has been opened and initialized by calling SDIO_open()
Parameters
handleAn SDIO_Handle returned from SDIO_open().
bufPointer to a buffer containing data to write to disk.
numByteNumber of bytes to be written.
Returns
SDIO_STATUS_SUCCESS if no errors occurred during the write, SDIO_STATUS_ERROR otherwise.
See also
SDIO host initialized the SDIO peripheral
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale