Serial transmission processing method and device, storage medium and electronic equipment

CN117573594BActive Publication Date: 2026-08-21TCL COMM TECH (CHENGDU) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311554572.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2026-08-21
Estimated Expiration
2043-11-20

AI Technical Summary

Technical Problem

目前,存在一些情况中,随着主机(如主控MCU或者ARM处理器等)的不断升级,会不支持某些标准的串行外设接口(SPI)模式,从而导致使用不被支持的标准的显示设备无法使用

Benefits of technology

[0024]In this way, the host can reassemble the received serial content to be transmitted into content that conforms to a first serial format and is compatible with a second serial format, according to the content type. Then, the reassembled and converted serial content is sent to the target device through the first serial peripheral interface. This allows the target device, which supports the interface mode of the second serial peripheral interface, to extract the content from the converted serial content. In turn, the host, which supports the interface mode of the first serial peripheral interface, can easily be compatible with target devices with different interface modes of the second serial peripheral interface. This allows for low-cost and cost-effective implementation of compatible serial transmission of different Serial Peripheral Interface (SPI) modes without increasing hardware costs, and can also be compatible with more display devices with different serial peripheral interface modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117573594B_ABST
    Figure CN117573594B_ABST
Patent Text Reader

Abstract

The application discloses a serial transmission processing method and device, a storage medium and an electronic device, relates to the technical field of data transmission, and is applied to a host computer. The host computer supports an interface mode of a first serial peripheral interface. The method comprises the following steps: receiving serial content to be transmitted; identifying the serial content to be transmitted to obtain a content type; converting the serial content to be transmitted into content conforming to a first serial format and compatible with a second serial format according to the content type, to obtain converted serial content; and sending the converted serial content to a target device through the first serial peripheral interface. The target device is a device supporting an interface mode of the second serial peripheral interface. The application can realize compatible serial transmission of different serial peripheral interface (SPI) modes at low cost and can be compatible with more display devices of different serial peripheral interface modes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, specifically to a serial transmission processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] In serial transmission via the Serial Peripheral Interface (SPI), the host typically needs to transmit the data to the display device through the SPI bus. Currently, there are situations where, with the continuous upgrading of the host (such as the main control MCU or ARM processor), it may no longer support certain standard SPI modes, thus rendering display devices using unsupported standards unusable. For example, if the upgraded host only supports the four-wire standard SPI mode and not the three-wire 9-bit SPI mode, then display devices supporting the three-wire 9-bit SPI mode cannot be used on the host platform.

[0003] Currently, the existing technologies achieve compatibility between different Serial Peripheral Interface (SPI) modes by adding digital circuits or configuration registers, but the number of compatible display devices is limited. The current approach suffers from high serial transmission costs and a limited number of compatible display devices. Summary of the Invention

[0004] This application provides a serial transmission processing scheme that can achieve compatible serial transmission of different Serial Peripheral Interface (SPI) modes at low cost without increasing hardware costs, and can be compatible with more display devices with different serial peripheral interface modes.

[0005] The embodiments of this application provide the following technical solutions:

[0006] According to one embodiment of this application, a serial transmission processing method is applied to a host, the host supporting an interface mode of a first serial peripheral interface. The method includes: receiving serial content to be transmitted, the content format of the serial content to be transmitted being a first serial format corresponding to the first serial peripheral interface; identifying the serial content to be transmitted to obtain a content type of the serial content to be transmitted; reassembling the serial content to be transmitted into content conforming to the first serial format and compatible with a second serial format according to the content type, obtaining converted serial content, the second serial format being a format corresponding to a second serial peripheral interface; and sending the converted serial content to a target device through the first serial peripheral interface, the target device being a device supporting the interface mode of the second serial peripheral interface.

[0007] In some embodiments of this application, identifying the serial content to be transmitted and obtaining the content type of the serial content to be transmitted includes: obtaining the content type feature corresponding to the serial content to be transmitted according to the serial transmission mode corresponding to the first serial peripheral interface; obtaining the content type of the serial content to be transmitted according to the content type feature, wherein the content type includes command type or data type.

[0008] In some embodiments of this application, the content type includes a command type; the step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type to obtain the converted serial content includes: determining the corresponding first content conversion logic according to the command type; and reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the first content conversion logic to obtain the converted serial content.

[0009] In some embodiments of this application, the step of recombining the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content includes: creating a command transmission array of a predetermined compatible byte number, wherein the number of bits of each byte in the command transmission array is the number of bits of the byte corresponding to the first serial format; and setting the command identifier content and the content in the serial content to be transmitted in each bit of the command transmission array according to the second serial format to obtain the converted serial content.

[0010] In some embodiments of this application, the content type includes a data type; the step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type to obtain the converted serial content includes: determining the corresponding second content conversion logic according to the data type; and reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the second content conversion logic to obtain the converted serial content.

[0011] In some embodiments of this application, the step of recombining the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content includes: determining the corresponding number of data compatible bytes based on the number of bytes of the serial content to be transmitted; creating a data transmission array of a size corresponding to the number of data compatible bytes; and setting data identifier content and the content in the serial content to be transmitted in each bit of the data transmission array according to the second serial format to obtain the converted serial content.

[0012] In some embodiments of this application, the first serial peripheral interface is a four-wire standard serial peripheral interface, and the second serial peripheral interface is a three-wire nine-bit standard serial peripheral interface.

[0013] According to one embodiment of this application, a serial transmission processing apparatus is applied to a host computer that supports an interface mode of a first serial peripheral interface. The apparatus includes: a receiving module for receiving serial content to be transmitted, wherein the content format of the serial content to be transmitted is a first serial format corresponding to the first serial peripheral interface; an identification module for identifying the serial content to be transmitted to obtain a content type of the serial content to be transmitted; a conversion module for recombining the serial content to be transmitted into content that conforms to the first serial format and is compatible with a second serial format according to the content type, thereby obtaining converted serial content, wherein the second serial format is a format corresponding to a second serial peripheral interface; and a sending module for sending the converted serial content to a target device through the first serial peripheral interface, wherein the target device is a device that supports the interface mode of the second serial peripheral interface.

[0014] In some embodiments of this application, the identification module is configured to: obtain the content type feature corresponding to the serial content to be transmitted according to the serial transmission mode corresponding to the first serial peripheral interface; and obtain the content type of the serial content to be transmitted according to the content type feature, wherein the content type includes command type or data type.

[0015] In some embodiments of this application, the content type includes a command type; the conversion module is configured to: determine a corresponding first content conversion logic based on the command type; and reassemble the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the first content conversion logic to obtain the converted serial content.

[0016] In some embodiments of this application, the conversion module is configured to: create a command transmission array of a predetermined compatible byte size, wherein the number of bits in each byte of the command transmission array is the number of bits in the byte corresponding to the first serial format; and set the command identifier content and the content in the serial content to be transmitted in each bit of the command transmission array according to the second serial format to obtain the converted serial content.

[0017] In some embodiments of this application, the content type includes a data type; the conversion module is configured to: determine a corresponding second content conversion logic based on the data type; and reassemble the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the second content conversion logic to obtain the converted serial content.

[0018] In some embodiments of this application, the conversion module is configured to: determine the corresponding number of data-compatible bytes based on the number of bytes of the serial content to be transmitted; create a data transmission array of the size corresponding to the number of data-compatible bytes; and set data identifier content and the content of the serial content to be transmitted in each bit of the data transmission array according to the second serial format to obtain the converted serial content.

[0019] In some embodiments of this application, the first serial peripheral interface is a four-wire standard serial peripheral interface, and the second serial peripheral interface is a three-wire nine-bit standard serial peripheral interface.

[0020] According to another embodiment of this application, a storage medium stores a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the methods described in the embodiments of this application.

[0021] According to another embodiment of this application, an electronic device may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.

[0022] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described in the embodiments of this application.

[0023] In this embodiment, the serial transmission processing method is applied to a host, which supports the interface mode of a first serial peripheral interface. The method includes: receiving serial content to be transmitted, wherein the content format of the serial content to be transmitted is a first serial format corresponding to the first serial peripheral interface; identifying the serial content to be transmitted to obtain the content type of the serial content to be transmitted; converting the serial content to be transmitted into content that conforms to the first serial format and is compatible with a second serial format according to the content type to obtain converted serial content, wherein the second serial format is the format corresponding to a second serial peripheral interface; and sending the converted serial content to a target device through the first serial peripheral interface, wherein the target device is a device that supports the interface mode of the second serial peripheral interface.

[0024] In this way, the host can reassemble the received serial content to be transmitted into content that conforms to a first serial format and is compatible with a second serial format, according to the content type. Then, the reassembled and converted serial content is sent to the target device through the first serial peripheral interface. This allows the target device, which supports the interface mode of the second serial peripheral interface, to extract the content from the converted serial content. In turn, the host, which supports the interface mode of the first serial peripheral interface, can easily be compatible with target devices with different interface modes of the second serial peripheral interface. This allows for low-cost and cost-effective implementation of compatible serial transmission of different Serial Peripheral Interface (SPI) modes without increasing hardware costs, and can also be compatible with more display devices with different serial peripheral interface modes. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 A flowchart of a serial transmission processing method according to an embodiment of this application is shown.

[0027] Figure 2 A schematic diagram of a four-wire serial peripheral interface bus according to an embodiment of this application is shown.

[0028] Figure 3 A schematic diagram of a three-wire nine-bit serial peripheral interface bus according to an embodiment of this application is shown.

[0029] Figure 4 A schematic diagram of the transmitted bytes according to an embodiment of this application is shown.

[0030] Figure 5 A block diagram of a serial transmission processing apparatus according to an embodiment of this application is shown.

[0031] Figure 6 A block diagram of an electronic device according to an embodiment of this application is shown. Detailed Implementation

[0032] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are merely illustrative of the present disclosure and are not intended to limit the present disclosure. Furthermore, the embodiments provided below are some embodiments for implementing the present disclosure, and not all embodiments for implementing the present disclosure. Unless otherwise specified, the technical solutions described in the embodiments of the present disclosure can be implemented in any combination.

[0033] It should be noted that, in the embodiments of this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of circuitry, processors, programs, or software, etc.) in the method or apparatus that includes that element.

[0034] For example, the serial transmission processing method provided in this disclosure includes a series of steps, but the serial transmission processing method provided in this disclosure is not limited to the steps described. Similarly, the serial transmission processing apparatus provided in this disclosure includes a series of units, but the apparatus provided in this disclosure is not limited to the units explicitly described, but may also include units that need to be set up for obtaining relevant information or processing based on information.

[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure.

[0036] Figure 1 A flowchart illustrating a serial transmission processing method according to an embodiment of this application is shown. The subject executing this serial transmission processing method can be any host, such as a main control MCU or an ARM processor.

[0037] The serial transmission processing method is applied to a host computer that supports the interface mode of a first serial peripheral interface, such as... Figure 1 As shown, the serial transmission processing method may include steps S110 to S140.

[0038] Step S110: Receive serial content to be transmitted, wherein the content format of the serial content to be transmitted is a first serial format corresponding to a first serial peripheral interface; Step S120: Identify the serial content to be transmitted to obtain the content type of the serial content to be transmitted; Step S130: Convert the serial content to be transmitted into content that conforms to the first serial format and is compatible with a second serial format according to the content type, to obtain converted serial content, wherein the second serial format is the format corresponding to a second serial peripheral interface; Step S140: Send the converted serial content to a target device through the first serial peripheral interface, wherein the target device is a device that supports the interface mode of the second serial peripheral interface.

[0039] The serial content to be transmitted is the content to be transmitted to the target device. The serial content to be transmitted can be a command or data (data can also be parameters). The host supports the interface mode of the first serial peripheral interface, and the serial content to be transmitted received by the host is the first serial format corresponding to the first serial peripheral interface.

[0040] For example, the first serial peripheral interface supported by the host is a four-wire standard serial peripheral interface, and the serial content to be transmitted received by the host is the first serial format (i.e., the four-wire standard format) corresponding to the four-wire standard serial peripheral interface.

[0041] The host can identify the serial content to be transmitted and obtain the content type of the serial content to be transmitted. The content type can usually be a command type or a data type.

[0042] The host can convert the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format, based on the content type, to obtain the converted serial content. The second serial format is the format corresponding to a second serial peripheral interface, such as a three-wire, 9-bit serial peripheral interface.

[0043] The converted serial content conforms to the first serial format and is compatible with the second serial format. Therefore, the converted serial content can be transmitted by the host through the first serial peripheral interface bus, and the converted serial content can also be recognized by devices that support the interface mode of the second serial peripheral interface.

[0044] Furthermore, the host can successfully send the converted serial content to the target device that supports the interface mode of the second serial peripheral interface through the first serial peripheral interface, and the target device can recognize the converted serial content according to the interface mode of the second serial peripheral interface. This ensures that the platform of the host supporting the interface mode of the first serial peripheral interface is compatible with the target device supporting the interface mode of the second serial peripheral interface.

[0045] In this way, based on steps S110 to S140, the host can reassemble the received serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type. Then, the reassembled and converted serial content is sent to the target device through the first serial peripheral interface, so that the target device that supports the interface mode of the second serial peripheral interface can extract the content from the converted serial content. In this way, the host that supports the interface mode of the first serial peripheral interface can easily be compatible with target devices with different interface modes of the second serial peripheral interface. It can achieve compatible serial transmission of different serial peripheral interface (SPI) modes at low cost without increasing hardware costs and can be compatible with more display devices with different serial peripheral interface modes.

[0046] The following description Figure 1 Further optional specific embodiments for each step performed during serial transmission processing in the example.

[0047] In one embodiment, identifying the serial content to be transmitted and obtaining the content type of the serial content to be transmitted may include: obtaining the content type feature corresponding to the serial content to be transmitted based on the serial transmission mode corresponding to the first serial peripheral interface; obtaining the content type of the serial content to be transmitted based on the content type feature, wherein the content type includes command type or data type.

[0048] Different serial transmission methods typically have corresponding characteristics that reflect the type of content being transmitted. Content type characteristics are those that reflect the type (command type or data type) of the transmitted content. Based on the serial transmission method corresponding to the first serial peripheral interface, the content type characteristics of the serial content to be transmitted can be obtained, and the content type of the serial content to be transmitted can be determined from these characteristics.

[0049] Taking a serial peripheral interface with a four-wire standard as an example, such as Figure 2 As shown, the bus 200 of a four-wire standard Serial Peripheral Interface (SPI) typically includes a D / C communication line 210. In the serial transmission mode of the four-wire standard SPI, a low level on the D / C line indicates that the transmitted content is a command, and a high level on the D / C line indicates that the transmitted content is data. Therefore, the content type characteristic can be determined by whether the D / C line is high or low. Furthermore, based on whether the D / C line is high or low, it is possible to determine whether the content type is a command type or a data type.

[0050] Furthermore, such as Figure 2 As shown, the bus 200 of the four-wire standard Serial Peripheral Interface (SPI) may also include a clock line (SCLK: Serial Clock) 220, a control line (CS) 230 for controlling transmission enable and disable, a write data line (MOSI) 240 for the host to write data to the target device (e.g., an LCD display device), and a read data line (MISO) 250 for the host to read data.

[0051] For further details, please refer to [link / reference]. Figure 3The three-wire 9-bit standard Serial Peripheral Interface (SPI) bus 300 may include a clock line (SCLK: Serial Clock) 310, a control line (CS) 320 for controlling transmission enable and disable, a write data line (MOSI) 330 for the host to write data to the target device (e.g., an LCD display device), and a read data line (MISO) 340 for the host to read data. It does not include D / C communication lines.

[0052] Furthermore, such as Figure 4 As shown, in the three-wire 9-bit standard Serial Peripheral Interface (SPI) mode, each byte 410 requires 9 SCLK clock cycles. The first bit of each byte is a "type identifier bit (used to identify the content type)," and the last 8 bits of each byte are the transmitted content (command or data). In contrast, in the four-wire standard Serial Peripheral Interface (SPI) mode, each byte 420 requires 8 SCLK clock cycles. The 8 bits of each byte are the transmitted content (command or data), and its content type characteristics are represented by the level of a separate D / C communication line without occupying bits in the byte.

[0053] In one embodiment, the content type includes a command type; the step of reassembling the serial content to be transmitted into content conforming to the first serial format and compatible with the second serial format according to the content type to obtain the converted serial content includes:

[0054] The corresponding first content conversion logic is determined according to the command type; through the first content conversion logic, the serial content to be transmitted is reassembled into content that conforms to the first serial format and is compatible with the second serial format, thereby obtaining the converted serial content.

[0055] The first content conversion logic bit is a preset logic program used to reassemble command-type content. If the content type of the serial content to be transmitted is identified as a command type, the corresponding first content conversion logic can be used to reassemble the serial content to be transmitted. Through the first content conversion logic, the serial content to be transmitted can be reassembled into content that conforms to the first serial format and is compatible with the second serial format, resulting in the converted serial content.

[0056] In one embodiment, reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content may specifically include:

[0057] Create a command transmission array of a predetermined compatible byte size, wherein the number of bits in each byte of the command transmission array is the same as the number of bits in the first serial format; in each bit of the command transmission array, set the command identifier content and the content of the serial content to be transmitted according to the second serial format to obtain the converted serial content.

[0058] The predetermined compatible byte count is the number of bytes used for the content of the predetermined reassembly command type. The predetermined compatible byte count can be set according to the actual situation; for example, the predetermined compatible byte count can be 2. A command transmission array of the predetermined compatible byte count size is created. The number of bits in each byte of the command transmission array is the same as the number of bits in the byte corresponding to the first serial format. The serial content to be transmitted is in the first serial format. For example, if the first serial format is the serial format of the four-wire standard Serial Peripheral Interface (SPI), the predetermined compatible byte count can be set to 2, and a 2-byte command transmission array can be created. Each byte in the command transmission array is 8 bits (that is, the number of bits in each byte is the same as the number of bits in the byte corresponding to the first serial format, 8 bits).

[0059] By setting the command identifier content and the content of the serial content to be transmitted in each bit of the created command transmission array according to the second serial format, a converted serial content that conforms to the first serial format and is compatible with the second serial format can be obtained.

[0060] For example, a 2-byte command transmission array is created, where each byte is 8 bits. The second serial format is a 3-wire 9-bit standard Serial Peripheral Interface (SPI) format, where each byte is 9 bits. In this case, the first bit of the "first byte" of the command transmission array can be set to the command identifier (used to identify that the transmitted content is a command), and the next 7 bits can be used to store the first 7 bits of the serial content to be transmitted. The last bit of the serial content to be transmitted can be placed in the first bit of the "second byte" of the command transmission array. This results in a converted serial content that conforms to the first serial format and is compatible with the second serial format; that is, the last 7 bits of the "second byte" of the command transmission array are discarded. Therefore, when the target device supports the 3-wire 9-bit standard Serial Peripheral Interface (SPI) interface mode, it can successfully identify the converted serial content according to the 3-wire 9-bit standard.

[0061] In one embodiment, the content type includes a data type; the step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type to obtain the converted serial content may include: determining a corresponding second content conversion logic according to the data type; and reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the second content conversion logic to obtain the converted serial content.

[0062] The second content conversion logic bit is a preset logic program for reconstructing data types. If the content type of the serial content to be transmitted is identified as a data type, the corresponding second content conversion logic can be used to reconstruct the serial content to be transmitted. Through the second content conversion logic, the serial content to be transmitted can be reconstructed into content that conforms to the first serial format and is compatible with the second serial format, resulting in the converted serial content.

[0063] In one embodiment, reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content may include: determining the corresponding number of data-compatible bytes based on the number of bytes in the serial content to be transmitted; creating a data transmission array of a size corresponding to the number of data-compatible bytes; and setting data identifier content and the content in the serial content to be transmitted in each bit of the data transmission array according to the second serial format to obtain the converted serial content.

[0064] When the serial content to be transmitted is data, its length is usually not fixed. In this case, the corresponding number of compatible bytes can be determined based on the number of bytes of the serial content to be transmitted. For example, if the number of bytes of the serial content to be transmitted is 8 bytes, if it is converted to the second serial format corresponding to the three-wire nine-bit standard serial peripheral interface, a data identifier (used to identify that the transmitted content is data) needs to be added before every 8 bits of data. Therefore, the number of compatible bytes can be 8 bytes + 1 = 9 bytes.

[0065] Furthermore, by setting the data identifier content and the content of the serial content to be transmitted in each bit of the created data transmission array according to the second serial format, a converted serial content that conforms to the first serial format and is compatible with the second serial format can be obtained.

[0066] For example, if the serial content to be transmitted is 2 bytes long with 8 bits per byte, a 3-byte data transmission array can be created, with each byte in the data transmission array being 8 bits. If the second serial format is the serial format of the three-wire 9-bit standard Serial Peripheral Interface (SPI), then each byte in the second serial format is 9 bits. In this case, the first bit of the "first byte" in the data transmission array can be set as the data identifier, and the next 7 bits can be used to store the first 7 bits of the first byte of the serial content to be transmitted. The last bit of the first byte of the serial content to be transmitted can be placed in the first bit of the "second byte" in the data transmission array. At the same time, the second bit of the "second byte" in the data transmission array can be set as the data identifier, and the next 6 bits can be used to store the first 6 bits of the second byte of the serial content to be transmitted. The last two bits of the second byte of the serial content to be transmitted can be placed in the first two bits of the "third byte" in the data transmission array. This results in a converted serial content that conforms to the first serial format and is compatible with the second serial format. In other words, the last 6 bits of the "third byte" in the data transmission array are discarded. Furthermore, when the target device is an interface mode that supports the three-wire 9-bit standard Serial Peripheral Interface (SPI), the converted serial content can be successfully identified from the converted serial content according to the three-wire 9-bit standard.

[0067] Furthermore, in one embodiment of the foregoing embodiments of this application, the first serial peripheral interface is a four-wire standard serial peripheral interface, and the second serial peripheral interface is a three-wire nine-bit standard serial peripheral interface. Based on the foregoing embodiments of this application, a target device that is compatible with the three-wire nine-bit standard can be effectively achieved, using a four-wire standard host. It is understood that in other embodiments, the first serial peripheral interface and the second serial peripheral interface can be two serial peripheral interfaces of different standards.

[0068] To facilitate better implementation of the serial transmission processing method provided in the embodiments of this application, the embodiments of this application also provide a serial transmission processing apparatus based on the above-described serial transmission processing method. The meanings of the terms used are the same as in the above-described serial transmission processing method, and specific implementation details can be found in the descriptions in the method embodiments. Figure 5 A block diagram of a serial transmission processing apparatus according to an embodiment of this application is shown.

[0069] like Figure 5As shown, the serial transmission processing device 500 is applied to a host computer that supports the interface mode of a first serial peripheral interface. The serial transmission processing device 500 may include: a receiving module 510 for receiving serial content to be transmitted, wherein the content format of the serial content to be transmitted is a first serial format corresponding to the first serial peripheral interface; an identification module 520 for identifying the serial content to be transmitted to obtain the content type of the serial content to be transmitted; a conversion module 530 for recombining the serial content to be transmitted into content that conforms to the first serial format and is compatible with a second serial format according to the content type, thereby obtaining converted serial content, wherein the second serial format is the format corresponding to the second serial peripheral interface; and a sending module 540 for sending the converted serial content to a target device through the first serial peripheral interface, wherein the target device is a device that supports the interface mode of the second serial peripheral interface.

[0070] In some embodiments of this application, the identification module is configured to: obtain the content type feature corresponding to the serial content to be transmitted according to the serial transmission mode corresponding to the first serial peripheral interface; and obtain the content type of the serial content to be transmitted according to the content type feature, wherein the content type includes command type or data type.

[0071] In some embodiments of this application, the content type includes a command type; the conversion module is configured to: determine a corresponding first content conversion logic based on the command type; and reassemble the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the first content conversion logic to obtain the converted serial content.

[0072] In some embodiments of this application, the conversion module is configured to: create a command transmission array of a predetermined compatible byte size, wherein the number of bits in each byte of the command transmission array is the number of bits in the byte corresponding to the first serial format; and set the command identifier content and the content in the serial content to be transmitted in each bit of the command transmission array according to the second serial format to obtain the converted serial content.

[0073] In some embodiments of this application, the content type includes a data type; the conversion module is configured to: determine a corresponding second content conversion logic based on the data type; and reassemble the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the second content conversion logic to obtain the converted serial content.

[0074] In some embodiments of this application, the conversion module is configured to: determine the corresponding number of data-compatible bytes based on the number of bytes of the serial content to be transmitted; create a data transmission array of the size corresponding to the number of data-compatible bytes; and set data identifier content and the content of the serial content to be transmitted in each bit of the data transmission array according to the second serial format to obtain the converted serial content.

[0075] In some embodiments of this application, the first serial peripheral interface is a four-wire standard serial peripheral interface, and the second serial peripheral interface is a three-wire nine-bit standard serial peripheral interface.

[0076] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0077] Furthermore, embodiments of this application also provide an electronic device, such as... Figure 4 As shown, Figure 4 A block diagram of an electronic device according to an embodiment of this application is shown, specifically:

[0078] The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0079] in:

[0080] The processor 601 is the control center of the electronic device. It connects to various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the electronic device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user page, and application programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.

[0081] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0082] The electronic device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0083] The electronic device may also include an input unit 604, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0084] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 602 according to the following instructions, and the processor 601 runs the computer programs stored in the memory 602, thereby realizing the various functions in the foregoing embodiments of this application.

[0085] If processor 601 can be implemented as the host, and the host supports the interface mode of the first serial peripheral interface, processor 601 can perform the following steps:

[0086] The system receives serial content to be transmitted, the content format of which is a first serial format corresponding to a first serial peripheral interface; identifies the serial content to be transmitted to obtain its content type; reassembles the serial content to be transmitted into a format that conforms to the first serial format and is compatible with a second serial format, according to the content type, to obtain converted serial content, the second serial format being the format corresponding to a second serial peripheral interface; and sends the converted serial content to a target device through the first serial peripheral interface, the target device being a device that supports the interface mode of the second serial peripheral interface.

[0087] In some embodiments of this application, identifying the serial content to be transmitted and obtaining the content type of the serial content to be transmitted includes: obtaining the content type feature corresponding to the serial content to be transmitted according to the serial transmission mode corresponding to the first serial peripheral interface; obtaining the content type of the serial content to be transmitted according to the content type feature, wherein the content type includes command type or data type.

[0088] In some embodiments of this application, the content type includes a command type; the step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type to obtain the converted serial content includes: determining the corresponding first content conversion logic according to the command type; and reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the first content conversion logic to obtain the converted serial content.

[0089] In some embodiments of this application, the step of recombining the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content includes: creating a command transmission array of a predetermined compatible byte number, wherein the number of bits of each byte in the command transmission array is the number of bits of the byte corresponding to the first serial format; and setting the command identifier content and the content in the serial content to be transmitted in each bit of the command transmission array according to the second serial format to obtain the converted serial content.

[0090] In some embodiments of this application, the content type includes a data type; the step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type to obtain the converted serial content includes: determining the corresponding second content conversion logic according to the data type; and reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format through the second content conversion logic to obtain the converted serial content.

[0091] In some embodiments of this application, the step of recombining the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content includes: determining the corresponding number of data compatible bytes based on the number of bytes of the serial content to be transmitted; creating a data transmission array of a size corresponding to the number of data compatible bytes; and setting data identifier content and the content in the serial content to be transmitted in each bit of the data transmission array according to the second serial format to obtain the converted serial content.

[0092] In some embodiments of this application, the first serial peripheral interface is a four-wire standard serial peripheral interface, and the second serial peripheral interface is a three-wire nine-bit standard serial peripheral interface.

[0093] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0094] Therefore, embodiments of this application also provide a storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the methods provided in embodiments of this application.

[0095] The storage medium can be a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0096] Since the computer program stored in the storage medium can execute the steps of any of the methods provided in the embodiments of this application, the beneficial effects that the methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0097] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0098] It should be understood that this application is not limited to the embodiments described above and shown in the accompanying drawings, but various modifications and changes can be made without departing from its scope.

Claims

1. A serial transmission processing method, characterized in that, The method is applied to a host computer that supports the interface mode of a first serial peripheral interface, and the method includes: Receive serial content to be transmitted, wherein the format of the serial content to be transmitted is the first serial format corresponding to the first serial peripheral interface; The serial content to be transmitted is identified to obtain the content type of the serial content to be transmitted; According to the content type, the serial content to be transmitted is reassembled into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content. The second serial format is the format corresponding to the second serial peripheral interface. The converted serial content is sent to the target device through the first serial peripheral interface, and the target device is a device that supports the interface mode of the second serial peripheral interface.

2. The method according to claim 1, characterized in that, The step of identifying the serial content to be transmitted to obtain the content type of the serial content to be transmitted includes: Based on the serial transmission method corresponding to the first serial peripheral interface, obtain the content type characteristics corresponding to the serial content to be transmitted; The content type of the serial content to be transmitted is obtained based on the content type characteristics, and the content type includes command type or data type.

3. The method according to claim 1, characterized in that, The content type includes command type; the step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type, to obtain the converted serial content, includes: Determine the corresponding first content conversion logic based on the command type; The serial content to be transmitted is reassembled into content that conforms to the first serial format and is compatible with the second serial format through the first content conversion logic to obtain the converted serial content.

4. The method according to claim 3, characterized in that, The step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content includes: Create a command transmission array of a predetermined compatible byte size, wherein the number of bits in each byte of the command transmission array is the same as the number of bits in the byte corresponding to the first serial format; In each bit of the command transmission array, the command identifier content and the content of the serial content to be transmitted are set according to the second serial format to obtain the converted serial content.

5. The method according to claim 1, characterized in that, The content type includes data types; the step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type, to obtain the converted serial content, includes: Determine the corresponding second content conversion logic based on the data type; The second content conversion logic reassembles the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format, thus obtaining the converted serial content.

6. The method according to claim 5, characterized in that, The step of reassembling the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format to obtain the converted serial content includes: The corresponding number of compatible bytes is determined based on the number of bytes of the serial content to be transmitted; Create a data transfer array of the size corresponding to the number of bytes the data is compatible with; In each bit of the data transmission array, the data identifier content and the content of the serial content to be transmitted are set according to the second serial format to obtain the converted serial content.

7. The method according to any one of claims 1 to 6, characterized in that, The first serial peripheral interface is a four-wire standard serial peripheral interface, and the second serial peripheral interface is a three-wire nine-bit standard serial peripheral interface.

8. A serial transmission processing device, characterized in that, The device is applied to a host computer that supports the interface mode of a first serial peripheral interface, and the device includes: The receiving module is used to receive serial content to be transmitted, wherein the content format of the serial content to be transmitted is the first serial format corresponding to the first serial peripheral interface; The identification module is used to identify the serial content to be transmitted and obtain the content type of the serial content to be transmitted; The conversion module is used to reassemble the serial content to be transmitted into content that conforms to the first serial format and is compatible with the second serial format according to the content type, so as to obtain the converted serial content, wherein the second serial format is the format corresponding to the second serial peripheral interface; The sending module is used to send the converted serial content to a target device through the first serial peripheral interface, wherein the target device is a device that supports the interface mode of the second serial peripheral interface.

9. A storage medium, characterized in that, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the method described in any one of claims 1 to 7.

10. An electronic device, characterized in that, include: Memory, which stores computer programs; A processor reads a computer program stored in memory to perform the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data sending method, data receiving method and communication terminal

    CN112463706A

  • Semiconductor memory with multiprotocol serial communication interface

    US20050013153A1