ZHCU602 December   2018

 

  1.    说明
  2.    资源
  3.    特性
  4.    应用
  5.    设计图像
  6. 1System Description
    1. 1.1 Key System Specifications
    2. 1.2 Introduction
    3. 1.3 MSP430FR2633 CapTIvate MCU
  7. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Design Considerations
    3. 2.3 Highlighted Products
      1. 2.3.1 MSP430FR2633 MCU Block Diagram
      2. 2.3.2 CapTIvate Technology Block Diagram
  8. 3Hardware, Software, Testing Requirements, and Test Results
    1. 3.1 System Design Theory
    2. 3.2 Capacitive Touch Sensors
      1. 3.2.1 Wheel Sensor
      2. 3.2.2 Slider Sensor
      3. 3.2.3 Button Sensor
    3. 3.3 Gesture and Key Mapping
      1. 3.3.1 Media Player
      2. 3.3.2 USB HID Keyboard Data
    4. 3.4 Capacitive Touch Gestures
      1. 3.4.1 How Gesture Detection Works
      2. 3.4.2 Tap Gesture
      3. 3.4.3 Double-Tap Gesture
      4. 3.4.4 Tap-and-Hold Gesture
      5. 3.4.5 Swipe Gesture
      6. 3.4.6 Slide Gesture
    5. 3.5 Getting Started With Hardware
    6. 3.6 Getting Started With Firmware
      1. 3.6.1 Programming Target MCU
      2. 3.6.2 MSP430FR2633 CapTIvate Gesture Firmware
      3. 3.6.3 Memory Footprint
      4. 3.6.4 MSP430F5529 HID Keyboard Device Firmware
    7. 3.7 Testing
      1. 3.7.1 Gesture
      2. 3.7.2 Power Measurements
      3. 3.7.3 Moisture Tolerance
  9. 4Demonstration
    1. 4.1 Wheel
      1. 4.1.1 Volume Control
      2. 4.1.2 Changing Music Tracks
        1. 4.1.2.1 Play/Pause
      3. 4.1.3 Mute
    2. 4.2 Slider
      1. 4.2.1 Volume Control
      2. 4.2.2 Changing Music Tracks
      3. 4.2.3 Play or Pause
      4. 4.2.4 Mute
    3. 4.3 Buttons
      1. 4.3.1 Volume Control
      2. 4.3.2 Changing Music Tracks
      3. 4.3.3 Play or Pause
      4. 4.3.4 Mute
  10. 5Design Files
    1. 5.1 Schematic
    2. 5.2 Bill of Materials
  11. 6Software Files
  12. 7Related Documentation
    1. 7.1 商标
  13. 8Terminology
  14. 9About the Author

USB HID Keyboard Data

Each keyboard key value is defined in the USB HID Usage Tables, Keyboard/Keypad Page (0x07), available from USB-IF. Typing these same keys or key combinations directly on the Windows keyboard controls the media player the same as the capacitive touch demo.

As shown in USB HID Usage document, each key is represented by an 8-bit value. For example, reporting the F7 key requires an 8-bit value (0x00 to 0xFF). Reporting a key-combination, such as CTRL-P requires two bytes, because two keys are being pressed simultaneously. Table 3 lists each keyboard key’s 8-bit value.

Table 3. Key Values From USB HID Usage Table for Keyboard/Keypad Page (0x07)

Keyboard Key Key Value
KEY-B 0x05
KEY-F 0x09
KEY-P 0x13
KEY-F7 0x40
KEY-F8 0x41
KEY-F9 0x42
KEY-MOD-LCTRL 0xE0

The key value is transmitted by the MSP430FR2633 to the MSP430 USB HID device over an I2C interface. When transmitting the key value, the key or key combination is reported as a 16-bit value, in which the lower byte represents the primary key and upper byte represents the key modifier, if applicable. If a key has no modifier, then the upper byte is 0x00. Table 4 lists the final 16-bit key representations that are reported to the MSP430 USB HID device.

Table 4. Media Player Functions

Media Player Function Key Combination 16-Bit Representation
Play or pause CTRL-P 0xE013
Previous music track CTRL-B 0xE005
Next music track CTRL-F 0xE009
Mute F7 0x0040
Volume up F8 0x0041
Volume down F9 0x0042