当前位置:网站首页>Design and driver transplantation of matrix keyboard circuit of Ti am335x industrial control module
Design and driver transplantation of matrix keyboard circuit of Ti am335x industrial control module
2022-07-26 02:03:00 【szembed】
The verification of this content uses yingpengfei embedded CoM-335x Core module and Evaluation Board EAC-335X, The brief introduction is as follows :

Preface
Compared with keys , Matrix key ( keyboard ) Use less GPIO Implement more key interfaces . following , be based on COM-335x Core module , Introduce linux The coding practice process of matrix keyboard in embedded system , Simply from the principle 、 Key value code description .
1 Principle introduction
Press the effective electric bisector of the key , It can be divided into high-level trigger and low-level trigger . In a general way , Button triggered by high level , In principle design, the uplink address is pulled down by resistance ; Low level trigger , Line address pull up . Separately shown 1-1、 chart 1-2 Shown , Pay attention to the trigger level when configuring the software .


Software level ,Linux input Subsystems provide support . Its architecture is shown in the figure 1-3, More about input Subsystem , Please refer to resources or kernel code .

2 Key configuration
Key configuration focuses on two issues , One is IO Distribute , The second is the key value .IO Distribute according to the principle , Pay attention to the effective level 、 The row is configured as input ; Key values can be obtained in two ways , Manual calculation and function call . The following two sections introduce section 1 How to configure the keys in Chapter .
2.1 Key configuration triggered by high level
, chart 1-1 The key for is 3 That's ok 2 Column , Line address drop-down .IO Configure line input 、 Column output 、 The drop-down 、 High level trigger , stay COM-335x Of dts The configuration in is as follows :

notes : In the above code list , The red font is the line address IO Distribute , Black is the column address IO Distribute .

notes :
① In the above code list , each GPIO The average effective electricity is high , namely :GPIO_ACTIVE_HIGH;
② debounce-delay-ms It means time to shake , The unit is millisecond ;
③ col-scan-delay-us Indicates the column scan interval , In microseconds .
④ linux,keymap The value of the attribute is the key value , It is calculated that . The calculation formula is shown in the figure 2-1:

With “MENU” For example , Its “linux,keymap” The value of is calculated as follows :

from include/dt-bindings/input/linux-event-codes.h In file , find MENU The value of is 139, namely 16 It's binary 8B( common 4 position 16 Hexadecimal number , Insufficient high-level compensation 0), Pictured 2-2 Shown .

chart 2-2
Sum up ,32~25 Bit is line number 、24~17 Position is listed 、 low 16 Bit is key value , convert to 16 Hexadecimal numbers are easy to read (4 position 2 A decimal number means 1 position 16 Hexadecimal number ).0x0000008b Express 0 That's ok 0 Column 、 The key value is 139.
2.2 Key configuration triggered by low level
chart 1-2 The key for is 6 That's ok 3 Column , Line address pull up .IO Configure line input 、 Column output 、 Pull up 、 Low level trigger , stay COM-335x Of dts The configuration in is as follows :

notes : In the above code list , The red font is the line address IO Distribute , Black is the column address IO Distribute .



notes :
① gpio-activelow Indicates low level trigger , If there is no such attribute , It means that the high level is valid ;
② linux,no-autorepeat Indicates that key repetition is disabled , namely : Long press a key , Print only once ;
③ call MATRIX_KEY Function calculates the key value , This method is better than 2.1 Section is intuitive , Please run the function as shown in the figure 2-3, The definition of key value is still from include/dt-bindings/input/linux-event-codes.h From the file .

chart 2-3
边栏推荐
- How to display numbers / English time in Excel
- 1205 Lock wait timeout exceeded; Try restarting transaction processing
- G2. passable paths (hard version) (tree diameter + LCA)
- DialogRPT-Dialog Ranking Pretrained Transformers
- E2. escape the maze (hard version)
- [C language brush leetcode] 814. Binary tree pruning (m)
- Worthington nuclease and Micrococcus related research and determination scheme
- E. OpenStreetMap (2D monotone queue)
- 大佬们, flinksql datahub源表,源表有字段 timestamp 16位, 写入Ora
- 1. Mx6ul core module serial Ethernet test (VII)
猜你喜欢

Create a future and enjoy extraordinary | gbase Nantah General Motors unveiled opengauss Developer Day 2022

Worthington nuclease and Micrococcus related research and determination scheme

I.MX6UL核心模块使用连载-RTC测试 (十二)

还在用==0 null equal 判断空值吗,对isEmpty 和 isBlank有多少了解呢

Implementation of C iterator

What is the difference between for... In... And for... Of

Ti AM335X工控模块使用beaglebone(bbb)的Debian系统

Sqlyog data import and export graphic tutorial
![[leetcode] 32. Longest valid bracket](/img/5e/45bb0b1ca3d9e429c6c5cf5c4c93ae.png)
[leetcode] 32. Longest valid bracket

I.MX6UL核心模块使用连载-nand flash读写测试 (三)
随机推荐
1. Mx6ul core module serial WiFi test (VIII)
I.MX6UL核心模块使用连载-以太网测试 (七)
Sqlyog data import and export graphic tutorial
Phoenix中常用shell操作
Ti AM335X工控模块使用beaglebone(bbb)的Debian系统
Guys, the flinksql datahub source table has a field timestamp 16 bits, which is written to ora
Software group verification
[leetcode] 32. Longest valid bracket
I.MX6UL核心模块使用连载-nand flash读写测试 (三)
[independent station construction] Shopify seller: learn these points and double the sales volume of online stores!
D. Permutation restoration (greedy + double pointer)
These practical security browser plug-ins improve your efficiency
Redis6.x配置参数详解
[in simple terms, play with FPGA learning 11 --- testbench writing skills 1]
MPLS knowledge points
1205 Lock wait timeout exceeded; Try restarting transaction processing
登堂入室soc之编程基础环境变量设置
MySQL locking table problem
Worthington papain - production of glycopeptides from purified proteoglycans (attached Literature)
DialogRPT-Dialog Ranking Pretrained Transformers