CN117676064A - Video signal transmission method, equipment and storage medium based on SPI communication - Google Patents

Video signal transmission method, equipment and storage medium based on SPI communication Download PDF

Info

Publication number
CN117676064A
CN117676064A CN202410144019.7A CN202410144019A CN117676064A CN 117676064 A CN117676064 A CN 117676064A CN 202410144019 A CN202410144019 A CN 202410144019A CN 117676064 A CN117676064 A CN 117676064A
Authority
CN
China
Prior art keywords
image data
data
video signal
spi communication
transmission method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410144019.7A
Other languages
Chinese (zh)
Inventor
裘天慧
徐亭亭
秦昌兵
张白雪
杨建兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Guozhao Photoelectric Technology Co ltd
Original Assignee
Nanjing Guozhao Photoelectric Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Guozhao Photoelectric Technology Co ltd filed Critical Nanjing Guozhao Photoelectric Technology Co ltd
Priority to CN202410144019.7A priority Critical patent/CN117676064A/en
Publication of CN117676064A publication Critical patent/CN117676064A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a video signal transmission method, equipment and a storage medium based on SPI communication, wherein the transmission method comprises the following steps: the host computer opens data transmission enabling based on SPI communication transmitting enabling signals, and transmits two control words and image data to the slave computer; the slave determines a decoding mode of the image data and a position of the image data written into the data buffer area according to the two control words; the slave machine writes the image data into the data cache area according to the determined decoding mode of the image data and the position of the image data written into the data cache area; the slave generates a time sequence signal to convert the image data in the data buffer area into a video signal, the host computer and the slave computer of the invention use SPI communication protocol as a synchronous data bus, the interconnection mode and the protocol rule are simple, and the two control words respectively control the decoding mode of the image data and the writing position in the data buffer area, so that the video signal transmission picture is stable.

Description

Video signal transmission method, equipment and storage medium based on SPI communication
Technical Field
The invention relates to the technical field of video signal transmission, in particular to a video signal transmission method, equipment and a storage medium based on SPI communication.
Background
At present, several mainstream video signal transmission interfaces exist, including HDMI, LVDS, MIPI, wherein most of the interfaces have complete and complex protocol rules to ensure lossless transmission of large-bandwidth video signals, but the encoding and decoding processes are complex, the area and the power consumption are large, the requirements on hardware are high, and the video signal transmission interfaces are not suitable for small portable equipment which only needs to transmit small-resolution video pictures.
The SPI (Serial Peripheral Interface ) can realize flexible data transmission by very simple hardware and software configuration without depending on complex protocol contents and circuit structures, while maintaining a high data transmission rate, which has a disadvantage in that a problem that a host cannot transmit data after disconnection from a slave is generated due to no response signal.
In order to increase the stability of data transmission and meet the transmission requirement of small-resolution pictures, a transmission mode with low power consumption, simple protocol rule and stable pictures is needed.
Disclosure of Invention
The technical purpose is that: aiming at the defects of the prior art, the invention discloses a video signal transmission method, equipment and a storage medium based on SPI communication, which can be used as an intermediate transmission medium between a host and a slave through a data buffer area, and even if the host can not send the latest image data, the slave can still display the image stored in the current frame buffer, thereby realizing the technical scheme of video signal transmission with simple interconnection mode, simple protocol rule and stable transmission picture.
The technical scheme is as follows: in order to achieve the technical purpose, the invention adopts the following technical scheme:
a video signal transmission method based on SPI communication specifically comprises the following steps:
s1, a host computer sends a transmission enabling signal to open data transmission enabling based on SPI communication, and sends two control words and image data to a slave computer;
s2, the slave determines a decoding mode of the image data and a position of the image data written into the data cache area according to the two control words;
s3, the slave machine writes the image data into the data cache area according to the decoding mode of the image data and the position of the image data written into the data cache area, which are determined in the step S2;
s4, the slave generates a time sequence signal and converts the image data in the data buffer area into a video signal.
Preferably, the two control words include a Horizontal Sub-pixel Sequence (HSS) and a control word and word frequency statistics and cardinality (Word Count and Base, WCB) control word, the HSS control word being used to determine a decoding mode of the image data so as to correspond to a pixel arrangement mode of the current display screen; the WCB control word is used to determine where image data is written into the data buffer area.
Preferably, the decoding mode includes a monochrome mode in which the image data contains gray information of a single color, each gray value being mapped to one pixel, and a color mode in which the image data contains gray information of three colors, each three gray values being mapped to one pixel.
Preferably, the WCB control word has two processing modes for determining the position of writing the image data into the data buffer area, including designating the row-column address of the pixel corresponding to the next image data, and continuously buffering the image data from the row-column address, or designating the buffer address of the next image data relative to the last image data, and writing from the last line or the next line of the last image data buffer address or writing from the position of ending the last image data buffer.
Preferably, the timing signal includes a line synchronization signal or a frame synchronization signal which can be periodically generated according to a resolution, and image data, the line synchronization signal is generated every time image data in the data buffer area is output, and the frame synchronization signal is generated every time image data in the data buffer area is output, according to a display resolution and a decoding mode.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the video signal transmission method based on SPI communication is realized when the processor executes the program.
The invention also provides a computer readable storage medium storing computer executable instructions for performing a video signal transmission method based on SPI communication as described in any one of the above.
The beneficial effects are that: the invention has the following beneficial effects:
the invention uses SPI communication protocol as a synchronous data bus between the host and the slave, and uses two control words to control the transmission of image data between the host and the slave, the interconnection mode and protocol rule are simple, and the two control words respectively control the decoding mode of the image data and the writing position in the data buffer area, so that the video signal transmission picture is stable.
The two control words of the invention only pass through one SI 0 Line transmission, while data is passed through SI 0 ~SI 3 4 data lines in total are transmitted so as to be distinguishable from image data; when the 1 st to 8 th SCLK transmits HSS control word after transmission enabling, the 9 th to 16 th SCLK transmits WCB control word, the control word function after inputting specific 8 bit image data is preset before image data transmission begins, then image data transmission begins, if the control word corresponding to the preset form is not received in the corresponding time, the transmission mode still follows the last valid control word, the two control words are valid in the signal transmission enabling period, the last control word fails after the next same type control word is input, the transmission method of image data follows the latest control word indication, the storage medium can keep storing data in the power-on period, and the signal transmission is carried outAfter the interrupt is enabled, only the transmitted data is affected, the cached image data cannot be lost, whether the image data is continuously transmitted from the interrupt or not can be selected according to the next WCB control word, the image data transmission can be more stable, and transmission errors in transmission are reduced.
The decoding mode comprises a monochromatic mode and a color mode, the time sequence signal comprises a line synchronous signal or a frame synchronous signal which can be periodically generated according to resolution and image data, and when the image data is transmitted, a proper data transmission enabling mode, a decoding mode and the time sequence signal can be selected according to the type of the image data, so that the decoding process is simple, the power consumption is low, and the image data transmission is more accurate and stable.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a block diagram showing steps of a video signal transmission method based on SPI communication;
FIG. 2 is a block diagram showing steps of a video signal transmission method based on SPI communication in a frame buffer mode according to the present invention;
fig. 3 is a schematic diagram of a data buffer area in a frame buffer mode according to the present invention.
Detailed Description
The present invention will now be described more fully hereinafter with reference to the accompanying drawings, in which preferred embodiments of the invention are shown, but in which the invention is not so limited.
As shown in fig. 1-3, a video signal transmission method based on SPI communication specifically includes the following steps:
s1, the host computer sends a transmission enabling signal to open data transmission enabling based on SPI communication, and sends two control words and image data to the slave computer.
The SPI communication protocol is used as a synchronous data bus, and four logic lines of a SO line input by a host machine and an SO line output by a slave machine, a SI line input by the host machine and an SCLK (Serial Clock) and a chip selection signal sent to the slave machine by the host machine are connected and communicated.
In one embodiment, the video signal source acts as a master, the display driver circuit acts as a slave, the chip select signal acts as a transmit enable signal, and the control words and image data are transmitted from the master for a transmit enable active period.
S2, the slave determines a decoding mode of the image data and a position of the image data written in the data buffer area according to the two control words.
And S3, the slave machine writes the image data into the data cache area according to the decoding mode of the image data and the position of the image data written into the data cache area, which are determined in the step S3.
The two control words comprise an HSS control word and a WCB control word, wherein the HSS control word is used for determining the decoding mode of the image data, the WCB control word is used for determining the position of the image data written into the data buffer area, and the two control words only pass through one SI 0 Line transmission, while image data is transmitted through SI 0 ~SI 3 4 data lines are used for transmission, so that two control words can be distinguished from common image data; when the 1 st to 8 th SCLK transmits HSS control words and the 9 th to 16 th SCLK transmits WCB control words after the transmission enable is valid, the functions of two control words after the specific 8-bit image data input should be preset before the image data transmission is enabled, then the image data transmission is started, if the control word corresponding to the preset form is not received in the corresponding time, the transmission mode still follows the last valid control word, the two control words are valid during the signal transmission enable period, the last control word fails after the next similar control word is input, and the transmission method of the image data follows the latest control word indication.
When the resolution is M 'rows by N' columns, the data buffer area can store image data with arbitrary size of M rows by N columns, wherein M is more than or equal to 1 and less than or equal to M ', N is more than or equal to 1 and less than or equal to N', M, N, M ', and N' are integers.
The data buffer area is used as an intermediate transmission medium between the host and the slave, and the storage medium can keep storing data, such as SRAM (Static Random-Access Memory) and the like, during the power-on period, only the transmitted data is affected after the signal transmission is enabled to be interrupted, the cached image data cannot be lost, even if the host cannot send the latest image data, the slave can still display the image stored in the current frame buffer, and the problem that the host cannot send the data after the slave is disconnected due to SPI has no response signal is solved.
The decoding mode includes a monochrome mode in which the image data contains gray information of a single color, each gray value is mapped to one pixel, and a color mode in which the image data contains gray information of three colors, each three gray values is mapped to one pixel, that is, assuming that the bit depth of the current image is K, each K-bit image data in the monochrome mode is stored in a data buffer area corresponding to one pixel, and each 3×k-bit image data in the color mode is stored in a data buffer area corresponding to one pixel.
The WCB control word has two processing modes for determining the position of writing the image data into the data buffer area, including designating the row-column address of the pixel corresponding to the next image data, continuously buffering the image data from the row-column address, or designating the buffer address of the next image data relative to the last image data, writing from the last line or the next line of the last image data buffer address or writing from the position of ending the last image data buffer.
The WCB control word may directly specify the row and column address of the pixel to which the next image data corresponds, e.g., the starting row and column address is (M) k ,N k ) Then the image data is written from the data buffer area position corresponding to the pixel; it is also possible to specify the buffer address of the next image data with respect to the last transfer, for example, the corresponding pixel row-column address of the last transferred image data is (M i ,N i ) To (M) j ,N j ) Then if input from the next line is designated, the next image data slave (M j +1, 0) pixel pairWriting is started at the position of the data buffer area, and if it is designated to start from the place where the last transfer ends, the next image data is transferred from (M j ,N j Writing is started at the position of the data buffer area corresponding to the +1) pixel, wherein N is as follows j <N-1 or the next image data slave (M j Starting writing at the position of the data buffer area corresponding to +1, 0) pixel, wherein N j = N-1。
When the image data writing address in the data caching area exceeds the resolution of the display picture, the data caching area only keeps the image data in the resolution, and the rest data cannot be stored so as to ensure the stability of transmission; the remaining data is discarded when the write address reaches (M-1, n-1) in the frame buffer mode.
S4, generating a time sequence signal, and converting the image data in the data buffer area into a video signal.
The timing signal includes a line synchronization signal or a frame synchronization signal and image data that can be periodically generated according to a resolution, and generates a line synchronization signal every time image data in the data buffer area is output, and generates a frame synchronization signal every time image data in the data buffer area is output, according to a display resolution and a decoding mode.
In the effective period of transmission enabling, the video signal transmission method provided by the invention can periodically output the image data in the buffer memory and generate a time sequence signal: outputting the image data in the current data buffer area according to the decoding mode according to the sequence of the preceding columns and the following columns from the pixel with the row-column address of (0, 0), generating a row synchronizing signal once every time a row is output, and outputting a frame synchronizing signal once every time a frame is output; and if the partial address is not written with the image data in advance, processing according to the all-zero data.
As shown in fig. 2, another embodiment of a video signal transmission method based on SPI communication according to the present invention is illustrated by taking a transmission mode as a frame buffer mode, and the transmission method includes the steps of:
a1, transmission enabling is effective.
A2, determining a decoding mode of the image data according to the HSS control word.
The transmitted HSS control word determines that the current decoding mode is a monochrome mode, and the amount of image data that can be buffered is the amount of data required for pixels of one frame or less in the monochrome mode.
A3, determining the writing address of the image data in the data buffer area according to the WCB control word.
As shown in fig. 3, the size of the data buffer area in the frame buffer mode is M 'rows×n' columns, and the specific position is represented by the pixel row-column address corresponding to the image data. The corresponding pixel of the last transmission of the designated image data to start writing is A 1 Its coordinates in the data buffer area are (M 0 ,N 0 ) Image data of 3 rows×n' ×k bits in total are sequentially written, each K-bit image data being mapped to one pixel, so that the corresponding coordinates of the last image data are (M 0 +3,N 0 -1); if the WCB control word specifies that image data is input from the next line of the previous image data transmission, then the write coordinates of the image data are pixel A as shown 3 (M 0 +4, 0); if the WCB control word designates the input from the next frame, the writing coordinate of the image data is (0, 0); if the WCB control word specifies that writing is to be started from the position where the last transfer was ended, the writing coordinates of the image data are pixel A as shown 2 (M 0 +3,N 0 ) A place; the next transmission may also specify the specific pixel coordinates again by the WCB control word.
A4, the image data is written into the data buffer area of the corresponding pixel in the preceding column and the following column.
In the image data transmission process, whether the column coordinate of the current corresponding pixel is N '-1 is judged, if not, the row synchronizing signal is output by the time sequence signal, if yes, whether the row coordinate of the current corresponding pixel is M' -1 is judged, if not, the row synchronizing signal is output by the time sequence signal, if yes, the frame synchronizing signal is output by the time sequence signal, and if the pixel coordinate exceeds (M '-1, N' -1) in a certain transmission process, the remaining written image data is discarded.
The invention provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes any video signal transmission method based on SPI communication when executing the program. The memory may be various types of memory, such as random access memory, read only memory, 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.
The invention also provides a computer readable storage medium storing computer executable instructions for executing any one of the above video signal transmission methods based on SPI communication. The storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is only a preferred embodiment of the invention, it being noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the invention.

Claims (7)

1. The video signal transmission method based on SPI communication is characterized by comprising the following steps:
s1, a host computer sends a transmission enabling signal to open data transmission enabling based on SPI communication, and sends two control words and image data to a slave computer;
s2, the slave determines a decoding mode of the image data and a position of the image data written into the data cache area according to the two control words;
s3, the slave machine writes the image data into the data cache area according to the decoding mode of the image data and the position of the image data written into the data cache area, which are determined in the step S2;
s4, the slave generates a time sequence signal and converts the image data in the data buffer area into a video signal.
2. The method of claim 1, wherein the two control words include an HSS control word and a WCB control word, the HSS control word being used to determine a decoding mode of the image data, and the WCB control word being used to determine a location where the image data is written into the data buffer.
3. A video signal transmission method based on SPI communication according to claim 2, wherein said decoding mode comprises a monochrome mode in which the image data contains gray information of a single color, each gray value being mapped to one pixel, and a color mode in which the image data contains gray information of three colors, each three gray values being mapped to one pixel.
4. A video signal transmission method based on SPI communication according to claim 2, wherein said WCB control word is processed in two ways to determine the location of the image data written into the data buffer area, including designating the row-column address of the pixel corresponding to the next image data, from which the image data is continuously buffered, or designating the buffer address of the next image data relative to the last image data, from the last line or the next line of the last image data buffer address, or from the location where the last image data buffer ends.
5. A video signal transmission method based on SPI communication according to claim 1, wherein the timing signal includes a line synchronization signal or a frame synchronization signal which can be periodically generated according to resolution, and image data, the line synchronization signal is generated once for each output of image data in the data buffer area, and the frame synchronization signal is generated once for each output of image data in the data buffer area, according to display resolution and decoding mode.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a video signal transmission method based on SPI communication according to any of claims 1-5 when the program is executed.
7. A computer-readable storage medium storing computer-executable instructions for performing a video signal transmission method based on SPI communication according to any one of claims 1-5.
CN202410144019.7A 2024-02-01 2024-02-01 Video signal transmission method, equipment and storage medium based on SPI communication Pending CN117676064A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410144019.7A CN117676064A (en) 2024-02-01 2024-02-01 Video signal transmission method, equipment and storage medium based on SPI communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410144019.7A CN117676064A (en) 2024-02-01 2024-02-01 Video signal transmission method, equipment and storage medium based on SPI communication

Publications (1)

Publication Number Publication Date
CN117676064A true CN117676064A (en) 2024-03-08

Family

ID=90075447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410144019.7A Pending CN117676064A (en) 2024-02-01 2024-02-01 Video signal transmission method, equipment and storage medium based on SPI communication

Country Status (1)

Country Link
CN (1) CN117676064A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132648A (en) * 2019-12-30 2021-07-16 西安奇维科技有限公司 High-speed real-time video transmission method based on FPGA
CN113626365A (en) * 2021-07-23 2021-11-09 石家庄科林电气股份有限公司 Communication method based on SPI bus
WO2022134560A1 (en) * 2020-12-24 2022-06-30 深圳市洲明科技股份有限公司 Data transmission and receiving methods for display screen, and sending and receiving cards of display screen
CN115858431A (en) * 2023-02-21 2023-03-28 北京国科环宇科技股份有限公司 Data transmission control method, controller and electronic equipment
CN116700943A (en) * 2022-02-28 2023-09-05 华为技术有限公司 Video playing system and method and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132648A (en) * 2019-12-30 2021-07-16 西安奇维科技有限公司 High-speed real-time video transmission method based on FPGA
WO2022134560A1 (en) * 2020-12-24 2022-06-30 深圳市洲明科技股份有限公司 Data transmission and receiving methods for display screen, and sending and receiving cards of display screen
CN113626365A (en) * 2021-07-23 2021-11-09 石家庄科林电气股份有限公司 Communication method based on SPI bus
CN116700943A (en) * 2022-02-28 2023-09-05 华为技术有限公司 Video playing system and method and electronic equipment
CN115858431A (en) * 2023-02-21 2023-03-28 北京国科环宇科技股份有限公司 Data transmission control method, controller and electronic equipment

Similar Documents

Publication Publication Date Title
JP3352600B2 (en) Display device
US6778168B2 (en) Method for displaying image, image display system, host system, image display apparatus, and interface for display
EP2857930B1 (en) Techniques to transmit commands to a target device
JP3280306B2 (en) Image information transmitting method, image information updating method, transmitting apparatus and updating apparatus
US5821910A (en) Clock generation circuit for a display controller having a fine tuneable frame rate
JPH0827705B2 (en) adapter
JPH0854865A (en) Interface of flat panel display
KR20160091175A (en) Display Controller for improving display noise, Semiconductor Integrated Circuit Device including the same and Method there-of
JP2004048372A (en) Image processor, image input/output apparatus, scaling method, and memory control method
US20080297525A1 (en) Method And Apparatus For Reducing Accesses To A Frame Buffer
CN115103208A (en) Line caching method, line reading method and processing system for video data
KR102263319B1 (en) Display Controller for improving display noise and System including the same
JP2006301724A (en) Memory controller, image processing controller and electronic equipment
CN117676064A (en) Video signal transmission method, equipment and storage medium based on SPI communication
CN115101025B (en) LCD control circuit supporting virtual frame buffering and control method thereof
TWI633789B (en) Method of reading data, method of transmitting data and mobile device thereof
US6414689B1 (en) Graphics engine FIFO interface architecture
US20060232593A1 (en) System and method for effectively utilizing a memory device in a compressed domain
CN115002304A (en) Video image resolution self-adaptive conversion device
EP0726557A1 (en) Display control method with partial rewriting and display controller and display apparartus using the same
KR20160067577A (en) An image processor, a method of operating the image processor, and an application processor including the image processor
US11605366B2 (en) LCC (low cost controllerless) graphics processing
JPH09274475A (en) A plurality of display devices capable of connecting to one computer
JP2011097279A (en) Data processing circuit, integrated circuit apparatus, and electronic equipment
JP2005122119A (en) Video interface device in system constituted of mpu and video codec

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination