Supported ICs
Overview
SDIO (Secure Digital Input Output) is an interface standard based on the SD card protocol that facilitates high-speed connections with devices equipped with SDIO Host.
Realtek provides a turn key solution that turns ICs with SDIO Device into WIFI network card devices or WIFI/BT combo devices.
Features
Data Width: Supports both 1-bit mode and 4-bit mode
Transfer Speed: Supports both default-speed mode and high-speed modes, with clock up to 50MHz
Multi-Function: SDIO can be expanded to many functional modules
Interrupt Mechanism: SDIO drives DAT1 to low, generating an interrupt to notify host
Supports DMA
Protocol Support: Fully compatible with SDIO card protocol 2.0
Note
For more details of multi-function, please refer to Multi-Function .
SDIO Bus Width
SDIO supports both 1-bit mode and 4-bit mode.
1-bit Mode
Signal Lines: In 1-bit mode, SDIO uses one data line (DAT0), along with a command line (CMD) and a clock line (CLK) for data transmission.
Transfer Rate: Since only one data line is used, the transfer rate is relatively low, but this mode requires simpler hardware interfaces and lower power consumption.
Primary Applications: Suitable for low-cost, low-speed applications or devices where high data throughput is not required.
4-bit Mode
Signal Lines: In 4-bit mode, SDIO uses four data lines (DAT0 - DAT3) for data transmission, along with a command line (CMD) and a clock line (CLK).
Transfer Rate: Significantly improved data transfer rates.
Primary Applications: Suitable for devices requiring high data throughput, such as high-speed wireless modules, storage devices, etc.
Note
After SDIO is identified and initialized by host, the bus width of SDIO depends on the operation of the host side.
To modify the bus width, please make changes on the SD host side.
SDIO Bus Speed Mode
SDIO supports both default-speed mode and high-speed mode to meet the needs of various devices and applications.
Default-Speed Mode
Clock frequency: Up to 25 MHz.
Application Scenarios: Suitable for devices with basic data transfer needs.
High-Speed Mode
Clock frequency: Up to 50 MHz.
Application Scenarios: Suitable for applications that require higher data transfer rates, such as wireless communication modules.
Note
After SDIO is identified and initialized by host, SDIO works in high-speed mode by default.
If users want to make SDIO work in default-speed mode after initialization, please contact Realtek.
Multi-Function
SDIO supports multiple functions, including WLAN and Bluetooth.
Note
RTL8721Dx supports only one function module, which is WLAN.
RTL8721F supports two function modules, WLAN and Bluetooth.
SDIO Architecture
The structure of the SDIO interface is shown in the figure below:
Function Pin Groups
The SDIO interface has hardware flexibility, and its function pins are divided into multiple function groups.
Different development boards may provide different groups of pins, allowing developers to choose the appropriate pin group based on the hardware.
Pin Functions
CLK: Clock input pin for data synchronization.
CMD: Command input/response output pin for sending commands/receiving responses.
DAT0-DAT3: Data pins supporting 1-bit and 4-bit mode data transmission.
Pin Groups
Group |
CLK |
CMD |
D3 |
D2 |
D1 |
D0 |
---|---|---|---|---|---|---|
0 |
PA16 |
PA15 |
PA14 |
PA13 |
PA18 |
PA17 |
1 |
PA29 |
PA28 |
PA27 |
PA26 |
PA31 |
PA30 |
2 (default) |
PB9 |
PB8 |
PB7 |
PB6 |
PB14 |
PB13 |
3 |
PB19 |
PB18 |
PB17 |
PA12 |
PB21 |
PB20 |
4 |
PB26 |
PB25 |
PB24 |
PB23 |
PB28 |
PB27 |
Group |
CLK |
CMD |
D3 |
D2 |
D1 |
D0 |
---|---|---|---|---|---|---|
0 |
PA18 |
PA19 |
PA26 |
PA4 |
PA25 |
PA5 |
1(default) |
PA18 |
PA19 |
PA21 |
PA4 |
PA20 |
PA5 |
2 |
PA18 |
PA19 |
PA21 |
PA27 |
PA20 |
PA28 |
3 |
PA18 |
PA19 |
PA26 |
PA27 |
PA25 |
PA28 |
4 |
PA11 |
PA10 |
PA9 |
PA6 |
PA8 |
PA7 |
5 |
PB23 |
PB22 |
PB16 |
PB13 |
PB15 |
PB14 |
6 |
PC7 |
PC6 |
PC5 |
PC2 |
PC4 |
PC3 |
Note
Users can modify SDIO_Pin_Grp
in the ameba_intfcfg.c
file to select different pin groups, for more details please refer to ameba_intfcfg.
WHC
Ameba can be connected to the host MCU via SDIO to perform as a WiFi card.
For more detailed information, please refer to Supported Chips .
Application Examples
Ameba SDK provides examples for SDIO device loopback test, helping users understand and utilize SDIO.
Users can run the loopback test examples to determine if the current hardware environment is functioning correctly.
The example code includes SDIO device example code and SD host example code based on Raspberry Pi.
SDIO Device Example Code
The example mbed_sdio_loopback_device demonstrates loopback test on the SDIO device side. Its main contents include:
Initialize the SDIO interface and function 1 (WLAN).
Initialize the transmit buffer and receive buffer for loopback test.
Set up the interrupt handler of the SDIO device to process received data in time and transmit data back to host.
SD Host Example Code
The example sdio_device_loopback_Raspberry demonstrates data communication with the SDIO device via SD host on a Raspberry Pi. Its main contents include:
Initialize SD host on the Raspberry Pi.
Identify and initialize the SDIO device and function 1 via the SD host.
Send data to function 1 of the SDIO device via the SD host continuously.
Receive data from function 1 of the SDIO device via the SD host continuously.
Note
For more details on the test, please refer to sdio_loopback_test_guide.pdf in the example path.
If users want to develop based on this example, please avoid occupying too much time in the tasks associated with the SDIO interrupt handler, which can prevent delays in handling interrupt-related events.