Data transmission method and data transmission device based on SDIO interface
By aligning the data length of the SDIO device and determining the maximum data length N, which is then obtained through a single CMD52 command, the problem of low data transmission efficiency in the SDIO interface is solved, and the data throughput is improved.
Patent Information
- Application Number
- CN202511059890.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-14
AI Technical Summary
In SDIO interface data transmission, the CMD52 command needs to be sent multiple times to obtain the data length, resulting in low effective data throughput and transmission delay, which affects the user experience.
The maximum data length N is determined by comparing the length of the data sent by the SDIO device with the standard data block length and performing alignment. N is then obtained through a single CMD52 command, reducing the number of CMD52 transmissions.
This significantly reduces the number of CMD52 transmissions, improving effective data utilization and the data throughput of SDIO devices.
Smart Images

Figure CN120950431A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data communication technology, specifically to a data transmission method and data transmission device based on the SDIO interface. Background Technology
[0002] With the development of technology, SDIO (Secure Digital Input and Output) interfaces have been widely used, for example, to connect external devices such as modems, barcode scanners, positioning receivers, cameras, and wireless network communication cards (such as WiFi cards). They are especially frequently used as high-throughput data transfer interfaces between various systems.
[0003] SDIO interfaces typically have six signal lines: CMD, CLK, DATA0, DATA1, DATA2, and DATA3. Commonly used commands for SDIO interfaces are CMD52 and CMD53. CMD52 is used to access the register space of any I / O function within the SDIO card, allowing read and write operations on a single register, but only one byte of data can be read or written at a time. CMD53 can handle multi-byte or multi-block data transfers, providing the highest possible transfer rate.
[0004] When an SDIO device actively sends data to the host, after receiving an interrupt signal from the SDIO device, the host needs to send a CMD52 command to obtain the length of the data to be transmitted. However, since CMD52 can only read or write one 8-bit data at a time, if the data length is long, the host needs to send CMD52 multiple times to obtain the complete data length before initiating data transmission via the CMD53 command. Each CMD52 transmission consumes software scheduling time. At the same CLK rate, the more CMD52 commands are sent, the more significant the reduction in effective data transmission efficiency, resulting in lower SDIO effective data throughput and even data transmission delays, impacting user experience. Summary of the Invention
[0005] This application addresses the aforementioned technical problems in the existing technology. The purpose of this application is to provide a data transmission method and device based on the SDIO interface, which can directly represent the maximum data length using parameters. This allows the host to obtain the maximum data length to be transmitted by sending a CMD52 signal only once, thereby significantly reducing the number of CMD52 transmissions, improving effective data utilization, and increasing the effective data throughput of SDIO.
[0006] According to a first aspect of this application, a data transmission method based on an SDIO interface is provided. The data transmission method includes: when an SDIO device sends a first data packet to a host, aligning the first data length to obtain N, where 0 ≤ N and N is an integer, based on a first comparison result between the first data length of the first data packet and the standard data length of a standard data block; wherein N represents the maximum data length after aligning the first data length; the host obtains N by sending a CMD52 command to the SDIO device to determine the maximum data length after aligning the first data length based on N.
[0007] According to a second aspect of this application, a data transmission device based on an SDIO interface is provided. The data transmission method device includes a host and an SDIO device. The SDIO device is configured to: when the SDIO device sends a first data packet to the host, perform alignment processing on the first data length to obtain N, where 0 ≤ N and N is an integer, based on a first comparison result between the first data length of the first data packet and the standard data length of a standard data block; wherein N represents the maximum data length after the alignment processing of the first data length; the host is configured to: obtain N by sending a CMD52 command to the SDIO device, so as to determine the maximum data length after the alignment processing of the first data length based on N.
[0008] According to a third aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing the computer to perform the steps of the data transmission method based on the SDIO interface as described in various embodiments of this application.
[0009] According to a fourth aspect of this application, a computer program product is provided, including computer instructions for causing a computer to perform the steps of the data transmission method based on the SDIO interface as described in various embodiments of this application.
[0010] Compared with the prior art, the beneficial effects of the embodiments of this application are as follows:
[0011] The data transmission method based on the SDIO interface provided in this application embodiment aligns the first data length based on a first comparison result between the first data length and the standard data length, and determines the value of N based on the maximum data length after alignment. Thus, the host can obtain N by sending a CMD52 command to the SDIO device. Since N represents the maximum data length after aligning the first data length, the host only needs to send one CMD52 command to determine the maximum data length to be transmitted from the SDIO device to the host based on N, significantly reducing the number of times the host sends CMD52 commands and improving the effective data utilization rate.
[0012] The above description is merely an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above description and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0013] In drawings that are not necessarily drawn to scale, the same reference numerals may describe similar parts in different views. Similar reference numerals with different letter suffixes may indicate different examples of similar components. The drawings generally illustrate various embodiments by way of example rather than limitation, and are used together with the specification and claims to illustrate the disclosed embodiments. Such embodiments are illustrative and exemplary, and are not intended to be exhaustive or exclusive embodiments of the method, apparatus, system, or non-transitory computer-readable medium having instructions for implementing the method.
[0014] Figure 1 A flowchart of a data transmission method based on an SDIO interface according to an embodiment of this application is shown.
[0015] Figure 2 Another flowchart of a data transmission method based on an SDIO interface according to an embodiment of this application is shown.
[0016] Figure 3 Another flowchart of a data transmission method based on an SDIO interface according to an embodiment of this application is shown.
[0017] Figure 4 A structural diagram of a data transmission apparatus based on an SDIO interface according to an embodiment of this application is shown. Detailed Implementation
[0018] To enable those skilled in the art to better understand the technical solutions of this application, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. The embodiments of this application will be further described in detail below with reference to the accompanying drawings and specific examples, but these are not intended to limit the scope of this application.
[0019] The terms "first," "second," and similar words used in this application do not indicate any order, quantity, or importance, but are merely used for distinction. The terms "including" or "comprising," etc., used in this application mean that the element preceding the word encompasses the elements listed after the word, and do not exclude the possibility of encompassing other elements. In this application, the arrows shown in the figures for each step are merely examples of the execution order, not limitations. The technical solution of this application is not limited to the execution order described in the embodiments. The steps in the execution order can be combined, broken down, or rearranged, as long as the logical relationship of the executed content is not affected.
[0020] All terms used in this application (including technical or scientific terms) have the same meaning as understood by one of ordinary skill in the art to which this application pertains, unless otherwise specifically defined. It should also be understood that terms defined in general dictionaries should be interpreted as having meanings consistent with their meanings in the context of the relevant art, and not as idealized or highly formalized, unless expressly defined herein. Technologies and equipment known to one of ordinary skill in the art may not be discussed in detail, but where appropriate, such technologies and equipment should be considered part of the specification.
[0021] Figure 1 A flowchart of a data transmission method based on an SDIO interface according to an embodiment of this application is shown. Steps S101-S102 illustrate the steps of the data transmission method based on the SDIO interface. In various embodiments of this application, the arrows shown in the figure for each step are merely examples of the execution order and not limitations. The technical solution of this application is not limited to the execution order described in the embodiments. The steps in the execution order can be combined, decomposed, or rearranged, as long as the logical relationship of the execution content is not affected.
[0022] In step S101, when the SDIO device sends the first data packet to the host, based on the first comparison result between the first data length of the first data packet and the standard data length of the standard data block, the first data length is aligned to obtain N, where 0 ≤ N and N is an integer; where N represents the maximum data length after the first data length is aligned.
[0023] In step S102, the host obtains N by sending a CMD52 command to the SDIO device, and determines the maximum data length after alignment processing of the first data length based on N.
[0024] In the SDIO (Secure Digital Input / Output) protocol, the standard data block length is usually compatible with the SD card specification, most commonly 512 bytes. For SDIO devices (such as WiFi modules and Bluetooth modules), data transmission is often based on the standard data length of 512 bytes, but it is not limited to this.
[0025] For ease of understanding, the following explanations will use a standard data length of 512 bytes as an example.
[0026] Specifically, when the SDIO device actively sends the first data packet to the host, the processor can compare the first data length of the first data packet with the standard data length to obtain a first comparison result. The first comparison result may include the first data length being less than the standard data length, and / or the first data length being greater than the standard data length.
[0027] The processor can align the first data length based on the first comparison result, and the maximum data length after alignment can be represented by N. For example, the data length can be represented by N×64 bytes. In this case, when N is 2, the data length is 128, and when N is 4, the data length is 256.
[0028] Specifically, the host and SDIO device can agree on a formula for representing data length in advance. For example, the data length calculation formula can be dynamically confirmed through a handshake protocol before the host and SDIO device communicate. This is just an example and does not constitute a limitation on any specific solution.
[0029] In this embodiment, after determining the value of N, the value of N is written into the data length register, and an interrupt mechanism is activated to inform the host that the first data packet is about to be sent.
[0030] After receiving an interrupt signal from the SDIO device, the host sends a CMD52 command to the SDIO device and reads N from the data length register. Based on N, the maximum data length of the first data length sent by the SDIO device can be determined. Therefore, even if the first data length is much greater than 512 bytes, the host only needs to send a CMD52 command to the SDIO device once, instead of sending multiple CMD52 commands. This greatly reduces the number of CMD52 command transmissions, improves effective data utilization, and increases the effective data throughput of SDIO.
[0031] In some embodiments of this application, when the first data length is less than the standard data length, the alignment process includes aligning the first data length to a first integer multiple of a first preset value, wherein N is a first integer multiple.
[0032] The first preset value is not specifically limited and can be pre-negotiated between the host and the SDIO device. The specific negotiation method is not limited. Preferably, the first preset value is 4, 16, 32, 64, 128, or 256.
[0033] like Figure 2 The following example illustrates the concept of a standard data length of 512 and a first preset value of 64.
[0034] In step S201, the SDIO device will send a first data packet of a first data length to the host. In step S202, it is determined whether the first data length is greater than 512. If the result of step S202 is no, then step S204 is executed to align the first data length to a first integer multiple of 64. In step S206, the value of the first integer multiple is determined based on the first data length, and the value of the first integer multiple is the value of N.
[0035] Specifically, when the first data length is less than the standard data length, alignment processing of the first data length is performed according to formula (1), which is as follows:
[0036] Maximum data length = N × first preset value;
[0037] The maximum data length refers to the maximum data length obtained after aligning the first data length. When the first data length is less than the standard data length, the maximum value N is obtained when aligning the first data length to a first integer multiple of the first preset value. max It is the ratio of the standard data length to the first preset value.
[0038] Before the host and SDIO device transmit data, the host and SDIO device can negotiate the first preset value and formula (1) in advance.
[0039] For example, assuming the first preset value is 64 and the first data length is 100, which is less than the standard data length of 512, the maximum data length after alignment according to formula (1) is 128, meaning N is a first integer multiple of 2. Assuming the first data length is 200, which is less than the standard data length of 512, the first data length 200 is aligned to 4 times 64 according to formula (1), resulting in a maximum data length of 4 × 64, meaning N is a first integer multiple of 4. In other words, when the first preset value is 64, N... max The maximum data length is 8, and the maximum data length is N×64, where N = 1 to 8.
[0040] Furthermore, if the judgment result of step S202 is yes, then step S203 is executed to align the first data length to a second integer multiple of the standard data length 512, and then step S205 is executed to determine the value of the second integer multiple based on the first data length. The sum of the value of the second integer multiple and 8 is the value of N.
[0041] For example, when the first data length is greater than the standard data length, alignment processing of the first data length is performed according to formula (2), which is as follows:
[0042] Maximum data length = (NN) max ) × standard data length.
[0043] For example, with a first preset value of 64 and a first data length of 1500, the first data length of 1500 is greater than the standard data length of 512. According to formula (2), the first data length is aligned to 3 times 512, that is, the maximum data length 1536 = (11-8) × 512, where N is the sum of 8 and the second integer multiple 3, that is, N is 11. In other words, with a first preset value of 64, the maximum data length = (N-8) × 512, where N = 9 to 255. For example, when N is 255, it can be used to represent a maximum data length of 126464 bytes.
[0044] In other words, in some embodiments of this application, when the first data length is greater than the standard data length, the alignment process includes aligning the first data length to a second integer multiple of the standard data length, wherein the value of N is the sum of the ratio of the standard data length to the first preset value and the second integer multiple.
[0045] like Figure 2 After executing steps S205 and S206, continue to execute step S207, write the value of N into the data length register, and start the interrupt mechanism. Then execute step S208, the host sends CMD52 to the SDIO device only once based on the received interrupt signal, and reads the value of N at least once. Based on the value of N, the maximum data length after the first data length is aligned can be obtained.
[0046] Specifically, the first preset value of 64 is still used as an example for explanation. The processor performs alignment processing on the first data length according to the first comparison result and determines the value of N, and writes the value of N into the data length register. The host sends CMD52 to the SDIO device only once and reads the value of N in the data register. If the read N is 6, then according to formula (1), the host can determine that the maximum data length of the first data packet to be sent by the SDIO device after alignment processing is 384; and if the read N is 15, then according to formula (2), the host can determine that the maximum data length of the first data packet to be sent by the SDIO device after alignment processing is 3584. This greatly reduces the number of times the host sends CMD52 commands to the SDIO device. Only one CMD52 command is needed to obtain the maximum data length of the first data packet, without having to send multiple CMD52 commands. This helps to reduce communication overhead, improve transmission efficiency, reduce power consumption and enhance system stability, and improve the effective data throughput of the SDIO device.
[0047] In some embodiments of this application, such as Figure 3 In step S301, when the host sends the second data packet to the SDIO device, the second data length of each second data packet is aligned to a third integer multiple of the second preset value to obtain each aligned third data packet.
[0048] There is no specific limitation on the second preset value. For example, the second preset value can be 4, 16, 32, 64, 128, or 256. The second preset value can also be negotiated in advance between the host and the SDIO device before data transmission, and there is no specific limitation on this.
[0049] In the process of aligning the second data length of each second data packet, preferably, the second data length of each second data packet is aligned to the same third integer multiple of the second preset value, thereby ensuring that the third data length of each third data packet after alignment is the same, which helps to reduce the number of times the host sends CMD53 to the SDIO device and improves data transmission efficiency.
[0050] For specific applications, such as WiFi network card data transmission, in high-throughput mode, most of the second data packets to be transmitted have the same or similar lengths. Preferably, the second data length of each second data packet can be aligned to the same third integer multiple of the second preset value.
[0051] For example, the second data length of the four second data packets to be transmitted by the host is approximately 90 bytes each (e.g., the second data length of the first second data packet is 86, the second data packet is 89, the third data packet is 95, and the fourth data packet is 100). With a second preset value of 64, as a preferred embodiment, the second data length of these four second data packets can be aligned to twice 64, i.e., aligned to 128 bytes, thereby obtaining aligned third data packets with the same third data length.
[0052] During data transmission, due to the generation of different numbers of messages or other factors, a second data packet with a significantly different length may appear in the data packet that the host is about to transmit to the SDIO device.
[0053] The understanding that the second data length changes significantly can be interpreted as the third data length of the third data packet obtained after aligning the significantly changed second data length being greater than the third data length of the third data packet obtained after aligning the insignificantly changed second data length.
[0054] For example, in the example above, if the second data length of the fourth second data packet among the four second data packets is 400, then the second data length of the fourth second data packet is considered to have changed significantly. During the alignment process, the second data length of the fourth second data packet is aligned to 8 times 64, that is, aligned to 512.
[0055] The specific method for aligning the second data length of each second data packet to a third integer multiple of the second preset value is not specified.
[0056] For example, the host can use a DMA (Direct Memory Access) linked list to send a second data packet to an SDIO device to achieve efficient batch data transfer. The DMA linked list is a data structure that links multiple non-contiguous memory blocks (descriptors). Through the linked list, the DMA controller can automatically transfer multiple data blocks sequentially.
[0057] During the alignment process, the processor can determine a third integer multiple of the second data length of each second data packet to be transmitted, based on the second data length of each second data packet to be transmitted. This determines the third data length of each aligned third data packet, and the aligned parameters (such as the aligned third data length and control flags) are directly written into the DMA descriptor and passed to the DMA controller through the descriptor. If multiple aligned third data packets need to be transmitted consecutively, each third data packet is configured as a descriptor and linked through the next pointer.
[0058] This is merely an example and does not constitute a limitation on any specific solution.
[0059] In step S302, the third data packets with the same third data length are aggregated to obtain a fourth data packet; in step S303, based on the second comparison result between the fourth data length of the fourth data packet and the standard data length, it is determined whether to perform alignment processing on the fourth data length.
[0060] Specifically, each third data packet with the same third data length can be aggregated into a fourth data packet, and the fourth data length of the fourth data packet can be the sum of the third data lengths of each third data packet.
[0061] Based on the above embodiments, the third data length of the third data packet obtained after aligning the significantly changed second data length is greater than the third data length of the third data packet obtained after aligning the insignificantly changed second data length. In some embodiments, the third data packet obtained after aligning based on the significantly changed second data length may not be aggregated, but may be transmitted as a separate fourth data packet.
[0062] For example, the second data length of the first three second data packets to be transmitted by the host is about 90 bytes, while the second data length of the fourth second data packet to be transmitted is 400 bytes. With the second preset value of 64, as a preferred embodiment, the second data length of the first three second data packets can be aligned to twice 64, that is, aligned to 128 bytes, to obtain a third data packet with the same third data length as the first three; and the second data length of the fourth second data packet can be aligned to eight times 64, that is, aligned to 512, to obtain a third data packet after alignment processing based on the significantly changed second data length.
[0063] Specifically, the three third data packets, each with a length of 128 bytes, can be aggregated into a single fourth data packet, in which case the fourth data packet has a length of 384 bytes. However, the third data packet with a length of 512 bytes is not aggregated and can be used as a separate fourth data packet for subsequent transmission. The fourth data packet has the same length as the third data packet, which is 512 bytes.
[0064] Furthermore, based on the fourth data packet, the relationship between the fourth data length and the standard data length of the fourth data packet is determined to obtain a second comparison result, and it is determined whether to perform alignment processing on the fourth data length based on the second comparison result.
[0065] Specifically, the second comparison result is that the fourth data length is less than the standard data length, or the fourth data length is greater than the standard data length.
[0066] Using a standard data length of 512 bytes as an example, when the fourth data length is less than 512, it is already a multiple of 64, so no further alignment is needed. However, when the fourth data length is greater than 512, it is aligned to a multiple of 512. For example, if the fourth data length is 640 bytes, it is aligned to 1024 bytes to obtain the fifth data packet after alignment.
[0067] In other words, in some embodiments, when the fourth data length is greater than the standard data length, the fourth data length is aligned to a fourth integer multiple of the standard data length to obtain the fifth data packet after alignment.
[0068] In step S304, in response to the CMD53 command sent by the host to the SDIO device, the fourth data packet that has not been aligned or the fifth data packet that has been aligned is sent to the SDIO device; wherein, the CMD53 command includes a first parameter for identifying the length of the third data packet and a second parameter for identifying the number of third data packets in the fourth data packet.
[0069] For example, the length of the third data and the number of third data packets included in the fourth data can be identified based on the address parameter information in the CMD53 command.
[0070] As in the preferred embodiment described above, when the lengths of the third data packets after alignment based on the second data packets to be transmitted are all the same, the data transmission method of this application embodiment can be executed such that the host only needs to send a CMD53 command to the SDIO device once, and the SDIO device can obtain the data information that the host will transmit based on the CMD53 command.
[0071] In some embodiments of this application, the number represented by the first bit in the 17-bit address of the CMD53 command is preset as the first parameter, and the third data length is obtained according to formula (3) based on the first parameter:
[0072] Third data length = (M+1) × second preset value formula (3);
[0073] Here, M refers to the number represented by the first bit in the 17-bit address, i.e., the first parameter.
[0074] For example, in the 17-bit address of the CMD53 command, the number M represented by the first bit in the 17-bit address can be based on the six binary bits bit0, bit1, bit2, bit3, bit4, and bit5. By using different combinations of 0 and 1, it can represent all integers between 0 and 63, with a maximum representation of (63+1)×64=4096 bytes. In this embodiment, the first parameter M is 63, and the first bit is bit0, bit1, bit2, bit3, bit4, and bit5.
[0075] In some embodiments of this application, the number represented by the second bit in the 17-bit address of the CMD53 command is preset as the second parameter. Based on the second parameter, the number of third data packets in the fourth data packet is obtained according to formula (4):
[0076] Number of packages = Q+1 formula (4);
[0077] Here, Q refers to the number represented by the second bit in the 17-bit address, i.e., the second parameter.
[0078] For example, in the example above, the second bit can be bit6, bit7, bit8, bit9, or bit10. In the 17-bit address of the CMD53 command, the number Q represented by the second bit in the 17-bit address can be based on the five binary bits bit6, bit7, bit8, bit9, and bit10. By using different combinations of 0 and 1, it can represent all integers between 0 and 31. The maximum number of packets can be represented as 31 + 1 = 32. In this embodiment, the second parameter Q is 31.
[0079] This is only an example. Based on the 17-bit address in the CMD53 command, the first bit and the second bit can be set. For example, the first bit can be bit0, bit1, bit2, bit3, bit4, and the second bit can be bit5, bit6, bit7, bit8, bit9, bit10.
[0080] Before the host and SDIO device transmit data, formulas (3) and (4) can be agreed upon in advance.
[0081] In some embodiments of this application, the SDIO device can parse the data based on the received fourth or fifth data packet and the CMD53 command, according to the first and second parameters.
[0082] In other words, when the SDIO device receives the CMD53 command and the fourth and / or fifth data packets sent by the host, it can parse the third data length of the third data packet to be transmitted by the host and the number of data packets in the fourth and / or fifth data packets according to the first and second parameters in the CMD53 command and formulas (3) and (4).
[0083] Based on the embodiments of this application, the host can send only one CMD53 command to the SDIO device, enabling the SDIO device to parse the length of the third data to be sent by the host and the number of packets in the aggregate packet based solely on the received CMD53 command. This eliminates the need to add extra information to the data packet (such as adding information about the first parameter M and the second parameter Q), additional CMD communication, or the host sending a separate message to the SDIO device to inform it of the parameters used for data parsing. This improves the transmission efficiency and throughput of the SDIO interface.
[0084] Figure 4 A structural diagram of a data transmission apparatus based on an SDIO interface according to an embodiment of this application is shown. The data transmission apparatus 400 includes a host 401 and an SDIO device 402. The SDIO device 402 is configured to, when sending a first data packet to the host 401, perform alignment processing on the first data length to obtain N, where 0 ≤ N and N is an integer, based on a first comparison result between the first data length of the first data packet and the standard data length of a standard data block; wherein N represents the maximum data length after the alignment processing of the first data length; the host 401 is configured to obtain N by sending a CMD52 command to the SDIO device 402 once, so as to determine the maximum data length after the alignment processing of the first data length based on N.
[0085] The host 401 can obtain the N by sending the CMD52 command to the SDIO device 402. Since N is used to represent the maximum data length after the first data length is aligned, the host 401 can determine the maximum data length that the SDIO device 402 wants to transmit to the host 401 based on N by sending the CMD52 command only once. This significantly reduces the number of times the host 401 sends the CMD52 command and improves the effective data utilization rate.
[0086] In various embodiments of this application, the processor may be a processing device including one or more general-purpose processing devices, such as a microprocessor, a central processing unit (CPU), a graphics processing unit (GPU), etc. More specifically, the processor may be a Complex Instruction Set Computing (CISC) microprocessor, a Reduced Instruction Set Computing (RISC) microprocessor, a Very Long Instruction Word (VLIW) microprocessor, a processor running other instruction sets, or a processor running a combination of instruction sets. The processor may also be one or more special-purpose processing devices, such as an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), a System-on-Chip (SoC), etc.
[0087] According to embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium storing computer instructions for causing the computer to perform the steps of the data transmission method based on the SDIO interface as described in various embodiments of this application.
[0088] The aforementioned computer-readable storage media may be such as read-only memory (ROM), random access memory (RAM), phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), electrically erasable programmable read-only memory (EEPROM), other types of random access memory (RAM), flash drives or other forms of flash memory, cache, registers, static memory, optical disc read-only memory (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape cassette or other magnetic storage devices, or any other possible non-transitory medium used to store information or instructions that can be accessed by computer equipment.
[0089] According to embodiments of this application, a computer program product is also provided, the computer program product including computer instructions for causing a computer to perform steps in the data transmission method based on the SDIO interface as described in various embodiments of this application.
[0090] This application describes various operations or functions that can be implemented as software code or instructions, or defined as software code or instructions. Such content can be directly executable source code or differential code (“incremental” or “patch” code) (“object” or “executable” form). The software code or instructions can be stored in a computer-readable storage medium and, when executed, can cause a machine to perform the described functions or operations, and include any mechanism for storing information in a machine-accessible form, such as recordable or non-recordable media (e.g., read-only memory (ROM), random access memory (RAM), disk storage media, optical storage media, flash memory devices, etc.).
[0091] Furthermore, although exemplary embodiments have been described herein, their scope includes any and all embodiments based on this application that have equivalent elements, modifications, omissions, combinations (e.g., schemes involving intersections of various embodiments), adaptations, or alterations. Elements in the claims will be interpreted broadly based on the language used in the claims and are not limited to the examples described in this specification or during the implementation of this application, which will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered illustrative only, and the true scope and spirit are indicated by the full scope of the following claims and their equivalents.
[0092] The above description is intended to be illustrative and not restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. Other embodiments may be used by those skilled in the art upon reading the above description. Furthermore, in the above detailed description, various features may be grouped together to simplify the application. This should not be construed as an intention that a disclosed feature not claimed is necessary for any claim. Rather, the subject matter of the application may be less than all the features of a particular disclosed embodiment. Thus, the claims are incorporated herein by reference as examples or embodiments, wherein each claim is an independent, separate embodiment, and these embodiments are contemplated as being combined with each other in various combinations or arrangements. The scope of this application should be determined by reference to the appended claims and the full scope of their equivalents.
[0093] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.
Claims
1. A data transmission method based on an SDIO interface, characterized in that, The data transmission method includes: when the SDIO device sends the first data packet to the host... Based on the first comparison result between the first data length of the first data packet and the standard data length of the standard data block, the first data length is aligned to obtain N, where 0 ≤ N and N is an integer; Wherein, N represents the maximum data length after the first data length has been aligned; The host obtains N by sending a CMD52 command to the SDIO device, and determines the maximum data length after alignment processing based on N.
2. The data transmission method according to claim 1, characterized in that, When the first data length is less than the standard data length, the alignment process includes: aligning the first data length to a first integer multiple of a first preset value, where N is a first integer multiple.
3. The data transmission method according to claim 2, characterized in that, When the first data length is greater than the standard data length, the alignment process includes: aligning the first data length to a second integer multiple of the standard data length, wherein the value of N is the sum of the ratio of the standard data length and the first preset value and the second integer multiple.
4. The data transmission method according to claim 3 or 4, characterized in that, The first preset value is 4, 16, 32, 64, 128 or 256.
5. The data transmission method according to claim 1, characterized in that, The data transmission method further includes: when the host sends a second data packet to the SDIO device... Align the second data length of each second data packet to a third integer multiple of the second preset value to obtain the aligned third data packets; Aggregate the third data packets of the same length to obtain a fourth data packet; Based on the second comparison result between the fourth data length of the fourth data packet and the standard data length, it is determined whether to perform alignment processing on the fourth data length; In response to the CMD53 command sent by the host to the SDIO device, the fourth data packet that has not been aligned or the fifth data packet that has been aligned is sent to the SDIO device. The CMD53 command includes a first parameter for identifying the length of the third data and a second parameter for identifying the number of third data packets in the fourth data packet.
6. The data transmission method according to claim 5, characterized in that, The number represented by the first bit in the 17-bit address of the CMD53 command is preset as the first parameter. Based on the first parameter, the third data length is obtained according to formula (3): Third data length = (M+1) × second preset value formula (3); Where M represents the first parameter.
7. The data transmission method according to claim 5, characterized in that, The number represented by the second bit in the 17-bit address of the CMD53 command is preset as the second parameter. Based on the second parameter, the number of third data packets in the fourth data packet is obtained according to formula (4): Number of packages = Q+1 formula (4); Where Q represents the second parameter.
8. The data transmission method according to any one of claims 5-7, characterized in that, The SDIO device can parse the data according to the first and second parameters based on the received fourth or fifth data packet and the CMD53 command.
9. A data transmission device based on an SDIO interface, characterized in that, The data transmission method apparatus includes a host and an SDIO device, wherein, The SDIO device is configured such that when the SDIO device sends the first data packet to the host... Based on the first comparison result between the first data length of the first data packet and the standard data length of the standard data block, the first data length is aligned to obtain N, where 0 ≤ N and N is an integer; Wherein, N represents the maximum data length after the first data length has been aligned; The host is configured to obtain N by sending a CMD52 command to the SDIO device, and then determine the maximum data length after alignment processing based on N for the first data length.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the steps of the data transmission method based on the SDIO interface as described in any one of claims 1-8.
11. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the steps of the data transmission method based on the SDIO interface as described in any one of claims 1-8.