Hardware Abstraction Layer (HAL)
SDIO (Secure Digital Input Output)

General Description

High level interface to the Secure Digital Input Output (SDIO).

The SDIO protocol is an extension of the SD interface for general I/O functions. Refer to the SD Specifications Part 1 SDIO Specifications Version 4.10 for more information on the SDIO protocol and specifications.

The host functionality of this driver allows commands to be sent over the SDIO bus; the supported commands can be found in cyhal_sdio_host_command_t. Bulk data transfer is supported via cyhal_sdio_bulk_transfer().

The device functionality of this driver allows configuring the SDIO device for receiving commands from the host. Data can be sent and received from/to application buffers.

Features

Quick Start

cyhal_sdio_init initializes the SDIO peripheral and passes a pointer to the SDIO block through the obj object of type cyhal_sdio_t.

Code Snippets

Host Code Snippets

Snippet1: Simple SDIO Host Initialization example

The following snippet shows how to initialize the SDIO host interface with a pre-defined configuration

cy_rslt_t rslt;
cyhal_sdio_t sdio_object;
#define BLOCK_SIZE (512)
#define SDIO_FREQ_HF (100000000UL)
cyhal_sdio_cfg_t my_sdio_cfg =
{
.block_size = BLOCK_SIZE,
.frequencyhal_hz = SDIO_FREQ_HF,
.is_sdio_dev = false
};
rslt = cyhal_sdio_init(&sdio_object,
SDIO_CMD_PIN,
SDIO_CLK_PIN,
SDIO_DATA0_PIN,
SDIO_DATA1_PIN,
SDIO_DATA2_PIN,
SDIO_DATA3_PIN);
rslt = cyhal_sdio_configure(&sdio_object, &my_sdio_cfg);
SDIO object.
Definition: cyhal_hw_types.h:769
uint16_t block_size
Block size (max block size for device mode)
Definition: cyhal_sdio.h:301
cy_rslt_t cyhal_sdio_configure(cyhal_sdio_t *obj, const cyhal_sdio_cfg_t *config)
Configure the SDIO block.
cy_rslt_t cyhal_sdio_init(cyhal_sdio_t *obj, cyhal_gpio_t cmd, cyhal_gpio_t clk, cyhal_gpio_t data0, cyhal_gpio_t data1, cyhal_gpio_t data2, cyhal_gpio_t data3)
Initialize the SDIO peripheral.
SDIO initial configuration.
Definition: cyhal_sdio.h:299
uint32_t cy_rslt_t
Provides the result of an operation as a structured bitfield.
Definition: cy_result.h:438

Snippet2: Configure Host Interrupt

The following snippet shows how to configure an interrupt to handle host specific events. Refer cyhal_sdio_event_t for different types of events.

// Event handler callback function
void sdio_host_event_handler(void* handler_arg, cyhal_sdio_event_t event)
{
CY_UNUSED_PARAMETER(handler_arg);
CY_UNUSED_PARAMETER(event);
switch (event)
{
case CYHAL_SDIO_CARD_INSERTION:
{
// Triggered when card insertion is detected in present state
// Insert application code to handle events
break;
}
case CYHAL_SDIO_CMD_COMPLETE:
{
// Triggered when command transfer is complete
// Insert application code to handle events
break;
}
case CYHAL_SDIO_XFER_COMPLETE:
{
// Triggered when host read/write transfer is complete
// Insert application code to handle events
break;
}
default:
{
// Anything for other commands
break;
}
}
}
void snippet_cyhal_host_sdio_interrupt_init()
{
#define INTERRUPT_PRIORITY (3u)
// Register the event callback
cyhal_sdio_register_callback(&sdio_obj, &sdio_host_event_handler, NULL);
// Enable events that should trigger the callback
cyhal_sdio_enable_event(&sdio_obj, CYHAL_SDIO_ALL_INTERRUPTS, INTERRUPT_PRIORITY, true);
}
void cyhal_sdio_register_callback(cyhal_sdio_t *obj, cyhal_sdio_event_callback_t callback, void *callback_arg)
Register an SDIO event callback handler.
cyhal_sdio_event_t
Types of events that could be asserted by SDIO.
Definition: cyhal_sdio.h:204
void cyhal_sdio_enable_event(cyhal_sdio_t *obj, cyhal_sdio_event_t event, uint8_t intr_priority, bool enable)
Configure the callback event.
@ CYHAL_SDIO_ALL_INTERRUPTS
Used to enable/disable all interrupts events.
Definition: cyhal_sdio.h:234

Snippet3: Sending Host Commands

The following snippet shows how to send a particular command. Some steps of the card initialization have been provided for reference. Refer to cyhal_sdio_host_command_t for different commands.

cy_rslt_t rslt;
uint32_t response;
bool f8Flag = false; // The CMD8 valid flag.
#define MY_SDIO_CMD_NO_ARG (0u)
#define MY_SDIO_CMD8 ((cyhal_sdio_command_t)8u)
#define MY_SDIO_CMD8_VHS_27_36 (0x100UL) // CMD8 voltage supplied 2.7-3.6 V.
#define MY_SDIO_CMD8_PATTERN_MASK (0xFFUL)
#define MY_SDIO_CMD8_CHECK_PATTERN (0xAAUL)
// Start the card initialization process
// Reset Card (CMD0).
rslt = cyhal_sdio_send_cmd(&sdio_obj, CYHAL_SDIO_XFER_TYPE_WRITE, CYHAL_SDIO_CMD_GO_IDLE_STATE,
MY_SDIO_CMD_NO_ARG, &response);
// Voltage check (CMD8).
rslt = cyhal_sdio_send_cmd(&sdio_obj, CYHAL_SDIO_XFER_TYPE_WRITE, MY_SDIO_CMD8, MY_SDIO_CMD8_VHS_27_36 |
MY_SDIO_CMD8_CHECK_PATTERN,
&response);
// Check the pattern.
if (MY_SDIO_CMD8_CHECK_PATTERN == (response & MY_SDIO_CMD8_PATTERN_MASK))
{
// The pattern is valid.
f8Flag = true;
}
else
{
// SDIO Card is unusable
}
if (f8Flag)
{
// Add further initialization commands based on SDIO card
}

Snippet4: Host Bulk Data Transfer

The following snippet shows how to start a bulk data transfer.

#define DATA_LENGTH (5u)
#define MY_SDIO_CMD_NO_ARG (0u)
cy_rslt_t rslt;
uint32_t data[DATA_LENGTH] = { '1', '2', '3', '4', '5' };
uint32_t response;
// Begin bulk data transfer
rslt = cyhal_sdio_bulk_transfer(&sdio_obj, CYHAL_SDIO_XFER_TYPE_WRITE, MY_SDIO_CMD_NO_ARG, data,
DATA_LENGTH,
&response);

Snippet5: Host Async Data Transfer

The following snippet shows how to start an async data transfer.

void sdio_host_async_interrupt_handler(void* handler_arg, cyhal_sdio_event_t event)
{
if ((handler_arg != NULL) && (event == CYHAL_SDIO_XFER_COMPLETE))
{
// Triggered when host read/write async transfer is complete
// Insert application code to handle events
}
}
void snippet_cyhal_host_sdio_async_transfer()
{
#define DATA_LENGTH (5u)
#define MY_SDIO_CMD_NO_ARG (0u)
#define INTERRUPT_PRIORITY (3u)
uint32_t data[DATA_LENGTH] = { '1', '2', '3', '4', '5' };
uint32_t handler_args = 0;
// Register the event callback
cyhal_sdio_register_callback(&sdio_obj, &sdio_host_async_interrupt_handler,
(void*)&handler_args);
// Enable events CYHAL_SDIO_CMD_COMPLETE and CYHAL_SDIO_XFER_COMPLETE events.
// Event CYHAL_SDIO_XFER_COMPLETE is triggered once
// async transfer is complete. Handle event in the event handler.
(cyhal_sdio_event_t)(CYHAL_SDIO_CMD_COMPLETE |
CYHAL_SDIO_XFER_COMPLETE),
INTERRUPT_PRIORITY,
true);
// Begin async data transfer
cyhal_sdio_transfer_async(&sdio_obj, CYHAL_SDIO_XFER_TYPE_WRITE, MY_SDIO_CMD_NO_ARG, data,
DATA_LENGTH);
// Wait for transfer to finish
while (cyhal_sdio_is_busy(&sdio_obj))
{
// Halt here until condition is false
}
}
bool cyhal_sdio_is_busy(const cyhal_sdio_t *obj)
Check if the specified SDIO is in use.

Device Code Snippets

Snippet1: Simple SDIO Device Initialization example

The following snippet shows how to initialize the SDIO device interface with a pre-defined configuration

cy_rslt_t rslt;
cyhal_sdio_t sdio_object;
#define BLOCK_SIZE (512)
#define SDIO_FREQ (50000000UL)
cyhal_sdio_cfg_t my_sdio_cfg =
{
.block_size = BLOCK_SIZE,
.frequencyhal_hz = SDIO_FREQ,
.is_sdio_dev = true
};
rslt = cyhal_sdio_init(&sdio_object,
SDIO_CMD_PIN,
SDIO_CLK_PIN,
SDIO_DATA0_PIN,
SDIO_DATA1_PIN,
SDIO_DATA2_PIN,
SDIO_DATA3_PIN);
rslt = cyhal_sdio_configure(&sdio_object, &my_sdio_cfg);

Snippet2: Configure Device Interrupt

The following snippet shows how to configure an interrupt to handle device specific events. Refer cyhal_sdio_event_t for different types of events.

// Event handler callback function
void sdio_dev_event_handler(void* handler_arg, cyhal_sdio_event_t event)
{
CY_UNUSED_PARAMETER(handler_arg);
CY_UNUSED_PARAMETER(event);
switch (event)
{
{
// Triggered on a mailbox or an F2 enable event
// Insert application code to handle events
break;
}
{
// Triggered on a read completion event
// Insert application code to handle events
break;
}
{
// Triggered on a read error event
// Insert application code to handle events
break;
}
default:
{
// Anything for other commands
break;
}
}
}
void snippet_cyhal_dev_sdio_interrupt_init()
{
#define INTERRUPT_PRIORITY (3u)
// Register the event callback
cyhal_sdio_register_callback(&sdio_obj, &sdio_dev_event_handler, NULL);
// Enable events that should trigger the callback
cyhal_sdio_enable_event(&sdio_obj, CYHAL_SDIO_ALL_INTERRUPTS, INTERRUPT_PRIORITY, true);
}
@ CYHAL_SDIO_DEV_READ_COMPLETE
Device read operation is complete.
Definition: cyhal_sdio.h:229
@ CYHAL_SDIO_DEV_HOST_INFO
Info from host (e.g.
Definition: cyhal_sdio.h:228
@ CYHAL_SDIO_DEV_READ_ERROR
Device error while performing read.
Definition: cyhal_sdio.h:231

Snippet3: Device Async Read

The following snippet shows how to start an async read.

void sdio_dev_async_interrupt_handler(void* handler_arg, cyhal_sdio_event_t event)
{
if ((handler_arg != NULL) && (event == CYHAL_SDIO_DEV_READ_COMPLETE))
{
// Triggered when device async read is complete
// Insert application code to handle events
}
}
void snippet_cyhal_sdio_dev_async_read()
{
#define DATA_LENGTH (5u)
#define INTERRUPT_PRIORITY (3u)
uint8_t data[DATA_LENGTH] = { '1', '2', '3', '4', '5' };
uint32_t handler_args = 0;
// Register the event callback
cyhal_sdio_register_callback(&sdio_obj, &sdio_dev_async_interrupt_handler,
(void*)&handler_args);
// Enable events CYHAL_SDIO_DEV_READ_COMPLETE and CYHAL_SDIO_DEV_READ_ERROR events.
// Event CYHAL_SDIO_DEV_READ_COMPLETE is triggered once
// async read is complete. Handle event in the event handler.
INTERRUPT_PRIORITY,
true);
// Begin async read
cyhal_sdio_dev_read_async(&sdio_obj, &data[0], DATA_LENGTH);
// Wait for read to finish
while (cyhal_sdio_is_busy(&sdio_obj))
{
// Halt here until condition is false
}
}
cy_rslt_t cyhal_sdio_dev_read_async(cyhal_sdio_t *obj, uint8_t *data, size_t length)
Start SDIO Device asynchronous read.

Snippet4: Device Mailbox Write

The following snippet shows how to write to the mailbox.

void snippet_cyhal_sdio_dev_write_mailbox()
{
#define HOST_MAILBOX_BITS (0x5u)
#define HOST_MAILBOX_DATA (0x3u)
uint32_t data = HOST_MAILBOX_DATA;
cy_rslt_t status = cyhal_sdio_dev_mailbox_write(&sdio_obj, HOST_MAILBOX_BITS, &data);
if (status != CY_RSLT_SUCCESS)
{
// Handle error
}
}
cy_rslt_t cyhal_sdio_dev_mailbox_write(cyhal_sdio_t *obj, uint32_t bits, uint32_t *data)
Write to the mailbox and send a signal to the host.
#define CY_RSLT_SUCCESS
cy_rslt_t return value indicating success
Definition: cy_result.h:465

API Reference

 SDIO HAL Results
 SDIO specific return codes.
 

Data Structures

struct  cyhal_sdio_cfg_t
 SDIO initial configuration. More...
 

Macros

#define SDIO_F2_FRAME_MAX_LENGTH   (0x800)
 Maximum frame length for SDIO.
 
#define SDIO_F2_FRAME_MAX_PAYLOAD   (SDIO_F2_FRAME_MAX_LENGTH - sizeof(sdiod_f2_frame_hdr_t))
 Maximum payload for SDIO.
 
#define SDIO_F2_DMA_BUFFER_SIZE    (sizeof(sdiod_dma_descs_buf_t) + sizeof(sdiod_f2_rx_frame_hdr_t) + (2 * SDIO_F2_FRAME_MAX_PAYLOAD))
 DMA Buffer size for SDIO.
 

Typedefs

typedef void(* cyhal_sdio_event_callback_t) (void *callback_arg, cyhal_sdio_event_t event)
 Callback for SDIO events.
 

Enumerations

enum  cyhal_sdio_event_t {
  CYHAL_SDIO_DEV_HOST_INFO = 0x80001 ,
  CYHAL_SDIO_DEV_READ_COMPLETE = 0x80002 ,
  CYHAL_SDIO_DEV_WRITE_COMPLETE = 0x80004 ,
  CYHAL_SDIO_DEV_READ_ERROR = 0x80008 ,
  CYHAL_SDIO_DEV_WRITE_ERROR = 0x80010 ,
  CYHAL_SDIO_ALL_INTERRUPTS = 0x0E1FF
}
 Types of events that could be asserted by SDIO. More...
 

Functions

cy_rslt_t cyhal_sdio_init (cyhal_sdio_t *obj, cyhal_gpio_t cmd, cyhal_gpio_t clk, cyhal_gpio_t data0, cyhal_gpio_t data1, cyhal_gpio_t data2, cyhal_gpio_t data3)
 Initialize the SDIO peripheral. More...
 
void cyhal_sdio_free (cyhal_sdio_t *obj)
 Release the SDIO block. More...
 
cy_rslt_t cyhal_sdio_configure (cyhal_sdio_t *obj, const cyhal_sdio_cfg_t *config)
 Configure the SDIO block. More...
 
bool cyhal_sdio_is_busy (const cyhal_sdio_t *obj)
 Check if the specified SDIO is in use. More...
 
cy_rslt_t cyhal_sdio_abort_async (cyhal_sdio_t *obj)
 Abort an SDIO transfer. More...
 
void cyhal_sdio_register_callback (cyhal_sdio_t *obj, cyhal_sdio_event_callback_t callback, void *callback_arg)
 Register an SDIO event callback handler. More...
 
void cyhal_sdio_enable_event (cyhal_sdio_t *obj, cyhal_sdio_event_t event, uint8_t intr_priority, bool enable)
 Configure the callback event. More...
 
cy_rslt_t cyhal_sdio_init_cfg (cyhal_sdio_t *obj, const cyhal_sdio_configurator_t *cfg)
 Initialize the SDIO peripheral using a configurator generated configuration struct. More...
 
bool cyhal_sdio_dev_is_ready (cyhal_sdio_t *obj)
 Check if the device is initialized by the host. More...
 
cy_rslt_t cyhal_sdio_dev_mailbox_write (cyhal_sdio_t *obj, uint32_t bits, uint32_t *data)
 Write to the mailbox and send a signal to the host. More...
 
cy_rslt_t cyhal_sdio_dev_mailbox_read (cyhal_sdio_t *obj, uint32_t *data)
 Read mailbox data. More...
 
cy_rslt_t cyhal_sdio_dev_read (cyhal_sdio_t *obj, uint8_t *data, size_t length, uint32_t timeout_ms)
 Synchronous read data. More...
 
cy_rslt_t cyhal_sdio_dev_write (cyhal_sdio_t *obj, const uint8_t *data, size_t length, uint32_t timeout_ms)
 Synchronous write data. More...
 
cy_rslt_t cyhal_sdio_dev_read_async (cyhal_sdio_t *obj, uint8_t *data, size_t length)
 Start SDIO Device asynchronous read. More...
 
cy_rslt_t cyhal_sdio_dev_write_async (cyhal_sdio_t *obj, const uint8_t *data, size_t length)
 Start SDIO Device asynchronous write. More...
 

Data Structure Documentation

◆ cyhal_sdio_cfg_t

struct cyhal_sdio_cfg_t
Data Fields
uint32_t frequencyhal_hz Clock frequency in hertz (target SDIO frequency for device mode)
uint16_t block_size Block size (max block size for device mode)
bool is_sdio_dev 0 if SDIO host, 1 if SDIO device

Enumeration Type Documentation

◆ cyhal_sdio_event_t

Types of events that could be asserted by SDIO.

Enumerator
CYHAL_SDIO_DEV_HOST_INFO 

Info from host (e.g.

mailbox) was received

CYHAL_SDIO_DEV_READ_COMPLETE 

Device read operation is complete.

CYHAL_SDIO_DEV_WRITE_COMPLETE 

Device write operation is complete.

CYHAL_SDIO_DEV_READ_ERROR 

Device error while performing read.

CYHAL_SDIO_DEV_WRITE_ERROR 

Device error while performing write.

CYHAL_SDIO_ALL_INTERRUPTS 

Used to enable/disable all interrupts events.

Function Documentation

◆ cyhal_sdio_init()

cy_rslt_t cyhal_sdio_init ( cyhal_sdio_t obj,
cyhal_gpio_t  cmd,
cyhal_gpio_t  clk,
cyhal_gpio_t  data0,
cyhal_gpio_t  data1,
cyhal_gpio_t  data2,
cyhal_gpio_t  data3 
)

Initialize the SDIO peripheral.

Parameters
[out]objPointer to an SDIO object. The caller must allocate the memory for this object but the init function will initialize its contents.
[in]cmdThe pin for the command signal
[in]clkThe pin for the clk signal
[in]data0The pin for the data0 signal
[in]data1The pin for the data1 signal
[in]data2The pin for the data2 signal
[in]data3The pin for the data3 signal
Returns
The status of the init request

Returns CY_RSLT_SUCCESS on successful operation. Refer to Snippet1: Simple SDIO Host Initialization example and Snippet1: Simple SDIO Device Initialization example for more information.

◆ cyhal_sdio_free()

void cyhal_sdio_free ( cyhal_sdio_t obj)

Release the SDIO block.

Return the peripheral, pins and clock owned by the SDIO object to its reset state

Parameters
[in,out]objThe SDIO object to deinitialize

◆ cyhal_sdio_configure()

cy_rslt_t cyhal_sdio_configure ( cyhal_sdio_t obj,
const cyhal_sdio_cfg_t config 
)

Configure the SDIO block.

SDIO is either a host or a device type. This function allows specifying the features for either type. Refer to cyhal_sdio_cfg_t for more information.

Parameters
[in,out]objThe SDIO object
[in]configThe SDIO configuration to apply
Returns
The status of the configure request.

Returns CY_RSLT_SUCCESS on successful operation.

◆ cyhal_sdio_is_busy()

bool cyhal_sdio_is_busy ( const cyhal_sdio_t obj)

Check if the specified SDIO is in use.

Parameters
[in]objThe SDIO peripheral to check
Returns
true if SDIO is in use. false, otherwise.

◆ cyhal_sdio_abort_async()

cy_rslt_t cyhal_sdio_abort_async ( cyhal_sdio_t obj)

Abort an SDIO transfer.

Parameters
[in]objThe SDIO peripheral to stop
Returns
The status of the abort_async request.

Returns CY_RSLT_SUCCESS on successful operation.

◆ cyhal_sdio_register_callback()

void cyhal_sdio_register_callback ( cyhal_sdio_t obj,
cyhal_sdio_event_callback_t  callback,
void *  callback_arg 
)

Register an SDIO event callback handler.

This function will be called when one of the events enabled by cyhal_sdio_enable_event occurs.

Parameters
[in]objThe SDIO object
[in]callbackThe callback function which will be invoked when the event triggers
[in]callback_argGeneric argument that will be provided to the callback when executed

Refer to Snippet2: Configure Host Interrupt and Snippet2: Configure Device Interrupt for usage information.

◆ cyhal_sdio_enable_event()

void cyhal_sdio_enable_event ( cyhal_sdio_t obj,
cyhal_sdio_event_t  event,
uint8_t  intr_priority,
bool  enable 
)

Configure the callback event.

Callbacks will be triggered for the specified SDIO events. Refer to cyhal_sdio_event_t for the list of supported events.

Parameters
[in]objThe SDIO object
[in]eventThe SDIO event type
[in]intr_priorityThe priority for NVIC interrupt events
[in]enableSet to true to enable events, or false to disable them

Refer to Snippet2: Configure Host Interrupt and Snippet2: Configure Device Interrupt for usage information.

◆ cyhal_sdio_init_cfg()

cy_rslt_t cyhal_sdio_init_cfg ( cyhal_sdio_t obj,
const cyhal_sdio_configurator_t cfg 
)

Initialize the SDIO peripheral using a configurator generated configuration struct.

Parameters
[in]objThe SDIO peripheral to configure
[in]cfgConfiguration structure generated by a configurator.
Returns
The status of the operation

◆ cyhal_sdio_dev_is_ready()

bool cyhal_sdio_dev_is_ready ( cyhal_sdio_t obj)

Check if the device is initialized by the host.

The SDIO device must be initialized by host commands. This function will return true if the sequence has completed.

Parameters
[in]objThe SDIO device object
Returns
true if SDIO is initialized. false, otherwise.

◆ cyhal_sdio_dev_mailbox_write()

cy_rslt_t cyhal_sdio_dev_mailbox_write ( cyhal_sdio_t obj,
uint32_t  bits,
uint32_t *  data 
)

Write to the mailbox and send a signal to the host.

This function will send a mailbox interrupt to the host, which will inform the host to access the data available in the mailbox on the device.

Parameters
[in]objThe SDIO device object
[in]bitsMailbox signal to notify
[in]dataData to send to the mailbox (NULL if nothing to send)
Returns
The status of the mailbox write request. Refer to Snippet4: Device Mailbox Write for usage information.

◆ cyhal_sdio_dev_mailbox_read()

cy_rslt_t cyhal_sdio_dev_mailbox_read ( cyhal_sdio_t obj,
uint32_t *  data 
)

Read mailbox data.

This function will read the mailbox data register. It should be performed after the device receives a mailbox notification from the host.

Parameters
[in]objThe SDIO device object
[in]dataData to send to the mailbox (Optional)
Returns
The status of the mailbox read request. Refer to Snippet4: Device Mailbox Write for usage information.

◆ cyhal_sdio_dev_read()

cy_rslt_t cyhal_sdio_dev_read ( cyhal_sdio_t obj,
uint8_t *  data,
size_t  length,
uint32_t  timeout_ms 
)

Synchronous read data.

This is a blocking call that reads the data sent from the host. The read will not complete until a suitable command from the host is received.

Parameters
[in]objThe SDIO device object
[out]dataThe buffer for receiving
[in,out]lengthNumber of words to read, updated with the number actually read
[in]timeout_msTimeout in millisecond, set this value to 0 if you don't want to wait at all.
Returns
The status of the read request

◆ cyhal_sdio_dev_write()

cy_rslt_t cyhal_sdio_dev_write ( cyhal_sdio_t obj,
const uint8_t *  data,
size_t  length,
uint32_t  timeout_ms 
)

Synchronous write data.

This is a blocking call that writes the data to the host. The write will not complete until a suitable command from the host is received.

Parameters
[in]objThe SDIO device object
[in]dataThe buffer for sending
[in,out]lengthNumber of words to write, updated with the number actually written
[in]timeout_msTimeout in millisecond, set this value to 0 if you don't want to wait at all.
Returns
The status of the write request

◆ cyhal_sdio_dev_read_async()

cy_rslt_t cyhal_sdio_dev_read_async ( cyhal_sdio_t obj,
uint8_t *  data,
size_t  length 
)

Start SDIO Device asynchronous read.

This is a non-blocking call. It will initiate the hardware to read from the host and then immediately return. When the requested quantity of data has been read, the CYHAL_SDIO_DEV_READ_COMPLETE event will be raised.

Parameters
[in]objThe SDIO device object
[out]dataThe read buffer
[in]lengthNumber of words to read
Returns
The status of the async read request. Refer to Snippet3: Device Async Read for usage information.

◆ cyhal_sdio_dev_write_async()

cy_rslt_t cyhal_sdio_dev_write_async ( cyhal_sdio_t obj,
const uint8_t *  data,
size_t  length 
)

Start SDIO Device asynchronous write.

This is a non-blocking call. It will initiate the hardware to write to the host and then immediately return. When the requested quantity of data has been written, the CYHAL_SDIO_DEV_WRITE_COMPLETE event will be raised.

Parameters
[in]objThe SDIO device object
[in]dataThe write buffer
[in]lengthThe number of words to write
Returns
The status of the async write request. Refer to Snippet3: Device Async Read for usage information.