Multi-theme display method and device based on MCU module, equipment and medium
By acquiring and processing the display parameters of the LCD module, configuring the MCU module, and performing screen updates in response to theme switching instructions, the problem that the MCU platform cannot achieve multi-theme display in the existing technology is solved and the functionality is improved.
Patent Information
- Application Number
- CN202411502382.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-21
AI Technical Summary
Due to system resource limitations, existing MCU-based theme technologies cannot realize multi-theme interface display on small and medium-sized color LCD displays, resulting in low functionality.
By obtaining the display parameters of the LCD module, the control parameters of the MCU module are calculated and processed, and these control parameters are used to configure the MCU module. Response theme switching instructions, the MCU module updates the screen to achieve multiple theme display.
The selectivity of the theme is increased, and the functionality is improved, so that the MCU module can achieve multi -themed interface display on the small and medium -sized color LCD display.
Smart Images

Figure CN119342303A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data display technology, and in particular to a multi-theme display method, device, equipment and medium based on an MCU module. Background Art
[0002] At present, electronic products have been widely used in people's lives, and more and more electronic products are equipped with display screens for operation and interaction. For example, from aerosol generating devices to air conditioners and refrigerators, they can be equipped with a color liquid crystal display (Liquid Crystal Display, hereinafter referred to as LCD) to make the product look more distinctive. At the same time, the unique display interaction interface can give the product a certain competitive advantage.
[0003] As the manufacturing process of electronic component product lines improves, the performance of microprocessors (Microcontroller Unit, hereinafter referred to as MCU) is improving while the price is also decreasing. MCUs with small and medium-sized LCDs have been widely used in various household appliances, instrumentation equipment, digital players, portable decoders and other products. In the application process of MCU, due to the influence of system resources (memory, code space), when using small and medium-sized color LCD screens, only one theme interface can be used for display status interaction. Therefore, the existing MCU-based theme technology has the problem of low functionality. Summary of the invention
[0004] The embodiments of the present invention provide a multi-theme display method, device, equipment and medium based on an MCU module, aiming to solve the problem that in the application process of the MCU platform in the prior art, due to the influence of system resources (memory, code space), only one theme interface can be used for display status interaction during the use of small and medium-sized color LCD screens, resulting in low functionality.
[0005] In order to solve the above problems, in a first aspect, an embodiment of the present invention provides a multi-theme display method based on an MCU module, which is applied to a multi-theme display system. The multi-theme display system includes an MCU module and an LCD module. The MCU module is communicatively connected to the LCD module. The multi-theme display method based on the MCU module includes:
[0006] Acquire display parameters of the LCD module, and perform calculations based on the display parameters to obtain control parameters of the MCU module;
[0007] Utilizing the control parameters to configure the MCU module;
[0008] In response to the received theme switching instruction, the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
[0009] In a second aspect, an embodiment of the present application provides a multi-theme display device based on an MCU module, which is applied to a multi-theme display system. The multi-theme display system includes an MCU module and an LCD module. The MCU module is communicatively connected to the LCD module. The multi-theme display device based on the MCU module includes:
[0010] A calculation unit, used to obtain display parameters of the LCD module, and perform calculation processing according to the display parameters to obtain control parameters of the MCU module;
[0011] A configuration unit, used to configure the MCU module using the control parameters;
[0012] The updating unit is used for responding to the received theme switching instruction, and the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
[0013] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor connected to the memory; the memory is used to store a computer program, and the processor is used to run the computer program stored in the memory to execute the method described in the first aspect above.
[0014] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method described in the first aspect above is implemented.
[0015] The embodiment of the present invention provides a multi-theme display method, device, equipment and medium based on an MCU module, wherein the multi-theme display method based on an MCU module is applied to a multi-theme display system, the multi-theme display system includes an MCU module and an LCD module, the MCU module is connected to the LCD module in communication, and the multi-theme display method based on the MCU module includes: obtaining display parameters of the LCD module, and calculating and processing according to the display parameters to obtain control parameters of the MCU module; configuring the MCU module using the control parameters; in response to the received theme switching instruction, the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module. It can be seen that by implementing the embodiment of the present invention, the control parameters of the MCU module are calculated and processed according to the display parameters; the MCU module is configured using the control parameters; in response to the received theme switching instruction, the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module. Therefore, by implementing the embodiment of the present invention, a method for the MCU module to perform a corresponding screen update on the LCD module using the theme switching instruction is realized, which increases the selectivity of the theme, thereby improving functionality. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0017] Figure 1 A schematic diagram of a flow chart of a multi-theme display method based on an MCU module provided in an embodiment of the present invention;
[0018] Figure 2 A schematic block diagram of a multi-theme display device based on an MCU module provided in an embodiment of the present invention;
[0019] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0022] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0023] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0024] See also Figure 1 , Figure 1 The flowchart of the multi-theme display method based on the MCU module provided by the embodiment of the present invention is as follows. Figure 1 As shown, an embodiment of the present invention provides a multi-theme display method based on an MCU module, which is applied to a multi-theme display system. The multi-theme display system includes an MCU module and an LCD module, and the MCU module is communicatively connected to the LCD module; the multi-theme display method based on the MCU module includes the following steps S110-S130.
[0025] S110, acquiring display parameters of the LCD module, and performing calculation processing according to the display parameters to obtain control parameters of the MCU module.
[0026] In this embodiment, the multi-theme display system is a system that uses the MCU module to control the LCD module, and implements the switching process of theme functions at the application layer. The multi-theme display system can be applied to various household appliances such as refrigerators, washing machines, air conditioners, instrumentation equipment, digital players, portable decoders and other equipment.
[0027] Moreover, for the majority of users, due to differences in personality, habits, age, hobbies, and personal preferences, the style changes of multiple theme switching can increase the user base of the product and extend the product life cycle. Therefore, it is very important to improve the functionality of multiple themes in the multi-theme display system.
[0028] The display parameters of the LCD module may be obtained, specifically, from the product design of the LCD module, and may be specifically configured according to actual conditions.
[0029] In one embodiment, the step of calculating and processing the display parameters to obtain the control parameters of the MCU module includes:
[0030] Analyzing the display parameters to obtain resolution, color depth and refresh rate;
[0031] The display buffer capacity in the control parameter is calculated by using the resolution, the color depth and the preset memory capacity according to a preset first calculation strategy;
[0032] The resolution, the color depth and the refresh rate are used to calculate according to a preset second calculation strategy to obtain the main frequency value in the control parameter.
[0033] In this embodiment, the display parameters refer to the relevant data of the display screen in the LCD module, and the resolution, color depth refresh rate and hardware interface of the display screen are obtained by text analysis or image analysis of the display parameters; wherein the text analysis and the image analysis can be implemented by program algorithms or manual processing; the resolution refers to the number of pixels on the screen, usually expressed as the number of horizontal pixels multiplied by the number of vertical pixels, for example, it can be 240*240; the color depth refers to the number of colors that each pixel can represent, for example, it can be 16 bits; the refresh rate refers to the number of times the screen redraws the image per second, for example, a frame refresh rate of 20 milliseconds can be selected, that is, 50 Hz per second, with a relatively small delay; the hardware interface refers to the physical connection method for connecting the display screen and the MCU module, that is, data communication can be performed with the MCU module, for example, the hardware interface can be a 4-wire SPI (Serial Peripheral Interface, referred to as SPI, serial peripheral interface) interface; the control parameters refer to the relevant setting parameters of the hardware device or communication in the MCU module, which can include display cache capacity, main frequency value, memory storage capacity, etc.; the display cache capacity refers to the display cache RAM (Random Access Controller) in the MCU module The main frequency value refers to the main frequency speed of the MCU module; the memory storage capacity refers to the memory size of the internal storage space (FLASH, a non-volatile memory) in the MCU module or the memory size of the external memory.
[0034] The display cache capacity in the control parameter is calculated using the resolution, the color depth and the preset memory capacity according to a preset first calculation strategy, including: multiplying the horizontal pixel number and the vertical pixel number in the resolution and the color depth to obtain a first value, dividing the second value by a first preset value to obtain a second value, adding the second value to the memory capacity to obtain a third value, and using the third value to perform screening to obtain the display cache capacity. For example, the resolution can be 240*240; the color depth can be 16 bits; the first preset value is 8 (one byte occupies 8 bits, for example, 16 bits divided by 8 occupies two bytes); the preset memory capacity can be 32 kilobytes, and the memory capacity is used for font cache, mounted file system cache (for example, FAT micro file system, a standard file system, used to access data as a file, equivalent to opening files, reading and writing files, convenient for reading and transplanting) and some variables, stacks and program frameworks, etc., specifically, it can be configured according to actual conditions; in this way, the above-mentioned first calculation strategy can be used for calculation to obtain: the first value is 921600, the second value is 115200 bytes, and the third value is 147968 bytes, so that the display cache capacity can be obtained by optimally screening using the third value, that is, screening out a value greater than and closest to the third value as the display cache capacity of the display cache RAM in the MCU module.
[0035] The method of using the resolution, the color depth and the refresh rate and calculating the main frequency value in the control parameter according to the preset second calculation strategy includes: multiplying the horizontal pixel number and the vertical pixel number in the resolution and the color depth to obtain a fourth value, multiplying the fourth value and the refresh rate to obtain a fifth value, and multiplying the fifth value and the second preset value to obtain the main frequency value. For example, the resolution can be 240*240; the color depth can be 16 bits; the second preset value is 4, and the refresh rate is 50 Hz per second; thus, the calculation can be performed by the above-mentioned second calculation strategy: the fourth value is 921600, the fifth value is 46080000 Hz, that is, 46 MHz, and the main frequency value can be 184 MHz; it should be noted that the fifth value is the frequency of the hardware interface (SPI interface), and the frequency of the SPI interface is half of the bus frequency, and the bus frequency is half of the main frequency value of the MCU module, so the main frequency value is 4 times the frequency of the SPI interface.
[0036] As for the determination of the memory storage capacity in the control parameters, for example, the internal storage space of the MCU module in the memory storage capacity can store icons, text, progress bars, etc., and the external memory in the memory storage capacity can store content such as the boot LOGO, theme background pictures, and theme setting pictures; resources such as the boot LOGO, theme background pictures, and theme setting pictures are stored in a file system manner, and icons, text, progress bars, etc. are stored in a 1-bit bitmap format. Moreover, the internal storage space of the MCU module>the size of the startup code+the size of the driver and application operation code+the size of resources such as icons, text, and progress bars. For example, the size of the MCU internal storage space can be 512K. After removing the size of the startup code+the size of the driver and application operation code+the size of resources such as icons, text, and progress bars, there is still about 128K bytes left.
[0037] The external memory in the memory storage capacity selects the external memory of the SPI interface as the first choice, and determines the working voltage and storage space of the external memory; the working voltage is equal to the MCU voltage of the MCU module = the interface voltage of the LCD module, which is usually 3.3V; the storage space needs to store the startup LOGO pictures, background pictures and other resource pictures of multiple themes. For example, when the resolution is 240*240, the startup LOGO of the theme is displayed in full screen, and the storage space occupied is 240*240*2=115200 bytes. The background picture and the startup LOGO are the same size. The size occupied by the theme setting picture resource is 1 / 4 of the background picture, and the number of sub-icons is 16 (the number of UIs displayed by the art design interface, the number of sub-icons, that is, the number of sub-icons corresponding to each theme is 16, which is not fixed and can be determined according to the UI designed by the art designer or the setting items of the product. There are about 16 design items, and some may not be displayed). Therefore, the storage space occupied by a theme is as follows: 115200+115200+115200 / 4*16=691200 (bytes); so the number of themes that can be stored in a 4M-byte external memory is as follows: 4*1024*1024 / 691200=6.068, i.e. 6 sets of themes.
[0038] Through the above embodiments, it can be known that the resolution, color depth and refresh rate are obtained by analyzing the display parameters; the display cache capacity in the control parameters is calculated according to the preset first calculation strategy using the resolution, color depth and preset memory capacity; the main frequency value in the control parameters is calculated according to the preset second calculation strategy using the resolution, color depth and refresh rate. Therefore, the accuracy of the control parameters is guaranteed, so that the control parameters can be used for subsequent targeted processing.
[0039] S120: Utilize the control parameters to configure the MCU module.
[0040] In this embodiment, after calculating and processing the display parameters to obtain the control parameters of the MCU module, the MCU module is configured using the obtained control parameters to determine the hardware device or communication parameters of the MCU module, thereby providing a processing basis for subsequent targeted processing.
[0041] S130 . In response to the received theme switching instruction, the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
[0042] In this embodiment, the theme switching instruction may be an instruction triggered by the LCD module and sent to the MCU module.
[0043] In one embodiment, before responding to the received theme switching instruction, the method further includes:
[0044] Configuring a driving method for the LCD module;
[0045] configuring the fill function;
[0046] Configure the triggering method for theme switching.
[0047] In this embodiment, before responding to the received theme switching instruction, it is necessary to build the framework of the multi-theme display system, that is, configure the driving method of the LCD module, the filling function, the triggering method of the theme switching, etc. to realize the construction of the system framework.
[0048] The configuration of the driving function of the LCD module may include configuring the hardware SPI interface communication mode, configuring the interface speed to be bus frequency / 2 (fastest speed), and also including the driving method of initialization, refreshing specified colors (clearing the screen), refreshing cache data, screen rotation, backlight brightness adjustment, turning off the screen, turning on the screen and other functions; specifically, the initialization is to write the values of relevant registers according to the driver chip data manual of the LCD module to make it work normally. Usually, the manufacturer of the display provides specific register values, and parameters such as color depth and display direction can also be changed; the refresh specified color and the refresh cache are both set by the MCU module to the driver chip of the LCD module through the SPI interface, and the driver chip is processed internally, and the result is directly displayed on the display, such as sending a setting LCD RAM address instruction, a setting column address command instruction, a column address start byte instruction, a column address end byte instruction, a setting row address instruction, a row address start byte instruction, a row address end byte instruction, a write LCD RAM instruction, and the color value of N pixels (N=width*height of the area to be refreshed). The screen rotation refers to the LCD module driver chip data manual. By changing the values of the four bits "Page Address Order", "Column Address Order", "Page / Column Order" and "Line Address Order", the rotation display of 0, 90, 180 and 270 degrees can be realized. The backlight brightness adjustment is to adjust the backlight brightness by controlling the PWM (pulse width modulation) value of the backlight control signal by the MCU module. Turning off the screen refers to the power saving mode. If the display screen is not operated for a period of time, the display screen is turned off. Specifically, the function of d refreshing the specified color is called to refresh the entire screen to black, and then the backlight brightness adjustment function is called to set the backlight to the minimum value. Turning on the screen first calls the refresh cache to update the LCD module, and then calls the backlight brightness adjustment function to set the backlight to the value before turning off.
[0049] The configuration of the fill function includes filling area color, filling picture data, drawing progress bar, filling font data, etc. The fill area color can be called when receiving a switching theme instruction, a volume adjustment instruction, or a screen saver time change instruction; assuming that the width of the rectangular area to be filled is W and the height is H; first, find the coordinate data of the X, Y coordinates corresponding to the rectangular area to be filled according to the display screen in the LCD module, and use the coordinate data, the width and height of the rectangular area to be filled and the display parameters to calculate the corresponding address data in the MCU module display cache RAM. For example, the color depth is 16 bits, so 1 pixel is 16 bits, that is, 2 bytes, so the memory address of the first row = (Y*screen width + X) * 2; then fill a row of rectangular width data, that is, fill W color data at the location of the memory address of the first row, and 1 color data is 2 bytes; then find the memory address of the second row, the memory address of the second row = the memory address of the first row + screen width * 2, and fill W color data at the location of the memory address of the second row; and so on to fill the memory data with a height of H rows. To draw the progress bar, first find the coordinate data of the X, Y coordinates corresponding to the rectangular area of the progress bar according to the display screen of the LCD module, and use the coordinate data, the width and height of the rectangular area of the progress bar and the display parameters to calculate the corresponding address data in the display cache RAM of the MCU module, in the same way as the above-mentioned filling area color; fill the color data of the progress bar with the first and last rows of data, and fill the color data of the progress bar with the first and last points from the second row to the second last row; calculate the percentage of the progress bar in the middle position, and calculate the filling width according to the obtained percentage, and fill the progress bar color data at the position less than or equal to the width. The filling of font data first finds the coordinate data of the X, Y coordinates corresponding to the rectangular area of the font data according to the display screen of the LCD module, and uses the coordinate data, the width and height of the rectangular area of the font data and the display parameters to calculate the corresponding address data in the display cache RAM of the MCU module, the method is the same as the above-mentioned filling area color; and according to the arrangement of the font data, fill the data line by line in the range of the font size, 1 byte included in 1 font data corresponds to the color of 8 pixels, for example, a decimal point has only 6 bytes, 6*8=48 points, 48*2=96 memory data, and 96 values are filled in the memory. It can also include the configuration of the screen refresh function, filling the background into the display cache, filling the icon into the display cache, filling the font into the display cache, filling the progress bar or the interface sub-picture resources, etc.; after the above steps are completed, call the refresh screen function of the application layer to update the data in the display cache RAM in the MCU module to the LCD display.
[0050] To configure the triggering method of theme switching, you can press and hold the key to enter in the setting menu; use the key to change the variable value of the theme page in the theme switching page; reload the theme resources (background, icon, font, etc.) of this page after the variable value of the theme page is changed; refresh the screen after all display variables are updated; store the variable value of the theme page to the external memory FLASH or display cache RAM to achieve power-off storage, and the stored variable value of the theme page can be called when the power is turned on next time.
[0051] Before responding to the received theme switching instruction, the method may further include: customizing the screen update task, first defining the display page, each page is a unique constant value, such as defining the value of "PAGE_LOGO" as 1, the value of "PAGE_VOLUME" as 2, and so on. Secondly, assigning a specific display function to each display page (such as defining the function name void user_display_logo(void) under the "PAGE_LOGO" page); next, defining the screen update mode, which is divided into two categories: automatic update and event-triggered update; automatic update is usually in the screen saver interface, using the time flag of the timer to refresh the screen content regularly; event triggering is to refresh the screen content when the display page is switched and the variables to be displayed on the current display page change; finally, defining the screen update mark, automatic update and event triggering set the mark bit, and clear the mark bit after completing the screen refresh task.
[0052] Through the above embodiments, it can be known that before responding to the received theme switching instruction, the method also includes: configuring the driving method of the LCD module; configuring the filling function; configuring the triggering method of the theme switching, etc. to build a theme framework, which provides a basis for subsequent targeted processing.
[0053] In one embodiment, the MCU module uses the theme switching instruction to perform corresponding screen update processing on the LCD module, including:
[0054] Acquire multiple filling functions and refreshing functions according to the theme switching instruction;
[0055] Using a plurality of filling functions to obtain the coordinate data of the display screen of the corresponding theme resource in the LCD module;
[0056] Performing calculation based on the coordinate data and the display parameters to obtain address data of the subject resource in the MCU module;
[0057] The theme switching instruction is used to perform data filling processing on the address data and call the refresh function to implement screen updating of the LCD module.
[0058] In this embodiment, the fill function includes filling area color, filling picture data, drawing progress bar, filling font data, etc.; the coordinate data refers to the coordinate value of the theme resource in the display screen; the theme resource includes background, font, color, icon, etc.; the address data refers to the storage address of the fill area or data in the display cache RAM of the MCU module. Specifically, the theme switching instruction is used to obtain multiple fill functions and refresh functions; multiple fill functions are used to obtain the coordinate data of the display screen of the corresponding theme resource in the LCD module; based on the coordinate data and the display parameters, the address data of the theme resource in the MCU module is obtained by calculation; the address data is filled with data using the theme switching instruction and the refresh function is called to achieve screen update of the LCD module.
[0059] Through the above embodiment, multiple filling functions and refresh functions are obtained according to the theme switching instruction; the coordinate data of the display screen of the corresponding theme resource in the LCD module is obtained by using the multiple filling functions; the address data of the theme resource in the MCU module is obtained by calculation based on the coordinate data and the display parameters; the address data is filled with data and the refresh function is called by using the theme switching instruction to implement the screen update of the LCD module. Therefore, the method of the MCU module using the theme switching instruction to perform the corresponding screen update of the LCD module is implemented, the selectivity of the theme is increased, and the functionality is improved.
[0060] See also Figure 2 , Figure 2 Schematic block diagram of a multi-theme display device 100 based on an MCU module provided in an embodiment of the present invention. Figure 2 As shown, an embodiment of the present invention provides a multi-theme display device 100 based on an MCU module for implementing the above method, and the multi-theme display device 100 based on an MCU module includes:
[0061] The calculation unit 110 is used to obtain display parameters of the LCD module, and perform calculation processing according to the display parameters to obtain control parameters of the MCU module.
[0062] In this embodiment, the multi-theme display system is a system that uses the MCU module to control the LCD module, and implements the switching process of theme functions at the application layer. The multi-theme display system can be applied to various household appliances such as refrigerators, washing machines, air conditioners, instrumentation equipment, digital players, portable decoders and other equipment.
[0063] Moreover, for the majority of users, due to differences in personality, habits, age, hobbies, and personal preferences, the style changes of multiple theme switching can increase the user base of the product and extend the product life cycle. Therefore, it is very important to improve the functionality of multiple themes in the multi-theme display system.
[0064] The display parameters of the LCD module may be obtained, specifically, from the product design of the LCD module, and may be specifically configured according to actual conditions.
[0065] In one embodiment, the step of calculating and processing the display parameters to obtain the control parameters of the MCU module includes:
[0066] Analyzing the display parameters to obtain resolution, color depth and refresh rate;
[0067] The display buffer capacity in the control parameter is calculated by using the resolution, the color depth and the preset memory capacity according to a preset first calculation strategy;
[0068] The resolution, the color depth and the refresh rate are used to calculate according to a preset second calculation strategy to obtain the main frequency value in the control parameter.
[0069] In this embodiment, the display parameters refer to the relevant data of the display screen in the LCD module, and the resolution, color depth refresh rate and hardware interface of the display screen are obtained by text analysis or image analysis of the display parameters; wherein the text analysis and the image analysis can be implemented by program algorithms or manual processing; the resolution refers to the number of pixels on the screen, usually expressed as the number of horizontal pixels multiplied by the number of vertical pixels, for example, it can be 240*240; the color depth refers to the number of colors that each pixel can represent, for example, it can be 16 bits; the refresh rate refers to the number of times the screen redraws the image per second, for example, a frame refresh rate of 20 milliseconds can be selected, that is, 50 Hz per second, with a relatively small delay; the hardware interface refers to the physical connection method for connecting the display screen and the MCU module, that is, data communication can be performed with the MCU module, for example, the hardware interface can be a 4-wire SPI (Serial Peripheral Interface, referred to as SPI, serial peripheral interface) interface; the control parameters refer to the relevant setting parameters of the hardware device or communication in the MCU module, which can include display cache capacity, main frequency value, memory storage capacity, etc.; the display cache capacity refers to the display cache RAM (Random Access Controller) in the MCU module The main frequency value refers to the main frequency speed of the MCU module; the memory storage capacity refers to the memory size of the internal storage space (FLASH, a non-volatile memory) in the MCU module or the memory size of the external memory.
[0070] The display cache capacity in the control parameter is calculated using the resolution, the color depth and the preset memory capacity according to a preset first calculation strategy, including: multiplying the horizontal pixel number and the vertical pixel number in the resolution and the color depth to obtain a first value, dividing the second value by a first preset value to obtain a second value, adding the second value to the memory capacity to obtain a third value, and using the third value to perform screening to obtain the display cache capacity. For example, the resolution can be 240*240; the color depth can be 16 bits; the first preset value is 8 (one byte occupies 8 bits, for example, 16 bits divided by 8 occupies two bytes); the preset memory capacity can be 32 kilobytes, and the memory capacity is used for font cache, mounted file system cache (for example, FAT micro file system, a standard file system, used to access data as a file, equivalent to opening files, reading and writing files, convenient for reading and transplanting) and some variables, stacks and program frameworks, etc., specifically, it can be configured according to actual conditions; in this way, the above-mentioned first calculation strategy can be used for calculation to obtain: the first value is 921600, the second value is 115200 bytes, and the third value is 147968 bytes, so that the display cache capacity can be obtained by optimally screening using the third value, that is, screening out a value greater than and closest to the third value as the display cache capacity of the display cache RAM in the MCU module.
[0071] The method of using the resolution, the color depth and the refresh rate and calculating the main frequency value in the control parameter according to the preset second calculation strategy includes: multiplying the horizontal pixel number and the vertical pixel number in the resolution and the color depth to obtain a fourth value, multiplying the fourth value and the refresh rate to obtain a fifth value, and multiplying the fifth value and the second preset value to obtain the main frequency value. For example, the resolution can be 240*240; the color depth can be 16 bits; the second preset value is 4, and the refresh rate is 50 Hz per second; thus, the calculation can be performed by the above-mentioned second calculation strategy: the fourth value is 921600, the fifth value is 46080000 Hz, that is, 46 MHz, and the main frequency value can be 184 MHz; it should be noted that the fifth value is the frequency of the hardware interface (SPI interface), and the frequency of the SPI interface is half of the bus frequency, and the bus frequency is half of the main frequency value of the MCU module, so the main frequency value is 4 times the frequency of the SPI interface.
[0072] As for the determination of the memory storage capacity in the control parameters, for example, the internal storage space of the MCU module in the memory storage capacity can store icons, text, progress bars, etc., and the external memory in the memory storage capacity can store content such as the boot LOGO, theme background pictures, and theme setting pictures; resources such as the boot LOGO, theme background pictures, and theme setting pictures are stored in a file system manner, and icons, text, progress bars, etc. are stored in a 1-bit bitmap format. Moreover, the internal storage space of the MCU module>the size of the startup code+the size of the driver and application operation code+the size of resources such as icons, text, and progress bars. For example, the size of the MCU internal storage space can be 512K. After removing the size of the startup code+the size of the driver and application operation code+the size of resources such as icons, text, and progress bars, there is still about 128K bytes left.
[0073] The external memory in the memory storage capacity selects the external memory of the SPI interface as the first choice, and determines the working voltage and storage space of the external memory; the working voltage is equal to the MCU voltage of the MCU module = the interface voltage of the LCD module, which is usually 3.3V; the storage space needs to store the startup LOGO pictures, background pictures and other resource pictures of multiple themes. For example, when the resolution is 240*240, the startup LOGO of the theme is displayed in full screen, and the storage space occupied is 240*240*2=115200 bytes. The background picture and the startup LOGO are the same size. The size occupied by the theme setting picture resource is 1 / 4 of the background picture, and the number of sub-icons is 16 (the number of UIs displayed by the art design interface, the number of sub-icons, that is, the number of sub-icons corresponding to each theme is 16, which is not fixed and can be determined according to the UI designed by the art designer or the setting items of the product. There are about 16 design items, and some may not be displayed). Therefore, the storage space occupied by a theme is as follows: 115200+115200+115200 / 4*16=691200 (bytes); so the number of themes that can be stored in a 4M-byte external memory is as follows: 4*1024*1024 / 691200=6.068, i.e. 6 sets of themes.
[0074] Through the above embodiments, it can be known that the resolution, color depth and refresh rate are obtained by analyzing the display parameters; the display cache capacity in the control parameters is calculated according to the preset first calculation strategy using the resolution, color depth and preset memory capacity; the main frequency value in the control parameters is calculated according to the preset second calculation strategy using the resolution, color depth and refresh rate. Therefore, the accuracy of the control parameters is guaranteed, so that the control parameters can be used for subsequent targeted processing.
[0075] The configuration unit 120 is used to configure the MCU module using the control parameters.
[0076] In this embodiment, after calculating and processing the display parameters to obtain the control parameters of the MCU module, the MCU module is configured using the obtained control parameters to determine the hardware device or communication parameters of the MCU module, thereby providing a processing basis for subsequent targeted processing.
[0077] The updating unit 130 is used for responding to the received theme switching instruction, and the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
[0078] In this embodiment, the theme switching instruction may be an instruction triggered by the LCD module and sent to the MCU module.
[0079] In one embodiment, before responding to the received theme switching instruction, the apparatus further includes:
[0080] Configuring a driving method for the LCD module;
[0081] configuring the fill function;
[0082] Configure the triggering method for theme switching.
[0083] In this embodiment, before responding to the received theme switching instruction, it is necessary to build the framework of the multi-theme display system, that is, configure the driving method of the LCD module, the filling function, the triggering method of the theme switching, etc. to realize the construction of the system framework.
[0084] The configuration of the driving function of the LCD module may include configuring the hardware SPI interface communication mode, configuring the interface speed to be bus frequency / 2 (fastest speed), and also including the driving method of initialization, refreshing specified colors (clearing the screen), refreshing cache data, screen rotation, backlight brightness adjustment, turning off the screen, turning on the screen and other functions; specifically, the initialization is to write the values of relevant registers according to the driver chip data manual of the LCD module to make it work normally. Usually, the manufacturer of the display provides specific register values, and parameters such as color depth and display direction can also be changed; the refresh specified color and the refresh cache are both set by the MCU module to the driver chip of the LCD module through the SPI interface, and the driver chip is processed internally, and the result is directly displayed on the display, such as sending a setting LCD RAM address instruction, a setting column address command instruction, a column address start byte instruction, a column address end byte instruction, a setting row address instruction, a row address start byte instruction, a row address end byte instruction, a write LCD RAM instruction, and the color value of N pixels (N=width*height of the area to be refreshed). The screen rotation refers to the LCD module driver chip data manual. By changing the values of the four bits "Page Address Order", "Column Address Order", "Page / Column Order" and "Line Address Order", the rotation display of 0, 90, 180 and 270 degrees can be realized. The backlight brightness adjustment is to adjust the backlight brightness by controlling the PWM (pulse width modulation) value of the backlight control signal by the MCU module. Turning off the screen refers to the power saving mode. If the display screen is not operated for a period of time, the display screen is turned off. Specifically, the function of d refreshing the specified color is called to refresh the entire screen to black, and then the backlight brightness adjustment function is called to set the backlight to the minimum value. Turning on the screen first calls the refresh cache to update the LCD module, and then calls the backlight brightness adjustment function to set the backlight to the value before turning off.
[0085] The configuration of the fill function includes filling area color, filling picture data, drawing progress bar, filling font data, etc. The fill area color can be called when receiving a switching theme instruction, a volume adjustment instruction, or a screen saver time change instruction; assuming that the width of the rectangular area to be filled is W and the height is H; first, find the coordinate data of the X, Y coordinates corresponding to the rectangular area to be filled according to the display screen in the LCD module, and use the coordinate data, the width and height of the rectangular area to be filled, and the display parameters to calculate the corresponding address data in the MCU module display cache RAM. For example, if the color depth is 16 bits, then 1 pixel is 16 bits, that is, 2 bytes, so the memory address of the first row = (Y*screen width + X) * 2; then fill a row of rectangular width data, that is, fill W color data at the location of the memory address of the first row, and 1 color data is 2 bytes; then find the memory address of the second row, the memory address of the second row = the memory address of the first row + screen width * 2, and fill W color data at the location of the memory address of the second row; and so on to fill the memory data with a height of H rows. To draw the progress bar, first find the coordinate data of the X, Y coordinates corresponding to the rectangular area of the progress bar according to the display screen of the LCD module, and use the coordinate data, the width and height of the rectangular area of the progress bar and the display parameters to calculate the corresponding address data in the display cache RAM of the MCU module, in the same way as the above-mentioned filling area color; fill the color data of the progress bar with the first and last rows of data, and fill the color data of the progress bar with the first and last points from the second row to the second last row; calculate the percentage of the progress bar in the middle position, and calculate the filling width according to the obtained percentage, and fill the progress bar color data at the position less than or equal to the width. The filling of font data first finds the coordinate data of the X, Y coordinates corresponding to the rectangular area of the font data according to the display screen of the LCD module, and uses the coordinate data, the width and height of the rectangular area of the font data and the display parameters to calculate the corresponding address data in the display cache RAM of the MCU module, the method is the same as the above-mentioned filling area color; and according to the arrangement of the font data, fill the data line by line in the range of the font size, 1 byte included in 1 font data corresponds to the color of 8 pixels, for example, a decimal point has only 6 bytes, 6*8=48 points, 48*2=96 memory data, and 96 values are filled in the memory. It can also include the configuration of the screen refresh function, filling the background into the display cache, filling the icon into the display cache, filling the font into the display cache, filling the progress bar or the interface sub-picture resources, etc.; after the above steps are completed, call the refresh screen function of the application layer to update the data in the display cache RAM in the MCU module to the LCD display.
[0086] To configure the triggering method of theme switching, you can press and hold the key to enter in the setting menu; use the key to change the variable value of the theme page in the theme switching page; reload the theme resources (background, icon, font, etc.) of this page after the variable value of the theme page is changed; refresh the screen after all display variables are updated; store the variable value of the theme page to the external memory FLASH or display cache RAM to achieve power-off storage, and the stored variable value of the theme page can be called when the power is turned on next time.
[0087] Before responding to the received theme switching instruction, the method may further include: customizing the screen update task, first defining the display page, each page is a unique constant value, such as defining the value of "PAGE_LOGO" as 1, the value of "PAGE_VOLUME" as 2, and so on. Secondly, assigning a specific display function to each display page (such as defining the function name void user_display_logo(void) under the "PAGE_LOGO" page); next, defining the screen update mode, which is divided into two categories: automatic update and event-triggered update; automatic update is usually in the screen saver interface, using the time flag of the timer to refresh the screen content regularly; event triggering is to refresh the screen content when the display page is switched and the variables to be displayed on the current display page change; finally, defining the screen update mark, automatic update and event triggering set the mark bit, and clear the mark bit after completing the screen refresh task.
[0088] Through the above embodiments, it can be known that before responding to the received theme switching instruction, the device also includes: configuring the driving method of the LCD module; configuring the filling function; configuring the triggering method of the theme switching, etc. to build the theme framework, providing a basis for subsequent targeted processing.
[0089] In one embodiment, the MCU module uses the theme switching instruction to perform corresponding screen update processing on the LCD module, including:
[0090] Acquire multiple filling functions and refreshing functions according to the theme switching instruction;
[0091] Using a plurality of filling functions to obtain the coordinate data of the display screen of the corresponding theme resource in the LCD module;
[0092] Performing calculation based on the coordinate data and the display parameters to obtain address data of the subject resource in the MCU module;
[0093] The theme switching instruction is used to perform data filling processing on the address data and call the refresh function to implement screen updating of the LCD module.
[0094] In this embodiment, the fill function includes filling area color, filling picture data, drawing progress bar, filling font data, etc.; the coordinate data refers to the coordinate value of the theme resource in the display screen; the theme resource includes background, font, color, icon, etc.; the address data refers to the storage address of the fill area or data in the display cache RAM of the MCU module. Specifically, the theme switching instruction is used to obtain multiple fill functions and refresh functions; multiple fill functions are used to obtain the coordinate data of the display screen of the corresponding theme resource in the LCD module; based on the coordinate data and the display parameters, the address data of the theme resource in the MCU module is obtained by calculation; the address data is filled with data using the theme switching instruction and the refresh function is called to achieve screen update of the LCD module.
[0095] Through the above embodiment, multiple filling functions and refresh functions are obtained according to the theme switching instruction; the coordinate data of the display screen of the corresponding theme resource in the LCD module is obtained by using the multiple filling functions; the address data of the theme resource in the MCU module is obtained by calculation based on the coordinate data and the display parameters; the address data is filled with data and the refresh function is called by using the theme switching instruction to implement the screen update of the LCD module. Therefore, the MCU module implements the corresponding screen update of the LCD module by using the theme switching instruction, which increases the selectivity of the theme and improves the functionality.
[0096] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned device and each user can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0097] The above device can be implemented in the form of a computer program. The computer program can be Figure 3 Runs on the computer device shown.
[0098] See also Figure 3 , Figure 3 1 is a schematic block diagram of a computer device 500 provided in an embodiment of the present application. The computer device 500 includes terminal devices such as computers and servers. Figure 3 As shown, the device 500 includes a processor 502 and a memory connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0099] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 stored in the non-volatile storage medium is executed by the processor 502, the multi-theme display method based on the MCU module described above can be implemented. The processor 502 is used to provide computing and control capabilities to support the operation of the entire device 500. The internal memory 504 provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 502, the processor 502 can execute the multi-theme display method based on the MCU module described above. It can be understood by those skilled in the art that the structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the device to which the scheme of the present invention is applied. The specific device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0100] The processor 502 is used to run the computer program stored in the memory to implement the following steps:
[0101] Acquire display parameters of the LCD module, and perform calculations based on the display parameters to obtain control parameters of the MCU module;
[0102] Utilizing the control parameters to configure the MCU module;
[0103] In response to the received theme switching instruction, the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
[0104] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0105] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which can be a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0106] Therefore, an embodiment of the present application further provides a storage medium. The storage medium may be a computer-readable storage medium, and the computer-readable storage medium includes a non-volatile computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0107] Acquire display parameters of the LCD module, and perform calculations based on the display parameters to obtain control parameters of the MCU module;
[0108] Utilizing the control parameters to configure the MCU module;
[0109] In response to the received theme switching instruction, the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
[0110] In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, and the division of the units is only a logical function division, and there may be other division methods in actual implementation. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the devices, equipment and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0111] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A multi-theme display method based on MCU module, characterized in that: Applied to a multi-theme display system, the multi-theme display system includes an MCU module and an LCD module, the MCU module is communicatively connected with the LCD module, and the multi-theme display method based on the MCU module includes: Acquire display parameters of the LCD module, and perform calculations based on the display parameters to obtain control parameters of the MCU module; Utilizing the control parameters to configure the MCU module; In response to the received theme switching instruction, the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
2. The method according to claim 1, characterized in that The MCU module uses the theme switching instruction to perform corresponding screen update processing on the LCD module, including: Acquire multiple filling functions and refreshing functions according to the theme switching instruction; Using a plurality of filling functions to obtain the coordinate data of the display screen of the corresponding theme resource in the LCD module; Performing calculation based on the coordinate data and the display parameters to obtain address data of the subject resource in the MCU module; The theme switching instruction is used to perform data filling processing on the address data and call the refresh function to implement screen updating of the LCD module.
3. The method according to claim 1, characterized in that The step of calculating and processing according to the display parameters to obtain the control parameters of the MCU module includes: Analyzing the display parameters to obtain resolution, color depth and refresh rate; The display buffer capacity in the control parameter is calculated by using the resolution, the color depth and the preset memory capacity according to a preset first calculation strategy; The resolution, the color depth and the refresh rate are used to calculate according to a preset second calculation strategy to obtain the main frequency value in the control parameter.
4. The method according to claim 2, characterized in that: Before responding to the received theme switching instruction, the method further includes: Configuring a driving method for the LCD module; configuring the fill function; Configure the triggering method for theme switching.
5. A multi-theme display device based on an MCU module, characterized in that: Applied to a multi-theme display system, the multi-theme display system includes an MCU module and an LCD module, the MCU module is communicatively connected with the LCD module, and the multi-theme display device based on the MCU module includes: A calculation unit, used to obtain display parameters of the LCD module, and perform calculation processing according to the display parameters to obtain control parameters of the MCU module; A configuration unit, used to configure the MCU module using the control parameters; The updating unit is used for responding to the received theme switching instruction, and the MCU module uses the theme switching instruction to perform a corresponding screen update on the LCD module.
6. The device according to claim 5, characterized in that The MCU module uses the theme switching instruction to perform corresponding screen update processing on the LCD module, including: Acquire multiple filling functions and refreshing functions according to the theme switching instruction; Using a plurality of filling functions to obtain the coordinate data of the display screen of the corresponding theme resource in the LCD module; Performing calculation based on the coordinate data and the display parameters to obtain address data of the subject resource in the MCU module; The theme switching instruction is used to perform data filling processing on the address data and call the refresh function to implement screen updating of the LCD module.
7. The device according to claim 5, characterized in that The step of calculating and processing according to the display parameters to obtain the control parameters of the MCU module includes: Analyzing the display parameters to obtain resolution, color depth and refresh rate; The display buffer capacity in the control parameter is calculated by using the resolution, the color depth and the preset memory capacity according to a preset first calculation strategy; The resolution, the color depth and the refresh rate are used to calculate according to a preset second calculation strategy to obtain the main frequency value in the control parameter.
8. The device according to claim 6, characterized in that Before responding to the received theme switching instruction, the device further includes: Configuring a driving method for the LCD module; configuring the fill function; Configure the triggering method for theme switching.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 4 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 4 can be implemented.
Citation Information
Cited By
LCD screen circuit and miniPC control circuit
CN118197256A
An LCD screen circuit and a control circuit of a mini PC
CN118197256B