Key lamp control method, device and system and key lamp system

文档序号:1381943 发布日期:2020-08-14 浏览:25次 中文

阅读说明:本技术 按键灯控制方法、装置及系统和按键灯系统 (Key lamp control method, device and system and key lamp system ) 是由 周晶晶 王晓虎 于 2019-01-21 设计创作,主要内容包括:本发明实施例涉及一种按键灯控制方法以及相对应的控制装置、控制系统和按键灯系统。所述控制方法例如包括:获取按键信息;根据所述按键信息获取按键灯控制信息,其中所述按键灯控制信息包含按键灯地址和对应所述按键灯地址的多个颜色按键灯数据;将所述多个颜色按键灯数据按照所述按键灯地址分别写入多个存储器,以更新所述多个存储器内分别存储的多个颜色按键灯数据集;以及将所述多个存储器内分别存储的所述多个颜色按键灯数据集以串行方式同时输出。本发明实施例可以克服按键灯数量多所造成的I/O口不够用的问题。(The embodiment of the invention relates to a key lamp control method, a corresponding control device, a control system and a key lamp system. The control method includes, for example: acquiring key information; acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address; respectively writing the color key lamp data into a plurality of memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the memories; and simultaneously outputting the plurality of color key lamp data sets stored in the plurality of memories in a serial manner. The embodiment of the invention can overcome the problem of insufficient I/O ports caused by the large number of key lamps.)

1. A key lamp control method, comprising:

acquiring key information;

acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address;

respectively writing the color key lamp data into a plurality of memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the memories; and

and simultaneously outputting the plurality of color key lamp data sets respectively stored in the plurality of memories in a serial manner.

2. The key lamp control method according to claim 1, wherein said acquiring key lamp control information based on the key information comprises: and acquiring the key lamp control information from a pre-stored mapping table according to the key information.

3. The key lamp control method according to claim 1 or 2, wherein the memories are dual port random access memories respectively and share an address line;

the key light control information contains a key light address and two colors corresponding to the key light address, and the two colors are red key light data and green key light data.

4. A key lamp control apparatus, comprising:

the acquisition module is used for receiving key information;

the mapping module is used for acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address;

the updating module is used for respectively writing the color key lamp data into a plurality of memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the memories; and

and the output module is used for simultaneously outputting the color key lamp data sets stored in the memories in a serial mode.

5. The key light control device according to claim 4, wherein the mapping module is specifically configured to obtain the key light control information from a pre-stored mapping table according to the key information.

6. A key light control device according to claim 4 or 5 wherein the plurality of memories are respectively dual port random access memories and share address lines; the key light control information contains a key light address and two colors corresponding to the key light address, and the two colors are red key light data and green key light data.

7. A key lamp control system, comprising: a processor and a memory coupled to the processor; wherein the memory stores instructions for execution by the processor, and the instructions cause the processor to perform operations to perform a key light control method as recited in any of claims 1-3.

8. A key light system, comprising:

the color key lamp groups comprise a plurality of key lamps with the same color;

the plurality of series-in and parallel-out driving chip sets are respectively connected with the plurality of color key lamp sets, wherein each series-in and parallel-out driving chip set comprises a plurality of series-in and parallel-out driving chips which are cascaded; and

a programmable logic device connected to the plurality of serial-in and parallel-out driver chipsets and configured to:

acquiring key information;

acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address;

respectively writing the color key lamp data into a plurality of internal memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the internal memories; and

and simultaneously outputting the color key lamp data sets stored in the internal memories to the serial input and output driving chip sets in a serial mode so as to refresh the states of the color key lamp sets.

9. The key light system of claim 8, wherein the obtaining key light control information according to the key information comprises: and acquiring the key lamp control information from a pre-stored mapping table according to the key information.

10. The key lamp system according to claim 8 or 9, wherein the plurality of internal memories are respectively dual port random access memories and share address lines; the color key lamp groups comprise a red key lamp group and a green key lamp group, and one red key lamp in the red key lamp group and one corresponding green key lamp in the green key lamp group correspond to one key; and the series-in parallel-out driving chip is a constant current driving chip.

Technical Field

The invention relates to the technical field of embedded equipment control, in particular to a key lamp control method, a key lamp control device, a key lamp control system and a key lamp system.

Background

What traditional key light adopted is Pulse Width Modulation (PWM) drive mode, realizes monochromatic luminance control through adjusting PWM's duty cycle, and double-colored lamp then needs two solitary PWM passageways to carry out independent control, just can realize the adjustment of different colours, different luminance, and adopts the mode of chip pin direct drive under most circumstances.

However, a large-sized operation console usually has many keys, each key corresponds to an indicator light (monochrome or dual-color), and as the functions of the product are rich, the functions of each key light are also more rich, but the number of I/O pins of a main control chip of the operation console is usually limited, and an independent channel cannot be allocated for each key light for control.

Disclosure of Invention

Therefore, to overcome the defects and shortcomings of the prior art, embodiments of the present invention provide a key lamp control method, a key lamp control device, a key lamp control system, and a key lamp system.

On one hand, the key lamp control method provided by the embodiment of the invention comprises the following steps: acquiring key information; acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address; respectively writing the color key lamp data into a plurality of memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the memories; and simultaneously outputting the plurality of color key lamp data sets stored in the plurality of memories in a serial manner.

In an embodiment of the present invention, the obtaining of the key lamp control information according to the key information includes: and acquiring the key lamp control information from a pre-stored mapping table according to the key information.

In an embodiment of the present invention, the memories are dual-port random memories respectively and share an address line, the key lamp control information includes a key lamp address and two color key lamp data corresponding to the key lamp address, and the two color key lamp data are red key lamp data and green key lamp data.

On the other hand, a key lamp control device provided in an embodiment of the present invention includes: the acquisition module is used for receiving key information; the mapping module is used for acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address; the updating module is used for respectively writing the color key lamp data into a plurality of memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the memories; and the output module is used for simultaneously outputting the color key lamp data sets stored in the memories in a serial mode.

In an embodiment of the present invention, the mapping module is specifically configured to obtain the key lamp control information from a pre-stored mapping table according to the key information.

In one embodiment of the invention, the plurality of memories are respectively dual-port random memories and share address lines; the key light control information contains a key light address and two colors corresponding to the key light address, and the two colors are red key light data and green key light data.

In another aspect, a key lamp control system provided in an embodiment of the present invention includes: a processor and a memory coupled to the processor; the memory stores instructions executed by the processor, and the instructions cause the processor to perform operations to perform any one of the key lamp control methods.

In another aspect, a key lamp system provided in an embodiment of the present invention includes: the color key lamp groups comprise a plurality of key lamps with the same color; the plurality of series-in and parallel-out driving chip sets are respectively connected with the plurality of color key lamp sets, wherein each series-in and parallel-out driving chip set comprises a plurality of series-in and parallel-out driving chips which are cascaded; and the programmable logic device is connected with the plurality of serial-in and parallel-out driving chip groups. The programmable logic device is to: acquiring key information; acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address; respectively writing the color key lamp data into a plurality of internal memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the internal memories; and outputting the color key lamp data sets stored in the internal memories to the serial-in parallel-out driving chip sets simultaneously to refresh the states of the color key lamp sets.

In an embodiment of the present invention, the obtaining of the key lamp control information according to the key information includes: and acquiring the key lamp control information from a pre-stored mapping table according to the key information.

In one embodiment of the invention, the plurality of internal memories are respectively dual-port random memories and share address lines; the color key lamp groups comprise a red key lamp group and a green key lamp group, and one red key lamp in the red key lamp group and one corresponding green key lamp in the green key lamp group correspond to one key; and the series-in parallel-out driving chip is a constant current driving chip.

As can be seen from the above, the above technical features of the present invention may have one or more of the following advantages: (a) the response speed is high, and the single chip refreshing period is short; (b) the multi-memory structure isolates the state refreshing of the key lamp and the data updating writing; (c) the single address and the multiple data can simultaneously control the states of two color key lamps of a multi-color key lamp such as a two-color key lamp; (d) the mapping table is flexibly suitable for various control protocols at the front end; and (e) the expansion and deletion of the number of key lamps can be completed only by changing the size of the memory and the mapping table.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a flowchart of a key lamp control method according to a first embodiment of the present invention.

Fig. 2 is a schematic structural diagram of a key lamp system according to a first embodiment of the present invention.

Fig. 3 is a schematic diagram of an internal implementation architecture of the programmable logic device shown in fig. 2.

Fig. 4 is a schematic block diagram of a key lamp control device according to a second embodiment of the present invention.

Fig. 5 is a schematic structural diagram of a key lamp control system according to a third embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

[ first embodiment ] A method for manufacturing a semiconductor device

As shown in fig. 1, a key lamp control method according to a first embodiment of the present invention includes:

s11: acquiring key information;

s13: acquiring key lamp control information according to the key information, wherein the key lamp control information comprises a key lamp address and a plurality of color key lamp data corresponding to the key lamp address;

s15: respectively writing the color key lamp data into a plurality of memories according to the key lamp addresses so as to update a plurality of color key lamp data sets respectively stored in the memories; and

s17: and simultaneously outputting the plurality of color key lamp data sets respectively stored in the plurality of memories in a serial manner.

In order to more clearly understand the key light control method of the present embodiment, the following description will be made in detail with reference to fig. 2 and 3 by taking an example that each key corresponds to a two-color key light (for example, a red key light and a green key light).

As shown in fig. 2, in the key lamp system of the present embodiment, a plurality of driving chips 231-23M and 251-25M, such as constant current driving chips (for example, MBI5041 type chips), are connected in two groups and cascaded to the programmable logic device 21 to drive a plurality of color key lamps, such as a plurality of red (R) LED lamps and a plurality of green (G) LED lamps. Each KEY corresponds to two color KEY lights (collectively referred to as two-color KEY lights), such as one red LED light and one green LED light. The LED lamps with the same color are connected with the output pins of the same group of series-in and parallel-out driving chips, and the LED lamps with different colors are connected with the output pins of different groups of series-in and parallel-out driving chips; for example, red LED lamp connections are connected in series into and out of driver chips 231-23M (or 251-25M), and green LED lamp connections are connected in series into and out of driver chips 251-25M (or 231-23M).

Each of the serial-in and parallel-out driving chips 231-23M and 251-25M has N output channels which can be connected with N LED lamps with the same color; in this way, for the plurality of serial-in and parallel-out driving chips 231-23M and 251-25M, each two output channels control the color display of one KEY, and the two output channels respectively correspond to the red LED lamp and the green LED lamp, and different colors can be displayed by different brightness combinations.

The common serial-in parallel driver chips 231-23M and 251-25M use a serial mode to press the color key lamp data into an internal register, and then the serial-in parallel driver chips 231-23M and 251-25M control the output current according to the value in the register, thereby achieving the purpose of controlling the brightness. The data to be displayed here can be multi-bit data such as 16-bit data for a single output channel, so that the multi-bit color key lamp data needs to be serialized in the serial output process. The serialization adopts a small-end mode, namely, the low bit is in front of the high bit. Each of the serial-in parallel driver chips 231-23M and 251-25M may drive, for example, 16(N ═ 16) channels of output, so that 16 color key lamp data of each of the serial-in parallel driver chips 231-23M and 251-25M need to be serialized 16 by 16 times. According to the difference of the number of the LED lamps, the number of chips used is also different, and the number of times of serialization is also different, a specific calculation formula is SerialCnt 16M, where M is the number of serial-in and parallel-out driving chips in each group, and a process of completely updating all registers in the serial-in and parallel-out driving chips 231-23M and 251-25M is referred to as a state refresh operation. In order to ensure the real-time response of the key lamp, the embodiment adopts a cyclic refreshing mode, and the refreshing period calculation formula is as follows: the frequency of serial data transmission is about 100Mhz, and different frequencies can be adopted according to different serial-in parallel driving chips, and the higher the frequency supported by the chips, the faster the refresh rate. Through calculation, under normal conditions, if each group of ten series-in parallel-out driving chips is cascaded, the refreshing period is 25 μ s, and the average series-in parallel-out driving chip is 2.5 μ s, the display requirement can be completely met.

Bearing the above, in order to accomplish real-time refreshing, need to save the colour button lamp data, the purpose of storage has two: 1) ensuring fast response to refresh required data; and 2) isolating the data updating operation and the state refreshing operation of the key lamp, and ensuring that the two operations do not influence each other.

Since a single key corresponds to two color key lamps, i.e., red and green, this embodiment adopts a dual RAM (Random Access Memory) structure for storing data, as shown in fig. 3. RAM _ R is red key light data memory, RAM _ G is green key light data memory, RAM _ R and RAM _ G's left side is the input, and the right side is state refresh output. The left input end is respectively provided with an address input port and a data input port; the data input port of the RAM _ R and the input data port of the RAM _ G respectively represent red data and green data of each two-color key lamp, and the two RAMs (namely the RAM _ R and the RAM _ G) share an address line, so that a common address can be allocated to the two color key lamps of each key, the data of the two RAMs (namely the RAM _ R and the RAM _ G) can be updated simultaneously during data updating operation, and an independent address does not need to be allocated to each color key lamp in the same two-color key lamp, so that the operation is very convenient. In addition, the input and the output of the double-RAM structure are independent clock domains, so that the data updating operation and the state refreshing operation are well isolated, the influence between reading and writing is greatly reduced, and the intuitive expression is very high response speed.

The role of the ROM in fig. 3 is to map the key information (corresponding to logical addresses) to the key lamp control information (including the key lamp physical addresses). It is worth mentioning that in the product development stage of the embedded device, for example, the programming of the front-end MCU usually requires great flexibility, which requires that the logical address of the key lamp can be changed frequently, and the change of the protocol brings great workload to the bottom layer development before, so that the present embodiment adopts the ROM mapping table to store the mapping relationship between the logical address and the physical address of the key lamp, such as the LED lamp; when the system works, when a logical address is input, the ROM outputs a physical address according to a pre-stored ROM mapping table, and after the logical address of each key lamp is changed by the front-end MCU, only the mapping table stored in the ROM needs to be changed, and the system is not needed to be realized by adjusting a program, so that the system is convenient and flexible to apply.

In addition, in the aspect of expansibility, the serial-in and parallel-out driving chips adopt a cascading mode, data are transmitted in a mode of shift registers, namely, the number of the serial-in and parallel-out driving chips is the number of the shift registers, and data required by each serial-in and parallel-out driving chip for driving and controlling the color key lamps occupy one area in the double RAMs, so that when the number of keys needs to be expanded or reduced, the sizes of the two RAMs are only required to be adjusted and mapping tables in the ROMs are only required to be changed, the whole change is very small, and the method can be applied to different occasions.

As can be seen from the above, the key lamp control method of the present embodiment may have the following features: (a) the response speed is high, and the single-chip refreshing period is about 2.5 mu s; (b) the double-RAM structure isolates the state refreshing of the key lamp and the data updating and writing; (c) the single address double data can simultaneously control the states of two color key lamps of the double-color key lamp; (d) the ROM mapping table is flexibly adapted to various control protocols of the MCU at the front end; and (e) the expansion and deletion of the number of key lamps can be completed only by changing the size of the RAM and the ROM mapping table.

It should be noted that the foregoing embodiment is described by taking a two-color key lamp as an example, but the embodiment of the present invention is not limited thereto, and three RAMs may be correspondingly configured for other multi-color key lamps, such as three-color key lamps of red, green, and blue. Of course, embodiments of the present invention do not exclude implementation of a monochrome key lamp.

[ second embodiment ]

As shown in fig. 4, a key lamp control device 40 according to a second embodiment of the present invention includes: an acquisition module 41, a mapping module 43, an update module 45, and an output module 47.

The obtaining module 41 is, for example, configured to receive key information; the mapping module 43 is, for example, configured to obtain key light control information according to the key information, where the key light control information includes a key light address and a plurality of color key light data corresponding to the key light address; the updating module 45 is, for example, configured to write the color key lamp data into a plurality of memories according to the key lamp addresses, respectively, so as to update a plurality of color key lamp data sets stored in the memories, respectively; and an output module 47, for example, for outputting the plurality of color key lamp data sets stored in the plurality of memories respectively simultaneously in a serial manner.

For specific functional details of the obtaining module 41, the mapping module 43, the updating module 45 and the output module 47, reference may be made to the detailed description in the foregoing first embodiment, and no further description is given here. Further, it is noted that the obtaining module 41, the mapping module 43, the updating module 45 and the output module 47 may be software modules, stored in a non-volatile memory and executed by a processor to perform the operations of steps S11, S13, S15 and 17 in the first embodiment. In one embodiment, fetch module 41, mapping module 43, update module 45, and output module 47 are, for example, integrated with programmable logic device 21.

[ third embodiment ]

As shown in fig. 5, a key light control system 50 according to a third embodiment of the present invention includes: a processor 51 and a memory 53; the memory 53 stores instructions executed by the processor 51, and the instructions cause the processor 51 to perform operations to perform the key lamp control method according to the first embodiment.

Furthermore, an embodiment of the present invention also provides, for example, a computer-readable storage medium which is a non-volatile memory and stores program codes, and when the program codes are executed by one or more processors, for example, the one or more processors are caused to execute the parameter backup method described in the foregoing first embodiment and/or the key lamp control method described in the foregoing third embodiment.

In addition, it should be understood that the foregoing embodiments are merely exemplary illustrations of the present invention, and technical solutions of the embodiments can be arbitrarily combined and used without conflict between technical features and structures, and without departing from the purpose of the present invention.

In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and/or method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units/modules is only one logical division, and there may be other divisions in actual implementation, for example, multiple units or modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units/modules described as separate parts may or may not be physically separate, and parts displayed as units/modules may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units/modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.

In addition, each functional unit/module in the embodiments of the present invention may be integrated into one processing unit/module, or each unit/module may exist alone physically, or two or more units/modules may be integrated into one unit/module. The integrated units/modules may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units/modules.

The integrated units/modules, which are implemented in the form of software functional units/modules, may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing one or more processors of a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于网络控制的灯光分区域节能照明控制系统及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!