A method and circuit for converting APPI data and CSI data based on MIPI protocol
By designing the APPI data conversion module and the SEP data conversion module based on the MIPI protocol, the clock domain and bit width conversion problems of data conversion between the APPI interface and the CSI interface are solved, and the normal data transmission and compatibility between the interfaces are achieved.
Patent Information
- Application Number
- CN202411601962.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-11
AI Technical Summary
The prior art is difficult to effectively solve the data conversion problem between the data transmitted by the APPI interface and the data transmitted by the CSI interface, especially when the bit width, format and clock domain are different.
A method of APPI data and CSI data conversion based on MIPI protocol is designed, and APPI data packets are obtained through the APPI data conversion module, their payloads are stored asynchronously, and a second data packet is generated. The data packet is transmitted to the SEP data conversion module, performs deframe frame and bit width standardization, and generates the target CSI data packet.
The clock domain and bit width conversion between APPI data and CSI data is realized to ensure normal transmission of data between different interfaces, and solve the problem of heterogeneity in data conversion.
Smart Images

Figure CN119135822B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of video interface data conversion, and in particular to a method and circuit for converting APPI data and CSI data based on the MIPI protocol. Background Art
[0002] MIPI (Mobile Industry Processor Interface) is an open standard and specification initiated by the MIPI Alliance for mobile application processors. It is widely used in mobile phone cameras, LCD displays, and RF / baseband interfaces. It can make the transmission of video data faster and more stable.
[0003] For different data transmission modules based on the MIPI protocol, there are often certain differences in input and output between different modules, such as different bit widths, different formats, different clock domains, etc. Therefore, it is necessary to set data conversion functions inside different data transmission modules to achieve normal transmission of video data.
[0004] In the prior art, although the MIPI protocol specifies the data transmission method of the APPI interface and the data transmission method of the CSI interface, a solution still needs to be designed to solve the data conversion between the data transmitted by the APPI interface and the data transmitted by the CSI interface. Summary of the invention
[0005] To solve the above technical problems, an embodiment of the present application provides a method and circuit for converting APPI data and CSI data based on the MIPI protocol.
[0006] On the one hand, the present application provides an APPI data and CSI data conversion method based on the MIPI protocol, which is applied to an APPI data conversion module, and the method includes: obtaining a first data packet containing APPI data, and storing the first data packet in a preset first storage area; reading multiple first data packets from the first storage area, and de-framing each first data packet to obtain a payload in each first data packet, and generating a second data packet according to the payload in each first data packet; transmitting the second data packet to a preset SEP data conversion module, so that the SEP data conversion module de-frames the second data packet and then splices the payload of the de-framed second data packet according to the bit width standard of the CSI data to obtain a target payload, and stores the target payload in a preset second storage area, and obtains a third data packet containing CSI data by reading the data stored in the second storage area.
[0007] In some embodiments of the present application, based on the above technical solution, the payloads of multiple first data packets are read from the first storage area, and a second data packet is generated according to the payload in each first data packet, including: reading the payload of the first data packet from the first storage area, and de-framing the payload of the first data packet to obtain a reference data segment, and marking the first byte and the last byte of the reference data segment; representing the payload between the first byte and the last byte in the reference data segment according to preset valid period data to generate the second data packet.
[0008] In some embodiments of the present application, based on the above technical solution, it also includes: when storing the payload of the first data packet in a preset first storage area, the ECC check value corresponding to the first data packet and the first data packet are associated and stored in the first storage area, and when reading the payload in the first storage area, the payload of the first data packet is checked according to the ECC check value, and then the payload of the first data packet is output.
[0009] In some embodiments of the present application, based on the above technical solution, storing the payload of the first data packet in a preset first storage area includes: obtaining frame header information in the first data packet, and determining whether bad packet information is marked in the frame header information, wherein the bad packet information is used to mark the abnormal state of the first data packet; if yes, discarding the corresponding first data packet so that the discarded first data packet cannot be read from the first storage area.
[0010] In some embodiments of the present application, based on the above technical solution, generating a second data packet according to the payload in each of the first data packets includes: obtaining frame header information in the first data packet, and identifying the unpacking order of the first data packet according to the sequence information in the frame header information, wherein the sequence information is used to represent the unpacking order of the first data packet, and the sequence information includes at least a head packet, a middle packet and a tail packet; determining whether the sequence information is a head packet, and if so, sequentially obtaining the first data packets corresponding to the middle packet and the tail packet of the sequence information, otherwise, discarding the corresponding first data packet, and re-obtaining other first data packets, so that the first data packet is unpacked according to the unpacking order corresponding to the sequence information.
[0011] On the other hand, the present application also discloses a method for converting APPI data and CSI data based on the MIPI protocol, which is applied to a SEP data conversion module. The method includes: obtaining a second data packet transmitted by the APPI data conversion module, wherein the second data packet is generated by the APPI data conversion module based on the payload in the first data packet containing APPI data; de-framing the second data packet to obtain the payload of the second data packet, and splicing the payload of the second data packet according to the bit width standard of the CSI data to obtain a target payload; storing the target payload in a preset second storage area, and obtaining a third data packet containing CSI data by reading the data stored in the second storage area.
[0012] In some embodiments of the present application, based on the above technical solution, the method also includes: when the SEP data conversion module deframes the payload of the second data packet, it also deframes the frame header information in the second data packet to obtain frame header attribute information; obtains the position information of the target payload stored in the second storage area; stores the frame header attribute information and the position information in a preset third storage area, so that when a third data packet containing CSI data is obtained by reading the data stored in the second storage area, the data stored in the second storage area is determined according to the frame header information and the position information read in the third storage area.
[0013] In some embodiments of the present application, based on the above technical solution, it also includes: when reading the data in the second storage area, inputting the second data packet into a preset CRC check module to generate CRC check information; detecting the check code in the CRC check information to verify the error information that occurs during the acquisition process of the data of the second data packet.
[0014] In some embodiments of the present application, based on the above technical solution, it also includes: when storing the target payload in a preset second storage area, the ECC check value corresponding to the second data packet is associated and stored in the second storage area, and when reading the data in the second storage area, the target payload is checked according to the ECC check value, and then the target payload is output.
[0015] On the other hand, the present application also discloses an APPI data and CSI data conversion circuit based on the MIPI protocol, including: an APPI data conversion module, adapted with a first storage area for storing data, for obtaining a first data packet containing APPI data, and storing the first data packet in the first storage area; reading multiple first data packets from the first storage area, and de-framing each first data packet to obtain a payload in each first data packet, and generating a second data packet according to the payload in each first data packet; a SEP data conversion module, adapted with a second storage area for storing data, for receiving the second data packet, so that the SEP data conversion module de-frames the payload of the second data packet and splices it according to the bit width standard of the CSI data, and stores the spliced payload in the second storage area, and obtains a third data packet containing CSI data by reading the data stored in the second storage area.
[0016] In the technical solution of the embodiment of the present application, the above invention content can at least bring the following beneficial effects:
[0017] The technical solution of the present application obtains a first data packet containing APPI data through an APPI data conversion module, and asynchronously stores the payload of the first data packet in a first storage area, so as to read the payload of the first data packet in the first storage area to generate a second data packet, and after de-framing the second data packet through a SEP data conversion module, splices the payload of the de-framed second data packet according to the bit width standard of CSI data to obtain a target payload, so as to read the data stored in the second storage area to obtain a third data packet containing CSI data. Since the storage and reading of the payload of the first data packet are not synchronized, the present application can realize the clock domain conversion control of the conversion of APPI data and CSI data, and at the same time, after de-framing the second data packet, splices the payload of the de-framed second data packet according to the bit width standard of CSI data to obtain the target payload, so that the present application can realize the bit width conversion of the conversion of APPI data and CSI data, thereby realizing the data conversion between the data transmitted by the APPI interface and the data transmitted by the CSI interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0019] Figure 1The present invention is a schematic diagram of the overall structure of an APPI data and CSI data conversion circuit based on the MIPI protocol, which is shown as an exemplary embodiment of the present application.
[0020] Figure 2 This is a schematic diagram of the overall structure of the internal circuit of the APPI data conversion module shown in an exemplary embodiment of the present application.
[0021] Figure 3 It is a schematic diagram of the overall structure of the internal circuit of the SEP data conversion module shown in the exemplary embodiment of the present application.
[0022] Figure 4 The present invention is a flowchart of a method for converting APPI data and CSI data based on the MIPI protocol, which is shown as an exemplary embodiment of the present application.
[0023] Figure 5 This is a flow chart of a second data packet generation process shown in an exemplary embodiment of the present application.
[0024] Figure 6 This is a flowchart of a first data packet storage process shown in an exemplary embodiment of the present application.
[0025] Figure 7 The flowchart of the second data packet generation process is shown as another exemplary embodiment of the present application.
[0026] Figure 8 The present invention is a flowchart of a method for converting APPI data and CSI data based on the MIPI protocol, which is another exemplary embodiment of the present invention.
[0027] Fig. 9 The flowchart of the second data packet deframing process shown in the exemplary embodiment of the present application.
[0028] Fig.10 This is a flow chart of a second data packet checking process shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0030] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0031] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0032] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0033] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0034] The present application discloses a MIPI data and CSI data conversion circuit based on the MIPI protocol. Figure 1 The schematic diagram of the overall structure of an APPI data and CSI data conversion circuit based on the MIPI protocol is shown as an exemplary embodiment of the present application. Figure 1 As shown, the conversion circuit at least includes an APPI data conversion module and a SEP data conversion module.
[0035] The APPI data conversion module is adapted to be connected with a first storage area for storing data, and the SEP data conversion module is adapted to be connected with a second storage area for storing data.
[0036] It should be noted that the first storage area and the second storage area may be connected via a wire or via a channel established by wireless communication, and there is no specific limitation here, as long as data transmission can be achieved.
[0037] In detail, the APPI data conversion module and the SEP data conversion module of the present application are disclosed. Figure 2 The overall structure diagram of the internal circuit of the APPI data conversion module shown in the exemplary embodiment of the present application is as follows: Figure 2 As shown, the APPI data conversion module disclosed in the present application may also include at least:
[0038] The payload control unit, the input end of the payload control unit is used as the input end of the APPI data conversion module to receive a data packet containing APPI data. The present application is exemplified by a first data packet. The first data packet may include video data, clock data, format information, etc. The video data in the first data packet may be regarded as a payload. Of course, the payload may also include other data in addition to the video data.
[0039] The output end of the payload control unit serves as the output end of the APPI data conversion module, and is used to output a second data packet containing SEP data generated after the APPI data corresponding to the first data packet is converted.
[0040] A payload asynchronous control unit, an input end of the payload asynchronous control unit is communicatively connected to the payload control unit, and an output end of the payload asynchronous control unit is communicatively connected to the first storage area so as to store the first data packet into the first storage area after asynchronous processing by the payload asynchronous control unit.
[0041] At the same time, based on the communication connection established between the payload control unit and the first storage area, the data stored in the first storage area is renamed so that a second data packet containing SEP data is output at the output end of the payload control unit according to a preset naming format.
[0042] A first check value generating unit, wherein the input end of the first check value generating unit is connected to the output end of the payload asynchronous control unit, and the output end of the first check value generating unit is connected to the input end of the first storage area, so as to generate a check value corresponding to the first data packet through the first check value generating unit.
[0043] A first verification value checking unit, wherein an input end of the first verification value checking unit is connected to an output end of the first storage area, and an output end of the first verification value checking unit is connected to an input end of a payload control unit so as to output data stored in the first storage area after performing a verification value check through the first verification value checking unit.
[0044] Figure 3 FIG. 1 is a schematic diagram of the overall structure of the internal circuit of the SEP data conversion module according to an exemplary embodiment of the present application. Figure 3 As shown, the SEP data conversion module disclosed in the present application may also include at least:
[0045] A writing unit, whose input end serves as a part of the input end of the SEP data conversion module and whose output end is connected to the second storage area, is used to write the target payload in the second data packet generated by the APPI data conversion module into the second storage area.
[0046] The CRC data acquisition unit has an input end serving as a part of the input end of the SEP data conversion module. The CRC data acquisition unit is used to acquire the payload of the second data packet to generate a CRC check code which is input into the CRC data checking unit.
[0047] A CRC data checking unit, whose input end serves as a partial input end of the SEP data conversion module, respectively obtains the frame header information and frame tail information in the second data packet, and the CRC check code generated by the CRC data acquisition unit, so as to respectively check the frame header information and frame tail information in the second data packet.
[0048] A second check value generating unit, wherein the input end of the second check value generating unit is connected to the output end of the writing unit, and the output end of the second check value generating unit is connected to the input end of the second storage area, so as to generate a check value corresponding to the second data packet through the second check value generating unit.
[0049] A second verification value checking unit, wherein the input end of the second verification value checking unit is connected to the output end of the second storage area, and the output end of the second verification value checking unit is connected to the input end of the data conversion unit, so as to output the data stored in the second storage area after performing a verification value check through the second verification value checking unit.
[0050] The frame header information acquisition unit has an input end serving as a part of the input end of the SEP data conversion module and an output end connected to the input end of the frame header information asynchronous control unit, and is used to deframe the frame header information in the second data packet.
[0051] The frame header information asynchronous processing unit has an output end connected to the input end of the data conversion unit and is used for asynchronously storing and outputting the frame header information.
[0052] The data conversion unit, the output end of the data conversion unit serves as a partial output end of the SEP data conversion module, and is used to convert the frame header information and the target effective load of the second data packet respectively.
[0053] A parity check unit, wherein the input end of the parity check unit is connected to the output end of the data conversion unit to perform a parity check on the data converted by the data conversion unit to generate parity check data, and the parity check data is combined with the data converted by the data conversion unit to obtain a third data packet.
[0054] In combination with the APPI data and CSI data conversion circuit based on the MIPI protocol disclosed in the above embodiment, the present application also provides an APPI data and CSI data conversion method based on the MIPI protocol. Figure 4 The flowchart of a method for converting APPI data and CSI data based on the MIPI protocol is shown as an exemplary embodiment of the present application. Figure 4 As shown, the method is applied to the APPI data conversion module, and the method may at least include the following execution steps:
[0055] S400, obtaining a first data packet containing APPI data, and asynchronously storing a payload of the first data packet into a preset first storage area;
[0056] S401, reading the payloads of a plurality of first data packets from a first storage area, and generating a second data packet according to the payload in each of the first data packets;
[0057] S402, transmitting the second data packet to a preset SEP data conversion module, so that the SEP data conversion module deframes the second data packet and then splices the payload of the deframed second data packet according to the bit width standard of the CSI data to obtain a target payload, and stores the target payload in a preset second storage area, and obtains a third data packet containing the CSI data by reading the data stored in the second storage area.
[0058] Specifically, the APPI data and CSI data conversion circuit based on the MIPI protocol can perform asynchronous storage through a payload asynchronous control unit when storing the first data packet in a preset first storage area, thereby improving the efficiency of data transmission and reducing data transmission errors caused by time differences generated by data storage.
[0059] For example, there are differences in the data types transmitted by different module interfaces, such as differences in bit widths. After reading multiple first data packets from the first storage area and de-framing each first data packet to obtain the payload in each first data packet, corresponding data adjustments can be made according to different output bit widths.
[0060] For example, the effective data length of data packet A is 12, and the effective data length of data packet B is 6. If data packet A is converted to data packet B, the effective data in data packet A needs to be split into two effective data of data packet B, and the frame header information corresponding to data packet A needs to be added to ensure the integrity of the data; conversely, if data packet B is converted to data packet A, the effective data of the two data packets B needs to be merged into one effective data of data packet A, and the frame header information corresponding to one data packet B needs to be subtracted. For another example, data packet A and data packet B are only different in frame header information. When performing data conversion, the conversion of different data packets is achieved by replacing the frame header information. Of course, the above examples are only for illustrating the technical solution of the present application, and no specific limitation is made.
[0061] It should be noted that, through the cooperation between the payload asynchronous control unit and the first storage area in the above-mentioned circuit, the present application can complete the clock domain conversion when the first data packet is asynchronously stored in the first storage area. For example, the payload reading time of the first data packet is determined according to the clock domain corresponding to the CSI data, or the generation time of the second data packet is determined, thereby realizing the conversion between the clock domain corresponding to the APPI data and the clock domain corresponding to the CSI data.
[0062] In addition, for further exemplary explanation, since the data of the APPI interface of the APPI data conversion module is 16 bits wide, the data received by the SEP data conversion module is also 16 bits wide, and the data of the CSI interface is 64 bits wide, so the SEP data conversion module needs to splice the data to realize the conversion of APPI data to CSI data. For example, the second data packet corresponding to the SEP data is 16 bits of data, and the payload of every 4 clock cycles can form 1 64 bits of data, thereby realizing the bit width conversion of APPI data and CSI data conversion.
[0063] Through the above implementation, the technical solution of the present application obtains a first data packet containing APPI data through an APPI data conversion module, and asynchronously stores the payload of the first data packet to a first storage area, so as to read the payload of the first data packet in the first storage area to generate a second data packet, and after de-framing the second data packet through the SEP data conversion module, splices the payload of the de-framed second data packet according to the bit width standard of the CSI data to obtain a target payload, so as to read the data stored in the second storage area to obtain a third data packet containing CSI data. Since the storage and reading of the payload of the first data packet are not synchronized, the present application can realize the clock domain conversion control of the conversion of APPI data and CSI data, and at the same time, after de-framing the second data packet, splices the payload of the de-framed second data packet according to the bit width standard of the CSI data to obtain the target payload, so that the present application can realize the bit width conversion of the conversion of APPI data and CSI data, thereby realizing the data conversion between the data transmitted by the APPI interface and the data transmitted by the CSI interface.
[0064] In some embodiments of the present application, based on the other embodiments mentioned above, after obtaining a third data packet containing CSI data by reading the data stored in the second storage area, the output data format can also be converted according to the data type required by the CSI data. For example, the output data of the SEP data conversion module is converted into a specified color encoding format RGB444, YUV422, etc., and after completing the data format conversion, the data is output through the CSI data transmission interface.
[0065] In some embodiments of the present application, based on the above other embodiments, Figure 5 The flowchart of the second data packet generation process shown in the exemplary embodiment of the present application is as follows: Figure 5 As shown, for the above-mentioned execution step S401, reading the payloads of multiple first data packets from the first storage area, and generating a second data packet according to the payload in each of the first data packets may at least include the following execution steps:
[0066] Reading the payload of the first data packet from the first storage area, de-framing the payload of the first data packet to obtain a reference data segment, and marking the first byte and the last byte of the reference data segment;
[0067] The effective load between the first byte and the last byte in the reference data segment is represented according to the preset effective period data to generate a second data packet.
[0068] It should be noted that the payload of the first data packet at least includes frame header information and check information when it is stored. When reading the payload of the first data packet, it can be located according to the frame header information, and then the corresponding payload is output to generate the parameter data segment. When obtaining the parameter data segment, the first byte and the last byte of the reference data segment are marked. Figure 5 The sop pulse in the reference data segment refers to the first byte, and the eop pulse refers to the last byte of the reference data segment.
[0069] Further, based on the effective cycle data, that is, Figure 5 The pulse segment corresponding to data_valid in the reference data segment represents the payload between the first byte and the last byte to generate the second data packet, that is, to generate Figure 5 The pulse segment corresponding to data.
[0070] In some embodiments of the present application, based on the other embodiments described above, when the payload of a first data packet is stored in a preset first storage area, the ECC check value corresponding to the first data packet is associated with the first data packet and stored in the first storage area, and when the payload in the first storage area is read, the payload of the first data packet is checked according to the ECC check value, and then the payload of the first data packet is output.
[0071] For example, a set of data bits are added to detect and correct data errors in memory. This set of ECC check value data bits is associated with the original data through a specific algorithm. When the original data changes, the ECC check value will also change. By comparing the ECC check value when reading data with the ECC check value when storing, the system can detect whether the data has errors and correct them under certain conditions.
[0072] In an embodiment of the present application, the ECC check value is used to detect and correct memory data errors. By comparing the ECC check value when reading data with the ECC check value when storing data, the system can ensure the integrity and accuracy of the data.
[0073] In some embodiments of the present application, based on the above other embodiments, Figure 6 The flowchart of the first data packet storage process shown in the exemplary embodiment of the present application is as follows: Figure 6 As shown, for the above-mentioned execution step S400, storing the payload of the first data packet into the preset first storage area may at least include the following execution steps:
[0074] S600, obtaining frame header information in a first data packet, and determining whether bad packet information is marked in the frame header information, wherein the bad packet information is used to mark an abnormal state of the first data packet;
[0075] S601: If yes, discard the corresponding first data packet so that the discarded first data packet cannot be read from the first storage area.
[0076] Specifically, during the data transmission process, by adopting appropriate verification methods, log records, error codes and status codes, bad packet data can be effectively identified and marked, thereby ensuring the security of data transmission and storage.
[0077] For illustrative purposes, the marking of bad packet data in the present application can be represented by the bad packet information defined in the frame header information, and in the process of storing the payload of the first data packet in a preset first storage area, the bad packet information in the frame header information is identified as abnormal, thereby determining that the first data packet with the abnormality will be discarded, so that the discarded first data packet cannot be read from the first storage area, thereby ensuring the integrity and reliability of the data.
[0078] In some embodiments of the present application, based on the above other embodiments, Figure 7 FIG. 1 is a flowchart of a second data packet generation process shown in another exemplary embodiment of the present application. Figure 7 As shown, for the above-mentioned execution step S401, generating a second data packet according to the effective load in each first data packet may at least include the following execution steps:
[0079] S700, obtaining frame header information in a first data packet, and identifying an unpacking order of the first data packet according to sequence information in the frame header information, wherein the sequence information is used to indicate an unpacking order of the first data packet, and the sequence information includes at least a head packet, a middle packet, and a tail packet;
[0080] S701. Determine whether the sequence information is a head packet. If so, obtain the first data packets corresponding to the middle packet and the tail packet in sequence. Otherwise, discard the corresponding first data packets and re-acquire other first data packets so that the first data packets are unpacked according to the unpacking order corresponding to the sequence information.
[0081] For example, when generating a second data packet according to the payload in each first data packet, the sequence information of the multiple first data packets is judged in sequence, and the second data packets are sorted and output according to the head packet, the middle packet and the tail packet. For example, the judgment starts from the first first data packet. If the first first data packet is not the head packet, the second first data packet is judged until the corresponding first data packet is judged as the head packet and then output, and then the middle packet is judged until the corresponding first data packet is judged as the middle packet and then output, and finally the first data packet corresponding to the tail packet is output, so that the multiple first data packets are output in a certain order, thereby enhancing the consistency of the data and optimizing the storage effect of the subsequent second data packets.
[0082] In combination with the APPI data and CSI data conversion circuit based on the MIPI protocol disclosed in the above embodiment, the present application also provides an APPI data and CSI data conversion method based on the MIPI protocol. Figure 8 A flowchart of a method for converting APPI data and CSI data based on the MIPI protocol is shown as another exemplary embodiment of the present application. Figure 8 As shown, the method is applied to the SEP data conversion module, and the method may at least include the following execution steps:
[0083] S800, obtaining a second data packet transmitted by the APPI data conversion module, where the second data packet is generated by the APPI data conversion module based on a payload in the first data packet containing APPI data;
[0084] S801, deframe the second data packet to obtain a payload of the second data packet, and splice the payload of the second data packet according to the bit width standard of CSI data to obtain a target payload;
[0085] S802: Store the target payload in a preset second storage area, and obtain a third data packet containing CSI data by reading data stored in the second storage area.
[0086] In combination with the APPI data and CSI data conversion method based on the MIPI protocol on the APPI data conversion module in the above embodiment, the APPI data and CSI data conversion method based on the MIPI protocol on the SEP data conversion module is exemplarily described. The SEP data conversion module of the present application realizes the bit width conversion between APPI data and CSI data by splicing the payload of the second data packet. As for the principle of bit width conversion between APPI data and CSI data, refer to the example in the above related embodiment, which will not be repeated here.
[0087] In some embodiments of the present application, based on the above other embodiments, Fig. 9 The flowchart of the second data packet deframing process shown in the exemplary embodiment of the present application is as follows: Fig. 9 As shown, when the SEP data conversion module deframes the payload of the second data packet, it also deframes the frame header information in the second data packet to obtain the frame header attribute information; and the above method may also include at least the following execution steps:
[0088] S900, obtaining location information of the target payload stored in the second storage area;
[0089] S901. Store frame header attribute information and position information in a preset third storage area so that when a third data packet containing CSI data is obtained by reading data stored in the second storage area, the data stored in the second storage area is determined based on the frame header information and position information read in the third storage area.
[0090] Specifically, when the SEP data conversion module deframes the payload of the second data packet, it simultaneously records the starting address and ending address of the payload of each second data packet in the second storage area, and stores these two address information together with the frame header attribute information in the frame header information asynchronous processing unit.
[0091] When the third data packet containing CSI data is obtained by reading the data stored in the second storage area, the data stored in the second storage area is determined based on the frame header information and position information read in the third storage area, thereby reading out the payload of the second data packet.
[0092] Through the above implementation, the technical solution of the present application can quickly determine the specific location of the payload of the second data packet in the second storage area according to the frame header attribute information in the frame header information, thereby improving data conversion efficiency.
[0093] In some embodiments of the present application, based on the above other embodiments, Fig.10 The flowchart of the second data packet verification process shown in the exemplary embodiment of the present application is as follows: Fig.10As shown, the above method may further include at least the following execution steps:
[0094] S1000, when reading data in the second storage area, inputting the second data packet into a preset CRC check module to generate CRC check information;
[0095] S1001. Detect the check code in the CRC check information to check the error information that occurs during the acquisition of the data of the second data packet.
[0096] For example, the CRC check in the technical solution of the present application, i.e., the cyclic redundancy check (Cyclic Redundancy Check), is used to detect errors in data transmission or storage. Specifically, it is based on the division operation, that is, a fixed polynomial (generating polynomial) is used to divide a data to be checked. When there is no error in the data, the result of this division is an integer, that is, the remainder is 0; and when there is an error in the data, the result of the division is not an integer, and the remainder is not 0. The receiver can determine whether the data is correct by comparing the remainder. For example, the second data packet of the present application is regarded as a binary polynomial, and the divisor (i.e., the generating polynomial) is also expressed as a binary polynomial. By using long division, the two polynomials are divided, and the remainder is the check code.
[0097] If the check code in the CRC check information is the same as the received check code, then there is no error in the data transmission; otherwise, it means that an error occurred during the data transmission process. The integrity and accuracy of the data can be ensured based on the check result.
[0098] In some embodiments of the present application, based on the above embodiments, similarly to when the first data packet is stored in the first storage area, when the target payload is stored in the preset second storage area, the ECC check value corresponding to the second data packet is associated and stored in the second storage area, and when the data in the second storage area is read, the target payload is checked according to the ECC check value and then the target payload is output.
[0099] Similar to the above embodiment where the payload of the first data packet is stored in the first storage area, by comparing the ECC check value when reading the data with the ECC check value when storing the data, the system can detect whether an error has occurred in the data and correct it under certain conditions, thereby ensuring the integrity and accuracy of the data.
[0100] In order to more clearly disclose the technical solution of the present application, further exemplary description is given in combination with the above-mentioned multiple embodiments. This solution is mainly divided into two functional modules, namely APPI data conversion module and SEP data conversion module. Each module requires a storage area to store data.
[0101] Specifically, when the APPI data conversion module receives the first data packet from the preset APPI data transmission interface, it first generates an ECC check value using the first data packet, and writes the 16-bit data of the first data packet and the generated ECC check value together to the first storage area, and then reads the data corresponding to the first data packet from the first storage area, and checks the ECC check value of the read data.
[0102] After reading the data in the first storage area, the first data packet is deframed, and the payloads deframed from the multiple first data packets are reframed to form a second data packet, and the first byte (SOP) and the last byte (EOP) of the second data packet are marked, and data_valid is used to indicate valid data, and then the second data packet is transmitted to the next module, that is, the SEP data conversion module, which can deframe the second data packet based on this information. And during the deframing process, the exception processing in the above embodiment is performed, that is, the processing of bad packet information, and the unpacking is performed according to the unpacking order in the above embodiment. After unpacking, the SEP data conversion module can receive sop, eop, data, data_valid and other signals from the previous module, where sop is the first byte flag, eop is the last byte flag, data is the valid data in the second data packet, and data_valid is the valid period data. Of course, the above data is only exemplary data.
[0103] Since the data transmitted by the APPI data transmission interface of the APPI data conversion module is 16 bits wide, the data received by the SEP data conversion module is also 16 bits wide, and the data transmitted by the transmission interface of the SEP data conversion module for outputting CSI data is 64 bits wide, so the SEP data conversion module needs to transmit the frame header information of the second data packet to the transmission interface for outputting CSI data, and transmit the payload of the second data packet to the transmission interface for outputting CSI data, and complete the bit width conversion and clock domain conversion of the corresponding data at the same time.
[0104] Based on this, first, the second data packet transmitted from the APPI data conversion module to the SEP data conversion module contains the frame header information, payload and CRC check information of the second data packet, and vc, vcx, datatype, wordcount, byteen, pf and other information can be extracted from the frame header information. Of course, this application does not make any specific restrictions on any parameters defined in the frame header information, only for explanation.
[0105] After decoding the frame header information, the data is spliced and the ECC calculation is performed on the spliced data to generate an 8-bit ECC check value. The 64-bit valid data and the 8-bit ECC check value are written together to the second storage area. At the same time, the starting address and the ending address of the payload of each second data packet in the second storage area are recorded, and these two address information and the vc and other information extracted from the frame header are stored in the third storage area, that is, the frame header information asynchronous processing unit.
[0106] Then, the data conversion unit reads the stored data information from the third storage area through the clock signal, obtains the frame header information of the second data packet and the position of the payload of the second data packet in the second storage area, corresponds the frame header information to the signal transmitted to the transmission interface for outputting CSI data, and reads the payload of the second data packet stored in the second storage area through the clock signal and transmits it to the transmission interface corresponding to the CSI data.
[0107] Based on this, the present application completes data bit width conversion and clock domain conversion through multiple storage areas and asynchronous processing units.
[0108] After reading the corresponding data from the second storage area, it is also necessary to perform a certain color format conversion on the data according to the data type, and after completing the data format conversion, the data is output through the transmission interface for outputting CSI data.
[0109] Among them, for the exception handling of the SEP data conversion module, a CRC check module is added to check the two CRCs of the frame header information of the second data packet and the frame tail information of the second data packet. If the CRC check in the frame header information is wrong, it means that there is a problem with the frame header information of the second data packet, then the packet is discarded and the frame header information is not written to the third storage area. If there is no check error in the frame header information and the CRC check of the frame tail information is wrong, the frame is continued to be deframed and the packet is transmitted to the next stage, and a frame tail error signal is generated and output to the next stage module, so that the subsequent module can further judge the transmitted data, thereby improving the data transmission efficiency.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0111] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A method for converting APPI data and CSI data based on MIPI protocol, characterized in that: Applied to the APPI data conversion module, the method comprises: Acquire a first data packet containing APPI data, and asynchronously store a payload of the first data packet into a preset first storage area; Reading the payloads of the plurality of first data packets from the first storage area, and generating a second data packet according to the payload in each of the first data packets; transmitting the second data packet to a preset SEP data conversion module, so that the SEP data conversion module deframes the second data packet, splices the payload of the deframed second data packet according to the bit width standard of the CSI data to obtain a target payload, stores the target payload in a preset second storage area, and obtains a third data packet containing the CSI data by reading the data stored in the second storage area; The step of reading the payloads of the plurality of first data packets from the first storage area and generating a second data packet according to the payload in each of the first data packets includes: Reading the payload of the first data packet from the first storage area, de-framing the payload of the first data packet to obtain a reference data segment, and marking the first byte and the last byte of the reference data segment; The effective load between the first byte and the last byte in the reference data segment is represented according to preset effective period data to generate the second data packet.
2. The method for converting APPI data and CSI data based on the MIPI protocol according to claim 1, characterized in that: Also includes: When storing the payload of the first data packet in a preset first storage area, the ECC check value corresponding to the first data packet is associated with the first data packet and stored in the first storage area, and when reading the payload in the first storage area, the payload of the first data packet is checked according to the ECC check value, and then the payload of the first data packet is output.
3. The method for converting APPI data and CSI data based on the MIPI protocol according to any one of claims 1 or 2, characterized in that: The storing the payload of the first data packet into a preset first storage area includes: Obtaining frame header information in the first data packet, and determining whether bad packet information is marked in the frame header information, wherein the bad packet information is used to mark an abnormal state of the first data packet; If yes, the corresponding first data packet is discarded, so that the discarded first data packet cannot be read from the first storage area.
4. The method for converting APPI data and CSI data based on the MIPI protocol according to claim 3, characterized in that: Generating a second data packet according to the payload in each of the first data packets comprises: Obtaining frame header information in the first data packet, and identifying the unpacking order of the first data packet according to sequence information in the frame header information, wherein the sequence information is used to indicate the unpacking order of the first data packet, and the sequence information at least includes a head packet, a middle packet, and a tail packet; Determine whether the sequence information is a head packet. If yes, then sequentially obtain the first data packets corresponding to the middle packet and the tail packet of the sequence information. Otherwise, discard the corresponding first data packets and re-acquire other first data packets so that the first data packets can be unpacked according to the unpacking order corresponding to the sequence information.
5. A method for converting APPI data and CSI data based on MIPI protocol, characterized in that: Applied to the SEP data conversion module, the method comprises: Acquire a second data packet transmitted by the APPI data conversion module, where the second data packet is generated by the APPI data conversion module based on a payload in the first data packet containing APPI data; De-framing the second data packet to obtain a payload of the second data packet, and splicing the payload of the second data packet according to a bit width standard of CSI data to obtain a target payload; The target payload is stored in a preset second storage area, and a third data packet containing CSI data is obtained by reading data stored in the second storage area.
6. The method according to claim 5, characterized in that The method further comprises: When the SEP data conversion module deframes the payload of the second data packet, it also deframes the frame header information in the second data packet to obtain the frame header attribute information; Acquire location information of the target payload stored in the second storage area; The frame header attribute information and the position information are asynchronously stored in a preset third storage area, so that when a third data packet containing CSI data is obtained by reading the data stored in the second storage area, the data stored in the second storage area is determined based on the frame header information and the position information read in the third storage area.
7. The method for converting APPI data and CSI data based on the MIPI protocol according to claim 5, characterized in that: Also includes: When reading the data in the second storage area, inputting the second data packet into a preset CRC check module to generate CRC check information; The check code in the CRC check information is detected to check error information that occurs during the acquisition of the data of the second data packet.
8. The method for converting APPI data and CSI data based on the MIPI protocol according to claim 5, characterized in that: Also includes: When the target payload is stored in a preset second storage area, the ECC check value corresponding to the second data packet is associated and stored in the second storage area, and when the data in the second storage area is read, the target payload is checked according to the ECC check value and then output.
9. A MIPI protocol-based APPI data and CSI data conversion circuit, characterized in that: include: An APPI data conversion module, configured to obtain a first data packet containing APPI data, and asynchronously store a payload of the first data packet into a preset first storage area; Reading the payloads of the plurality of first data packets from the first storage area, and generating a second data packet according to the payload in each of the first data packets; Transmitting the second data packet to a preset SEP data conversion module, so that the SEP data conversion module deframes the second data packet, splices the payload of the deframed second data packet according to the bit width standard of the CSI data to obtain a target payload, stores the target payload in a preset second storage area, and obtains a third data packet containing the CSI data by reading the data stored in the second storage area; The SEP data conversion module is used to obtain a second data packet transmitted by the APPI data conversion module, where the second data packet is generated by the APPI data conversion module based on a payload in the first data packet containing the APPI data; De-framing the second data packet to obtain a payload of the second data packet, and splicing the payload of the second data packet according to a bit width standard of CSI data to obtain a target payload; The target payload is stored in a preset second storage area, and a third data packet containing CSI data is obtained by reading data stored in the second storage area.
Citation Information
Patent Citations
Data forwarding device and data transmission method between buses with different bit widths
CN115543882A