Digital television receiver with keyboard
Technical field
The present invention relates to a kind of digital television receiver, especially relate to a kind of digital television receiver of realizing external connection keyboard by key scan.
Background technology
In Digital Television development and universal process, in order to meet different customer demands, operator provides more TV programme, digital television program service other value-added services in addition also are provided, such as stock system, gaming platform service, to meet different groups user's individual sexual demand.
Simultaneously, increasing along with the digital television receiver practical function, and the fast development of electronic information technology, FLASH memory and the memory size of digital television receiver increase day by day, and the operating rate of the processor of digital television receiver also improves greatly, for integrated advanced games software in digital television receiver provides possibility.
On current digital television receiver, integrated game is all some trivial games, as Chinese chess, push box, Tetris etc., although it is less to move the system resource of these game needs, but these trivial games are difficult to attract more game player in content, and can only realize by remote controller key on game operation, there is the defect of inconvenient operation.
How keyboard and the mouse action of similar PC are provided for digital television receiver, with user-friendly, have become one of technical problem that current urgent need solves.
Summary of the invention
The invention reside in and propose a kind of digital television receiver with keyboard, carry out key scan by the SPI interface and realize external connection keyboard in digital television receiver, thereby solve the Contemporary Digital television receiver, can only operate and have unhandy technical problem by remote controller.
The present invention adopts following technical scheme to realize: a kind of digital television receiver with keyboard, the line scan signals of external keyboard matrix circuit and column scan signal all are coupled to the processor of digital television receiver, by processor, are obtained scan code the key for searching code table key range of keyboard matrix circuit and are carried out the predetermined operation of button.
Wherein, the line scan signals of keyboard matrix circuit and column scan signal all are connected to the I/O interface of processor.
Wherein, the quantity of the quantity of line scan signals and column scan signal equates.
Wherein, keyboard matrix circuit is by the SPI processor of interface connection.
Wherein, 3 GPIO interfaces on processor are connected the driving chip for the driving display part by the data wire of SPI clock signal, SPI respectively with chip selection signal; And a plurality of switching signals that drive chip connect keyboard matrix circuit and are multiplexed with respectively keyboard matrix circuit sweep signal and column scan signal, by driving chip obtain the scan code of keyboard matrix circuit and pass to processor.
Compared with prior art, the present invention has following beneficial effect:
The present invention takes full advantage of the hardware of existing digital television receiver, complete the scanning of keyboard or realize external connection keyboard by the keyboard matrix of SPI interface scans drive circuit by the I/O interface with processor, have advantages of and realize simple and realize that cost is low, and external connection keyboard is convenient to user's operation, is conducive to the future development of digital television receiver towards high-endization, interaction platform.
The accompanying drawing explanation
Fig. 1 is the circuit diagram of the present invention the 1st embodiment;
Fig. 2 is the schematic flow sheet of the 1st embodiment;
Fig. 3 is the circuit diagram of the present invention the 2nd embodiment;
Fig. 4 is the sequential chart of the 2nd embodiment;
Fig. 5 is the schematic flow sheet of the 2nd embodiment.
Embodiment
The present invention utilizes existing digital television receiver (being designated hereinafter simply as main frame) to have under the prerequisite of high speed processor and mass storage, realizes the keyboard of key scan working method by expansion on extended interface reserved on the monitor board of main frame.
As shown in Figure 1, the present embodiment is to access keyboard matrix circuit on a plurality of I/O interfaces of the directly processor U1 in main frame, such as, if adopt 4 * 4 keyboard matrix circuit, on processor U1, define I/O1~I/O8 totally 8 I/O interfaces realize keyboard scan.Wherein, I/O1~I/O4 of processor U1 is as the column scan of keyboard matrix circuit, and I/O5~I/O8 is as the line scanning of keyboard matrix circuit; When certain button of pressing wherein, the I/O interface be connected with the button two ends just communicates, identical level value is arranged, processor U1 obtains scan code by the value of scans I/O1~I/O8, utilizing the judgement of scan code key for searching code table is which button is pressed, then according to setting, operate accordingly, as shown in Figure 2.
For example, when in keyboard matrix circuit, any button all is not pressed, I/O1~I/O8 is high level, so the time scan code be binary one 1111111; When button SW1 is pressed, now I/O4 and I/O5 are low level, and scan code now is binary one 1100111, and processor U1 searches this scan code in the key table, and can judge is that the SW1 button is pressed.
The 2nd embodiment as shown in Figure 3, the present embodiment is to utilize LED to drive chip U2 to realize, the method realized is also by Serial Peripheral Interface (SPI) (Serial Peripheral Interface, SPI) realize key scan, advantage is to save the I/O mouth, do not need extra keyboard scanning circuit, realize that cost is low.Wherein, drive chip U2 to be connected 3 GPIO interfaces on processor U1 with chip selection signal (STB) by the data wire (DATA) of SPI clock signal (CLK), SPI, and drive chip U2 for driving display part U3 (such as being LED).K switch 1, K2 and KS1~KS8 forms the keyboard matrix of 2*8=16, and wherein, K switch 1, K2 are line scan signals, and K switch S1~KS8 is column scan signal.
Wherein, sequential and the step of reading key assignments by the SPI interface are shown in respectively shown in Fig. 4 and Fig. 5.When chip selection signal is significant level, when in the period 1, certain button is pressed, now, processor U1 is by data wire to driving chip U2 to send the control command that reads key assignments, and the command address of key assignments is read in input, by driving chip U2 to read key assignments or scan code; In the period 2, drive chip U2 that key assignments is sent to processor U1, processor U1 reads key assignments or scan code; Then searched this scan code in the key table by processor U1, can judge is that concrete which button is pressed, and carries out the predetermined respective operations of this button and process.
As for external access of mouse in digital television receiver, its implementation is fairly simple.The existing integration USB functional module of present a lot of digital television receiver, this USB functional module can be supported external access of mouse.If there is no the integration USB functional module in digital television receiver, can be by increase the USB transmission circuit in digital television receiver, and use external memory interface (External Memory Interface, EMI) bussing technique to support external access of mouse, be not described in detail in this.
To sum up, this case takes full advantage of the hardware of existing digital television receiver, complete the scanning of keyboard or realize external connection keyboard by the keyboard matrix of SPI interface scans drive circuit by the I/O interface with processor, have advantages of and realize simple and realize that cost is low, and external connection keyboard is convenient to user's operation, is conducive to the future development of digital television receiver towards high-endization, interaction platform.