Data Transmission Control Method, Device, Equipment and Medium Based on SPI Communication Protocol
By performing MCU initialization and image preformatting processing in SPI communication, the problem of low data transmission efficiency and poor reliability in TFT screen display is solved, and efficient data transmission and smooth image display are achieved.
Patent Information
- Application Number
- CN202411797938.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing SPI communication protocols have problems such as low data transmission efficiency, poor reliability and poor image display quality in TFT screen display. Especially in high refresh rate and large resolution scenarios, it is difficult to ensure the integrity and accuracy of image information.
By obtaining SPI communication parameter information, performing MCU initialization configuration, generating final configuration information of chip select signals, pre-formatting the image information according to the TFT screen communication protocol, and saving the formatted image information to SPI-FLASH, and directly transmitting it to the TFT screen to display, avoiding additional MCU processing.
It improves the data transmission rate and screen refresh rate, ensures the efficiency of data transmission and the smoothness of image display, and improves the reliability of data storage and the stability of display effects.
Smart Images

Figure CN119299600B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission control, and particularly to a data transmission control method, device, equipment and medium based on the SPI communication protocol. Background Art
[0002] With the rapid development of information technology, display technology has been widely used in various fields. Especially in embedded systems, TFT (Thin Film Transistor) screens have become the mainstream choice due to their high resolution, high contrast and fast response time. To achieve efficient data transmission and display, SPI (Serial Peripheral Interface), as a high-speed synchronous serial communication standard, is widely used in many embedded systems. The SPI communication protocol, with its simple and efficient characteristics, has become one of the important ways to connect a microcontroller (MCU) and an external storage device (such as SPI-FLASH).
[0003] In the existing technology, to achieve efficient display of TFT screens, traditional data transmission methods require the MCU to perform multiple conversions and processes on image data, which not only increases the burden on the MCU but also reduces the data transmission rate. Secondly, there is the problem of data transmission reliability. Since the data needs to be processed multiple times during transmission, it is easy to cause data loss or errors, thereby affecting the display effect. In addition, existing methods are difficult to ensure the integrity and accuracy of image information when dealing with complex image data, especially in display scenarios with high refresh rates and large resolutions, these problems are more prominent. Therefore, how to improve data transmission efficiency and display quality has become an urgent technical problem to be solved. Summary of the Invention
[0004] To improve data transmission efficiency and display quality, the present application provides a data transmission control method, device, equipment and medium based on the SPI communication protocol.
[0005] The first above-mentioned invention object of the present application is achieved by the following technical solutions:
[0006] A data transmission control method based on the SPI communication protocol, the data transmission control method based on the SPI communication protocol includes:
[0007] Obtain parameter information of SPI communication, and initialize and configure SPI communication through the MCU according to the parameter information of SPI communication to generate the final configuration information of the chip select signal;
[0008] Based on the final configuration information of the chip select signal, pre-format the image information according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol;
[0009] After completing the initialization configuration and saving the pre-formatted image information, the MCU controls the final configuration information of the chip select signal of the SPI, reads the pre-formatted image information from the SPI-FLASH, and directly transmits the pre-formatted image information to the TFT screen for display.
[0010] By adopting the above technical solution, it is possible to control the SPI communication through the MCU to ensure that when reading the image data in the SPI-FLASH, the image information has been pre-formatted according to the communication protocol of the TFT screen, so that the data can be directly transmitted to the TFT screen, avoiding additional conversion or processing of the data by the MCU. In this way, by normalizing the pixel arrangement and color format of the image information in the data preprocessing stage, the data layout in the SPI-FLASH is made to exactly match the display requirements of the TFT screen. During the data transmission process, the MCU only needs to send the data in the SPI-FLASH to the TFT screen block by block according to the protocol order, without further intervening in the data format conversion, thereby ensuring the efficiency of data transmission. Through this direct transmission method, the data transmission rate and the screen refresh rate are effectively increased, thus achieving a smoother image display effect.
[0011] In a preferred example of the present application, it can be further configured as: obtaining the parameter information of the SPI communication, and initializing the SPI communication through the MCU according to the parameter information to generate the final configuration information of the chip select signal, including:
[0012] According to the target device information in the parameter information of the SPI communication, configure the chip select control register of the MCU, specify the chip select pin of the SPI-FLASH as the communication channel, and generate the initial configuration information of the chip select signal;
[0013] Based on the initial configuration information, set the level state of the chip select signal to low level to activate the communication mode of the SPI-FLASH, and generate the final configuration information of the chip select signal.
[0014] By adopting the above technical solution, by configuring the chip select control register of the MCU, the chip select pin of the SPI-FLASH is used as an independent communication channel, which can ensure the independence of the chip select signal, avoid multi-device communication interference, and thus ensure the efficient transmission of data. By activating the SPI-FLASH communication mode after setting the chip select signal to low level and generating the final configuration information of the chip select signal, the stable control of the data transmission mode of the SPI-FLASH can be realized, effectively improving the continuity and reliability of data transmission, and further improving the stability and transmission efficiency of the SPI communication process.
[0015] In a preferred example of the present application, it can be further configured as follows: based on the final configuration information of the chip select signal, the image information is pre-formatted according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and the pre-formatted image information is stored in the SPI-FLASH in the structural order of the TFT screen communication protocol, including:
[0016] According to the communication protocol of the TFT screen, analyze the pixel arrangement and the format requirements of the image information to generate preliminary formatted information that conforms to the communication protocol of the TFT screen;
[0017] According to the preliminary formatted information, adjust and encode the pixel arrangement of the image information to obtain the pre-formatted image information, and store the pre-formatted image information in the SPI-FLASH in the structural order of the TFT screen communication protocol.
[0018] By adopting the above technical solution, it is possible to analyze the pixel arrangement and format requirements of the image information based on the communication protocol of the TFT screen, ensure that the pre-formatted image information meets the standards of TFT screen display, and thus avoid image distortion caused by format incompatibility during data transmission; by storing the pre-formatted image information in the SPI-FLASH in the structural order of the TFT screen communication protocol, it is possible to directly transmit it to the TFT screen in the display order during subsequent reading, ensuring the continuity of data transmission and the stability of the display effect, thereby improving the data transmission efficiency and the refresh rate of the screen.
[0019] In a preferred example of the present application, it can be further configured as follows: according to the preliminary formatted information, adjust and encode the pixel arrangement of the image information to obtain the pre-formatted image information, and store the pre-formatted image information in the SPI-FLASH in the structural order of the TFT screen communication protocol, including:
[0020] Rearrange the pixel information of the image information according to the pixel arrangement requirements in the preliminary formatting information to generate adjusted pixel arrangement information, and perform encoding processing on the adjusted pixel arrangement information to generate the formatted image information that matches the communication protocol of the TFT screen;
[0021] Write the formatted image information into the specified storage area of the SPI-FLASH block by block in the structural order of the TFT screen communication protocol, and record the storage location information of each block of formatted image information;
[0022] Check the writing status of each block of formatted image information according to the storage location information to confirm that the formatted image information is saved in the SPI-FLASH.
[0023] By adopting the above technical solutions, it is possible to adjust and encode the pixel arrangement of the image information according to the preliminary formatting information, so that the generated formatted image information matches the communication protocol of the TFT screen, thereby ensuring the consistency of the data format transmitted to the TFT screen and realizing efficient data docking; by writing the formatted image information into the specified storage area of the SPI-FLASH block by block and recording the storage location information of each block, it is possible to accurately locate the position of each data block during subsequent reading and avoid information confusion; at the same time, by checking the writing status of each block of image information, it is ensured that the image information is completely saved in the SPI-FLASH, thereby improving the reliability of data storage and the stability of subsequent display effects.
[0024] In a preferred example of the present application, it can be further configured that: the checking the writing status of each block of formatted image information according to the storage location information to confirm that the formatted image information is saved in the SPI-FLASH includes:
[0025] Read the content of each block of formatted image information one by one according to the storage location information to generate verification information;
[0026] Compare the verification information with the preset information in the storage location information to identify the writing integrity of each block of formatted image information and obtain a comparison result;
[0027] Based on the comparison result, confirm the writing status of each block of formatted image information to ensure that the formatted image information has been completely saved in the SPI-FLASH.
[0028] By adopting the above technical solution, it is possible to read the content of each block of formatted image information one by one and generate verification information, so as to check each block of the stored image information content to ensure that no data is missed or tampered with during the reading process; by comparing the verification information with the preset information in the storage location information, it helps to identify the writing integrity of each block of image information and effectively exclude the situation of data corruption or incompleteness; based on the comparison result, the writing state of each block of image information is confirmed, so as to ensure that the image information has been completely saved to the SPI-FLASH, improving the reliability of data storage and providing guarantee for subsequent stable and efficient image display.
[0029] In a preferred example of the present application, it can be further configured as follows: after the initialization configuration and the saving of the formatted image information are completed, the MCU controls the final configuration information of the chip select signal of the SPI, reads the formatted image information from the SPI-FLASH, and directly transmits the formatted image information to the TFT screen for display, including:
[0030] By controlling the low level state of the final configuration information of the chip select signal, the SPI-FLASH is enabled to enter the read mode, a communication channel between the SPI-FLASH and the MCU is established, and read channel information is obtained;
[0031] According to the read channel information, the formatted image information is read block by block from the SPI-FLASH in the structural order of the TFT screen communication protocol to generate the read image information;
[0032] The read image information is transmitted to the TFT screen to achieve direct display of the read image information.
[0033] By adopting the above technical solution, it is possible to make the SPI-FLASH enter the read mode through the low level state of the chip select signal and establish a stable communication channel with the MCU, thus ensuring the connection reliability during the data transmission process; by obtaining and using the read channel information, the formatted image information can be read block by block from the SPI-FLASH in the structural order of the TFT screen communication protocol, ensuring that the image data is read in the order required for display and avoiding data disorder or repeated transmission; finally, the read image information is directly transmitted to the TFT screen to achieve smooth and delay-free image display.
[0034] In a preferred example of the present application, it can be further configured as follows: the transmission of the read image information to the TFT screen to achieve direct display of the read image information further includes:
[0035] During the transmission process of the read image information, the transmission rate of the read image information is detected in real time according to the current display state of the TFT screen, and transmission status information is generated;
[0036] Through the transmission status information, the refresh rate of the TFT screen is adjusted in real time to ensure smooth display of the read image information. Through the transmission status information, the brightness of the TFT screen is dynamically adjusted to adapt to the current ambient light conditions and optimize the display of the read image information.
[0037] By adopting the above technical solution, the transmission rate of image information can be detected in real time according to the current display state of the TFT screen, thereby generating transmission status information to reflect the dynamic changes during the transmission process. By adjusting the refresh rate of the TFT screen in real time through the transmission status information, smooth display of image information can be ensured, avoiding screen freezing or delay phenomena. At the same time, by dynamically adjusting the screen brightness through the transmission status information, the display brightness of the TFT screen can adapt to the current ambient light conditions, further optimizing the image display effect, and thus improving the user's viewing experience and visual comfort.
[0038] The second above-mentioned invention object of the present application is achieved through the following technical solutions:
[0039] A data transmission control device based on the SPI communication protocol, the data transmission control device based on the SPI communication protocol includes:
[0040] An SPI initialization configuration module, configured to obtain parameter information of SPI communication, and initialize the SPI communication through the MCU according to the parameter information of the SPI communication to generate final configuration information of the chip select signal;
[0041] An image information formatting and saving module, configured to pre-format the image information according to the communication protocol of the TFT screen based on the final configuration information of the chip select signal to obtain formatted image information, and save the formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol;
[0042] An image information reading and displaying module, configured to, after completing the initialization configuration and saving of the formatted image information, control the final configuration information of the chip select signal of the SPI by the MCU, read the formatted image information from the SPI-FLASH, and directly transmit the formatted image information to the TFT screen for display.
[0043] By adopting the above technical solution, it is possible to control SPI communication through the MCU, ensuring that when reading image data from the SPI-FLASH, the image information has been pre-formatted according to the communication protocol of the TFT screen, enabling the data to be directly transmitted to the TFT screen, avoiding additional conversion or processing of the data by the MCU. In this way, by normalizing the pixel arrangement and color format of the image information in the data preprocessing stage, the data layout in the SPI-FLASH is made to exactly match the display requirements of the TFT screen. During the data transmission process, the MCU only needs to send the data in the SPI-FLASH to the TFT screen block by block according to the protocol sequence, without further intervening in the data format conversion, thus ensuring the efficiency of data transmission. Through this direct transmission method, the data transmission rate and the screen refresh rate are effectively improved, thereby achieving a smoother image display effect.
[0044] The above-mentioned third object of the present application is achieved by the following technical solution:
[0045] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above data transmission control method based on the SPI communication protocol are implemented.
[0046] The above-mentioned fourth object of the present application is achieved by the following technical solution:
[0047] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the above data transmission control method based on the SPI communication protocol are implemented.
[0048] In summary, the present application includes at least one of the following beneficial technical effects:
[0049] 1. It is possible to control SPI communication through the MCU, ensuring that when reading image data from the SPI-FLASH, the image information has been pre-formatted according to the communication protocol of the TFT screen, enabling the data to be directly transmitted to the TFT screen, avoiding additional conversion or processing of the data by the MCU. In this way, by normalizing the pixel arrangement and color format of the image information in the data preprocessing stage, the data layout in the SPI-FLASH is made to exactly match the display requirements of the TFT screen. During the data transmission process, the MCU only needs to send the data in the SPI-FLASH to the TFT screen block by block according to the protocol sequence, without further intervening in the data format conversion, thus ensuring the efficiency of data transmission. Through this direct transmission method, the data transmission rate and the screen refresh rate are effectively improved, thereby achieving a smoother image display effect;
[0050] 2. It can make the SPI-FLASH enter the read mode through the low-level state of the chip select signal, and establish a stable communication channel with the MCU, thus ensuring the connection reliability during data transmission. By obtaining and utilizing the read channel information, the formatted image information can be read block by block from the SPI-FLASH according to the structure sequence of the TFT screen communication protocol, ensuring that the image data is read in the order required for display and avoiding data disorder or repeated transmission. Finally, the read image information is directly transmitted to the TFT screen to achieve smooth and delay-free image display.
[0051] 3. It can adjust and encode the pixel arrangement of the image information according to the preliminary formatting information, making the generated formatted image information match the TFT screen communication protocol, thus ensuring the consistency of the data format transmitted to the TFT screen and achieving efficient data docking. By writing the formatted image information block by block into the specified storage area of the SPI-FLASH and recording the storage location information of each block, the position of each data block can be accurately located during subsequent reading, avoiding information confusion. At the same time, by verifying the writing status of each block of image information, it is ensured that the image information is completely saved in the SPI-FLASH, thereby improving the reliability of data storage and the stability of subsequent display effects. Description of the Drawings
[0052] Figure 1 is a flowchart of a data transmission control method based on the SPI communication protocol in an embodiment of the present application;
[0053] Figure 2 is a flowchart of the implementation in step S10 of the data transmission control method based on the SPI communication protocol in an embodiment of the present application;
[0054] Figure 3 is a flowchart of the implementation in step S20 of the data transmission control method based on the SPI communication protocol in an embodiment of the present application;
[0055] Figure 4 is a flowchart of the implementation in step S201 of the data transmission control method based on the SPI communication protocol in an embodiment of the present application;
[0056] Figure 5 is a flowchart of the implementation in step S2013 of the data transmission control method based on the SPI communication protocol in an embodiment of the present application;
[0057] Figure 6 is a flowchart of the implementation in step S30 of the data transmission control method based on the SPI communication protocol in an embodiment of the present application;
[0058] Figure 7It is a flowchart of the implementation after step S302 in the data transmission control method based on the SPI communication protocol in an embodiment of the present application;
[0059] Figure 8 It is a principle block diagram of a data transmission control device based on the SPI communication protocol in an embodiment of the present application;
[0060] Figure 9 It is a schematic diagram of the device in an embodiment of the present application. Detailed implementation manners
[0061] The present application will be further described in detail below with reference to the accompanying drawings.
[0062] In an embodiment, as Figure 1 shown, the present application discloses a data transmission control method based on the SPI communication protocol, which specifically includes the following steps:
[0063] S10: Obtain the parameter information of the SPI communication, and initialize and configure the SPI communication through the MCU according to the parameter information of the SPI communication to generate the final configuration information of the chip select signal.
[0064] Specifically, when obtaining the parameter information of the SPI communication, according to the model of the SPI communication target device and the communication protocol parameters, first obtain the parameter information including the clock frequency, data transmission mode, and chip select control method, etc. By loading these parameter information into the chip select control register, clock control register, and mode selection register of the MCU, it is ensured that a reliable communication connection can be established between the MCU and the SPI-FLASH and remain stable during the communication process. Then, set the chip select signal to the low level state to make the SPI-FLASH enter the communication mode. By verifying the response of each parameter item by item, including detecting whether the response of the chip select signal meets the expectation, whether the clock frequency is within the communication range, and whether the data transmission mode is compatible with the TFT screen, to ensure the completion of the configuration of the chip select signal and the SPI communication, and finally form the effective state of the chip select signal, thereby generating the final configuration information of the chip select signal.
[0065] S20: Based on the final configuration information of the chip select signal, pre-format the image information according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol.
[0066] Specifically, when pre-formatting the image information according to the communication protocol of the TFT screen based on the final configuration information of the chip select signal, according to the requirements of the TFT screen communication protocol, first perform preprocessing on the pixel arrangement and color coding of the image information, arrange the pixels of the image information in the row and column order required by the screen, and convert the pixel information into a specified format such as RGB565 or RGB888 required for screen display; after completing the conversion of pixel arrangement and color format, re-arrange the formatted image information according to the data transmission order of the TFT screen communication protocol, and save the information in segments by means of data chunking. The size of each segment of information is adjusted according to the reading ability of the SPI-FLASH and the refresh rate of the TFT screen, so that the data chunks conform to the refresh rhythm of the screen when being read, and all data chunks are stored in the continuous storage area of the SPI-FLASH in the structural order to ensure the consistency of the format and the integrity of the transmission of the data during subsequent reading.
[0067] S30: After completing the initialization configuration and saving the formatted image information, the MCU controls the final configuration information of the chip select signal of the SPI, reads the formatted image information from the SPI-FLASH, and directly transmits the formatted image information to the TFT screen for display.
[0068] Specifically, after completing the initialization configuration and saving the formatted image information, when the MCU controls the final configuration information of the chip select signal of the SPI, reads the formatted image information from the SPI-FLASH and directly transmits it to the TFT screen for display, maintain the communication channel with the SPI-FLASH by keeping the chip select signal at a low level state, so that the SPI-FLASH enters the information reading mode. The MCU reads the image information blocks block by block according to the requirements of the TFT screen communication protocol, and ensures that the reading order of the information blocks is consistent with the screen display requirements. After reading an information block, directly transmit the information block to the TFT screen through the SPI interface. After receiving each information block, the TFT screen displays it row by row and column by column in the specified area to achieve the effect of continuous display, ensuring the integrity and smoothness of the display content. When the information blocks are transmitted block by block and completed, write the last information block of the image information into the display area of the TFT screen, and the entire transmission and display process is completed.
[0069] In one embodiment, as Figure 2 shown, in step S10, that is, obtain the parameter information of the SPI communication, and initialize and configure the SPI communication through the MCU according to the parameter information to generate the final configuration information of the chip select signal, including:
[0070] S101: Configure the chip select control register of the MCU according to the target device information in the SPI communication parameter information, specify the chip select pin of the SPI-FLASH as the communication channel, and generate the initial configuration information of the chip select signal.
[0071] Specifically, according to the target device information in the SPI communication parameter information, through the configuration operation of the chip select control register by the MCU, first load the required target device information into the internal register of the MCU, including the address information, communication channel number, and register position information of the SPI-FLASH. Set the chip select pin of the SPI-FLASH as the only communication channel with the MCU to ensure that the chip select signal is only sent to the specified device during communication. Set this pin as a dedicated chip select port and perform relevant settings. Confirm the establishment of the chip select channel by reading and writing each bit in the register, including whether the signal reception stability and channel exclusivity meet the requirements. Once the verification is successful, generate the initial configuration information of the chip select signal to ensure that the dedicated channel configuration for subsequent communication is in place.
[0072] S102: Based on the initial configuration information, set the level state of the chip select signal to low level to activate the communication mode of the SPI-FLASH and generate the final configuration information of the chip select signal.
[0073] Specifically, based on the initial configuration information, set the level state of the chip select signal to low level to activate the communication mode of the SPI-FLASH. First, the MCU controls the chip select pin to pull down the level state of the chip select signal from the default high level, so that the SPI-FLASH enters the active state. The low level state of the chip select signal is continuously maintained, indicating that the SPI-FLASH is the only device in the communication mode. During the activation process, the feedback signal of the chip select pin is monitored in real time to confirm the stability of the low level state and avoid fluctuations in the level state caused by external interference, ensuring that the SPI-FLASH is always in the selected state during communication, and generating and locking the final configuration information of the chip select signal.
[0074] In an embodiment, as Figure 3 shown, in step S20, that is, based on the final configuration information of the chip select signal, pre-format the image information according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol, including:
[0075] S201: According to the communication protocol of the TFT screen, analyze the pixel arrangement and format requirements of the image information, and generate the preliminary formatted information that conforms to the communication protocol of the TFT screen.
[0076] Specifically, when parsing the pixel arrangement and format requirements of image information according to the communication protocol of the TFT screen, first read the protocol standard of the TFT screen, extract key information such as pixel arrangement, color depth, and transmission order, map this information to the storage structure of the image data, and determine the priority of the image pixel arrangement according to the pixel arrangement method in the protocol standard, such as the requirements of horizontal scanning or vertical scanning. At the same time, extract the color coding requirements, such as RGB565 or RGB888 format, perform appropriate bit-depth conversion on the image information according to the format requirements, and combine the extracted arrangement rules and format standards to form a set of preliminary formatting information applicable to TFT screen display to ensure that the image information processed in subsequent steps can match the display requirements of the screen.
[0077] S202: According to the preliminary formatting information, adjust and encode the pixel arrangement of the image information to obtain the formatted image information, and save the formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol.
[0078] Specifically, when adjusting and encoding the pixel arrangement of the image information according to the generated preliminary formatting information, first perform row-column transformation on the image data to adjust the pixel arrangement method to the horizontal or vertical scanning order required by the TFT screen, and gradually rearrange the pixel data by traversing each row or column of the image. Immediately afterwards, perform color depth encoding to encode the pixel information into a color format that matches the TFT screen format, such as compressing 24-bit RGB data into 16-bit RGB565 format or keeping it as RGB888 format. After completing the color encoding, organize and store all the formatted image data into the SPI-FLASH block by block according to the transmission order of the TFT screen communication protocol, ensuring that the arrangement order of the data blocks is consistent with the TFT screen display order, so that no additional conversion is required during subsequent reading, achieving a fast and direct screen display effect.
[0079] In one embodiment, as Figure 4 shown, in step S202, that is, according to the preliminary formatting information, adjust and encode the pixel arrangement of the image information to obtain the formatted image information, and save the formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol, including:
[0080] S2021: According to the pixel arrangement requirements in the preliminary formatting information, rearrange the pixel information of the image information to generate the adjusted pixel arrangement information, and perform encoding processing on the adjusted pixel arrangement information to generate the formatted image information that matches the TFT screen communication protocol.
[0081] Specifically, when rearranging the pixel information of the image information according to the pixel arrangement requirements in the preliminary formatting information, first analyze the preliminary formatting information to determine the arrangement order of the pixels, such as whether it is necessary to arrange from left to right, from top to bottom, or in other specific directions. Then, reorganize the pixel information row by row or column by column according to the determined order to make it consistent with the display order of the TFT screen. At the same time, normalize the color depth and color format in the pixel information; after completing the arrangement adjustment, perform encoding processing on the adjusted pixel arrangement information to convert the original color format into a format that meets the requirements of the TFT screen communication protocol. For example, convert 24-bit RGB information into 16-bit RGB565 encoding, or encode according to other formats required by the TFT screen to ensure that the pixel arrangement and color encoding are compatible with the TFT screen protocol, and finally generate formatted image information to ensure the accuracy and integrity of the information during subsequent SPI communication transmission and display processes.
[0082] S2022: Write the formatted image information into the specified storage area of the SPI-FLASH block by block according to the structure order of the TFT screen communication protocol, and record the storage location information of each block of formatted image information.
[0083] Specifically, when writing the formatted image information into the specified storage area of the SPI-FLASH block by block according to the structure order of the TFT screen communication protocol, first divide the formatted image information into several information blocks of the same size according to the protocol requirements, and determine the storage order and location information of each block of information; in the writing operation, write each block of information into the specified storage address of the SPI-FLASH in sequence through the SPI communication protocol. During the writing process, record the start address and storage location offset of each block of information in real time for subsequent positioning and verification. After writing each block of information, check the write feedback signal to ensure that the information block is successfully stored at the target address. If a write failure is detected, immediately execute the rewrite operation until it is successful, and update the storage location information table after successful writing to ensure that the physical storage location of each block of formatted image information is completely recorded, providing accurate location information support for subsequent information reading and verification.
[0084] S2023: Check the writing status of each block of formatted image information according to the storage location information to confirm that the formatted image information is saved to the SPI-FLASH.
[0085] Specifically, when verifying the writing status of each block of formatted image information according to the storage location information, the storage addresses of each block of information in the SPI-FLASH are read in sequence, the physical addresses of each block of information are located according to the location information in the storage location information table, and each block of information is extracted from the SPI-FLASH through a read operation and compared bit by bit with the content in the original formatted image information to confirm whether the information content is consistent; during the comparison process, the verification results of each block of information are recorded in real time. If information inconsistency is detected, the information block is marked as a writing failure status, and the writing and verification operations are re-executed until the comparison results are consistent, so as to ensure that each block of formatted image information is accurately stored in the SPI-FLASH, and finally confirm that all information blocks have been successfully written and are consistent with the original information.
[0086] In one embodiment, as Figure 5 shown, in step S2023, that is, verifying the writing status of each block of formatted image information according to the storage location information and confirming that the formatted image information is saved in the SPI-FLASH includes:
[0087] S20231: According to the storage location information, read the content of each block of formatted image information one by one to generate verification information.
[0088] Specifically, according to the storage location information, the content of the formatted image information is directly read from the SPI-FLASH block by block through SPI communication instructions and transmitted to the TFT screen in the order that conforms to the TFT screen communication protocol. The MCU does not perform any data caching or additional transfer operations during this process, and directly reads and transmits each block of image information from the SPI-FLASH to the specified display area of the TFT screen to achieve continuous and efficient data transmission. To ensure the smoothness of the transmission process, the MCU detects the status feedback of the SPI-FLASH chip select signal after each block of information is transmitted. If an abnormal situation occurs during the reading, such as unstable signal or interruption of the low-level state, the MCU re-sends the chip select signal to restore the stability of the communication channel. After all the image information is read and transmitted block by block, it is ensured that the data displayed on the TFT screen is smooth and continuous without interruption, meeting the high-efficiency display requirements of direct transmission.
[0089] S20232: Compare the verification information with the preset information in the storage location information to identify the writing integrity of each block of formatted image information and obtain the comparison result.
[0090] Specifically, during the direct transmission of image information, the MCU monitors the transmission status of the SPI interface and the validity of the chip select signal to real-time monitor the stability of data transmission, ensuring that the communication channel between the SPI-FLASH and the TFT screen remains connected at all times. When the level status of the chip select signal remains low, the MCU continuously reads and transmits image information to the TFT screen to achieve fast and continuous transmission; if the chip select signal appears abnormal due to external interference or communication accidents, the MCU immediately triggers the operation of re-sending the chip select signal to restore the communication mode of the SPI-FLASH and ensure the continuity of subsequent transmissions, avoiding image display stuttering or delays caused by signal abnormalities and ensuring the smoothness of the entire display process.
[0091] S20233: Based on the comparison results, confirm the writing status of each block of formatted image information to ensure that the formatted image information has been completely saved to the SPI-FLASH.
[0092] Specifically, after all the image information has been directly transmitted to the TFT screen, the MCU confirms the integrity of each data block during the transmission process according to the feedback information of the SPI communication status, and judges whether there are any omissions or transmission errors during the transmission process by monitoring the status register of the SPI interface or receiving feedback information. If any data transmission is incomplete or not completely successful is detected, the MCU will mark the corresponding data block and re-read the data block from the SPI-FLASH and re-transmit it to the TFT screen until all the image information blocks are confirmed to be completely transmitted, to ensure that each information block received by the TFT screen is accurate.
[0093] In one embodiment, as Figure 6 shown, in step S30, that is, after the initialization configuration and the saving of the formatted image information are completed, the MCU controls the final configuration information of the chip select signal of the SPI, reads the formatted image information from the SPI-FLASH, and directly transmits the formatted image information to the TFT screen for display, including:
[0094] S301: By controlling the low level status of the final configuration information of the chip select signal, make the SPI-FLASH enter the read mode, establish a communication channel between the SPI-FLASH and the MCU, and obtain the read channel information.
[0095] Specifically, by controlling the final configuration information of the chip select signal to keep it in the low level state, the SPI-FLASH is activated and enters the read mode, thereby establishing a communication channel with the MCU. At this time, the SPI-FLASH is ready to respond to the read request of the MCU. The MCU controls to ensure the stability of the channel connectivity through the continuous chip select signal and maintains the communication continuously in the low level state of the chip select signal. The read channel information is used to specify the data area to be accessed in the SPI-FLASH and ensure that the SPI-FLASH is only connected to the current MCU communication channel, laying a foundation for subsequent data transmission and completing the establishment of the read channel.
[0096] S302: According to the read channel information, read the formatted image information block by block from the SPI-FLASH in the structural order of the TFT screen communication protocol to generate the read image information.
[0097] Specifically, according to the read channel information, the MCU reads the formatted image information block by block from the SPI-FLASH in the structural order of the TFT screen communication protocol. The MCU reads the data block at the specified storage address from the SPI-FLASH and transmits it in the order required by the protocol. When reading each block of information, the MCU directly obtains the content from the SPI-FLASH according to the TFT screen protocol without additional caching or processing of the data. Each data block is organized and read in the format and order required for screen display so as to be directly transmitted to the display area of the TFT screen, generating the read image information, ensuring the smooth connection of the image information during the transmission process and realizing continuous image display.
[0098] S303: Transmit the read image information to the TFT screen to achieve the direct display of the read image information.
[0099] Specifically, after the data decoding of the read image information is completed, it is immediately transmitted to the display buffer of the TFT screen through the SPI interface in the specified order. During the transmission process, the low level state of the chip select signal is maintained to ensure the stability of the SPI communication, so that each frame of image information can be transmitted row by row and column by column to the display area according to the protocol requirements of the TFT screen and complete the final pixel rendering and display in the control circuit of the TFT screen. The whole transmission process is continuous and efficient, without the need for the MCU to further process or intervene in the data. The SPI interface directly matches the display protocol of the TFT screen during transmission to ensure the integrity and clarity of the image. When the image information transmission is completed, the TFT screen automatically refreshes and displays the complete image content.
[0100] In one embodiment, as Figure 7 shown, after step S303, that is, transmitting the read image information to the TFT screen to achieve the direct display of the read image information, it further includes:
[0101] S3031: During the transmission process of the read image information, the transmission rate of the read image information is detected in real time according to the current display state of the TFT screen, and transmission status information is generated.
[0102] Specifically, during the transmission process of the image information, the MCU monitors the transmission rate of the image data in real time by analyzing the display status information returned from the TFT screen. The obtained display status includes frame rate, current received data rate, and delay feedback. The transmission status information is dynamically generated based on these data. The MCU calculates and analyzes the received data. When the transmission rate deviates or differs from the preset threshold, transmission status information is generated and the transmission status is marked as low speed or normal status, so as to provide basic information support for subsequent refresh rate and brightness adjustment. The entire monitoring and generation process can ensure the stability of the transmission rate and make the image information transmission meet the display requirements of the TFT screen.
[0103] S3032: Through the transmission status information, the refresh rate of the TFT screen is adjusted in real time to ensure the smooth display of the read image information. Through the transmission status information, the brightness of the TFT screen is dynamically adjusted to adapt to the current ambient light conditions and optimize the display of the read image information.
[0104] Specifically, when the MCU receives the transmission status information, it adjusts the display refresh rate in real time to maintain the smoothness of the image transmission. For example, when the transmission rate decreases, the refresh rate is appropriately reduced to synchronize the image content with the transmission rhythm and avoid phenomena such as screen tearing or frame skipping. At the same time, during the brightness adjustment process, the MCU adjusts the brightness based on the transmission status information and in combination with the feedback information of the current ambient light to ensure that the display effect of the TFT screen can adapt to the ambient light conditions. When the light is weak, the brightness is reduced to avoid visual discomfort caused by excessive light emission, or the brightness is increased in a well-lit environment to ensure that the image is clearly visible. The entire adjustment process of the refresh rate and brightness is based on the transmission status information, thereby realizing the stable and adaptive display of the image and ensuring that the visual effect and viewing experience of the final image reach an optimized state.
[0105] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0106] In one embodiment, a data transmission control device based on the SPI communication protocol is provided. The data transmission control device based on the SPI communication protocol corresponds one-to-one to the data transmission control method based on the SPI communication protocol in the above embodiment. As Figure 8As shown, the data transmission control device based on the SPI communication protocol includes an SPI initialization configuration module, an image information formatting and saving module, and an image information reading and displaying module. The detailed descriptions of each functional module are as follows:
[0107] The SPI initialization configuration module is used to obtain the parameter information of SPI communication, and initialize the SPI communication through the MCU according to the parameter information of SPI communication to generate the final configuration information of the chip select signal;
[0108] The image information formatting and saving module is used to pre-format the image information according to the communication protocol of the TFT screen based on the final configuration information of the chip select signal, obtain the formatted image information, and save the formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol;
[0109] The image information reading and displaying module is used to, after the initialization configuration and the saving of the formatted image information are completed, control the final configuration information of the chip select signal of the SPI by the MCU, read the formatted image information from the SPI-FLASH, and directly transmit the formatted image information to the TFT screen for display.
[0110] Optionally, the SPI initialization configuration module includes:
[0111] The chip select register configuration sub-module is used to configure the chip select control register of the MCU according to the target device information in the parameter information of SPI communication, specify the chip select pin of the SPI-FLASH as the communication channel, and generate the initial configuration information of the chip select signal;
[0112] The chip select signal activation sub-module is used to set the level state of the chip select signal to low level based on the initial configuration information, activate the communication mode of the SPI-FLASH, and generate the final configuration information of the chip select signal.
[0113] Optionally, the image information formatting and saving module includes:
[0114] The image information format parsing sub-module is used to parse the pixel arrangement and the format requirements of the image information according to the communication protocol of the TFT screen, and generate the preliminary formatted information that conforms to the communication protocol of the TFT screen;
[0115] The formatted information storage sub-module is used to adjust and encode the pixel arrangement of the image information according to the preliminary formatted information, obtain the formatted image information, and save the formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol.
[0116] Optionally, the formatted information storage sub-module includes:
[0117] A pixel arrangement adjustment unit, which is used to rearrange the pixel information of the image information according to the pixel arrangement requirements in the preliminary formatting information, generate adjusted pixel arrangement information, perform encoding processing on the adjusted pixel arrangement information, and generate formatted image information that matches the TFT screen communication protocol;
[0118] A formatting information writing unit, which is used to write the formatted image information into the specified storage area of the SPI-FLASH block by block according to the structure order of the TFT screen communication protocol, and record the storage location information of each block of formatted image information;
[0119] An information writing verification unit, which is used to verify the writing status of each block of formatted image information according to the storage location information, and confirm that the formatted image information is saved in the SPI-FLASH.
[0120] Optionally, the information writing verification unit includes:
[0121] An information reading subunit, which is used to read the content of each block of formatted image information one by one according to the storage location information and generate verification information;
[0122] A verification comparison subunit, which is used to compare the verification information with the preset information in the storage location information, identify the writing integrity of each block of formatted image information, and obtain a comparison result;
[0123] A writing status confirmation subunit, which is used to confirm the writing status of each block of formatted image information based on the comparison result, and ensure that the formatted image information has been completely saved in the SPI-FLASH.
[0124] Optionally, the image information reading and display module includes:
[0125] A reading channel establishment sub-module, which is used to make the SPI-FLASH enter the reading mode by controlling the low-level state of the final configuration information of the chip select signal, establish a communication channel between the SPI-FLASH and the MCU, and obtain reading channel information;
[0126] A block-by-block reading sub-module, which is used to read the formatted image information from the SPI-FLASH block by block according to the reading channel information in the structure order of the TFT screen communication protocol, and generate the read image information;
[0127] A direct display sub-module, which is used to transmit the read image information to the TFT screen to achieve direct display of the read image information.
[0128] Optionally, the direct display sub-module is further followed by:
[0129] A transmission rate detection unit is configured to detect the transmission rate of the read image information in real time according to the current display state of the TFT screen during the transmission of the read image information, and generate transmission status information.
[0130] A refresh rate adjustment and brightness dynamic adjustment unit is configured to adjust the refresh rate of the TFT screen in real time through the transmission status information to ensure smooth display of the read image information, and dynamically adjust the brightness of the TFT screen through the transmission status information to adapt to the current ambient light conditions and optimize the display of the read image information.
[0131] For the specific limitations of the data transmission control device based on the SPI communication protocol, reference can be made to the limitations of the data transmission control method based on the SPI communication protocol in the foregoing text, which will not be elaborated herein. Each module in the above-mentioned data transmission control device based on the SPI communication protocol can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form for the processor to call and execute the operations corresponding to the above-mentioned modules.
[0132] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 9 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a data transmission control method based on the SPI communication protocol.
[0133] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0134] Obtain the parameter information of the SPI communication, and initialize and configure the SPI communication through the MCU according to the parameter information of the SPI communication to generate the final configuration information of the chip select signal.
[0135] Based on the final configuration information of the chip select signal, pre-format the image information according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol;
[0136] After completing the initialization configuration and saving the pre-formatted image information, the MCU controls the final configuration information of the chip select signal of the SPI, reads the pre-formatted image information from the SPI-FLASH, and directly transmits the pre-formatted image information to the TFT screen for display.
[0137] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0138] Obtain the parameter information of the SPI communication, and initialize the SPI communication through the MCU according to the parameter information of the SPI communication to generate the final configuration information of the chip select signal;
[0139] Based on the final configuration information of the chip select signal, pre-format the image information according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol;
[0140] After completing the initialization configuration and saving the pre-formatted image information, the MCU controls the final configuration information of the chip select signal of the SPI, reads the pre-formatted image information from the SPI-FLASH, and directly transmits the pre-formatted image information to the TFT screen for display.
[0141] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0143] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data transmission control method based on the SPI communication protocol, characterized in that, The data transmission control method based on the SPI communication protocol includes: Obtain the parameter information of SPI communication, and initialize and configure SPI communication through the MCU according to the parameter information of the SPI communication to generate the final configuration information of the chip select signal; Based on the final configuration information of the chip select signal, pre-format the image information according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol; The step of, based on the final configuration information of the chip select signal, pre-format the image information according to the communication protocol of the TFT screen to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol, includes: According to the communication protocol of the TFT screen, analyze the pixel arrangement of the image information and the format requirements of the image information to generate preliminary formatted information that conforms to the communication protocol of the TFT screen; According to the preliminary formatted information, adjust and encode the pixel arrangement of the image information to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol; The step of, according to the preliminary formatted information, adjust and encode the pixel arrangement of the image information to obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol, includes: According to the pixel arrangement requirements in the preliminary formatted information, rearrange the pixel information of the image information to generate adjusted pixel arrangement information, and perform encoding processing on the adjusted pixel arrangement information to generate the pre-formatted image information that matches the communication protocol of the TFT screen; Write the pre-formatted image information into the specified storage area of the SPI-FLASH block by block in the structural order of the TFT screen communication protocol, and record the storage location information of each block of pre-formatted image information; According to the storage location information, check the writing status of each block of pre-formatted image information to confirm that the pre-formatted image information is saved to the SPI-FLASH; After completing the initialization configuration and saving the pre-formatted image information, the MCU controls the final configuration information of the chip select signal of the SPI, reads the pre-formatted image information from the SPI-FLASH, and directly transmits the pre-formatted image information to the TFT screen for display; The step of, after completing the initialization configuration and saving the pre-formatted image information, the MCU controls the final configuration information of the chip select signal of the SPI, reads the pre-formatted image information from the SPI-FLASH, and directly transmits the pre-formatted image information to the TFT screen for display, includes: By controlling the low-level state of the final configuration information of the chip select signal, the SPI-FLASH is enabled to enter the read mode, a communication channel is established between the SPI-FLASH and the MCU, and read channel information is obtained; According to the read channel information, the formatted image information is read block by block from the SPI-FLASH in the structural order of the TFT screen communication protocol to generate the read image information; The read image information is transmitted to the TFT screen to realize the direct display of the read image information.
2. The data transmission control method based on the SPI communication protocol according to claim 1, characterized in that The obtaining of the parameter information of the SPI communication and the initialization configuration of the SPI communication by the MCU according to the parameter information to generate the final configuration information of the chip select signal includes: According to the target device information in the parameter information of the SPI communication, the chip select control register of the MCU is configured, and the chip select pin of the SPI-FLASH is specified as the communication channel to generate the initial configuration information of the chip select signal; Based on the initial configuration information, the level state of the chip select signal is set to low level to activate the communication mode of the SPI-FLASH and generate the final configuration information of the chip select signal.
3. The data transmission control method based on the SPI communication protocol according to claim 1, characterized in that, The verifying of the writing state of each block of formatted image information according to the storage location information to confirm that the formatted image information is saved in the SPI-FLASH includes: According to the storage location information, the content of each block of formatted image information is read one by one to generate verification information; The verification information is compared with the preset information in the storage location information to identify the writing integrity of each block of formatted image information and obtain a comparison result; Based on the comparison result, the writing state of each block of formatted image information is confirmed to ensure that the formatted image information has been completely saved in the SPI-FLASH.
4. The data transmission control method based on the SPI communication protocol according to claim 1, characterized in that, The transmitting of the read image information to the TFT screen to realize the direct display of the read image information further includes: During the transmission of the read image information, the transmission rate of the read image information is detected in real time according to the current display state of the TFT screen to generate transmission state information; Through the transmission state information, the refresh rate of the TFT screen is adjusted in real time to ensure the smooth display of the read image information, and through the transmission state information, the brightness of the TFT screen is dynamically adjusted to adapt to the current ambient light conditions and optimize the display of the read image information.
5. A data transmission control device based on the SPI communication protocol, characterized in that, The data transmission control device based on the SPI communication protocol includes: An SPI initialization configuration module, which is used to obtain the parameter information of the SPI communication and perform initialization configuration of the SPI communication by the MCU according to the parameter information of the SPI communication to generate the final configuration information of the chip select signal; An image information formatting and saving module, which is used to pre-format the image information according to the communication protocol of the TFT screen based on the final configuration information of the chip select signal, obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol; The image information formatting and saving module includes: An image information format parsing sub-module, which is used to parse the pixel arrangement of the image information and the format requirements of the image information according to the communication protocol of the TFT screen, and generate preliminary formatted information that conforms to the communication protocol of the TFT screen; A formatted information storage sub-module, which is used to adjust and encode the pixel arrangement of the image information according to the preliminary formatted information, obtain the pre-formatted image information, and save the pre-formatted image information to the SPI-FLASH in the structural order of the TFT screen communication protocol; The formatted information storage sub-module includes: A pixel arrangement adjustment unit, which is used to re-arrange the pixel information of the image information according to the pixel arrangement requirements in the preliminary formatted information, generate adjusted pixel arrangement information, and perform encoding processing on the adjusted pixel arrangement information to generate the pre-formatted image information that matches the communication protocol of the TFT screen; A formatted information writing unit, which is used to write the pre-formatted image information into the specified storage area of the SPI-FLASH block by block in the structural order of the TFT screen communication protocol, and record the storage location information of each block of pre-formatted image information; An information writing verification unit, which is used to verify the writing status of each block of pre-formatted image information according to the storage location information, and confirm that the pre-formatted image information is saved to the SPI-FLASH; An image information reading and displaying module, which is used to, after completing the initialization configuration and saving of the pre-formatted image information, control the final configuration information of the chip select signal of the SPI by the MCU, read the pre-formatted image information from the SPI-FLASH, and directly transmit the pre-formatted image information to the TFT screen for display; The image information reading and displaying module includes: A reading channel establishing sub-module, which is used to make the SPI-FLASH enter the reading mode by controlling the low level state of the final configuration information of the chip select signal, establish a communication channel between the SPI-FLASH and the MCU, and obtain reading channel information; A block-by-block reading sub-module, which is used to read the pre-formatted image information from the SPI-FLASH block by block in the structural order of the TFT screen communication protocol according to the reading channel information, and generate the read image information; A direct display sub-module, which is used to transmit the read image information to the TFT screen to realize the direct display of the read image information.
6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data transmission control method based on the SPI communication protocol according to any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data transmission control method based on the SPI communication protocol according to any one of claims 1 to 4.
Citation Information
Patent Citations
Interface protocol display method and system and storage medium
CN116614566A
Display system and reference monitor
CN116916100A