微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 模拟电路设计 > MAX1233/MAX1234触摸屏控制器入门

MAX1233/MAX1234触摸屏控制器入门

时间:03-17 来源:互联网 点击:
        1. T R KB
          Read raw keypad result
          0x8004 0x0000
          0x0040 = R3C2 key

          4.4) 从键盘中屏蔽单个按键

          使用键盘屏蔽寄存器和键盘2结果寄存器来屏蔽每个按键。屏蔽掉的按键被扫描至KPD寄存器,但是不在键盘2结果寄存器中报告。

          表17. 按键命令序列:屏蔽单个按键
          DEMO1234 Command
          Action
          SPI data in
          Verification
          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
          T W KM 0020
          Mask only R2C2 key
          0x0050 0x0020
          Press and release R1C1 (key "1")
          T R KB
          Read raw keypad result
          0x8004 0x0000
          0x0001 = R1C1 key
          T R K2
          Read masked keypad result
          0x8011 0x0000
          0x0001 = R1C1 key
          Press and release R2C2 (key "5")
          T R KB
          Read raw keypad result
          0x8004 0x0000
          0x0020 = R2C2 key
          T R K2
          Read masked keypad result
          0x8011 0x0000
          0x0000 = no key
          Press and release R3C2 (key "8")
          T R KB
          Read raw keypad result
          0x8004 0x0000
          0x0040 = R3C2 key
          T R K2
          Read masked keypad result
          0x8011 0x0000
          0x0040 = R3C2 key

          4.5) 从键盘中屏蔽一列

          使用键盘列寄存器来屏蔽所有列。不扫描屏蔽列,因此,KPD寄存器不会探测这些列中的按键。

          表18. 按键命令序列:屏蔽键盘的一列
          DEMO1234 Command
          Action
          SPI data in
          Verification
          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
          T W KK 2000
          Mask entire C2 column
          0x0051 0x2000
          Press and release R1C1 (key "1")
          T R KB
          Read raw keypad result
          0x8004 0x0000
          0x0001 = R1C1 key
          Press and release R2C2 (key "5")
          T R KB
          Read raw keypad result
          0x8004 0x0000
          (previous value)
          Press and release R3C2 (key "8")
          T R KB
          Read raw keypad result
          0x8004 0x0000
          (previous value)
          Press and release R2C3 (key "6")
          T R KB
          Read raw keypad result
          0x8004 0x0000
          0x0200 = R2C3 key

          5) 电源管理

          表19. 关断命令
          DEMO1234 Command
          Action
          SPI data in
          Verification
          T W AC C000
          Power off ADC
          0x0040 0xc000
          T W AC 0300
          Power off internal reference
          0x0040 0x0300
          REF = not driven
          T W DC 8000
          Disable DAC
          0x0042 0x8000
          DACOUT = 0.0V
          T W KC C000
          Power off keypad
          0x0041 0xc000

          6) 菜单系统

          全部源代码实现下面的控制台菜单系统,它连接至MINIQUSB+模块。

          CmodComm测试程序主菜单—在连接前
          A) adjust timing parameters
          L) CmodLog... functions
          C) connect
          D) Debug Messages
          X) exit

          对C (连接)命令的响应
          C
          Hardware supports optimized native SMBus commands.

          Board connected.

          Got board banner: Maxim MINIQUSB V01.05.41 >
          Firmware version is OK.
          (configured for SPI auto-CS 4-byte mode) (SCLK=2MHz) ...

          主菜单—连接后有效
          T) Test the device
          8) CmodP8Bus... functions
          A) adjust timing parameters
          L) CmodLog... functions
          P) CmodPin... functions
          S) CmodSpi... functions
          M) CmodSMBus... functions
          $) CmodCommStringWrite list of hex codes

          R) CmodBoardReset
          D) Disconnect

          测试菜单命令—连接后有效
          R) Read register
          W) Write register
          M0) measure no measurement; configure reference
          M1) measure X,Y
          M2) measure X,Y,Z1,Z2
          M3) measure X
          M4) measure Y
          M5) measure Z1,Z2
          M6) measure BAT1/4
          M7) measure BAT2/4
          M8) measure AUX1
          M9) measure AUX2
          MA) measure TEMP1
          MB) measure BAT1/4,BAT2/4,AUX1,AUX2,TEMP1,TEMP2
          MC) measure TEMP1,TEMP2
          MD) no measurement; drive Y+,Y-
          ME) no measurement; drive X+,X-
          MF) no measurement; drive Y+,X-
          .) Exit this menu

          6.1) 寄存器读/写命令

          表20. 读取寄存器助记符
          DEMO1234 Command
          Mnemonic
          SPI data in
          T R A1
          Test Read AUX1 register
          0x8007 0x0000
          T R A2
          Test Read AUX2 register
          0x8008 0x0000
          T R AC
          Test Read ADC_control register
          0x8040 0x0000
          T R AX
          Test Read X register
          0x8000 0x0000
          T R AY
          Test Read Y register
          0x8001 0x0000
          T R AZ1
          Test Read Z1 register
          0x8002 0x0000
          T R AZ2
          Test Read Z2 register
          0x8003 0x0000
          T R B1
          Test Read BAT1 register
          0x8005 0x0000
          T R B2
          Test Read BAT2 register
          0x8006 0x0000
          T R DC
          Test Read DAC_control register
          0x8042 0x0000
          T R DD
          Test Read DAC_data register
          0x800b 0x0000
  • Copyright © 2017-2020 微波EDA网 版权所有

    网站地图

    Top