Real-time video signal transmission method based on SPI communication, electronic equipment and storage medium

By using SPI -based real -time video signal transmission methods in small portable devices, the HSS and WCB control words are used to flexibly configure image data to solve the problem of small and small resolution video transmission in the existing technology, and realize the instant display and adaptation of image data. Sexual transmission.

CN119383294AActive Publication Date: 2025-01-28NANJING GUOZHAO OPTOELECTRONICS TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411506283.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-28
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

The existing video signal transmission interface is difficult to achieve real-time transmission of small-resolution video images in small portable devices, and has high hardware requirements and high power consumption.

Method used

Adopting the real -time video signal transmission method based on SPI communication, the flexible configuration image data is flexibly configured through HSS control characters and WCB control characters, and the adaptation of the decoding mode and timing signal type of image data is suitable for different application scenarios.

Benefits of technology

In the case of a limited number of interconnection lines, the image data is displayed and transmitted in real time, simplifying the interconnection methods and protocol rules, and adapting to a variety of transmission environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383294A_ABST
    Figure CN119383294A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time video signal transmission method based on SPI (Serial Peripheral Interface) communication, electronic equipment and a storage medium, and the transmission method comprises the following steps: a host sends a transmission enable signal based on SPI communication to start data transmission, and sends two kinds of control words and image data to a slave; the slave determines a decoding mode of the image data and the type of a time sequence signal needing to be generated according to the two control words; the slave machine generates a corresponding time sequence signal; the slave machine performs serial-parallel conversion processing on the image data according to the decoding mode and outputs the image data; the SPI communication protocol is used as a synchronous data bus between the host and the slave, the interconnection mode and the protocol rule are simple, and the decoding mode of the image data and the generation of the time sequence signal are respectively controlled by the two control words, so that the video signal can be instantly generated in different application environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video signal transmission, and in particular to a real-time video signal transmission method based on SPI communication, an electronic device and a storage medium. Background Art

[0002] There are currently several mainstream video signal transmission interfaces, including HDMI, LVDS, MIPI, etc. Most of these interfaces have complete and complex protocol rules to ensure lossless transmission of large-bandwidth video signals, but the encoding and decoding process is complex, the area and power consumption are large, and the hardware requirements are high. They are not suitable for small portable devices that only need to transmit low-resolution video images.

[0003] The Serial Peripheral Interface (SPI) does not need to rely on complex protocol content and circuit structure. Through very simple hardware and software configuration, it can achieve flexible data transmission while maintaining a high data transmission rate. In SPI communication, according to the number of data lines used when the host transmits to the slave, it can be divided into Standard-SPI, Dual-SPI and Quad-SPI, which can send 1bit / 2bit / 4bit data at a time to meet different communication rate requirements.

[0004] The standard SPI transmission rate is slow but has the lowest power consumption. The two-wire and four-wire SPI can improve the efficiency of data transmission, but they consume more power and require a higher number of interfaces. In order to meet the transmission requirements of small-resolution images in different application scenarios, a real-time video signal transmission method that is compatible with multiple environments, flexible in configuration, and has simple protocol rules is needed to achieve instant display of the image. Summary of the invention

[0005] Technical purpose: In response to the existing requirements of various video transmission scenarios, the present invention discloses a real-time video signal transmission method, electronic device and storage medium based on SPI communication, which can flexibly configure image data according to application scenarios through control words. Even when the number of interconnection lines is limited, the slave can still receive images, thereby realizing a video signal transmission solution with simple interconnection method, simple protocol rules and adaptability to various application environments.

[0006] Technical solution: To achieve the above technical objectives, the present invention adopts the following technical solution: A real-time video signal transmission method based on SPI communication specifically comprises the following steps: S1. The host sends a transmission enable signal based on SPI communication to start data transmission, and sends two control words and image data to the slave. The two control words are a horizontal sub-pixel sequence (HSS) control word and a word count and base (WCB) control word. The HSS control word is used to determine the decoding mode of the image data, and the WCB control word is used to determine the type of generated timing signal. S2. The slave determines the decoding mode of the image data and the type of the generated timing signal according to the HSS control word and the WCB control word; S3, the slave generates a corresponding timing signal according to the type of the timing signal generated determined in step S2; S4, the slave performs serial-to-parallel conversion on the image data according to the decoding mode of the image data and the timing signal, outputs parallel image data in units of pixels, and converts it into a video signal; S5. Close the data transmission and complete the video signal transmission between the host and the slave.

[0007] Preferably, the decoding mode consists of three parts, namely, color mode, transmission protocol and bit depth.

[0008] Preferably, the color mode includes a monochrome mode and a color mode. In the monochrome mode, the image data contains grayscale information of a single color, and each grayscale value is mapped to a pixel. In the color mode, the image data contains grayscale information of three colors, and every three grayscale values ​​are mapped to a pixel.

[0009] Preferably, the transmission protocol includes single-line transmission, double-line transmission and four-line transmission, where single-line, double-line and four-line represent the number of data lines used by the host when transmitting image data.

[0010] Preferably, the bit depth includes 4-bit depth and 8-bit depth, which represent the bit width of the grayscale value of each color in the image data.

[0011] Preferably, the WCB control word includes a valid WCB control word and an invalid WCB control word, and the valid WCB control word generates two timing signals, namely a line synchronization signal and a frame synchronization signal; Line synchronization signal, indicating that the next image data is the first data of the next line; Frame synchronization signal, indicating that the next image data is the first data of the next frame; An invalid WCB control word does not generate any timing signal, indicating that the next image data follows the content of the previous transmission.

[0012] Preferably, the HSS control word and the WCB control word are transmitted using a single line.

[0013] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the real-time video signal transmission method based on SPI communication as described above is implemented.

[0014] The present invention also provides a storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the above-mentioned real-time video signal transmission method based on SPI communication.

[0015] Beneficial effects: The real-time video signal transmission method, electronic device and storage medium based on SPI communication provided by the present invention have the following beneficial effects: The host and slave of the present invention rely on the SPI communication protocol as a synchronous data bus, and control the transmission of image data between the host and the slave through two control words. The interconnection method and protocol rules are simple. The two control words respectively control the decoding mode of the image data and the type of the timing signal, so that the slave can select a suitable mode to transmit the video signal according to the type of video signal to be generated by the host.

[0016] The decoding mode of the present invention includes three parts, namely, color mode, transmission protocol and bit depth. The color mode includes monochrome mode and color mode. The transmission protocol includes single-line transmission, two-line transmission and four-line transmission. The bit depth includes 4-bit depth and 8-bit depth. It can reasonably and flexibly select a suitable decoding mode to transmit image data according to the application scenario. Even when the number of interconnection lines is limited, the slave can still receive image data. The video signal transmission method of the present invention can perform serial-to-parallel conversion processing on the image data according to the decoding mode, so as to adapt to a variety of transmission environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0018] Figure 1 A flow chart of a real-time video signal transmission method based on SPI communication of the present invention; Figure 2 This is an example timing diagram of control word transmission and image data conversion when the host and the slave communicate once in the present invention; Figure 3 This is an example timing diagram of control word transmission and image data conversion when the host and the slave communicate twice continuously in the present invention. DETAILED DESCRIPTION

[0019] The present invention will be described more clearly and completely below by means of several preferred embodiments in combination with the accompanying drawings, but the present invention is not limited to the scope of the embodiments.

[0020] like Figure 1 As shown, a real-time video signal transmission method based on SPI communication specifically includes the following steps: S1. The host sends a transmission enable signal based on SPI communication to start data transmission and sends two control words and image data to the slave.

[0021] The SPI communication protocol is a synchronous data bus. The host and the slave are connected and communicated by four logic lines: the serial output (Serial Out, SO) line input by the host and output by the slave, the serial input (Serial In, SI) line output by the host and input by the slave, the serial clock (Serial Clock, SCLK) sent by the host to the slave, and the chip select (Chip Select, CS) signal.

[0022] In a specific embodiment, the video signal source acts as a host, the display driving circuit acts as a slave, and the CS signal acts as a transmission enable signal. Control words and image data can be sent from the host through the SI line only during the effective period of the transmission enable.

[0023] The two control words include an HSS control word and a WCB control word. The HSS control word is used to determine the decoding mode of the image data, and the WCB control word is used to determine the type of generated timing signal. In the present invention, the two control words are transmitted through only one SI0 line, while the image data is transmitted through one, two or all four data lines of SI0~SI3, so that the two control words can be distinguished from general image data. When the transmission enable is valid, the 1st to 8th SCLK transmits the HSS control word, and the 9th to 16th SCLK transmits the WCB control word. Before the image data transmission is enabled, the corresponding relationship between the specific 8-bit data input and the functions of the two control words should be agreed in advance, and then the image data transmission is started. During the transmission, the high bit is input first. If the control word corresponding to the pre-agreed form is not received within the corresponding time, the transmission mode still follows the last valid control word, and the two control words are valid during the signal transmission enable period. The previous control word becomes invalid after the next control word is input. The transmission method of the image data follows the latest control word instruction.

[0024] S2. The slave determines the decoding mode of the image data and the type of generated timing signal according to the HSS control word and the WCB control word respectively.

[0025] S3. The slave generates a corresponding timing signal according to the type of the timing signal to be generated determined in step S2.

[0026] The WCB control word includes a valid WCB control word and an invalid WCB control word. The valid WCB control word generates two timing signals, namely a line synchronization signal and a frame synchronization signal. The line synchronization signal indicates that the next image data is the first data of the next line. The frame synchronization signal indicates that the next image data is the first data of the next frame. The invalid WCB control word does not generate any timing signal, indicating that the next image data is immediately after the content of the previous transmission.

[0027] If a valid WCB control word is detected, the corresponding timing signal will be pulled high in the next clock cycle after receiving the control word and maintained for one clock cycle, thereby ensuring that the image data after serial-to-parallel conversion processing must be output after the timing signal is generated.

[0028] S4. The slave performs row-serial-to-parallel conversion on the image data according to the decoding mode of the image data and the timing signal, outputs parallel image data in units of pixels, and converts it into a video signal.

[0029] The decoding mode includes three aspects: color mode, transmission protocol and bit depth.

[0030] The color mode is divided into a monochrome mode and a color mode. In the monochrome mode, the image data contains the grayscale information of a single color, and each grayscale value is mapped to one pixel; in the color mode, the image data contains the grayscale information of three colors, and every three grayscale values ​​are mapped to one pixel; The transmission protocol is divided into single-line transmission, dual-line transmission and four-line transmission. Each SCLK transmits 1bit / 2bit / 4bit data respectively. In single-line transmission, image data is only received from SI0 line. In dual-line transmission, image data is received from SI0 / SI1 lines. In four-line transmission, image data is received from SI0~SI3 at the same time. The bit depth is divided into 4-bit depth and 8-bit depth, which represents the bit width of the grayscale value of each color in the image data. Assuming that the bit depth of the current image is K, each K-bit image data in monochrome mode is regarded as corresponding to one pixel, and each 3×K-bit image data in color mode is regarded as corresponding to one pixel.

[0031] When image data is transmitted, it starts from the high bit. In the image data transmitted by the same serial clock, SI0 to SI3 are regarded as the high bit to the low bit of the gray value. After receiving the gray value of a pixel, it is converted into parallel image data output, and the data output of the previous pixel is maintained before the gray value of the next pixel is transmitted. If the gray value of a pixel is not transmitted at the end of the transmission enable, the remaining low bits are treated as all zero data and then converted to parallel output.

[0032] If the transmission is enabled immediately after receiving the two control words, only the timing signal is generated for this transmission, and no image data is processed.

[0033] S5, close the data transmission, complete the video signal transmission between the host and the slave, that is, turn the CS signal to a high level.

[0034] Example 1

[0035] like Figure 2 As shown, a real-time communication between a host and a slave is taken as an embodiment of the present invention, which specifically includes the following steps: A1. Use the CS signal as an enable signal, and then turn the CS signal to a low level, indicating that the transmission enable is valid. The host transmits the HSS control word, WCB control word and image data to the slave.

[0036] A2. The slave determines the decoding mode of the image data according to the HSS control word, and determines the timing signal to be generated according to the WCB control word.

[0037] The host and the slave agree in advance on the correspondence between the 8-bit data and the control word function. The high bit is input first during transmission. When the WCB control word is 0x2C, it indicates the generation of a frame synchronization signal. When the WCB control word is 0x2E, it indicates the generation of a line synchronization signal. All other cases are considered invalid control words. The HSS[0] bit indicates the color mode. A low level corresponds to a monochrome mode and a high level corresponds to a color mode. HSS[3:2] indicates the transmission protocol. 2'b01 / 10 / 11 correspond to single-wire, dual-wire and quad-wire transmission protocols respectively. HSS[5:4] indicates the bit depth. 2'b01 / 10 correspond to 4-bit and 8-bit bit depths respectively. The remaining bits should be set to 0.

[0038] In this embodiment, the transmitted HSS control word is 0x1B, which is equivalent to 8'b0001_1101, that is, the HSS control word determines that the color mode in the current decoding mode is the color mode, follows the transmission protocol of four-wire transmission, and the bit depth is 4bit, and the transmitted WCB control word is 0x2E, which determines that the timing signal type to be generated for this transmission is the line synchronization signal.

[0039] A3. The slave generates a corresponding timing signal according to the timing signal type determined by the WCB control word.

[0040] like Figure 2 As shown in , after receiving the two control words in the first 16 clock cycles, a row synchronization signal is generated in the 17th clock cycle according to the type of the WCB control word and maintained for one clock cycle, indicating that the next image data is mapped to the first pixel of a new row.

[0041] A4, the slave performs row-serial-to-parallel conversion on the image data according to the decoding mode of the image data and the timing signal, outputs parallel image data in units of pixels, and converts it into a video signal; According to the color mode and 4-bit bit depth in the decoding mode, one pixel in this transmission contains 3×4bit=12bit grayscale value information, and because it follows the four-wire transmission protocol, the image data of every three clock cycles can be converted into the grayscale value information of one pixel. During the transmission process, the principle of high-order input is followed, and the highest bit D[0] and the lowest bit D

[11] are output in parallel, and the output of the grayscale information data D[0]~D

[11] of the previous pixel is maintained until the grayscale value information D

[12] ~D

[23] of the next pixel is input.

[0042] A5. Turn the CS signal to a high level, turn off data transmission, and complete the video signal transmission between the host and the slave.

[0043] Example 2

[0044] like Figure 3 As shown, two consecutive real-time communications between the host and the slave are used as another embodiment of the present invention, which specifically includes the following steps: B1. Use the CS signal as an enable signal, and then turn the CS signal to a low level, indicating that the transmission enable is valid. The host transmits the HSS control word, WCB control word and image data to the slave.

[0045] B2. The slave determines the decoding mode of the image data according to the HSS control word, and determines the timing signal to be generated according to the WCB control word.

[0046] In this embodiment, the host and the slave agree in advance that the correspondence between the 8-bit data and the control word function is the same as the first embodiment. The transmitted HSS control word is 0x28, which is equivalent to 8'b0010_1000, and the color mode in the current decoding mode is determined to be monochrome mode, following the transmission protocol of two-wire transmission, and the bit depth is 8bit; the transmitted WCB control word is 0x2C, and it is determined that the timing signal type to be generated for this transmission is a frame synchronization signal.

[0047] B3. The slave generates a corresponding timing signal according to the timing signal type determined by the WCB control word.

[0048] like Figure 3 As shown in , after receiving the two control words in the first 16 clock cycles, a frame synchronization signal is generated in the 17th clock cycle according to the type of the WCB control word and maintained for one clock cycle, indicating that the next image data is mapped to the first pixel of a new frame.

[0049] B4. The slave performs row-to-serial-to-parallel conversion on the image data according to the decoding mode of the image data and the timing signal, outputs parallel image data in units of pixels, and converts it into a video signal.

[0050] According to the monochrome mode and 8-bit bit depth in the decoding mode, one pixel in this transmission contains 1×8bit=8bit grayscale value information, and because it follows the two-wire transmission protocol, the image data of every four clock cycles can be converted into the grayscale value information of one pixel. During the transmission process, the principle of high-order input is followed, and the highest bit of D[0] and the lowest bit of D[7] are output in parallel, and the data output of the previous pixel is kept until the grayscale value information of the next pixel is input.

[0051] B5. After the first image data transmission between the host and the slave is completed, the CS signal is turned to a low level to make the enable effective, and the second image data transmission between the host and the slave is carried out. The host again transmits the HSS control word and the WCB control word to the slave.

[0052] B6. Determine the decoding mode of the image data during the second image data transmission according to the HSS control word, and determine the type of timing signal that needs to be generated for the second image data transmission according to the WCB control word.

[0053] During the second image data transmission, the transmitted HSS control word is 0x2C, which is equivalent to 8'b0010_1100, and the color mode in the decoding mode is updated to monochrome mode, following the transmission protocol of four-wire transmission, and the bit depth is 8 bits; the transmitted WCB control word is an invalid control word, indicating that the next image data follows the content of the previous transmission, so no timing signal is generated.

[0054] B7. The slave performs row-serial-to-parallel conversion on the image data according to the decoding mode of the image data, outputs parallel image data in units of pixels, and converts it into a video signal.

[0055] After the HSS control word updates the decoding mode during the second data transmission, the color mode and bit depth are the same as the first image data transmission. In this transmission, one pixel contains 1×8bit=8bit grayscale value information, and the transmission protocol changes from the first two-wire transmission to four-wire transmission. Therefore, the image data of each input of two clock cycles can be converted into the grayscale value information of one pixel. During the transmission process, the principle of high-bit input first is followed, and parallel data D[12:19] and D[20:27] are output successively. When the second transmission is enabled, only the high 4-bit grayscale value D

[28] ~D

[31] of one pixel is received, so the remaining low bits are processed as all-zero data, and finally the parallel data {D[28:31], 4'b0} is output.

[0056] B8. Turn the CS signal to a high level, turn off data transmission, and complete the video signal transmission between the host and the slave.

[0057] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned methods for transmitting video signals based on SPI communication is implemented. The memory may be various types of memory, such as a random access memory, a read-only memory, a flash memory, etc. The processor may be various types of processors, such as a central processing unit, a microprocessor, a digital signal processor, or an image processor, etc.

[0058] The present invention also provides a storage medium storing computer executable instructions, the computer executable instructions are used to execute any of the above-mentioned video signal transmission methods based on SPI communication. The storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and other media that can store program codes.

[0059] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A real-time video signal transmission method based on SPI communication, characterized in that: The specific steps include: S1. The host sends a transmission enable signal based on SPI communication to start data transmission, and sends two control words and image data to the slave. The two control words are HSS control word and WCB control word. The HSS control word is used to determine the decoding mode of the image data, and the WCB control word is used to determine the type of generated timing signal; S2. The slave determines the decoding mode of the image data and the type of the generated timing signal according to the HSS control word and the WCB control word; S3, the slave generates a corresponding timing signal according to the type of the timing signal generated determined in step S2; S4, the slave performs row-to-serial-to-parallel conversion on the image data according to the decoding mode of the image data and the timing signal, outputs parallel image data in units of pixels, and converts it into a video signal; S5, close the data transmission, and complete the video signal transmission between the host and the slave.

2. A real-time video signal transmission method based on SPI communication according to claim 1, characterized in that, The decoding mode consists of three parts: color mode, transmission protocol and bit depth.

3. A real-time video signal transmission method based on SPI communication according to claim 2, characterized in that, The color mode includes monochrome mode and color mode. In monochrome mode, the image data contains grayscale information of a single color, and each grayscale value is mapped to one pixel. In color mode, the image data contains grayscale information of three colors, and every three grayscale values ​​are mapped to one pixel.

4. A real-time video signal transmission method based on SPI communication according to claim 2, characterized in that, The transmission protocols include single-line transmission, dual-line transmission and quad-line transmission. Single-line, dual-line and quad-line represent the number of data lines used by the host to transmit image data.

5. A real-time video signal transmission method based on SPI communication according to claim 2, characterized in that, The bit depth includes 4-bit depth and 8-bit depth, which indicates the bit width of the grayscale value of each color in the image data.

6. A real-time video signal transmission method based on SPI communication according to claim 1, characterized in that, The WCB control word includes a valid WCB control word and an invalid WCB control word. The valid WCB control word generates two timing signals, namely, a line synchronization signal and a frame synchronization signal. Line synchronization signal, indicating that the next image data is the first data of the next line; Frame synchronization signal, indicating that the next image data is the first data of the next frame; An invalid WCB control word does not generate any timing signal, indicating that the next image data follows the content of the previous transmission.

7. A real-time video signal transmission method based on SPI communication according to claim 4, characterized in that: HSS control word and WCB control word are transmitted via single line.

8. An electronic device, characterized in that: It comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a real-time video signal transmission method based on SPI communication as described in any one of claims 1 to 7 is implemented.

9. A storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute a real-time video signal transmission method based on SPI communication as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Communication method based on SPI bus

    CN113626365A

  • Method for expanding chip selection number and enhancing read-write response time flexibility of SPI (Serial Peripheral Interface)

    CN113722261A

  • Remote image acquisition device

    CN114554155A

  • 8B / 10B coding and decoding IP core based on FPGA

    CN116955262A

  • Video signal transmission method and device based on SPI communication and storage medium

    CN117676064A