MAX1233/MAX1234触摸屏控制器入门

[09-13 17:05:19]   来源:http://www.88dzw.com  控制技术   阅读:8648

文章摘要:4.2) 读写GPIO引脚GPIO数据寄存器读取GPIO输入引脚,写入GPIO输出引脚。注意:在这些例子中,C3、C4和R4是引脚名称,而不是元件名称。表15. GPIO实例 DEMO1234 CommandActionSPI data inVerificationT W GC C8C0Keypad:(C2,C1) x (R3,R2,R1);GPIO outputs: C4,C3;GPIO input: R40x004f 0xc8c0T W GP 4000GPIO pullup disable: C30x004e 0x4000Connect external resistor between

MAX1233/MAX1234触摸屏控制器入门,标签:计算机控制技术,工厂电气控制技术,http://www.88dzw.com

4.2) 读写GPIO引脚

GPIO数据寄存器读取GPIO输入引脚,写入GPIO输出引脚。注意:在这些例子中,C3、C4和R4是引脚名称,而不是元件名称。

表15. GPIO实例
DEMO1234 Command
Action
SPI data in
Verification
T W GC C8C0
Keypad:
(C2,C1) x (R3,R2,R1);
GPIO outputs: C4,C3;
GPIO input: R4
0x004f 0xc8c0
T W GP 4000
GPIO pullup disable: C3
0x004e 0x4000
Connect external resistor between C3 pin and DVDD
Connect DVM to C4 pin
T W GD 8000
GPIO write C4 = 1
0x000f 0x8000
C4 pin = high
T W GD 0000
GPIO write C4 = 0
0x000f 0x0000
C4 pin = low
T W GD 8000
GPIO write C4 = 1
0x000f 0x8000
C4 pin = high
T W GD 0000
GPIO write C4 = 0
0x000f 0x0000
C4 pin = low
Connect DVM to C3 pin
T W GD 4000
GPIO write C3 = 1
0x000f 0x4000
C3 pin = high
T W GD 0000
GPIO write C3 = 0
0x000f 0x0000
C3 pin = low
T W GD 4000
GPIO write C3 = 1
0x000f 0x4000
C3 pin = high
T W GD 0000
GPIO write C3 = 0
0x000f 0x0000
C3 pin = low
Connect R4 pin to DVDD
T R GD
GPIO read
0x800f 0x0000
Buffer = 0x0800
Connect R4 pin to GND
T R GD
GPIO read
0x800f 0x0000
Buffer = 0x0000

4.3) 检测按键:自动扫描

可以配置键盘控制寄存器在探测到有按键按下时,自动扫描键盘。

表16. 按键命令序列:自动扫描
DEMO1234 Command
Action
SPI data in
Verification
Optional: connect oscilloscope to KEYIRQ-bar
I C 0 3
Configure KEYIRQ-bar pulse accumulator: falling-edge trigger
I 0 0
Reset the pulse accumulator
I R 0
Read the number of times KEYIRQ-bar has pulsed low count = 0
T W GC 0000
Keypad:
(C4,C3,C2,C1) x (R4,R3,R2,R1);
GPIO outputs: none;
GPIO inputs: none
0x004f 0x0000
T W KC bf00
Wait for keypress;
maximum debounce and hold times
0x0041 0xbf00
Press and release R1C1 (key "1") KEYIRQ pulse
I R 0
Read the number of times KEYIRQ-bar has pulsed low count has increased
T R KB
Read raw keypad result
0x8004 0x0000
0x0001 = R1C1 key
Press and release R2C2 (key "5") KEYIRQ pulse
I R 0
Read the number of times KEYIRQ-bar has pulsed low count has increased
T R KB
Read raw keypad result
0x8004 0x0000
0x0020 = R2C2 key
Press and release R3C2 (key "8") KEYIRQ pulse
I R 0
Read the number of times KEYIRQ-bar has pulsed low count has increased
T R KB
Read raw keypad result
0x8004 0x0000
0x0040 = R3C2 key

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]  下一页


Tag:控制技术计算机控制技术,工厂电气控制技术控制技术