SH 2 Reference Manual V1.2
SH-2-Reference-Manual-v1.2
User Manual: Pdf
Open the PDF directly: View PDF .
Page Count: 83
Download | |
Open PDF In Browser | View PDF |
SH-2 Reference Manual Document Number: 1000-3625 Document Revision: 1.2 Date: 05/19/2017 Hillcrest Laboratories, Inc. 15245 Shady Grove Road, Suite 400 Rockville, MD 20850 Copyright © 2017 Hillcrest Labs, Inc. All rights reserved. Table of Contents LIST OF FIGURES ............................................................................................................... 4 1.0 INTRODUCTION ....................................................................................................... 7 1.1 1.2 1.3 2.0 3.0 Intended Audience ................................................................................................................. 7 Scope ..................................................................................................................................... 7 Revision History ..................................................................................................................... 7 SENSOR USAGE ..................................................................................................... 8 HOST INTERFACES ............................................................................................... 10 3.1 UART Interface.....................................................................................................................10 3.1.1 S-format Output Packet ....................................................................................................10 3.1.2 L-format Output Packet ....................................................................................................10 3.1.3 H-format Output Packet....................................................................................................11 4.0 CONFIGURATION .................................................................................................. 13 4.1 Flash Storage .......................................................................................................................13 4.2 RAM Storage ........................................................................................................................13 4.3 Records ................................................................................................................................13 4.3.1 Static Calibration ..............................................................................................................13 4.3.2 Dynamic Calibration .........................................................................................................13 4.3.3 MotionEngine Power Management and Stability Classifier .............................................14 4.3.4 Sensor Orientation ...........................................................................................................14 4.3.5 AR/VR Stabilization ..........................................................................................................15 4.3.6 Significant Motion Detector Configuration ........................................................................16 4.3.7 Shake Detector Configuration ..........................................................................................16 4.3.8 Serial Number ..................................................................................................................17 4.3.9 Maximum Fusion Period ..................................................................................................17 4.3.10 Environmental Sensor Calibration .............................................................................17 4.3.11 Ambient Light Sensor (ALS) Calibration ....................................................................18 4.3.12 Proximity Sensor Calibration ......................................................................................18 4.3.13 Flip Detector Configuration ........................................................................................19 4.3.14 Pickup Detector Configuration ...................................................................................20 4.3.15 Stability Detector Configuration .................................................................................22 4.3.16 Activity Tracker Configuration ....................................................................................22 4.3.17 Sleep Detector Configuration .....................................................................................22 4.3.18 Tilt Detector Configuration .........................................................................................23 4.3.19 Pocket Detector Configuration ...................................................................................23 4.3.20 Circle Detector Configuration .....................................................................................24 4.3.21 User Record ...............................................................................................................25 4.3.22 MotionEngine Time Source Selection ........................................................................25 4.3.23 UART Output Format Selection .................................................................................25 4.3.24 Gyro-Integrated Rotation Vector ................................................................................25 4.3.25 Fusion Control Record ...............................................................................................27 4.3.26 Configuration Records Summary ...............................................................................27 4.3.27 Version Information ....................................................................................................28 5.0 OPERATION ........................................................................................................... 29 5.1 Sensor Metadata ..................................................................................................................29 5.1.1 Sensor-Specific Metadata ................................................................................................32 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 1 1000-3625 SH-2 Reference Manual 5.2 Input Reports ........................................................................................................................32 5.3 Output Reports .....................................................................................................................33 5.4 Feature Reports ...................................................................................................................33 5.4.1 Rate Control .....................................................................................................................33 5.4.2 Threshold Control .............................................................................................................33 5.4.3 Batch Operation ...............................................................................................................33 5.5 Sensor Triggering .................................................................................................................34 6.0 REPORT DESCRIPTIONS ...................................................................................... 36 6.1 Report ID Convention ...........................................................................................................36 6.2 Summary ..............................................................................................................................36 6.3 Configuration Reports ..........................................................................................................37 6.3.1 Product ID Request (0xF9) ..............................................................................................37 6.3.2 Product ID Response (0xF8) ............................................................................................37 6.3.3 FRS Write Request (0xF7) ...............................................................................................38 6.3.4 FRS Write Data Request (0xF6) ......................................................................................38 6.3.5 FRS Write Response (0xF5) ............................................................................................39 6.3.6 FRS Read Request (0xF4) ...............................................................................................40 6.3.7 FRS Read Response (0xF3) ............................................................................................40 6.3.8 Command Request (0xF2) ...............................................................................................41 6.3.9 Command Response (0xF1) ............................................................................................41 6.4 Commands ...........................................................................................................................42 6.4.1 Report Errors (0x01).........................................................................................................43 6.4.2 Perform Self-Test .............................................................................................................44 6.4.3 Counter Commands (0x02) ..............................................................................................44 6.4.4 Tare (0x03) .......................................................................................................................45 6.4.5 Initialization (0x04) ...........................................................................................................47 6.4.6 Save DCD (0x06) .............................................................................................................49 6.4.7 ME Calibration Commands (0x07) ...................................................................................50 6.4.8 Configure Periodic DCD Save (0x09) ..............................................................................51 6.4.9 Get Oscillator Type (0x0A) ...............................................................................................52 6.4.10 Clear DCD and Reset (0x0B) .....................................................................................53 6.5 Sensor Reports ....................................................................................................................53 6.5.1 Common Fields ................................................................................................................54 6.5.2 Common Dynamic Feature Report ..................................................................................55 6.5.3 Get Feature Request (0xFE) ............................................................................................55 6.5.4 Set Feature Command (0xFD) .........................................................................................55 6.5.5 Get Feature Response (0xFC) .........................................................................................56 6.5.6 Force Sensor Flush (0xF0) ..............................................................................................56 6.5.7 Flush Completed (0xEF) ..................................................................................................57 6.5.8 Raw Accelerometer (0x14) ...............................................................................................57 6.5.9 Accelerometer (0x01) .......................................................................................................58 6.5.10 Linear Acceleration (0x04) .........................................................................................58 6.5.11 Gravity (0x06).............................................................................................................59 6.5.12 Raw Gyroscope (0x15) ..............................................................................................59 6.5.13 Gyroscope Calibrated (0x02) .....................................................................................60 6.5.14 Gyroscope Uncalibrated (0x07) .................................................................................60 6.5.15 Raw Magnetometer (0x16) ........................................................................................61 6.5.16 Magnetic Field Calibrated (0x03) ...............................................................................62 6.5.17 Magnetic Field Uncalibrated (0x0F) ...........................................................................62 6.5.18 Rotation Vector (0x05) ...............................................................................................63 6.5.19 Game Rotation Vector (0x08) ....................................................................................63 6.5.20 Geomagnetic Rotation Vector (0x09).........................................................................64 6.5.21 Pressure (0x0A) .........................................................................................................65 6.5.22 Ambient Light (0x0B) .................................................................................................65 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 2 1000-3625 6.5.23 6.5.24 6.5.25 6.5.26 6.5.27 6.5.28 6.5.29 6.5.30 6.5.31 6.5.32 6.5.33 6.5.34 6.5.35 6.5.36 6.5.37 6.5.38 6.5.39 6.5.40 6.5.41 6.5.42 6.5.43 6.5.44 7.0 SH-2 Reference Manual Humidity (0x0C) .........................................................................................................65 Proximity (0x0D).........................................................................................................66 Temperature (0x0E) ...................................................................................................66 Reserved (0x17).........................................................................................................67 Tap Detector (0x10) ...................................................................................................67 Step Detector (0x18) ..................................................................................................67 Step Counter (0x11) ...................................................................................................68 Significant Motion (0x12) ...........................................................................................69 Stability Classifier (0x13) ...........................................................................................69 Shake Detector (0x19) ...............................................................................................70 Flip Detector (0x1A) ...................................................................................................70 Pickup Detector (0x1B) ..............................................................................................71 Stability Detector (0x1C) ............................................................................................71 Personal Activity Classifier (0x1E) .............................................................................72 Sleep Detector (0x1F) ................................................................................................74 Tilt Detector (0x20) ....................................................................................................74 Pocket Detector (0x21) ..............................................................................................75 Circle Detector (0x22) ................................................................................................75 Heart Rate Monitor (0x23) .........................................................................................76 ARVR-Stabilized Rotation Vector (0x28) ...................................................................76 ARVR-Stabilized Game Rotation Vector (0x29) ........................................................77 Gyro-Integrated Rotation Vector (0x2A) ....................................................................77 BATCHING ............................................................................................................. 79 7.1 Batch queues .......................................................................................................................79 7.2 Batch timestamps .................................................................................................................79 7.2.1 Base Timestamp Reference (0xFB) .................................................................................79 7.2.2 Timestamp Rebase (0xFA) ..............................................................................................80 8.0 9.0 REFERENCES ........................................................................................................ 81 NOTICES ................................................................................................................ 82 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 3 1000-3625 SH-2 Reference Manual List of Figures Figure 1: Document History .............................................................................................. 7 Figure 2: Sensor Usage ..................................................................................................... 9 Figure 3: S-format Output Packet Definition ................................................................... 10 Figure 4: L-format Output Packet Definition ................................................................... 11 Figure 5: H-format Output Packet Definition ................................................................... 12 Figure 6: MotionEngine Power Management and Stability Classifier Record ............. 14 Figure 7: Sensor Orientation Record .............................................................................. 14 Figure 8: AR/VR Stabilization Record ............................................................................. 15 Figure 9: Significant Motion Detector Configuration Record........................................ 16 Figure 10: Shake Detector Configuration Record .......................................................... 16 Figure 11: Serial Number Record.................................................................................... 17 Figure 12: Maximum Fusion Period Record ................................................................... 17 Figure 13: Environmental Sensor Calibration Record ................................................... 17 Figure 14: ALS Calibration Record ................................................................................. 18 Figure 15: Proximity Sensor Calibration Record ........................................................... 18 Figure 16: Flip Detector Configuration Record .............................................................. 19 Figure 17: Pickup Detector Configuration Record......................................................... 20 Figure 18: Stability Detector Configuration Record ...................................................... 22 Figure 19: Sleep Detector Configuration Record ........................................................... 22 Figure 20: Tilt Detector Configuration Record ............................................................... 23 Figure 21: Pocket Detector Configuration Record......................................................... 23 Figure 22: Circle Detector Configuration Record .......................................................... 24 Figure 23: User Record .................................................................................................... 25 Figure 24: Time Source Record ...................................................................................... 25 Figure 25: UART Output Format Selection Record ......................................................... 25 Figure 26: Gyro-Integrated Rotation Vector Configuration Record ............................... 26 Figure 27: Fusion Control Record .................................................................................. 27 Figure 28: Configuration Records .................................................................................. 28 Figure 29: Metadata Records .......................................................................................... 30 Figure 30: Metadata Record Format – Revision 3 .......................................................... 30 Figure 31: Metadata Record Format – Revision 4 .......................................................... 31 Figure 32: Personal Activity Classifier Sensor-Specific Metadata. .............................. 32 Figure 33: Sensor Trigger Modes ................................................................................... 35 Figure 34: Report ID List ................................................................................................. 37 Figure 35: Product ID Request ........................................................................................ 37 Figure 36: Product ID Response ..................................................................................... 38 Figure 37: FRS Write Request ......................................................................................... 38 Figure 38: FRS Write Data Request ................................................................................ 39 Figure 39: FRS Write Response ...................................................................................... 39 Figure 40: FRS Read Request ......................................................................................... 40 Figure 41: FRS Read Response ...................................................................................... 40 Figure 42: Command Request ........................................................................................ 41 Figure 43: Command Response...................................................................................... 42 Figure 44: Command Identifiers...................................................................................... 43 Figure 45: Report Errors Command................................................................................ 43 Figure 46: Report Errors Response ................................................................................ 44 Figure 47: Get Counts Command ................................................................................... 44 Figure 48: Get Counts Response .................................................................................... 45 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 4 1000-3625 SH-2 Reference Manual Figure 49: Clear Counts Command ................................................................................ 45 Figure 50: Tare Now Command....................................................................................... 46 Figure 51: Persist Tare Command .................................................................................. 47 Figure 52: Set Reorientation Command ......................................................................... 47 Figure 53: Initialize Command......................................................................................... 48 Figure 54: Initialize Command Subsystems ................................................................... 48 Figure 55: Initialize Response ......................................................................................... 48 Figure 56: Save DCD Command...................................................................................... 49 Figure 57: Save DCD Response ...................................................................................... 49 Figure 58: Configure ME Calibration Command ............................................................ 50 Figure 59: Get ME Calibration Command ....................................................................... 50 Figure 60: Configure ME Calibration Response............................................................. 51 Figure 61: Configure Periodic Save DCD Command ..................................................... 52 Figure 62: Get Oscillator Type Command ....................................................................... 52 Figure 63: Get Oscillator Type Response ...................................................................... 53 Figure 64: Clear DCD and Reset Command .................................................................... 53 Figure 65: Common Report Fields .................................................................................. 54 Figure 66: Common Feature Report ............................................................................... 55 Figure 67: Get Feature Request (0xFE) .......................................................................... 55 Figure 68: Set Feature Command (0xFD) ....................................................................... 56 Figure 69: Get Feature Response (0xFC) ....................................................................... 56 Figure 70: Force Sensor Flush (0xF0) ............................................................................ 57 Figure 71: Flush Completed (0xEF) ................................................................................ 57 Figure 72: Raw Accelerometer Input Report .................................................................. 57 Figure 73: Accelerometer Input Report .......................................................................... 58 Figure 74: Linear Acceleration Input Report .................................................................. 58 Figure 75: Gravity Input Report....................................................................................... 59 Figure 76: Raw Gyroscope Input Report ........................................................................ 60 Figure 77: Gyroscope Calibrated Input Report .............................................................. 60 Figure 78: Gyroscope Uncalibrated Input Report .......................................................... 61 Figure 79: Raw Magnetometer Input Report .................................................................. 61 Figure 80: Magnetic Field Calibrated Input Report ........................................................ 62 Figure 81: Magnetic Field Uncalibrated Input Report .................................................... 63 Figure 82: Rotation Vector Input Report ........................................................................ 63 Figure 83: Game Rotation Vector Input Report .............................................................. 64 Figure 84: Geomagnetic Rotation Vector Input Report ................................................. 64 Figure 85: Pressure Sensor Input Report ....................................................................... 65 Figure 86: Ambient Light Sensor Input Report .............................................................. 65 Figure 87: Humidity Sensor Input Report ....................................................................... 66 Figure 88: Proximity Sensor Input Report ...................................................................... 66 Figure 89: Temperature Sensor Input Report ................................................................ 66 Figure 90: Tap Detector Input Report ............................................................................. 67 Figure 91: Step Detector Input Report ............................................................................ 68 Figure 92: Step Counter Input Report............................................................................. 68 Figure 93: Significant Motion Input Report .................................................................... 69 Figure 94: Stability Classifier Input Report .................................................................... 69 Figure 95: Shake Detector Input Report ......................................................................... 70 Figure 96: Flip Detector Input Report ............................................................................. 71 Figure 97: Pickup Detector Input Report ........................................................................ 71 Figure 98: Stability Detector Input Report ...................................................................... 72 Figure 99: Personal Activity Classifier Feature Report. ................................................ 72 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 5 1000-3625 Figure 100: Figure 101: Figure 102: Figure 103: Figure 104: Figure 105: Figure 106: Figure 107: Figure 108: Figure 109: Figure 110: Figure 111: Figure 112: SH-2 Reference Manual Personal Activity Classifier Report ............................................................. 73 Activity Classification States ...................................................................... 74 Sleep Detector Input Report ........................................................................ 74 Tilt Detector Input Report ............................................................................ 74 Pocket Detector Input Report ...................................................................... 75 Circle Detector Input Report ........................................................................ 75 Heart Rate Monitor Input Report ................................................................. 76 ARVR-Stabilized Rotation Vector Input Report .......................................... 77 ARVR-Stabilized Game Rotation Vector Input Report ............................... 77 Gyro-Integrated Rotation Vector Input Report ........................................... 78 Timestamp Dependencies ........................................................................... 79 Base Timestamp Reference Record ........................................................... 80 Timestamp Rebase Record ......................................................................... 80 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 6 1000-3625 1.0 SH-2 Reference Manual Introduction The SH-2 is Hillcrest’s turnkey sensor hub software solution. The SH-2 connects to various motion and environmental sensors, collects data from them, processes that data and provides the results to a host processor. 1.1 Intended Audience This document is intended for application developers implementing products that use the SH-2. 1.2 Scope This document describes the features of the SH-2, how they work, how to use them and the application programming interface (API) for the SH-2. This document assumes the reader is already familiar with Hillcrest’s MotionEngine. 1.3 Revision History 1.2 Revision Date 05/19/2017 1.1 02/16/2017 1.0 02/06/2017 Description Clarified Tare command usage, added description of Tare application to AR/VR Stabilized Rotation Vectors and GyroIntegrated Rotation Vector. Clarified FRS Read “BUSY” status behavior. Fix bad references. Added language clarifying interaction between Gyro-Integrated Rotation Vector and other fusion outputs. Clarified SHTP channels in 6.2. Update the default value of AR/VR Stabilization FRS record. Remove unused reference. Initial issue Figure 1: Document History Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 7 1000-3625 2.0 SH-2 Reference Manual Sensor Usage The SH-2 connects to and manages a variety of physical sensors. It processes the outputs of the physical sensors to produce virtual sensors. Virtual sensors require data from one or more physical sensors. Figure 2 indicates which physical sensors are required for which virtual sensors. The number of physical sensors in use at any one time impacts the power consumed by the device. Using more physical sensors means consuming more power. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 8 1000-3625 SH-2 Reference Manual HRM temperature proximity humidity ambient light pressure magnetometer gyroscope Virtual Sensors Raw accelerometer Acceleration Linear acceleration Gravity Raw gyroscope Gyroscope calibrated Gyroscope uncalibrated Raw magnetometer Magnetic field calibrated Magnetic field uncalibrated Rotation vector Game rotation vector Geomagnetic rotation vector Pressure Ambient light Humidity Proximity Temperature Tap detector Step detector Step counter Significant motion Stability classifier Shake detector Flip detector Pickup detector Stability detector Personal Activity classifier Sleep detector Tilt detector Pocket detector Circle detector Heart rate monitor AR/VR Stabilized Rotation Vector AR/VR Stabilized Game Rotation Vector Gyro-Integrated Rotation Vector accelerometer Physical Sensors X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X1 Figure 2: Sensor Usage 1 Magnetometer is not required when Gyro-Integrated Rotation Vector is configured with the Game Rotation Vector as its Reference Data Type (see 4.3.24). Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 9 1000-3625 3.0 SH-2 Reference Manual Host Interfaces The SH-2 communicates to the host processor through Hillcrest’s Sensor Hub Transport Protocol. See [1] for details of the SHTP protocol. See [2] for details of how SH-2 uses SHTP. 3.1 UART Interface Certain SH-2 products support a UART interface with special output formats. There are two such output formats available. 3.1.1 S-format Output Packet The S-format is the default output packet format for the UART mode. This output packet provides heading information. Below is a description of the output packet layout: Byte 0 1 2 3 4 5 Description Header = 0xAA Reserved = 0x00 Sequence Number Angle LSB Angle MSB Checksum Figure 3: S-format Output Packet Definition Header Packet header byte, always equal to 0xAA. Reserved Reserved byte, always equal to 0x00. Sequence Number Sequence number of the packet. The first packet sent after startup will have a sequence number of 0. After the 256th packet is sent the sequence number rolls over back to 0. Angle 16-bit heading value expressed in units of centidegrees (degrees x100). This value has a range of -18000 to 18000 centidegrees. Checksum Checksum of the packet, equal to the XOR of the sequence number and angle bytes of the packet. 3.1.2 L-format Output Packet The L-format packet is an alternate output packet format for the UART mode. This output packet format needs to be selected using an FRS record – see 4.3.23 for more information on the FRS record. Below is a description of the output packet layout. Byte 0 1 2 3 4 5 6 7 8 Description Header LSB = 0xAC Header MSB = 0xAC Sequence Number Angle LSB Angle MSB Angular velocity LSB Angular velocity MSB X-axis acceleration LSB X-axis acceleration MSB Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 10 1000-3625 SH-2 Reference Manual Byte 9 10 11 12 13 14 Description Y-axis acceleration LSB Y-axis acceleration MSB Z-axis acceleration LSB Z-axis acceleration MSB Reserved Checksum Figure 4: L-format Output Packet Definition Header 16-bit packet header, always equal to 0xACAC. Sequence Number Sequence number of the packet. The first packet sent after startup will have a sequence number of 0. After the 256th packet is sent the sequence number rolls over back to 0. Angle 16-bit heading value expressed in units of decidegrees (degrees x10). This value has a range of -1800 to 1800 decidegrees. Angular velocity 16-bit angular velocity value expressed in units of decidegrees per second (degrees per second x10). X-axis acceleration 16-bit acceleration value expressed in milli-gravities (gravitational constant x1000) representing the acceleration of the device in the X-direction. Y-axis acceleration 16-bit acceleration value expressed in milli-gravities (gravitational constant x1000) representing the acceleration of the device in the Y-direction. Z-axis acceleration 16-bit acceleration value expressed in milli-gravities (gravitational constant x1000) representing the acceleration of the device in the Z-direction. Reserved Reserved byte, always equal to 0x00. Checksum Checksum of the packet, equal to the sum of the sequence number, angle, angular velocity, and acceleration bytes of the packet. 3.1.3 H-format Output Packet The H-format packet is another alternate output packet format for the UART mode. This output packet provides Euler angles and acceleration values. This output packet format needs to be selected using an FRS record – see 4.3.23 for more information on the FRS record. Below is a description of the output packet layout. Byte 0 1 2 3 4 5 Description Header LSB = 0xAA Header MSB = 0xAA Sequence Number Yaw LSB Yaw MSB Pitch LSB Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 11 1000-3625 SH-2 Reference Manual Byte 6 7 8 9 10 11 12 13 14 15 16 17 18 Description Pitch MSB Roll LSB Roll MSB X-axis acceleration LSB X-axis acceleration MSB Y-axis acceleration LSB Y-axis acceleration MSB Z-axis acceleration LSB Z-axis acceleration MSB Reserved Reserved Reserved Checksum Figure 5: H-format Output Packet Definition Header 16-bit packet header, always equal to 0xAAAA. Sequence Number Sequence number of the packet. The first packet sent after startup will have a sequence number of 0. After the 256th packet is sent the sequence number rolls over back to 0. Yaw 16-bit angular yaw value expressed in units of centidegrees (degrees x100). Pitch 16-bit angular pitch value expressed in units of centidegrees (degrees x100). Roll 16-bit angular roll value expressed in units of centidegrees (degrees x100). X-axis acceleration 16-bit acceleration value expressed in milli-gravities (gravitational constant x1000) representing the acceleration of the device in the X-direction. Y-axis acceleration 16-bit acceleration value expressed in milli-gravities (gravitational constant x1000) representing the acceleration of the device in the Y-direction. Z-axis acceleration 16-bit acceleration value expressed in milli-gravities (gravitational constant x1000) representing the acceleration of the device in the Z-direction. Reserved Reserved bytes, always equal to 0x00. Checksum Checksum of the packet, equal to the sum of the sequence number, yaw, pitch, roll, acceleration and reserved bytes of the packet. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 12 1000-3625 4.0 SH-2 Reference Manual Configuration The SH-2 has a number of configurable options that control the overall behavior of the hub. These configuration options are stored as records in either flash or RAM. Only one record of each configuration options may be stored. Access to the configuration records is provided through reports described in section 6.3. 4.1 Flash Storage The SH-2 can be implemented on processors with flash memory. On these systems the configuration records persist through power cycles. The configuration options may be changed at any time; however, the SH-2 must be restarted for changes to take effect. The SH-2 has a very simple flash record system (FRS) that manages reading, writing and erasing these records. The FRS implements wear leveling to reduce wear on the flash memory. 4.2 RAM Storage The SH-2 can also be implemented on processors without flash. In these systems the configuration records are stored in RAM. They must be downloaded each time the SH-2 is started. To change configuration options, restart the SH-2 and download new options. 4.3 Records 4.3.1 Static Calibration Static calibration data is produced by the manufacturing process for per device calibration and stored on the SH-2. There are two per device calibration records – one for the accelerometer, gyroscope and magnetometer (AGM) sensor set and one for the screen rotation accelerometer (SRA). The SH-2 uses a nominal calibration if static calibration data is not configured. The nominal calibration is built-in to the SH-2 sensor drivers. There are two nominal calibration records – one for the AGM sensor set and one for the SRA. The per device records are read/write. The nominal records are read only. The data format is proprietary to Hillcrest Labs. 4.3.2 Dynamic Calibration Dynamic calibration is produced by MotionEngine during operation. Dynamic calibration may be stored for use following a restart to enhance MotionEngine’s startup performance. The data format is proprietary to Hillcrest Labs. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 13 1000-3625 SH-2 Reference Manual 4.3.3 MotionEngine Power Management and Stability Classifier The MotionEngine power management record controls the thresholds MotionEngine uses to determine when the device is at rest and when it is in motion. The format of a MotionEngine Power Management record is shown in Figure 6. This record also configures the thresholds use by the stability classifier. Description Word 0 1 2 Byte 3 Reserved Byte 2 Byte 1 Byte 0 Delta orientation Stable threshold Delta acceleration Stable duration Figure 6: MotionEngine Power Management and Stability Classifier Record Delta orientation Once a device has been determined to be not moving based on the generation of ON_TABLE or IS_STABLE, delta orientation is the amount of change in device orientation required to recognize that the device is in motion. The units are radians. The delta orientation value is a signed, 2’scomplement fixed point number with a Q point of 28. The default value is 0.2. Stable threshold The gyro output must be below this limit for the stable duration in order for an IS_STABLE notification to be generated. The units are radians per second. The stable threshold value is a signed, 2’s-complement fixed point number with a Q point of 25. The default value is 1.0. Stable duration The amount of time in seconds that motion must be below the stable threshold before an IS_STABLE notification is generated. The default value is 3. Delta acceleration When using wake-on-motion, this is the amount of acceleration required for the accelerometer to determine that motion has occurred. The units are mg. The delta acceleration value is unsigned. The default value is 0. 4.3.4 Sensor Orientation The sensor orientation record controls the rotation of the MotionEngine output coordinate system relative to the sensor’s coordinate system. The rotation vector is a signed, 2’scomplement fixed point number with a Q point of 30. The format of a sensor orientation record is shown in Figure 7. If the rotation vector is set to all 0’s then no rotation is applied. The default values are 0 for all for values. In addition, each accelerometer, gyroscope and magnetometer has its own sensor orientation record. The sensor specific records are used to align the orientation of sensors to the system when not using per device static calibration data. Word 0 1 2 3 Description Rotation quaternion X Rotation quaternion Y Rotation quaternion Z Rotation quaternion W Figure 7: Sensor Orientation Record Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 14 1000-3625 SH-2 Reference Manual 4.3.5 AR/VR Stabilization During large, fast motions the angular position output may sometimes become misaligned with the actual angular position. When the device slows or stops, angular position can be determined accurately and the angular position output updated accordingly. However, step updates to the output are undesirable in some applications. AR/VR stabilization addresses this issue by correcting angular position errors only when the device is moving. The AR/VR stabilization record controls the thresholds MotionEngine uses to stabilize angular position. The format of an AR/VR stabilization record is shown in Figure 8. The AR/VR stabilization parameters are all unsigned, fixed point numbers. There are separate AR/VR stabilization records for the rotation vector and game rotation vector. If a record is not programmed then default values of 0 are used for all parameters. Word 0 1 2 3 Description Scaling Max rotation Max error Stability magnitude Figure 8: AR/VR Stabilization Record Scaling Scaling controls what fraction of the angular velocity can be used to correct angular position errors. The range for this parameter is 0 to 1.0. This parameter is dimensionless. The Q point is 30. A typical value is 0.2. Max rotation Max rotation is the maximum amount of angular correction that can be used to correct angular position errors. The settings for scaling and max rotation determine how aggressively angular errors are corrected. The range is 0 to PI. The units are radians. The Q point is 29. A typical value is 7.3 degrees or 0.127 radians. Max error Max error is the maximum angular error allowed to accumulate before the angular position output is updated in a single step. The units are radians. The range is 0 to PI. The Q point is 29. A typical value is 45 degrees or 0.785 radians. Stability magnitude Stability magnitude controls the amount of change in angular position that must occur before the angular position output is updated with a new value. The units are radians. The Q point is 29. A typical value is 0.0 degrees or 0.0 radians. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 15 1000-3625 SH-2 Reference Manual 4.3.6 Significant Motion Detector Configuration The significant motion detector has several parameters that must be configured. The configuration parameters are 32-bit integers or 32-bit signed fixed point numbers. If this record is not programmed then default values are used. Word 0 1 Description Acceleration threshold Step threshold Figure 9: Significant Motion Detector Configuration Record Acceleration threshold The acceleration threshold to trigger significant motion. The default value is 10.0 m/s^2. The Q point is 24. Step threshold The number of steps required to trigger significant motion. The default value is 5. This is an unsigned integer. 4.3.7 Shake Detector Configuration The shake detector has several parameters that must be configured. The configuration parameters are 32-bit signed integers, 32-bit signed fixed point numbers or bit fields. If this record is not programmed then default values are used. Word 0 1 2 3 4 Description Minimum time Maximum time Threshold Shake count Enable flags Figure 10: Shake Detector Configuration Record Minimum time The minimum time in microseconds between direction changes. The default value is 50,000us. Maximum time The maximum time in microseconds between direction changes. The default value is 400,000us. Threshold The threshold in m/s^2 that must be exceeded to count as a direction change. The default value is 8.0m/s^2. The Q point is 26. Shake count The number of direction changes to count as a shake. The default value is 3. Enable flags Enable flags for shake detection on the X, Y and Z axes. 0 – disable, 1 – enable. X, Y, and Z axes are enabled by default. Bit 0 – X axis Bit 1 – Y axis Bit 2 – Z axis Bit 3:7 - reserved Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 16 1000-3625 SH-2 Reference Manual 4.3.8 Serial Number The serial number record stores a 32-bit number used to identify an individual device. The format of a serial number record is shown in Figure 11. Word 0 Description 32-bit serial number Figure 11: Serial Number Record 4.3.9 Maximum Fusion Period The maximum fusion period record stores the maximum fusion period allowed. The units are microseconds. If a fusion period larger than this maximum is requested then the fusion period will be set to this maximum. The fusion period check can be disabled by clearing this record or by setting the maximum to 0. Word 0 Description Max fusion period Figure 12: Maximum Fusion Period Record 4.3.10 Environmental Sensor Calibration Each environmental sensor may require calibration. The calibration parameters for the environmental sensors are offset and scale. Offset accounts for a fixed difference between the output of the sensor and the actual value. Scale accounts for the difference between how much the output of the sensor changes and how much the actual value changes. Offset and scale are both signed fixed point numbers. The Q point is different for each type of sensor. If the calibration record for a particular sensor is not programmed then default values of offset = 0 and scale = 1 are used. Word 0 1 Description Offset Scale Figure 13: Environmental Sensor Calibration Record Offset The offset value is added to the output of the sensor. The Q points are: Pressure: 20 Temperature: 7 Humidity: 8 Ambient Light: 8 Proximity: 4 Scale The output of the sensor is multiplied by the scale. The Q points are: Pressure: 15 Temperature: 15 Humidity: 15 Ambient Light: 15 Proximity: 15 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 17 1000-3625 4.3.11 SH-2 Reference Manual Ambient Light Sensor (ALS) Calibration The ALS may require additional calibration parameters beyond the simple scale and offset provided to all environmental sensors. These parameters are device specific and are stored in the ALS Calibration Record. Word 0 1 1..N Description Sensor GUID Bits 7:0 – Length Bits 31:8 - Reserved Parameters Figure 14: ALS Calibration Record Sensor GUID An ID that uniquely identifies the sensor for which the calibration record was created. Length Length in words of the parameters section of the record. Parameters The calibration parameters applicable for a specific sensor. Contact Hillcrest Labs for details. 4.3.12 Proximity Sensor Calibration The proximity sensor may require additional calibration parameters beyond the simple scale and offset provided to all environmental sensors. These parameters are device specific and are stored in the Proximity Sensor Calibration Record. Word 0 1 1..N Description Sensor GUID Bits 7:0 – Length Bits 31:8 - Reserved Parameters Figure 15: Proximity Sensor Calibration Record Sensor GUID An ID that uniquely identifies the sensor for which the calibration record was created. Length Length in words of the parameters section of the record. Parameters The calibration parameters applicable for a specific sensor. Contact Hillcrest Labs for details. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 18 1000-3625 4.3.13 SH-2 Reference Manual Flip Detector Configuration The flip detector has several parameters that must be configured. The configuration parameters are 32-bit signed fixed point numbers. If this record is not programmed then default values are used. Word 0 1 2 Description Time constant Angular threshold Angular hysteresis Figure 16: Flip Detector Configuration Record Time constant The time constant used for filtering input data. The default value is 0.4. The Q point is 20. Angular threshold The angle in radians, measured from a downward pointing line (i.e. line pointing toward earth) defining the maximum range to be in the down state. The default value is pi/4 (45 degrees). The Q point is 29. Angular hysteresis The angle in radians defining the amount of hysteresis to apply. The hysteresis region is angular threshold ± (angular hysteresis / 2). The default value is pi/90 (2 degrees). The Q point is 29. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 19 1000-3625 4.3.14 SH-2 Reference Manual Pickup Detector Configuration The pickup detector has several parameters that must be configured. The configuration parameters are 32-bit signed fixed point numbers. If this record is not programmed then default values are used. The pickup detector can be operated in three different modes. The first mode, “Level-to-notlevel” (LNL) reports a pick-up event when the sensor hub moves from a level position to a nonlevel position. The second mode, “Stopped within Tilt Region” (SWTR) reports a pick-up event when the sensor hub is rotated to a given angular position and held there. The third mode reports a pick-up event when either the LNL or SWTR conditions are satisfied. These detectors are configured independently. In Figure 17, fields are identified as belonging to the “Level-to-Not-Level” (LNL) detector or the “Stopped Within Tilt Region” (SWTR) detector. Description Word 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 MSB LSB Enabled detectors LNL Orientation Y LNL Orientation X LNL Orientation W LNL Orientation Z LNL Group Delay LNL Angular Deviation LNL Angular Hysteresis SWTR Orientation Y SWTR Orientation X SWTR Orientation W SWTR Orientation Z SWTR Group Delay SWTR Roll Minimum SWTR Roll Maximum SWTR Pitch Minimum SWTR Pitch Maximum SWTR Stable Acceleration SWTR Motion Acceleration SWTR Motion to Stable Duration Figure 17: Pickup Detector Configuration Record Enabled Detectors A bitmap of enabled detectors. LNL and SWTR detectors are enabled by default. Bit 0 – LNL detector Bit 1 – SWTR detector Bit 2:31 – reserved LNL Orientation A rotation quaternion that is applied to the input before computing what is "level". The default value is the identity quaternion. The Q point is 14. LNL Group delay The desired group delay in seconds. The default value is 0.4 seconds. The Q point is 20. LNL Angular Deviation The angle (in radians) defining much tilt there can be and still consider the device "level". The default value is pi/4 radians (45 degrees). The Q point is 29. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 20 1000-3625 SH-2 Reference Manual LNL Angular Hysteresis The angle (in radians) defining the amount of hysteresis to apply. The entry point for level will be: angDeviation angHysteresis/2. The exit point from level will be: angDeviation + angHysteresis/2. The default value is pi/90 radians (2 degrees). The Q point is 29. SWTR Orientation A rotation quaternion that is applied to the input before decomposing into roll and pitch. The default value is (0.7071, 0, 0, 0.7071) for (W,X,Y,Z). The Q point is 14. SWTR Group Delay The desired group delay in seconds. The default value is 0.125 seconds. The Q point is 20. SWTR Roll Minimum The minimum roll value (in rads) when stopped to trigger a detection. The default value is –pi/18 radians (-10 degrees). The Q point is 29. SWTR Roll Maximum The maximum roll value (in rads) when stopped to trigger a detection. The default value is 2.96706 radians (170 degrees). The Q point is 29. SWTR Pitch Minimum The minimum pitch value (in rads) when stopped to trigger a detection. The default value is –pi/3 radians (-60 degrees). The Q point is 29. SWTR Pitch Maximum The maximum pitch value (in rads) when stopped to trigger a detection. The default value is pi/3 radians (60 degrees). The Q point is 29. SWTR Stable Acceleration The largest acceleration (in m/s^2) that is allowed to indicated stopped. The default value is 1.0 m/s^2. The Q point is 24. SWTR Motion Acceleration The smallest acceleration (in m/s^2) that will trigger motion. The default value is 4.0 m/s^2. The Q point is 24. SWTR Motion to Stable Duration The amount of time allowed (in seconds) between the last detected motion and when the device is stopped. The Q point is 20. The default value is 1.0 seconds. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 21 1000-3625 4.3.15 SH-2 Reference Manual Stability Detector Configuration The stability detector has several parameters that must be configured. The configuration parameters are 32-bit fixed point numbers. If this record is not programmed then default values are used. Word 0 1 Description Acceleration threshold Duration Figure 18: Stability Detector Configuration Record Acceleration threshold The acceleration in m/s^2 that must be exceeded to trigger not stable. The default value is 0.784 m/s^2. The Q point is 24. This value is signed. Duration The duration in microseconds that acceleration must remain below the acceleration threshold in order to declare that the device is stable. The default value is 500,000us. The Q point is 0. This value is unsigned. 4.3.16 Activity Tracker Configuration The data format of the Activity Tracker Configuration is proprietary to Hillcrest Labs. 4.3.17 Sleep Detector Configuration The sleep detector has several parameters that must be configured. The configuration parameters are 32-bit unsigned fixed point numbers. If this record is not programmed then default values are used. Word 0 1 2 3 Description Filter coefficient Processing window Categorization window Calibration constant Figure 19: Sleep Detector Configuration Record Filter coefficient A coefficient used to clamp low acceleration values to 0. The default value is 0.035. The Q point is 29. Processing window The processing window size in seconds. The default value is 10. The Q point is 0. Categorization window The categorization window size in number of processing windows. The default value is 6. The Q point is 0. Calibration constant A unitless calibration constant that tunes how small a movement triggers a hard wake. It should be tuned experimentally. The default value is 0.45. The Q point is 29. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 22 1000-3625 4.3.18 SH-2 Reference Manual Tilt Detector Configuration The tilt detector has several parameters that must be configured. The configuration parameters are 32-bit signed fixed point numbers. If this record is not programmed then default values are used. Word 0 1 Description Processing window Angular threshold Figure 20: Tilt Detector Configuration Record Processing window The processing window size in seconds. The default value is 2. The Q point is 27. Angular threshold The cosine of the angle that defines a tilt. The default value is cos(35 degrees) = 0.81915… The Q point is 30. 4.3.19 Pocket Detector Configuration The pocket detector has several parameters that must be configured. The configuration parameters are 32-bit signed fixed point numbers. If this record is not programmed then default values are used. Word 0 1 2 3 4 5 6 7 8 9 10 11 12 Description MSB LSB Orientation Y Orientation X Orientation W Orientation Z Orientation Group Delay Angular Ghost Group Delay Near threshold Dark threshold Level threshold Inverted threshold Straight threshold Linear motion threshold Angular motion threshold Motion timeout Opaque adjacency debounce time Figure 21: Pocket Detector Configuration Record Orientation A rotation quaternion that is applied to the input before pocket determination. The default value is the identity quaternion. The Q point is 14. Orientation Group Delay The desired group delay of the orientation filter in seconds. The Q point is 20. Angular Ghost Group Delay The desired group delay of the angular ghost filter in seconds. The Q point is 20. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 23 1000-3625 SH-2 Reference Manual Near Threshold The threshold below which values are considered near. The default value is 3 cm. The Q point is 0. Dark Threshold The threshold below which values are considered dark. The default value is 10 lux. The Q point is 0. Level Threshold The threshold at which a “level” state is determined. The default value is cos(15 degrees). The Q point is 29. Inverted Threshold The threshold at which a “inverted” state is determined. The default value is cos(100 degrees). The Q point is 29. Straight Threshold The threshold at which a “straight” state is determined The default value is sin(10 degrees). The Q point is 29. Linear Motion Threshold The threshold at which linear motion is considered. The default value is 2 m/s^2. The Q point is 26. Angular Motion Threshold The threshold at which angular motion is considered. The default value is pi/3 rad/s. The Q point is 28. Motion Timeout The timeout for determining motion consideration. The default value is 1 second. The Q point is 20. Opaque Adjacency Debounce Time The debounce time for determining opaque adjacency (a near and dark state). The default value is 1 second. The Q point is 20. 4.3.20 Circle Detector Configuration The circle detector has several parameters that must be configured. The configuration parameters are 32-bit signed fixed point numbers. If this record is not programmed then default values are used. Word 0 1 2 Description Acceleration threshold Angular threshold Revolution threshold Figure 22: Circle Detector Configuration Record Acceleration threshold The threshold of acceleration change from gravity to be considered circle motion. The default value is 4 m/s^2. The Q point is 24. Angular threshold The threshold of angle between rotation axes. The default value is 0. The Q point is 30. Revolution threshold The threshold for revolutions in radians. The default value is 3pi. The Q point is 25. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 24 1000-3625 4.3.21 SH-2 Reference Manual User Record There is a record available for the user to store data. The data must be stored as words. The user record should be limited to 64 words. Word 0 … n Description User defined Figure 23: User Record 4.3.22 MotionEngine Time Source Selection MotionEngine needs to know how to determine the amount of time between two samples from gyroscope. There are two methods for determining the sample time. The first method is to use the period that the gyroscope is set to. The second method is to use the sample timestamps provided by the system clock from the chip on which the sensor hub library is operating. If the system clock is based on a crystal or an accurate oscillator (±2%) then use time stamps; otherwise use the gyroscope period. Word 0 Description Time source Figure 24: Time Source Record 0 – use gyroscope period 1 – use timestamps others – reserved Time source 4.3.23 UART Output Format Selection Some SH-2 products support UART output. There are multiple output formats available for products operating in UART mode. This FRS record is used to select which output format to use. If this record is not present in a system, the S-format output is used by default. Word 0 Description UART Output Format Selection Figure 25: UART Output Format Selection Record 0 – S-format Output UART Output Format Selection 1 – L-format Output 2 – H-format Output others – reserved 4.3.24 Gyro-Integrated Rotation Vector The Gyro-Integrated Rotation Vector provides high-rate, low-latency rotation vector output. It can be configured to use several different sources as a reference vector, and prediction can optionally be enabled and tuned. Description Word 0 1 MSB LSB Reserved Reference Data Type Synchronization Interval Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 25 1000-3625 SH-2 Reference Manual Description Word 2 3 4 5 6 MSB LSB Maximum Error Prediction Amount Alpha Beta Gamma Figure 26: Gyro-Integrated Rotation Vector Configuration Record Reference Data Type The slower fused result which is used to provide periodic corrections to the fast gyro integration process. Acceptable values are 0x0207 (6-axis Game Rotation Vector) and 0x0204 (9-axis Absolute Rotation Vector). Default value is 6-axis Game Rotation Vector (0x0207). Reserved Set to 0. Synchronization Interval Duration, in microseconds, desired between outputs of reference data type. The units are microseconds. The default value is 10000 (equivalent to 100 Hz). Maximum Error Maximum discrepancy, in radians, between the gyrointegrated rotation vector and the reference vector that can be used for smooth corrections. If the reference vector diverges from the gyro-integrated rotation vector by more than this amount, the gyro-integrated rotation vector will be updated in a single discontinuous step to match the reference. The units are radians. The Q-point is 29. The default value is π/6 (equivalent to 30 degrees). Prediction amount Amount forward in time at which prediction will be performed. The units are seconds. The Q-point is 10. Default value is 0. Set this to 0 to disable prediction. Alpha Unitless position prediction parameter. The Q-point is 20. Default value is 0.303072543909142 Beta Unitless velocity prediction parameter. The Q-point is 20. Default value is 0.113295896384921 Gamma Unitless acceleration prediction parameter. The Q-point is 20. Default value is 0.002776219713054 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 26 1000-3625 4.3.25 SH-2 Reference Manual Fusion Control Record MotionEngine needs to know if the Game Rotation Vector is to use the magnetometer for stabilization. This is a bit oriented flag word. Word 0 Description Flags Figure 27: Fusion Control Record Bit 0 - Enable Mag Stabilized Game Rotation Vector 0 – False 1 – True others – reserved 4.3.26 Configuration Records Summary A list of all the configuration records is shown in Figure 28. Record ID 0x7979 0x4D4D 0x8A8A 0x4E4E 0x1F1F 0xD3E2 0x2D3E 0x2D41 0x2D43 0x2D46 0x2D4C 0x3E2D 0x3E2E 0xC274 0x7D7D 0xD7D7 0x4B4B 0x39AF 0x4D20 0x1AC9 0x39B1 0x4DA2 0xD401 0xD402 0x1B2A 0xFC94 0xED85 0xED88 0xED87 0xED89 Description Static calibration – AGM Nominal calibration – AGM Static calibration – SRA Nominal calibration - SRA Dynamic calibration MotionEngine power management System orientation Primary accelerometer orientation Screen rotation accelerometer orientation Gyroscope orientation Magnetometer orientation AR/VR stabilization – rotation vector AR/VR stabilization – game rotation vector Significant Motion detector configuration Shake detector configuration Maximum fusion period Serial number Environmental sensor - Pressure calibration Environmental sensor - Temperature calibration Environmental sensor - Humidity calibration Environmental sensor - Ambient light calibration Environmental sensor - Proximity calibration ALS Calibration Proximity Sensor Calibration Pickup detector configuration Flip detector configuration Stability detector configuration Activity Tracker configuration Sleep detector configuration Tilt detector configuration Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 27 1000-3625 SH-2 Reference Manual Record ID 0xEF27 0xEE51 0x74B4 0xD403 0xA1A1 0xA1A2 0xA1A3 Description Pocket detector configuration Circle detector configuration User record MotionEngine Time Source Selection UART Output Format Selection Gyro-Integrated Rotation Vector configuration Fusion Control Flags Figure 28: Configuration Records 4.3.27 Version Information Version information is retrieved by using the HCOMM Product ID Request message. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 28 1000-3625 5.0 5.1 SH-2 Reference Manual Operation Sensor Metadata Each sensor has a set of static metadata associated with it. This metadata provides information about the sensor’s capabilities and limitations. The metadata available for each sensor is Vendor ID Sensor driver version Sensor-specific metadata Name string Maximum range Minimum period Batch buffer reserved count Maximum batch buffer count Resolution Power Bytes used in batch buffer for one sample Q point 1 – applies to sensor output Q point 2 – applies to sensor bias or sensor accuracy unless otherwise noted. The metadata for each sensor is retrieved by performing an FRS read operation. The FRS record ID for each sensor is listed in Figure 29. Record ID 0xE301 0xE302 0xE303 0xE304 0xE305 0xE306 0xE307 0xE308 0xE309 0xE30A 0xE30B 0xE30C 0xE30D 0xE30E 0xE30F 0xE310 0xE311 0xE312 0xE313 0xE314 0xE315 0xE316 0xE317 0xE318 0xE319 0xE31A Description Raw accelerometer Accelerometer Linear acceleration Gravity Raw gyroscope Gyroscope calibrated Gyroscope uncalibrated Raw magnetometer Magnetic field calibrated Magnetic field uncalibrated Rotation vector Game rotation vector Geomagnetic rotation vector Pressure Ambient light Humidity Proximity Temperature Tap detector Step detector Step counter Significant motion Stability classifier Shake detector Flip detector Pickup detector Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 29 1000-3625 SH-2 Reference Manual Record ID 0xE31B 0xE31C 0xE31D 0xE31E 0xE31F 0xE320 0xE321 0xE322 0xE323 0xE324 Description Stability detector Personal Activity classifier Sleep detector Tilt detector Pocket detector Circle detector Heart Rate Monitor ARVR Stabilized Rotation Vector ARVR Stabilized Game Rotation Vector Gyro-integrated Rotation Vector Figure 29: Metadata Records The format of the metadata records is shown in Figure 30 and Figure 26. Description Word 0 1 2 3 4 5 6 7 8 9 … 9+ SensorSpecific Metadata Length … N MSB LSB Version Range Resolution Revision = 3 Power Minimum period FIFO reserved count FIFO max count Vendor ID length Batch buffer bytes Q point 2 Q point 1 Q point 3 Sensor-Specific Metadata Length Sensor-Specific metadata … Vendor ID … Vendor ID Figure 30: Metadata Record Format – Revision 3 Description Word 0 1 2 3 4 5 6 7 8 MSB LSB Version Range Resolution Revision = 4 Power Minimum period FIFO reserved count FIFO max count Vendor ID length Batch buffer bytes Q point 2 Q point 1 Q point 3 Sensor-Specific Metadata Length Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 30 1000-3625 SH-2 Reference Manual Description Word 9 10 … 10 + SensorSpecific Metadata Length … N MSB LSB Maximum period Sensor-Specific metadata … Vendor ID … Vendor ID Figure 31: Metadata Record Format – Revision 4 Version Identifies the physical sensor/driver/fusion versions for a given sensor. The elements within this field are updated when a component changes in a manner that affects the output of the sensor. LSB – ME version Byte 1 – MH version Byte 2 – SH version MSB – 0x00 Range The range of the sensor. The format is unsigned fixed point. The units and Q point are the same as those used in the sensor’s input report. Resolution The resolution of the sensor. The format is unsigned fixed point. The units and Q point are the same as those used in the sensor’s input report. Power The power used by the sensor in mA when operating. The format is unsigned fixed point. The Q point is 10. Revision Indicates the revision of the metadata record. Minimum period An unsigned integer indicating the minimum operating period in microseconds of the sensor. FIFO max count The maximum number of samples that can be stored in the batch buffer. FIFO reserved count The number entries reserved in the batch FIFO for this sensor Batch buffer bytes The number of bytes used in the batch buffer to store one entry. Vendor ID length The length of the vendor ID in bytes. Q point 1 A signed 16-bit integer indicating the Q point of the sensor data fields. Q point 2 A signed 16-bit integer indicating the Q point of the sensor bias Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 31 1000-3625 SH-2 Reference Manual or accuracy fields. This field is applicable only to sensors that have bias or accuracy outputs as well as data outputs. Sensor-Specific Metadata length An unsigned 16-bit integer indicating how many bytes are used for sensor-specific metadata. 0 if there is no additional metadata. This value must be a multiple of four. Q point 3 A signed 16-bit integer indicating the Q point of the sensor data change sensitivity. Maximum period An unsigned integer indicating the maximum operating period in microseconds of the sensor. Sensor-Specific Metadata Some sensors expose additional information (e.g. Personal activity classifier exposes a bitmap representing the set of supported classification states). This area is used for such information. This field is padded with zeroes if the length is not a multiple of four. Vendor ID The vendor ID is a character string that lists the vendor name and part number. It is null terminated. The first byte starts in the LSB of the first word. This field is padded with zeroes if the length of the vendor ID is not a multiple of four. 5.1.1 Sensor-Specific Metadata Sensors may need to expose more detailed information than the basic set of fields above. The format of these sensors’ Sensor-specific Metadata is described here. 5.1.1.1 Personal Activity Classifier Metadata (0xE31C) The sensor-specific metadata length is 4. The sensor-specific metadata is structured as shown in Figure 32. Description Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 0 … … … … … … 1 2 3 … … Reserved … … Classification 30 supported … … … … … … … … … … … … Classification 1 supported … … … Classification 0 supported … … … Figure 32: Personal Activity Classifier Sensor-Specific Metadata. 5.2 Input Reports The SH-2 returns sensor data to the host via input reports. Each sensor has its own input report. Input reports are sent at a rate specified by the host. This rate may either be synchronous to the sensor’s operating rate or asynchronous. Input reports may also be requested by the host at Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 32 1000-3625 SH-2 Reference Manual any time. The SH-2may also be configured to send input reports only if thresholds are exceeded. Each sensor has its own set of thresholds. If a threshold is configured then the SH-2 will send reports at the requested rate only if the sensor output exceeds the threshold. Sensor data is sent to the host on either the “Wakeup” SHTP channel or the “Normal” SHTP channel, depending on whether a sensor has been configured as a wakeup sensor or not (see [2]). The Gyro-integrated Rotation Vector is reported on a separate “gyroRV” SHTP channel to facilitate traffic prioritization and other optimizations. Input reports are also used to send configuration responses to the host. Configuration input reports will be sent on the SHTP “control” channel (see [2]). 5.3 Output Reports Output reports are used to send configuration information to the SH-2. 5.4 Feature Reports Sensor operation is controlled through feature reports. Setting a feature report for a sensor causes operation of that sensor to change to comply with the settings in the feature report. Getting a feature report returns the current operation configuration of the sensor. The operations that can be controlled by feature reports are described in the following sections. These descriptions provide an overview of how to control sensor operation. In cases where specific field in feature reports are mentioned see section 6.0 for detailed information about those fields. 5.4.1 Rate Control Sensor operating rate is controlled through the report interval field. When set to zero the sensor is off. When set to a non-zero value the sensor generates reports at that interval or more frequently. If the sensor cannot operate as quickly as requested, it will operate at its minimum interval, if possible. Input reports are generated at the operating rate of the sensors. Please note that while active, the Gyro-Integrated Rotation Vector (6.5.44) may cause a reduction in both the nominal and actual reporting periods for fusion outputs for given requested periods. For example, a 400 Hz Game Rotation Vector may drop to 100 Hz to permit full-speed operation of the Gyro-Integrated Rotation Vector. 5.4.2 Threshold Control Each sensor has a configurable reporting threshold used to determine if an input report should be sent or not. The reporting threshold is set using the change sensitivity field. Change sensitivities are either absolute or relative. Absolute sensitivities are evaluated to determine if the current output values exceed the change sensitivity. Relative sensitivities are evaluated to determine if the current output has changed relative to the previous output by an amount that exceeds the change sensitivity. 5.4.3 Batch Operation Batching causes the sensor to buffer its input reports until they can be sent. There are two batch buffers. The first buffer is a circular buffer. When the SH-2 in on, reports are sent based on a delay interval or when the buffer is full. When the SH-2 is asleep, reports are queued in the buffer until the buffer is full. New sensor reports then overwrite the oldest reports in the buffer. When the SH-2 is turned on the reports in the buffer are sent. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 33 1000-3625 SH-2 Reference Manual The second buffer is a wake-on-full buffer. When the SH-2 is on or asleep, reports are sent based on a delay interval or when the buffer is full. When the SH-2 is asleep, reports are queued in the buffer until the buffer is full. When the buffer is full, the SH-2 wakes the AP and sends the reports. In cases where reports are sent when the buffer is full, they are sent soon enough to prevent the buffer from actually overflowing. Thus, no reports are lost. 5.5 Sensor Triggering Sensors report events based on trigger modes. The trigger modes are: Continuous – events are reported continuously at the report interval On-change – events are reported only if the sensor’s output has changed. In addition, events are reported no more frequently than once every report interval One-shot – a single event is reported and then the sensor turns off Special – reporting requirements are explained in the section on that sensor’s report Wake-up – When the sensor has a report to send, it can wake the host in order to send the report. i.e. it can cause the system to exit sleep mode. Always-on – The sensor remains on, even during periods of sleep The trigger mode for each sensor, except the significant motion detector, can be configured as continuous, on-change or special. The trigger mode for the significant motion detector is always one-shot. In addition, sensors can be configured to wake up the application processor. The trigger mode and wake-up capability for each sensor when configured for an Android system is shown in Figure 33. Note the interaction between “wake-up” and “always-on.” A sensor may be configured as always-on, but not wakeup. In this mode, the sensor will continue to run and log data to the nonwakeup batch buffer while the hub is asleep. When a (different) wakeup sensor triggers, the buffered data from all sensors is delivered. Thus, the host will get the data from the wakeup sensor and then the backlog of data from the non-wakeup, but always-on sensors. It is generally not useful to configure a sensor as “wake-up” but not “always-on.” Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 34 always-on wake-up special one-shot Output Raw accelerometer Acceleration Linear acceleration Gravity Raw gyroscope Gyroscope calibrated Gyroscope uncalibrated Raw magnetometer Magnetic field calibrated Magnetic field uncalibrated Rotation vector Game rotation vector Geomagnetic rotation vector ARVR-Stabilized Rotation vector ARVR-Stabilized Game rotation vector Pressure Ambient light Humidity Proximity Temperature SAR Tap detector Step detector Step counter Significant motion Stability classifier Shake detector Flip detector Pickup detector Stability detector Personal Activity Classifier Sleep detector Tilt detector Pocket Detector Circle detector on-change SH-2 Reference Manual continuous 1000-3625 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X Figure 33: Sensor Trigger Modes Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 35 1000-3625 6.0 6.1 SH-2 Reference Manual Report Descriptions Report ID Convention The report ID is shown as byte 0 in the reports defined throughout the following sections. 6.2 Summary The following table summarizes all the reports in use with SH-2. Direction is relative to the host (e.g. “write” indicates transmission of data from host to hub). SHTP Channel Direction SH-2 Control SH-2 Control SH-2 Control Wakeup/Normal Wakeup/Normal SH-2 Control SH-2 Control SH-2 Control SH-2 Control SH-2 Control SH-2 Control SH-2 Control SH-2 Control SH-2 Control Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal W W W R R W R W W W W R W R R R R R R R R R R R R R R R R R R R R R R R R R Report ID 0xFE 0xFD 0xFC 0xFB 0xFA 0xF9 0xF8 0xF7 0xF6 0xF5 0xF4 0xF3 0xF2 0xF1 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 Description Get Feature Request Set Feature Command Get Feature Response Base Timestamp Timestamp Rebase Product ID Request Product ID Response FRS Write Request FRS Write Data FRS Write Response FRS Read Request FRS Read Response Command Request Command Response Accelerometer Gyroscope Magnetic Field Linear Acceleration Rotation Vector Gravity Uncalibrated Gyroscope Game Rotation Vector Geomagnetic Rotation Vector Pressure Ambient Light Humidity Proximity Temperature Uncalibrated Magnetic Field Tap Detector Step Counter Significant Motion Stability Classifier Raw Accelerometer Raw Gyroscope Raw Magnetometer SAR Step Detector Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 36 1000-3625 SH-2 Reference Manual SHTP Channel Direction Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal Wakeup/Normal R R R R R R R R R R R R Report ID 0x19 0x1A 0x1B 0x1C 0x1E 0x1F 0x20 0x21 0x22 0x23 0x28 0x29 Description Shake Detector Flip Detector Pickup Detector Stability Detector Personal Activity Classifier Sleep Detector Tilt Detector Pocket Detector Circle Detector Heart Rate Monitor ARVR-Stabilized Rotation Vector ARVR-Stabilized Game Rotation Vector Figure 34: Report ID List 6.3 Configuration Reports Configuration reports are read and written using messages. These messages are described in the following sections. Some configuration reports are used to collect information. Some configuration reports are used to read and write configuration records. 6.3.1 Product ID Request (0xF9) The product ID request is used to request product ID information from the FSP3xx. Byte 0 1 Description Report ID = 0xF9 Reserved Figure 35: Product ID Request 6.3.2 Product ID Response (0xF8) The product ID response returns product ID information about the FSP3xx. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 Description Report ID = 0xF8 Reset Cause SW Version Major SW Version Minor SW Part Number LSB SW Part Number … SW Part Number … SW Part Number MSB SW Build Number LSB SW Build Number … SW Build Number … SW Build Number MSB SW Version Patch LSB Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 37 1000-3625 SH-2 Reference Manual Byte 13 14 15 Description SW Version Patch MSB Reserved Reserved Figure 36: Product ID Response Reset Cause The last cause of the processor reset. Only reported for the overall system ID. Subsystem Product IDs will report Not Applicable. 0 – Not Applicable 1 – Power On Reset 2 – Internal System Reset 3 – Watchdog Timeout 4 – External Reset 5 – Other SW Version: software version major (8 bits).minor (8 bits).patch (16 bits) SW Part Number: 32-bit value representing the software part number SW Build Number: 32-bit software build number 6.3.3 FRS Write Request (0xF7) The FRS write request is used to initiate writing an FRS record. Byte 0 1 2 3 4 5 Description Report ID = 0xF7 Reserved Length LSB Length MSB FRS Type LSB FRS Type MSB Figure 37: FRS Write Request Length: length in 32-bit words of the record to be written. If the length is set to 0 then the record is erased. FRS Type: FRS record type (see Figure 28) 6.3.4 FRS Write Data Request (0xF6) The FRS write data request is sent to write data to the record indicated by a previous write request. Only one FRS operation may be in progress at any one time. Byte 0 1 2 3 4 5 Description Report ID = 0xF6 Reserved Offset LSB Offset MSB Data0 LSB Data0 … Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 38 1000-3625 SH-2 Reference Manual Byte 6 7 8 9 10 11 Description Data0 … Data0 MSB Data1 LSB Data1 … Data1 … Data1 MSB Figure 38: FRS Write Data Request Offset: offset, in 32-bit words, from the beginning of the record indicating where in the record the data is to be written Data0/1: 32-bit words of data to be written to the FRS record The offset field is used to detect missing or put of order write data requests. When writing a record, the write data requests must be supplied in order, with both data0 and data1 fields used. If the record contains an odd number of words then the final write data request must use data0. 6.3.5 FRS Write Response (0xF5) The write response report indicates the status of a write operation. Byte 0 1 2 3 Description Report ID = 0xF5 Status/Error Word Offset LSB Word Offset MSB Figure 39: FRS Write Response Status/Error: 0 – word(s) received 1 – unrecognized FRS type 2 – busy 3 – write completed 4 – write mode entered or ready 5 – write failed 6 – data received while not in write mode 7 – invalid length 8 – record valid (the complete record passed internal validation checks) 9 – record invalid (the complete record failed internal validation checks) 10 – device error (DFU flash memory device unavailable) 11 – record is read only 12-255 – reserved Word Offset: the number of words offset from the beginning of the record for the most recently received write data request An FRS write response is generated for each write request or write data request. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 39 1000-3625 SH-2 Reference Manual 6.3.6 FRS Read Request (0xF4) The FRS read request is used to retrieve an FRS record from the FSP3xx. Only one FRS operation may be in progress at a time. If a Read Request is issued before the first read operation is complete, it will be responded to with a Read Response indicating BUSY and then it will complete the already in-progress read operation. Byte 0 1 2 3 4 5 6 7 Description Report ID = 0xF4 Reserved Read Offset LSB Read Offset MSB FRS Type LSB FRS Type MSB Block Size LSB Block Size MSB Figure 40: FRS Read Request Read Offset: offset, in 32-bit words, from the beginning of the FRS record at which to begin the read operation. The first word in an FRS record is word 0. FRS Type: FRS record type to read (see Figure 28) Block Size: number of 32-bit words to read. If the block size is zero then the entire record beginning at the read offset is returned 6.3.7 FRS Read Response (0xF3) The FRS read response report is used to return the contents of an FRS record. Once a read request has been received, the FSP3xx generates read responses until the request record or portion of a record is returned. Only one FRS operation may be in progress at a time. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Report ID = 0xF3 Data Length (bits 7:4) Word Offset LSB Word Offset MSB Data0 LSB Data0 … Data0 … Data0 MSB Data1 LSB Data1 … Data1 … Data1 MSB FRS Type LSB FRS Type MSB Reserved Reserved Status (bits 3:0) Figure 41: FRS Read Response Data Length: the number of data words contained within the message. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 40 1000-3625 SH-2 Reference Manual Status: 0 – no error 1 – unrecognized FRS type 2 – busy 3 – read record completed 4 – offset out of range 5 – record empty 6 – read block completed (if block size requested) 7 – read block completed and read record completed (if block size requested) 8 – device error (DFU flash memory device unavailable) 9-15 – reserved Word Offset: the number of words offset from the beginning of the record Data0/1: between 0 and 2 32-bit words of data from and FRS record. If only 1 word is present then it will be in the data0 field. FRS Type: indicates to which type of FRS record the data belongs (see Section 4.0) 6.3.8 Command Request (0xF2) The command request is used to ask the SH-2 to perform some special operation or report some special data that is not part of normal sensor operation. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Description Report ID = 0xF2 Sequence number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Figure 42: Command Request Sequence number A monotonically incrementing uint8_t that rolls over. It is used to detect missing commands and to synchronize responses Command A unit8_t in the range of 1-127 indicating the command. 0 and 128-255 are reserved. P0 – P9 A set of command-specific parameters. The interpretation of these parameters is defined for each command. 6.3.9 Command Response (0xF1) The command response is used to report the results of some special operation or some special data that is not part of normal sensor operation. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 41 1000-3625 SH-2 Reference Manual Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Report ID = 0xF1 Sequence number Command Command sequence number Response sequence number R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 Figure 43: Command Response Sequence number A monotonically incrementing uint8_t that rolls over. It is used to detect missing responses Command A unit8_t indicating the command being responded to. A value of with the most significant bit set indicates that the response was autonomously generated and is not associated with a command request. Bits 6-0 indicate the command that the response corresponds to. That is, bits 6-0 identify how to interpret the response. Command sequence number The sequence number from the command request for which the response was returned. It is used to synchronize commands and responses. This field is set to 0 for unsolicited responses. Response sequence number Some commands may require multiple responses. This is a monotonically incrementing uint8_t that counts responses within a group of responses to a single request. It may rollover. It restarts at 0 with each new response group. A response group may consist of only one response. R0 – R10 A set of response values. The interpretation of these values is specific to the response for each command. 6.4 Commands A set of commands has been defined to support a variety of operations on the sensor hub. For each command id, a Command Message and associated Response message are usually defined. (A few cases define only a command or only a response.) The definitions of the command and response formats for each command id are defined in the following sections. The following table summarizes the command identifiers defined to date: Id 1 2 Name Errors Counter Description Command and Response to access error queue. See section 6.4.1 Command and Response to access counters. See section 6.4.3 Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 42 1000-3625 Id 3 4 5 6 7 8 9 10 11 SH-2 Reference Manual Name Tare Initialize Reserved DCD ME CAL Reserved DCD Save Oscillator Clear DCD and Reset Description Command and Response to operate on tare. See section 6.4.4 Reinitialize sensor hub components. See section 6.4.5 ID 5 is not currently in use. It is reserved for future use. Command to save DCD. See section 6.4.6 Command and Response to configure ME Calibration. See section 6.4.7 Deprecated. Command to configure periodic saving of DCD. See section 6.4.6 Command to retrieve the oscillator type used in the clock system. Command to clear the in-memory DCD state and perform a chip reset. See section Figure 44: Command Identifiers 6.4.1 Report Errors (0x01) The SH-2 maintains a queue of errors. The report error command is used to retrieve values from this queue. The usage of parameters and response values is shown below. The report error command may generate multiple responses. The SH-2 will send as many responses as necessary to send all the errors in its queue. Every error response ends with a response with the error source set to 255, indicating that there are no more errors to report. Byte 0 1 2 3 Name Report ID Sequence Number Command P0 4 5 6 7 8 9 10 11 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See section 6.3.8. 0x01 – report all errors in the error queue The severity of errors to report. Errors of this severity and higher will be reported. 0 – highest priority. Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 45: Report Errors Command Byte 0 1 2 3 4 5 Name Report ID Sequence Number Command Command Sequence Number Response Sequence Number R0 Description 0xF1- Command Response See Section 6.3.9 0x01 – report all errors in the error queue See Section 6.3.9 See Section 6.3.9 Severity – the severity of the error currently being reported Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 43 1000-3625 SH-2 Reference Manual Byte 6 Name R1 7 R2 8 9 10 11 12 13 14 15 R3 R4 R5 R6 R7 R8 R9 R10 Description Error sequence number. A monotonically incrementing uin8_t that counts all the errors generated for the reported severity. It may rollover. Error source. 0 – reserved, 1 – MotionEngine, 2 – MotionHub, 3 – SensorHub, 4 – Chip level executable, 5-254 reserved. 255 – no error to report. Error. See library API Error module. See library API Error code. See library API Reserved Reserved Reserved Reserved Reserved Figure 46: Report Errors Response 6.4.2 Perform Self-Test TBD 6.4.3 Counter Commands (0x02) Counter commands are specified with a command byte of 2. Sub-commands are specified by the P0 byte. 6.4.3.1 Get Counts (0x00) Retrieve the number of times a specified sensor has produced samples, and what has been done with those samples. Offered = Number of samples produced by underlying data source. On = Number of “Offered” samples while this sensor was requested by host. Accepted = Number of “On” samples that passed decimation filter. Attempted = Number of “Accepted” samples that passed threshold requirements and had transmission to the host attempted. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x02 – Counter command 0x00 – Sub-command: get counts Sensor ID Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 47: Get Counts Command Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 44 1000-3625 SH-2 Reference Manual These counts are returned in a pair of responses. The response sequence number (0 or 1) indicates the types of counts it contains. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Name Report ID Sequence Number Command Command Sequence Number Response Sequence Number R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 Description 0xF1- Command Response See Section 6.3.9 0x02 – Counter command See 6.3.9 See 6.3.9 Sensor ID Status (0= invalid sensor requested, 1=valid sensor requested) Reserved Count Offered (Sequence Number=0) Count On (Sequence Number=1) LSB Count Offered (SN=0) Count On (SN=1) … Count Offered (SN=0) Count On (SN=1) …. Count Offered (SN=0) Count On (SN=1) MSB Count Accepted (SN=0) Count Attempted (SN=1) LSB Count Accepted (SN=0) Count Attempted (SN=1) … Count Accepted (SN=0) Count Attempted (SN=1) …. Count Accepted (SN=0) Count Attempted (SN=1) MSB Figure 48: Get Counts Response 6.4.3.2 Clear Counts (0x01) Clear all counters for a given sensor to 0. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x02 – Counter command 0x01 – Sub-command: clear counts Sensor ID Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 49: Clear Counts Command 6.4.4 Tare (0x03) Tare commands are specified with a Command byte of 3. Sub-commands are specified by the P0 byte. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 45 1000-3625 SH-2 Reference Manual 6.4.4.1 Tare Now (0x00) This command instructs SH-2 to perform a tare operation along one or more axis. Currently the following axes are supported: P1 = 0x07: (X,Y, Z). This tares with rotation around all axes. This will reorient all motion outputs (e.g. accelerometer, gyroscope, magnetometer, rotation vectors). P1 = 0x04: (Z): This will tare with a rotation around Z, which changes the heading, but not the tilt. The Z axis will be defined by the current reorientation. If P2 is 0 (Rotation Vector) or 2 (Geomagnetic Rotation Vector), then this will reorient all motion outputs. If P2 is 1 (Gaming Rotation Vector), then this will only tare the Gaming Rotation Vector. A Zaxis Gaming Rotation tare cannot be persistent, because the Gaming Rotation Vector has no absolute reference for heading. If P2 is 3, 4, or 5 (Gyro-Integrated Rotation Vector, ARVR-Stabilized Rotation Vector, ARVRStabilized Game Rotation Vector), then the tare will be performed on the underlying rotation vector (Rotation Vector or Game Rotation Vector). The derived vector will be immediately updated to match the value of the underlying rotation vector at this time. Byte 0 1 2 3 4 5 Name Report ID Sequence Number Command P0 P1 P2 6 7 8 9 10 11 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x03 – Tare command 0x00 – Subcommand: Perform Tare now Bitmap of axes to tare: Bit 0= X, Bit 1= Y, Bit 2= Z Rotation Vector to use as basis for tare. 0: Rotation Vector 1: Gaming Rotation Vector 2: Geomagnetic Rotation Vector 3: Gyro-Integrated Rotation Vector 4: ARVR-Stabilized Rotation Vector 5: ARVR-Stabilized Game Rotation Vector Reserved Reserved Reserved Reserved Reserved Reserved Figure 50: Tare Now Command 6.4.4.2 Persist Tare (0x01) This command instructs SH-2 to persist the results of the last tare operation to flash for use at the next system restart. These results are stored in the master Sensor Orientation configuration record, individual sensor orientation records are not modified. Note that this only persists the tare applied to rotation vector and geomagnetic rotation vector. Byte 0 Name Report ID Description 0xF2 – Command Request Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 46 1000-3625 SH-2 Reference Manual Byte 1 2 3 4 5 6 7 8 9 10 11 Name Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description See Section 6.3.8. 0x03 – Tare command 0x01 – Persist Tare Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 51: Persist Tare Command 6.4.4.3 Set Reorientation (0x02) This command instructs SH-2 to set the current run-time sensor reorientation. Note that this does not replace any persistent tare settings in the master Sensor Orientation configuration record. Persistent tare settings must be cleared by deleting the Sensor Orientation configuration record. To clear the current tare, set P1-P8 to 0x00. The rotation vector is a signed, 16-bit 2’s-complement fixed point number with a Q-point of 14. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x03 – Tare Command 0x02 – Set Reorientation Rotation quaternion X LSB Rotation quaternion X MSB Rotation quaternion Y LSB Rotation quaternion Y MSB Rotation quaternion Z LSB Rotation quaternion Z MSB Rotation quaternion W LSB Rotation quaternion W MSB Figure 52: Set Reorientation Command 6.4.5 Initialization (0x04) The initialize command requests that the sensor hub reinitialize itself or one of its subsystems. The response is sent unsolicited if the sensor hub itself resets. 6.4.5.1 Initialize Command This command is sent by the host to re-initialize the sensor hub (or one of its subsystems.) Byte 0 Name Report ID Description 0xF2 – Command Request Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 47 1000-3625 SH-2 Reference Manual Byte 1 2 3 4 5 6 7 8 9 10 11 Name Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description See Section 6.3.8. 0x04 – Initialize command Subsystem Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 53: Initialize Command The subsystem field indicates which component of the sensor hub should be reinitialized: Value 0 1 Others Subsystem None SensorHub Reserved Description No Operation. Reinitialize the entire sensor hub. Reserved Figure 54: Initialize Command Subsystems 6.4.5.2 Initialize Response The sensor hub responds to the Initialize command with an Initialize Response. In the case where the sensor hub reinitializes itself, this response is unsolicited. An unsolicited response is also generated after startup. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Name Report ID Sequence Number Command Command Sequence Number Response Sequence Number R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 Description 0xF1- Command Response See Section 6.3.9 0x04 – Initialize, 0x84 – Initialize (unsolicited) See 6.3.9 See 6.3.9 Status (0 – successful. 1 – Operation failed) Subsystem Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 55: Initialize Response Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 48 1000-3625 SH-2 Reference Manual 6.4.6 Save DCD (0x06) The Save DCD command requests that the sensor hub save the current DCD. Upon completion, a Save DCD Response will be sent. 6.4.6.1 Save DCD Command This command is sent by the host to save the DCD. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x06 – Save DCD Command Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 56: Save DCD Command 6.4.6.2 Save DCD Response The sensor hub responds to the Save DCD command with a Save DCD Response containing a success/failure status. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Name Report ID Sequence Number Command Command Sequence Number Response Sequence Number R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 Description 0xF1- Command Response See Section 6.3.9 0x06 – Save DCD See 6.3.9 See 6.3.9 Status (0 – success. Non Zero – Operation failed) Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 57: Save DCD Response Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 49 1000-3625 SH-2 Reference Manual 6.4.7 ME Calibration Commands (0x07) The ME Calibration command requests tell the sensor hub to enable/disable the accelerometer, gyro and magnetometer calibration routines and can read back the enable/disable state of each of these routines. 6.4.7.1 Configure ME Calibration Command This command is sent by the host to configure the ME calibration of the accelerometer, gyro and magnetometer giving the host the ability to control when calibration is performed. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x07 – ME Calibration Command Accel Cal Enable (1 – enabled, 0 – disabled) Gyro Cal Enable (1 – enabled, 0 – disabled) Mag Cal Enable (1 – enabled, 0 – disabled) 0x00 – Subcommand: Configure ME Calibration Planar Accel Cal Enable (1 – enabled, 0 – disabled) Reserved Reserved Reserved Reserved Figure 58: Configure ME Calibration Command 6.4.7.2 Get ME Calibration Command This command is sent by the host to request the enable/disable state of the accelerometer, gyro and magnetometer calibration routines. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x07 – ME Calibration Command Reserved Reserved Reserved 0x01 – Subcommand: Get ME Calibration Reserved Reserved Reserved Reserved Reserved Figure 59: Get ME Calibration Command Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 50 1000-3625 SH-2 Reference Manual 6.4.7.3 ME Calibration Response The sensor hub responds to the Configure ME Calibration command with a Configure ME Calibration Response containing a success/failure status and the enable/disable state of the accelerometer, gyro and magnetometer calibration routines. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Name Report ID Sequence Number Command Command Sequence Number Response Sequence Number R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 Description 0xF1- Command Response See Section 6.3.9 0x07 – Configure ME Calibration See 6.3.9 See 6.3.9 Status (0 – success. Non Zero – Operation failed) Accel Cal Enable (1 – enabled, 0 – disabled) Gyro Cal Enable (1 – enabled, 0 – disabled) Mag Cal Enable (1 – enabled, 0 – disabled) Planar Accel Cal Enable (1 – enabled, 0 – disabled) Reserved Reserved Reserved Reserved Reserved Reserved Figure 60: Configure ME Calibration Response 6.4.8 Configure Periodic DCD Save (0x09) The Configure Periodic DCD Save command configures the automatic saving of DCD. There is no response to this command. This command does not inhibit the Save DCD command. 6.4.8.1 Configure Periodic DCD Save Command This command is sent by the host to enable or disable the saving of DCD on a periodic basis. Byte 0 1 2 3 Name Report ID Sequence Number Command P0 4 5 6 7 8 9 10 11 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x09– Configure DCD Save Command 0x00 – Enable Periodic DCD Save 0x01 – Disable Periodic DCD Save Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 51 1000-3625 SH-2 Reference Manual Figure 61: Configure Periodic Save DCD Command 6.4.9 Get Oscillator Type (0x0A) The Get Oscillator Type command is used to get information about the oscillator type used in the clock system of the SH-2. 6.4.9.1 Get Oscillator Type Command This command is sent by the host to request information about the clock system of the SH-2. Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x0A – Get Oscillator Type Command Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 62: Get Oscillator Type Command 6.4.9.2 Get Oscillator Type Response The sensor hub responds to the Get Oscillator Type command with a Get Oscillator Type Response containing the oscillator type used by the SH-2 clock system. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Name Report ID Sequence Number Command Command Sequence Number Response Sequence Number R0 R1 R2 R3 R4 R5 R6 R7 R8 Description 0xF1- Command Response See Section 6.3.9 0x0A – Get Oscillator Type Command See 6.3.9 See 6.3.9 Oscillator Type (0 – internal Oscillator, 1 – external crystal, 2 – external clock ) Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 52 1000-3625 Byte 14 15 SH-2 Reference Manual Name R9 R10 Description Reserved Reserved Figure 63: Get Oscillator Type Response 6.4.10 Clear DCD and Reset (0x0B) The sensor hub stores updated Dynamic Calibration Data to RAM frequently. At non-power-up reset, the hub will persist the last-stored DCD from RAM to FRS. In order to prevent this from happening (e.g. if one desires to fully clear DCD state), this command performs an atomic clearDCD (from RAM) and system reset. The recommended sequence for completely resetting DCD state is: 1. Reset hub (via pin toggle, reset command, or Clear DCD and Reset Command) 2. Delete flash copy of DCD via FRS: see 6.3.3. 3. Issue Clear DCD and Reset Command. 6.4.10.1 Clear DCD and Reset Command Clear any copy of DCD stored in RAM and perform a chip reset immediately. No response is sent for this command, though the hub will report an unsolicited Initialization Response as in a standard reset (see 6.4.5.2). Byte 0 1 2 3 4 5 6 7 8 9 10 11 Name Report ID Sequence Number Command P0 P1 P2 P3 P4 P5 P6 P7 P8 Description 0xF2 – Command Request See Section 6.3.8. 0x0B – Clear DCD and Reset Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Figure 64: Clear DCD and Reset Command 6.5 Sensor Reports Sensor feature reports are used to control and configure sensors, and to retrieve sensor configuration. Sensor input reports are used to send sensor data to the host. The sensor input reports use fixed point formats for their data fields. Some sensors report both the sensor data output and either the sensor bias or the sensor accuracy. For sensors that have both types of outputs, the Q point of each type of output may be different. The default Q point for each type is provided in the following sections about the reports for each sensor. For SH-2 systems using revision 1 or later of the sensor metadata record, the Q points are provided in the Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 53 1000-3625 SH-2 Reference Manual metadata record. If there is a difference between the Q point listed below and that of the metadata record, the metadata record takes precedence. 6.5.1 Common Fields The sensor feature and input reports have a number of fields in common across many sensors. These common fields and their meaning are listed in Figure 65. Fields that are specific to a sensor are explained in that sensors report. Field Report ID Sequence number Report Interval Batch Interval Feature flags Change sensitivity absolute Change sensitivity relative Sensor-Specific Configuration word Status Delay LSB Description Report ID 8-bit unsigned integer used to track reports. The sequence number increments once for each report sent. Gaps in the sequence numbers indicate missing or dropped reports. 32-bit unsigned integer representing the interval in microseconds between asynchronous input reports 32-bit unsigned integer controlling the maximum delay (in microseconds) between the time that a sensor is sampled and the time that its data can be reported. The value 0 is reserved for “do not delay” and the value 0xFFFFFFFF is reserved for “never trigger delivery on the basis of elapsed time” A bit field that enables various features for a sensor. Bit 0: change sensitivity type. 0 – absolute 1 – relative Bit 1: change sensitivity enable 0 – disabled 1 – enabled Bit 2: wake-up enable 0 – disabled 1 – enabled Bit 3: always-on enable (run sensor while hub is in “sleep” mode) 0 – disabled 1 – enabled Bit 4: reserved Bit 5: reserved Bit 6: reserved Bit 7: reserved 16-bit signed fixed point integer representing the value a sensor output must exceed in order to trigger another input report. 16-bit signed fixed point integer representing the amount by which a sensor output must change from the previous input report in order to trigger another input report. 32-bit field available for use by sensors requiring additional configuration options. Bits 1:0 – indicate the status of a sensor. 0 – Unreliable 1 – Accuracy low 2 – Accuracy medium 3 – Accuracy high Bits 7:2 – Delay upper bits: 6 most-significant bits of report delay. See blow. 8 least-significant bits of report delay. Units are 100 us. Figure 65: Common Report Fields Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 54 1000-3625 SH-2 Reference Manual 6.5.2 Common Dynamic Feature Report All sensors use the same format for a feature report. This format is shown in Figure 66. Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Feature Report ID Feature flags Change sensitivity [absolute | relative] LSB Change sensitivity [absolute | relative] MSB Report Interval LSB Report Interval Report Interval Report Interval MSB Batch Interval LSB Batch Interval Batch Interval Batch Interval MSB Sensor-specific configuration word LSB Sensor-specific configuration word Sensor-specific configuration word Sensor-specific configuration word MSB Read/Write R R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W Figure 66: Common Feature Report The type of change sensitivity may be either absolute or relative. The units of change sensitivity are normally the same as that of the input reports. The Q point of the change sensitivity is normally the same as that of the input reports. Any variations from this normal arrangement are explained in the individual sensor’s report section. For some sensors the change sensitivity is redefined to have a meaning that is applicable to that particular sensor. In these cases use of the change sensitivity field is explained in the feature report section for that sensor. 6.5.3 Get Feature Request (0xFE) Get-Feature requests are issued by sending the following report to SH-2. These are sent on the SH-2 control channel from host to hub. Byte 0 1 Description Report ID=0xFE Feature Report ID Figure 67: Get Feature Request (0xFE) “Feature Report ID” is set to the ID of the feature report that is to be obtained. For example, to request the Raw Accelerometer feature report, the bytes 0xFE 0x14 would be sent to SH-2. SH2 will respond by sending a Get Feature Response (6.5.5) at some point in the future. 6.5.4 Set Feature Command (0xFD) Set-Feature commands are issued by prefixing the full feature report with 0xFD. These are sent on the SH-2 control channel from host to hub. Byte 0 1 2 3 Description Report ID = 0xFD Feature Report ID Feature flags Change sensitivity [absolute | relative] LSB Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 55 1000-3625 SH-2 Reference Manual Byte 4 5 6 7 8 9 10 11 12 13 14 15 16 Description Change sensitivity [absolute | relative] MSB Report Interval LSB Report Interval Report Interval Report Interval MSB Batch Interval LSB Batch Interval Batch Interval Batch Interval MSB Sensor-specific configuration word LSB Sensor-specific configuration word Sensor-specific configuration word Sensor-specific configuration word MSB Figure 68: Set Feature Command (0xFD) 6.5.5 Get Feature Response (0xFC) SH-2 will respond to Get Feature Requests (6.5.3) by sending a Get Feature Response on the control channel. These are the full feature report that was requested, prefixed with 0xFC. Note that SH-2 protocol version 1.0.1 and higher will send Get Feature Response messages unsolicited if a sensor’s rate changes (e.g. due to change in the rate of a related sensor). Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Description Report ID = 0xFC Feature Report ID Feature flags Change sensitivity [absolute | relative] LSB Change sensitivity [absolute | relative] MSB Report Interval LSB Report Interval Report Interval Report Interval MSB Batch Interval LSB Batch Interval Batch Interval Batch Interval MSB Sensor-specific configuration word LSB Sensor-specific configuration word Sensor-specific configuration word Sensor-specific configuration word MSB Figure 69: Get Feature Response (0xFC) 6.5.6 Force Sensor Flush (0xF0) This is sent from the host to the hub to trigger a flush of outstanding data from a given sensor (e.g. before its batch settings would require it). The hub may report data for other sensors as Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 56 1000-3625 SH-2 Reference Manual well. Each of these will result in the transmission of a corresponding Flush Complete report (6.5.7) to the host. Byte 0 1 Description Report ID=0xF0 Sensor ID Figure 70: Force Sensor Flush (0xF0) 6.5.7 Flush Completed (0xEF) Report that all data from a given sensor, as of the corresponding Force Sensor flush () has been transmitted. Byte 0 1 Description Report ID=0xEF Sensor ID Figure 71: Flush Completed (0xEF) 6.5.8 Raw Accelerometer (0x14) The accelerometer sensor reports raw readings from the physical accelerometer MEMS sensor. The units are ADCs. Interpretation of the reported values is sensor dependent. The report ID is 0x14. 6.5.8.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.8.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Report ID = 0x14 Sequence number Status Delay Accelerometer Axis X LSB Accelerometer Axis X MSB Accelerometer Axis Y LSB Accelerometer Axis Y MSB Accelerometer Axis Z LSB Accelerometer Axis Z MSB Reserved Reserved Timestamp LSB … … Timestamp MSB Figure 72: Raw Accelerometer Input Report The timestamp field is a uint32_t. It is the time that the sample was taken as measured by a timer running on the hub. The units are microseconds. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 57 1000-3625 SH-2 Reference Manual 6.5.9 Accelerometer (0x01) The accelerometer sensor reports the total acceleration of the device. The units are m/s^2. The Q point is 8. The report ID is 0x01. 6.5.9.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.9.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 Description Report ID = 0x01 Sequence number Status Delay Accelerometer Axis X LSB Accelerometer Axis X MSB Accelerometer Axis Y LSB Accelerometer Axis Y MSB Accelerometer Axis Z LSB Accelerometer Axis Z MSB Figure 73: Accelerometer Input Report 6.5.10 Linear Acceleration (0x04) The linear acceleration sensor reports the acceleration of the device minus gravity. The units are m/s^2. The Q point is 8. The report ID is 0x04. 6.5.10.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.10.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 Description Report ID = 0x04 Sequence number Status Delay Linear acceleration Axis X LSB Linear acceleration Axis X MSB Linear acceleration Axis Y LSB Linear acceleration Axis Y MSB Linear acceleration Axis Z LSB Linear acceleration Axis Z MSB Figure 74: Linear Acceleration Input Report Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 58 1000-3625 6.5.11 SH-2 Reference Manual Gravity (0x06) The gravity sensor reports gravity in the device’s coordinate frame. The units are m/s^2. The Q point is 8. The report ID is 0x06. 6.5.11.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.11.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 Description Report ID = 0x06 Sequence number Status Delay Gravity Axis X LSB Gravity Axis X MSB Gravity Axis Y LSB Gravity Axis Y MSB Gravity Axis Z LSB Gravity Axis Z MSB Figure 75: Gravity Input Report 6.5.12 Raw Gyroscope (0x15) The gyroscope sensor reports raw readings from the physical gyroscope MEMS sensor. The units are ADCs. Interpretation of the reported values is sensor dependent. The report ID is 0x15. 6.5.12.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.12.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Description Report ID = 0x15 Sequence number Status Delay Gyroscope Axis X LSB Gyroscope Axis X MSB Gyroscope Axis Y LSB Gyroscope Axis Y MSB Gyroscope Axis Z LSB Gyroscope Axis Z MSB Gyroscope temperature LSB Gyroscope temperature MSB Timestamp LSB … Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 59 1000-3625 SH-2 Reference Manual Byte 14 15 Description … Timestamp MSB Figure 76: Raw Gyroscope Input Report The timestamp field is a uint32_t. It is the time that the sample was taken as measured by a timer running on the hub. The units are microseconds. 6.5.13 Gyroscope Calibrated (0x02) The gyroscope calibrated sensor reports drift-compensated rotational velocity. The units are rad/s. The Q point is 9. The report ID is 0x02. 6.5.13.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.13.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 Description Report ID = 0x02 Sequence number Status Delay Gyroscope calibrated Axis X LSB Gyroscope calibrated Axis X MSB Gyroscope calibrated Axis Y LSB Gyroscope calibrated Axis Y MSB Gyroscope calibrated Axis Z LSB Gyroscope calibrated Axis Z MSB Figure 77: Gyroscope Calibrated Input Report 6.5.14 Gyroscope Uncalibrated (0x07) The gyroscope uncalibrated sensor reports rotational velocity without drift compensation. An estimate of drift is also reported. The units for both values are rad/s. The Q point for both values is 9. The report ID is 0x07. 6.5.14.1 Feature Report The change sensitivity is applied to each uncalibrated axis independently. The change sensitivity does not apply to the bias fields. 6.5.14.2 Input Report Byte 0 1 2 3 4 Description Report ID = 0x07 Sequence number Status Delay Gyroscope uncalibrated Axis X LSB Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 60 1000-3625 SH-2 Reference Manual Byte 5 6 7 8 9 10 11 12 13 14 15 Description Gyroscope uncalibrated Axis X MSB Gyroscope uncalibrated Axis Y LSB Gyroscope uncalibrated Axis Y MSB Gyroscope uncalibrated Axis Z LSB Gyroscope uncalibrated Axis Z MSB Gyroscope uncalibrated bias Axis X LSB Gyroscope uncalibrated bias Axis X MSB Gyroscope uncalibrated bias Axis Y LSB Gyroscope uncalibrated bias Axis Y MSB Gyroscope uncalibrated bias Axis Z LSB Gyroscope uncalibrated bias Axis Z MSB Figure 78: Gyroscope Uncalibrated Input Report 6.5.15 Raw Magnetometer (0x16) The magnetometer sensor reports raw readings from the physical magnetometer sensor. The units are ADCs. Interpretation of the reported values is sensor dependent. The report ID is 0x16. 6.5.15.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.15.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Report ID = 0x16 Sequence number Status Delay Magnetometer Axis X LSB Magnetometer Axis X MSB Magnetometer Axis Y LSB Magnetometer Axis Y MSB Magnetometer Axis Z LSB Magnetometer Axis Z MSB Reserved Reserved Timestamp LSB … … Timestamp MSB Figure 79: Raw Magnetometer Input Report The timestamp field is a uint32_t. It is the time that the sample was taken as measured by a timer running on the hub. The units are microseconds. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 61 1000-3625 6.5.16 SH-2 Reference Manual Magnetic Field Calibrated (0x03) The magnetic field calibrated sensor reports the geomagnetic field calibrated for hard and soft iron effects such that the vector is aligned with the declination and heading of Earth’s magnetic field. The units are uTesla. The Q point is 4. The report ID is 0x03. 6.5.16.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.16.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 Description Report ID = 0x03 Sequence number Status Delay Magnetic Field calibrated Axis X LSB Magnetic Field calibrated Axis X MSB Magnetic Field calibrated Axis Y LSB Magnetic Field calibrated Axis Y MSB Magnetic Field calibrated Axis Z LSB Magnetic Field calibrated Axis Z MSB Figure 80: Magnetic Field Calibrated Input Report 6.5.17 Magnetic Field Uncalibrated (0x0F) The magnetic field uncalibrated sensor reports the geomagnetic field calibrated for soft iron effects only. Estimates for the hard iron bias are also reported. The units for both values are uTesla. The Q point for both values is 4. The report ID is 0x0F. 6.5.17.1 Feature Report The change sensitivity is applied to each uncalibrated axis independently. The change sensitivity does not apply to the hard iron bias fields. 6.5.17.2 Input Report Byte 0 1 2 3 4 5 6 7 6 9 10 11 Description Report ID = 0x0F Sequence number Status Delay Magnetic Field uncalibrated Axis X LSB Magnetic Field uncalibrated Axis X MSB Magnetic Field uncalibrated Axis Y LSB Magnetic Field uncalibrated Axis Y MSB Magnetic Field uncalibrated Axis Z LSB Magnetic Field uncalibrated Axis Z MSB Magnetic Field uncalibrated hard iron bias Axis X LSB Magnetic Field uncalibrated hard iron bias Axis X MSB Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 62 1000-3625 SH-2 Reference Manual Byte 12 13 14 15 Description Magnetic Field uncalibrated hard iron bias Axis Y LSB Magnetic Field uncalibrated hard iron bias Axis Y MSB Magnetic Field uncalibrated hard iron bias Axis Z LSB Magnetic Field uncalibrated hard iron bias Axis Z MSB Figure 81: Magnetic Field Uncalibrated Input Report 6.5.18 Rotation Vector (0x05) The rotation vector sensor reports the orientation of the device. The format of the rotation vector is a unit quaternion. The Q point is 14. In addition an estimate of the heading accuracy is reported. The units for the accuracy estimate are radians. The Q point is 12. The report ID is 0x05. 6.5.18.1 Feature Report The change sensitivity is applied to the angular difference between two rotation vectors. The units for change sensitivity are radians. The change sensitivity is unsigned and the Q point is 13. 6.5.18.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Description Report ID = 0x05 Sequence number Status Delay Unit quaternion i component LSB Unit quaternion i component MSB Unit quaternion j component LSB Unit quaternion j component MSB Unit quaternion k component LSB Unit quaternion k component MSB Unit quaternion real component LSB Unit quaternion real component MSB Accuracy estimate LSB Accuracy estimate MSB Figure 82: Rotation Vector Input Report 6.5.19 Game Rotation Vector (0x08) The rotation vector sensor reports the orientation of the device. The format of the rotation vector is a unit quaternion. The Q point is 14. The report ID is 0x08. 6.5.19.1 Feature Report The change sensitivity is applied to the angular difference between two rotation vectors. The units for change sensitivity are radians. The change sensitivity is unsigned and the Q point is 13. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 63 1000-3625 SH-2 Reference Manual 6.5.19.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 Description Report ID = 0x08 Sequence number Status Delay Unit quaternion i component LSB Unit quaternion i component MSB Unit quaternion j component LSB Unit quaternion j component MSB Unit quaternion k component LSB Unit quaternion k component MSB Unit quaternion real component LSB Unit quaternion real component MSB Figure 83: Game Rotation Vector Input Report 6.5.20 Geomagnetic Rotation Vector (0x09) The geomagnetic rotation vector sensor reports the orientation of the device. The format of the rotation vector is a unit quaternion. The Q point is 14. In addition an estimate of the heading accuracy is reported. The units for the accuracy estimate are radians. The Q point is 12. The report ID is 0x09. 6.5.20.1 Feature Report The change sensitivity is applied to the angular difference between two rotation vectors. The units for change sensitivity are radians. The change sensitivity is unsigned and the Q point is 13. 6.5.20.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Description Report ID = 0x09 Sequence number Status Delay Unit quaternion i component LSB Unit quaternion i component MSB Unit quaternion j component LSB Unit quaternion j component MSB Unit quaternion k component LSB Unit quaternion k component MSB Unit quaternion real component LSB Unit quaternion real component MSB Accuracy estimate LSB Accuracy estimate MSB Figure 84: Geomagnetic Rotation Vector Input Report Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 64 1000-3625 6.5.21 SH-2 Reference Manual Pressure (0x0A) The pressures sensor reports atmospheric pressure. The units are hectopascals. The Q point is 20. The report ID is 0x0A. 6.5.21.1 Feature Report The Q point of the change sensitivity is 6. 6.5.21.2 Input Report Byte 0 1 2 3 4 6 6 7 Description Report ID = 0x0A Sequence number Status Delay Atmospheric pressure LSB … … Atmospheric pressure MSB Figure 85: Pressure Sensor Input Report 6.5.22 Ambient Light (0x0B) The ambient light sensor reports the measures the amount of light entering the sensor. The units are lux. The Q point is 8. The report ID is 0x0B. 6.5.22.1 Feature Report The Q point of the change sensitivity is 6. 6.5.22.2 Input Report Byte 0 1 2 3 4 5 6 7 Description Report ID = 0x0B Sequence number Status Delay Ambient light LSB … … Ambient light MSB Figure 86: Ambient Light Sensor Input Report 6.5.23 Humidity (0x0C) The humidity sensor reports relative humidity in the ambient air. The units are percent. The Q point is 8. The report ID is 0x0C. 6.5.23.1 Feature Report No special remarks. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 65 1000-3625 SH-2 Reference Manual 6.5.23.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x0C Sequence number Status Delay Relative humidity LSB Relative humidity MSB Figure 87: Humidity Sensor Input Report 6.5.24 Proximity (0x0D) The proximity sensor reports distance from the device. The units are centimeters. The Q point is 4. The report ID is 0x0D. 6.5.24.1 Feature Report The change sensitivity is applied to each axis independently. 6.5.24.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x0D Sequence number Status Delay Distance LSB Distance MSB Figure 88: Proximity Sensor Input Report 6.5.25 Temperature (0x0E) The temperature sensor reports ambient temperature. The units are °C. The Q point is 7. The report ID is 0x0E. 6.5.25.1 Feature Report No special remarks. 6.5.25.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x0E Sequence number Status Delay Temperature LSB Temperature MSB Figure 89: Temperature Sensor Input Report Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 66 1000-3625 SH-2 Reference Manual 6.5.26 Reserved (0x17) 6.5.27 Tap Detector (0x10) The tap detector reports single and double taps. The report ID is 0x10. 6.5.27.1 Feature Report The change sensitivity should be set to 0 for the tap detector. 6.5.27.2 Input Report Byte 0 1 2 3 4 Description Report ID = 0x10 Sequence number Status Delay Taps detected Figure 90: Tap Detector Input Report Taps detected Bit field. Indicates single and double taps along each axis. The direction flag is not valid if a tap was not detected along the associated axis. The direction flag means that if a tap was detected and the direction flag is set then the tap was along the positive given axis towards the origin. For example, if the positive Z axis is pointing out of the face of a device and the user taps on the face of the device then the Z axis tap and direction flags will both be set. If a tap is detected, it may be either a single or a double tap. Bit 0 – X axis tap. Bit 1 – X axis positive tap Bit 2 – Y axis tap Bit 3 – Y axis positive tap Bit 4 – Z axis tap Bit 5 – Z axis positive tap Bit 6 – double tap Bit 7 – reserved 6.5.28 Step Detector (0x18) The step detector reports steps detected. Each report indicates a single step. The report ID is 0x18. 6.5.28.1 Feature Report The change sensitivity should be set to 0 for the step detector. 6.5.28.2 Input Report Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 67 1000-3625 SH-2 Reference Manual Byte 0 1 2 3 4 5 6 7 Description Report ID = 0x18 Sequence number Status Delay Detect latency LSB … … Detect latency MSB Figure 91: Step Detector Input Report Detect latency 6.5.29 The delay in microseconds from The time from when the step occurred until the time the step was detected and reported. Step Counter (0x11) The step counter reports steps counted. The units are steps. The value is unsigned. The Q point is 0. The report ID is 0x11. The step counter will wake the host at least once before the steps field wraps around to a previously reported value. 6.5.29.1 Feature Report No special remarks. 6.5.29.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 Description Report ID = 0x11 Sequence number Status Delay Detect latency LSB … … Detect latency MSB Steps LSB Steps MSB Reserved Reserved Figure 92: Step Counter Input Report Detect latency The delay in microseconds from The time from when the last step being counted occurred until the time the step count was reported. Steps The number of steps counted. This is a normally incrementing count of the number of steps taken by the user. This field may decrement of motions previously reported as steps are determined not to be steps. This field rolls over. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 68 1000-3625 SH-2 Reference Manual 6.5.30 Significant Motion (0x12) The significant motion detector sends a single report when it detects significant motion. It automatically turns itself off after sending its single report. The report ID is 0x12. 6.5.30.1 Feature Report The change sensitivity should be set to 0 for the significant motion detector. 6.5.30.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x12 Sequence number Status Delay Motion LSB Motion MSB Figure 93: Significant Motion Input Report Motion Indicates motion being reported. 1 – significant motion detected All other values are reserved. 6.5.31 Stability Classifier (0x13) The stability classifier sensor reports the type of stability detected. The report ID is 0x13. 6.5.31.1 Feature Report The change sensitivity should be set to 0 for the stability classifier sensor. 6.5.31.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x13 Sequence number Status Delay Stability classification Reserved Figure 94: Stability Classifier Input Report Stability Classification Stability classification is the state of the device based on its movement. 0 – unknown 1 – on table. The hub is at rest on a stable surface with very little vibration. 2 – stationary. The hub’s motion is below the stable threshold but the stable duration requirement has not been met. This output is Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 69 1000-3625 SH-2 Reference Manual only available when gyro calibration is enabled. See section 6.4.7 for details about enabling gyro calibration. When gyro calibration is disabled, only states 0, 1, 3 and 4 are output. 3 – stable. The hub’s motion has met the stable threshold and duration requirements. 4 – motion. The hub is moving. 5 – 255 Reserved 6.5.32 Shake Detector (0x19) The shake detector sends a report each time it detects a shake. The report ID is 0x19. 6.5.32.1 Feature Report The change sensitivity should be set to 0 for the shake detector. 6.5.32.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x19 Sequence number Status Delay Shake LSB Shake MSB Figure 95: Shake Detector Input Report Shake A bit field that indicates the axis along which that a shake was detected. Bit 0 – X axis shake. Bit 1 – Y axis shake Bit 2 – Z axis shake Bits 3-15 – Reserved 6.5.33 Flip Detector (0x1A) The flip detector sends a report each time it detects a flip. The report ID is 0x1A. 6.5.33.1 Feature Report The change sensitivity should be set to 0 for the flip detector. 6.5.33.2 Input Report Byte 0 1 2 Description Report ID = 0x1A Sequence number Status Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 70 1000-3625 SH-2 Reference Manual Byte 3 4 5 Description Delay Flip LSB Flip MSB Figure 96: Flip Detector Input Report Flip Indicates that a flip was detected. 1 – flip detected All other values are reserved 6.5.34 Pickup Detector (0x1B) The pickup detector sends a report each time it detects a pickup. The report ID is 0x1B. 6.5.34.1 Feature Report The change sensitivity should be set to 0 for the pickup detector. 6.5.34.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x1B Sequence number Status Delay Pickup LSB Pickup MSB Figure 97: Pickup Detector Input Report Pickup Indicates that a pickup was detected. 1 – level to not level detected 2 – stopped within tilt region detected 3 – both level to not level and stopped within tilt region detected All other values are reserved 6.5.35 Stability Detector (0x1C) The stability detector sends a report each time it detects entry in or exit from a stable state. The report ID is 0x1C. 6.5.35.1 Feature Report The change sensitivity should be set to 0 for the stability detector. 6.5.35.2 Input Report Byte 0 1 Description Report ID = 0x1C Sequence number Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 71 1000-3625 SH-2 Reference Manual Byte 2 3 4 5 Description Status Delay Stability LSB Stability MSB Figure 98: Stability Detector Input Report Stability Bit field. Indicates stability detector events. A value of 1 means the event was detected. Bit 0 – stable state entered Bit 1 – stable state exited All other bits are reserved 6.5.36 Personal Activity Classifier (0x1E) 6.5.36.1 Feature Report The lower 31 bits of Sensor-Specific Configuration Word indicate which classifications are requested (bit indices correspond with the classification states enumerated in Figure 101: Activity Classification States). For example, to enable still (4), walking (6) and running (7), the host would set bits 4, 6, and 7, supplying 0x000000D0 as the Sensor-Specific Configuration Word. If any classifications are requested, the “Unknown” classification (0) will automatically be requested. Change sensitivity is specified in percent (0-100), and is applied to the confidence of each classification. A report will be produced if any requested classification’s confidence change since the last transmitted input report exceeds the specified threshold. Note that this change is not relative to the value of the confidence. For example, a 10% change threshold, when applied to a classification having original confidence of 80%, will trigger at 90% and 70%, not 88% and 72%. The most significant bit of Sensor-Specific Configuration Word imposes the additional constraint that the most-likely-state must differ from the last reported most-likely state when set. Description Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 0 … … … … … … 1 2 3 … … MLS Change … … Classification 30 enable … … … … … … … … … … … … Classification 1 enable … … … Classification 0 enable … … … Figure 99: Personal Activity Classifier Feature Report. 6.5.36.2 Input Report Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 72 1000-3625 SH-2 Reference Manual Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Report ID = 0x1E Sequence number Status Delay Page Number + EOS Most likely state Classification (10 x Page Number) confidence Classification (10 x Page Number) + 1 confidence Classification (10 x Page Number) + 2 confidence Classification (10 x Page Number) + 3 confidence Classification (10 x Page Number) + 4 confidence Classification (10 x Page Number) + 5 confidence Classification (10 x Page Number) + 6 confidence Classification (10 x Page Number) + 7 confidence Classification (10 x Page Number) + 8 confidence Classification (10 x Page Number) + 9 confidence Figure 100: Personal Activity Classifier Report Page Number + EOS MSB is set if this is the last input report for a set of classification results, MSB is clear if more input reports follow this one. 7 least-significant bits indicate page number in the event that classifications are added that exceed the length of a single input report. Results will be reported in multiple pages of no more than 10 confidence levels per page. Most likely state Indicates most likely current state, per Figure 101: Activity Classification States. Classification n confidence Confidence that the current state is (Page Number x 10) + n. Confidences range from 0 to 100, but do not add up to 100 (as activities are not mutually exclusive). Note that the classifier may not be able to be configured to provide exactly the set of classifications requested. In this case, confidence reports for unwanted classifications may be masked (set to 0) internally by SH-2. Note that if the personal activity classifier supports more than 10 classifications, all pages will be reported (even if no classifications were requested on that page or no confidence levels on that page exceeded the change threshold). ID 0 1 2 3 4 5 6 7 8 Description Unknown In-Vehicle On-Bicycle On-Foot Still Tilting Walking Running OnStairs Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 73 1000-3625 SH-2 Reference Manual Figure 101: Activity Classification States 6.5.37 Sleep Detector (0x1F) The sleep detector sends a report each time it detects a change in sleep state. The report ID is 0x1F. 6.5.37.1 Feature Report The change sensitivity should be set to 0 for the sleep detector. 6.5.37.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x1F Sequence number Status Delay Sleep state Reserved Figure 102: Sleep Detector Input Report Sleep state Indicates the users current sleep state. 0 – hard wake 1 – soft wake 2 – light sleep 3 – deep sleep 4 – unknown All other values are reserved 6.5.38 Tilt Detector (0x20) The tilt detector sends a report each time it detects a tilt. The report ID is 0x20. 6.5.38.1 Feature Report The change sensitivity should be set to 0 for the tilt detector. 6.5.38.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x20 Sequence number Status Delay Tilt LSB Tilt MSB Figure 103: Tilt Detector Input Report Tilt Indicates that a tilt was detected. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 74 1000-3625 SH-2 Reference Manual 1 – tilt detected All other values are reserved 6.5.39 Pocket Detector (0x21) The pocket detector sends a report each time it detects entry in or exit from a pocket state. The report ID is 0x21. 6.5.39.1 Feature Report The change sensitivity should be set to 0 for the pocket detector. 6.5.39.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x21 Sequence number Status Delay Pocket LSB Pocket MSB Figure 104: Pocket Detector Input Report Pocket State Bit field. Indicates pocket detector events. A value of 1 means the event was detected. Bit 0 – entered in pocket state Bit 1 – entered out of pocket state All other bits are reserved 6.5.40 Circle Detector (0x22) The circle detector sends a report each time it detects a double circle gesture. The report ID is 0x22. 6.5.40.1 Feature Report The change sensitivity should be set to 0 for the circle detector. 6.5.40.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x22 Sequence number Status Delay Circle LSB Circle MSB Figure 105: Circle Detector Input Report Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 75 1000-3625 SH-2 Reference Manual Circle Indicates that a circle was detected. 1 – circle gesture detected All other values are reserved 6.5.41 Heart Rate Monitor (0x23) The heart rate monitor measures the user’s heart rate. The report ID is 0x23. Heart rate is an unsigned 16-bit integer reported in beats per minute (bpm). 6.5.41.1 Feature Report No special remarks. 6.5.41.2 Input Report Byte 0 1 2 3 4 5 Description Report ID = 0x23 Sequence number Status Delay Heart rate LSB Heart rate MSB Figure 106: Heart Rate Monitor Input Report 6.5.42 ARVR-Stabilized Rotation Vector (0x28) The ARVR-stabilized rotation vector sensor reports the orientation of the device. Accumulated errors are corrected while the device is in motion, which limits the appearance of discontinuities or jumps in data. The format of the rotation vector is a unit quaternion. The Q point is 14. In addition an estimate of the heading accuracy is reported. The units for the accuracy estimate are radians. The Q point is 12. The report ID is 0x28. 6.5.42.1 Feature Report The change sensitivity is applied to the angular difference between two rotation vectors. The units for change sensitivity are radians. The change sensitivity is unsigned and the Q point is 13. 6.5.42.2 Input Report Byte 0 1 2 3 4 5 6 7 8 Description Report ID = 0x28 Sequence number Status Delay Unit quaternion i component LSB Unit quaternion i component MSB Unit quaternion j component LSB Unit quaternion j component MSB Unit quaternion k component LSB Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 76 1000-3625 SH-2 Reference Manual Byte 9 10 11 12 13 Description Unit quaternion k component MSB Unit quaternion real component LSB Unit quaternion real component MSB Accuracy estimate LSB Accuracy estimate MSB Figure 107: ARVR-Stabilized Rotation Vector Input Report 6.5.43 ARVR-Stabilized Game Rotation Vector (0x29) The ARVR-Stabilized game rotation vector sensor reports the orientation of the device. Accumulated errors are corrected while the device is in motion, which limits the appearance of discontinuities or jumps in data. The format of the rotation vector is a unit quaternion. The Q point is 14. The report ID is 0x29. 6.5.43.1 Feature Report The change sensitivity is applied to the angular difference between two rotation vectors. The units for change sensitivity are radians. The change sensitivity is unsigned and the Q point is 13. 6.5.43.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 Description Report ID = 0x29 Sequence number Status Delay Unit quaternion i component LSB Unit quaternion i component MSB Unit quaternion j component LSB Unit quaternion j component MSB Unit quaternion k component LSB Unit quaternion k component MSB Unit quaternion real component LSB Unit quaternion real component MSB Figure 108: ARVR-Stabilized Game Rotation Vector Input Report 6.5.44 Gyro-Integrated Rotation Vector (0x2A) The Gyro-Integrated Rotation Vector sensor reports the absolute orientation of the device as determined by integrating gyroscope data at every gyroscope sample and correcting to the more-accurate Rotation Vector periodically. This sensor can support higher data rates than the more-accurate Rotation Vector can. The format of the output report is a unit quaternion and calibrated gyroscope data. The Q point of the angular position is 14 and angular velocity is 10. The report ID is 0x2A. 6.5.44.1 Feature Report This feature supports neither on-change nor batched operation. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 77 1000-3625 SH-2 Reference Manual While this virtual sensor is controlled (via set-feature reports) with report ID 0x2A on the common control channel, its data is delivered on the “inputGyroRv” SHTP channel, not the standard input report channels. 6.5.44.2 Input Report Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Description Unit quaternion i component LSB Unit quaternion i component MSB Unit quaternion j component LSB Unit quaternion j component MSB Unit quaternion k component LSB Unit quaternion k component MSB Unit quaternion real component LSB Unit quaternion real component MSB Angular velocity x component LSB Angular velocity x component MSB Angular velocity y component LSB Angular velocity y component MSB Angular velocity z component LSB Angular velocity z component MSB Figure 109: Gyro-Integrated Rotation Vector Input Report Note that this input report *DOES NOT* contain a report ID field. This is the only type of report delivered on the “inputGyroRV” SHTP channel, so it is omitted to save transmission time. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 78 1000-3625 7.0 SH-2 Reference Manual Batching Under SH-2, all input reports on the inputNormal and inputWakeup channels are delivered in batch format. The batch interval setting in the Common Dynamic Feature Report (6.5.2) dictates how many microseconds are allowed to elapse between the point in time where a sensor measurement is obtained and the time that it is provided to the host. A lower value results in lower data latency but higher system power consumption. In order to comply with the Android L requirements [3], we separate wakeup sensor data from non-wakeup sensor data. Any time that a delivery is triggered, we deliver the data from the wakeup queue first before sending the data from the non-wakeup queue. 7.1 Batch queues SH-2 maintains two batch queues, one for wake-up sensor data, the other for non-wake-up sensor data. These are sized independently and do not share memory. Sensors are configured as wake-up by setting the wake-up bit in the “Feature Flags” field of the Common Dynamic Feature Report (6.5.2). 7.2 Batch timestamps In order to balance the needs of transmitting high-frequency data (with low timestamp overhead) and low-frequency data (with large batch delay values), we combine the sensor report’s 14-bit delay field with two additional record types: a Base Timestamp Reference and Timestamp Rebase. 1. A “Base Timestamp Reference” record is inserted at the start of each batch, giving a shared time reference between the host and the sensor hub. 2. A “Timestamp Rebase” record is inserted to extend the delay for blocks of reports which are too far from the batch’s Base Timestamp Reference to be represented with the 14-bit report delay field. Figure 110 graphically displays the relationship between the various sources of timing data. Transport Reference (e.g. HINT) Base Reference Report Report Timestamp Rebase Report Report Figure 110: Timestamp Dependencies 7.2.1 Base Timestamp Reference (0xFB) The Base Timestamp Reference provides a delta from the transport-protocol-defined reference point (the HINT assert for SHTP) and some arbitrary point in time. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 79 1000-3625 SH-2 Reference Manual Byte 0 1 2 3 4 Description Report ID=0xFB Base Delta LSB: relative to transport-defined reference point. Signed. Units are 100 microsecond ticks. Base Delta Base Delta Base Delta MSB Figure 111: Base Timestamp Reference Record For example, if HINT occurs at some time t and the Base Timestamp Reference record has a value for delta of 10, the timestamps in a given batch will be relative to t – 1 ms. The value 0x7FFFFFFF is reserved to indicate that Base Delta exceeded the maximum value that could be represented in 32 bits. 7.2.2 Timestamp Rebase (0xFA) The 14-bit delay field of sensor input reports can represent up to 16383 100-microsecond ticks, or up to 1.64 seconds. Low frequency, batched sensor data can easily span ranges of time on the order of seconds or minutes. The Timestamp Rebase record is added to the batch’s Base Timestamp Reference to derive a new base for sensor reports. Note that Rebase Delta is signed. Byte 0 1 2 3 4 Description Report ID=0xFA Rebase Delta LSB: relative to Base Timestamp Reference. Signed. Units are 100 microsecond ticks. Rebase Delta Rebase Delta Rebase Delta MSB Figure 112: Timestamp Rebase Record For example, if HINT occurs at time 5.0 seconds and the batch’s Base Timestamp Base Delta is 4.0 seconds, this establishes a shared base timestamp at 1.0 seconds. If a timestamp rebase is encountered having delta 1.5 seconds, then the basis to which subsequent report delays are applied will be 2.5 (e.g. a sensor report having delay = 1.0 seconds would be timestamped as occurring at t=3.5). Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 80 1000-3625 8.0 SH-2 Reference Manual References 1. Hillcrest Laboratories, 1000-3535 Sensor Hub Transport Protocol 2. Hillcrest Laboratories, 1000-3600 SH-2 SHTP Reference Manual 3. Batching: http://source.android.com/devices/sensors/batching.html Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 81 1000-3625 9.0 SH-2 Reference Manual Notices Information furnished by Hillcrest Laboratories, Inc. (Hillcrest) is believed to be accurate and reliable. However, Hillcrest assumes no responsibility for its use, nor for any infringement of patents or other rights of third parties that may result from its use. Hillcrest reserves the right to make changes, corrections, modifications or improvements to this document at any time without notice. Information in this document supersedes and replaces all information previously supplied. Hillcrest makes no warranties, express or implied, regarding the information contained in this document. Information in this document is provided solely to enable the use of Hillcrest products. “Typical” and default parameters provided by Hillcrest are not guaranteed, and can vary between applications and over time. The product is designed primarily for use in consumer electronics and has not been evaluated for use in products or systems where failure or malfunction may result in personal injury, death, severe property damage or environmental damage, such as aerospace, lifesaving, life sustaining or military applications. Hillcrest assumes no liability for any claims or damages arising from information contained in this document, or from the use of products and services detailed herein. This exclusion includes, but is not limited to, claims or damages based on the infringement of patents, trademarks, copyrights and/or any other intellectual property rights. The product is provided by Hillcrest “As Is.” Hillcrest makes no representations or warranties regarding the product express or implied, including without limitation any implied warranties as to title, noninfringement, merchantability, or fitness for a particular purpose. Freespace is a registered trademark of Hillcrest Laboratories, Inc. The Hillcrest Labs logo is a trademark of Hillcrest Laboratories, Inc. All other trademarks and copyrights are the property of their respective owners. Third party notices are available on our website at: http://hillcrestlabs.com/legal/third-partyattributions/ Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. Copyright © 2017 Hillcrest Laboratories, Inc. All rights reserved. 82
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 83 Language : en-US Tagged PDF : Yes XMP Toolkit : 3.1-701 Producer : Microsoft® Word 2016 Title : SH-2 Reference Manual Creator : Hillcrest Creator Tool : Microsoft® Word 2016 Create Date : 2017:05:19 17:06:16-04:00 Modify Date : 2017:05:19 17:06:16-04:00 Document ID : uuid:F40ABDC4-7785-48CB-946B-001FD06C6351 Instance ID : uuid:F40ABDC4-7785-48CB-946B-001FD06C6351 Author : HillcrestEXIF Metadata provided by EXIF.tools