当前位置:网站首页>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
边栏推荐
- Jupiter notebook reported an error: notebook validation failed: non unique cell ID '2a4xx6' detected
- Turn: do the right thing efficiently
- 还在用==0 null equal 判断空值吗,对isEmpty 和 isBlank有多少了解呢
- Dest0g3 520 orientation (under update)
- Worthington产气荚膜梭菌神经氨酸酶的特征及测定
- 登堂入室soc之arm汇编基础
- Dataframe modifies the value of a row or column position
- 一款可插拔的AM335X工控模块板载wifi模块
- [Verilog digital system design (Xia Yuwen) 3 ----- basic concepts of Verilog syntax 1]
- Ti AM335X工控模块使用beaglebone(bbb)的Debian系统
猜你喜欢

DialogRPT-Dialog Ranking Pretrained Transformers

1. Mx6ul core module use serial RTC test (XII)

【2021】【论文笔记】6G技术愿景——OTFS调制技术

I.MX6UL核心模块使用连载-TF卡读写测试 (五)

餐饮连锁门店重塑增长背后的数字化转型

I.MX6UL核心模块使用连载-触摸屏校准 (九)

What is the difference between for... In... And for... Of
![[independent station construction] Shopify seller: learn these points and double the sales volume of online stores!](/img/52/8c1520db38ffa8927e975b6f244a65.png)
[independent station construction] Shopify seller: learn these points and double the sales volume of online stores!

Dest0g3 520 orientation (under update)

I.MX6UL核心模块使用连载-USB接口测试 (六)
随机推荐
What are the functions of cloud notes, and how do browsers add cloud note plug-ins
The import and Export button of Damon database table is gray, and the DMP file cannot be imported
Turn: do the right thing efficiently
npm ERR! code ETIMEDOUTnpm ERR! syscall connectnpm ERR! errno ETIMEDOUTnpm ERR! network request t
Dqn pytoch example
[C language brush leetcode] 443. Compressed string (m)
MPLS knowledge points
【LeetCode】32、 最长有效括号
pdf. JS introduction
Redis6.x配置参数详解
Alibaba cloud redis development specification
1205 Lock wait timeout exceeded; Try restarting transaction processing
1. Mx6ul core module use serial RTC test (XII)
Jupiter notebook reported an error: notebook validation failed: non unique cell ID '2a4xx6' detected
pt-onnx-ncnn转换的问题记录(接yolov5训练)
SQLyog数据导入导出图文教程
【2021】【论文笔记】6G技术愿景——OTFS调制技术
Protect syslog servers and devices
JS add random pixel noise background to the page
IDEA如何快速删除最近打开的项目