SH-2 API User's Guide: Generated by Doxygen 1.8.11
SH-2 API User's Guide: Generated by Doxygen 1.8.11
3 File Index 9
4.11.2.1 heartRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.16.1.1 pickup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Generated by Doxygen
CONTENTS v
Generated by Doxygen
vi CONTENTS
5 File Documentation 35
5.1.2.1 sh2_AsyncEvent_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.2.2 sh2_Counts_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.2.3 sh2_ErrorRecord_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.2.4 sh2_ProductId_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.2.5 sh2_Quaternion_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.2.6 sh2_SensorConfig_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.2.7 sh2_SensorEvent_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.2.8 sh2_SensorMetadata_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1.2.9 sh2_TareAxis_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1.2.10 sh2_TareBasis_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1.3.1 sh2_CalStatus_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1.3.2 sh2_OscType_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1.3.3 sh2_SensorId_e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1.3.4 sh2_TareAxis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1.3.5 sh2_TareBasis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.1.4.2 sh2_clearDcdAndReset(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.1.4.3 sh2_clearTare(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Generated by Doxygen
CONTENTS vii
5.1.4.15 sh2_persistTare(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.1.4.16 sh2_reinitialize(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.1.4.17 sh2_saveDcdNow(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2.2.1 SH2_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2.2.2 SH2_ERR_BAD_PARAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2.2.3 SH2_ERR_HUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2.2.4 SH2_ERR_IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2.2.5 SH2_ERR_OP_IN_PROGRESS . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.2.2.6 SH2_ERR_TIMEOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.2.2.7 SH2_OK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Generated by Doxygen
viii CONTENTS
5.4.2.1 PAC_UNKNOWN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.4.2.2 PICKUP_LEVEL_TO_NOT_LEVEL . . . . . . . . . . . . . . . . . . . . . . . . 54
5.4.2.3 SHAKE_X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.4.2.4 STABILITY_CLASSIFIER_UNKNOWN . . . . . . . . . . . . . . . . . . . . . . 55
5.4.2.5 STABILITY_ENTERED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.4.2.6 TAPDET_X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.4.3.1 sh2_Accelerometer_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.4.3.2 sh2_AmbientLight_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.4.3.3 sh2_CircleDetector_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.4.3.4 sh2_FlipDetector_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.4.3.5 sh2_GyroIntegratedRV_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.6 sh2_Gyroscope_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.7 sh2_GyroscopeUncalibrated_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.8 sh2_HeartRateMonitor_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.9 sh2_Humidity_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.10 sh2_MagneticField_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.11 sh2_MagneticFieldUncalibrated_t . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.12 sh2_PocketDetector_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.4.3.13 sh2_Pressure_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.14 sh2_Proximity_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.15 sh2_RawAccelerometer_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.16 sh2_RawGyroscope_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.17 sh2_RawMagnetometer_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.18 sh2_Reserved_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.19 sh2_RotationVector_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.20 sh2_RotationVectorWAcc_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.4.3.21 sh2_SigMotion_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.4.3.22 sh2_SleepDetector_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.4.3.23 sh2_StepCounter_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.4.3.24 sh2_StepDetector_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.4.3.25 sh2_Temperature_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.4.3.26 sh2_TiltDetector_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Index 59
Generated by Doxygen
Chapter 1
Introduction
Hillcrest Labs, Inc. produces a line of sensor hubs that interoperate with a host processor using an interface called
SH-2. (Sensor Hub 2.) This interface is comprised of a proprietary protocol, SHTP (Sensor Hub Transport Protocol),
and a set of features that are based on that protocol. Some products that implement the SH-2 interface include the
BNO080, BNO085 and FSP200.
In order to facilitate integration of SH-2 devices into other products, Hillcrest provides an API and driver that manage
the SHTP (Sensor Hub Transport Protocol) interface and delivers application-level functionality. This document
describes how to use the SH-2 API and integrate it into new systems.
SH-2 API
The SH-2 API makes the sensor hub's features available to an application. This section describes how the API
works, beginning with a list of the API functions and brief descriptions of each. Following that, we describe a set of
conventions that the API uses.
API Functions
Initialization
• sh2_initialize()
This function initializes the sensor hub. It should be called before any other API functions to ensure the device starts
from a known state. When called, the sensor hub is reset. Also, the underlying SHTP layer is configured to support
SH-2 operations for the device.
An event handler callback can be registered at initialization time. This callback will be used to notify the application
when certain events occur. For example, the reset complete event will be passed to the callback when the device is
in a state where sensor configuration can start.
2 Hillcrest SH-2 sensor hub driver for MCU Applications
Configuring Sensors
• sh2_setSensorConfig()
• sh2_getSensorConfig()
• sh2_getMetadata()
The sh2_setSensorConfig() function is used to enable and disable sensors. It sets the desired event rate and other
attributes that control data production.
The sh2_getSensorConfig() function reads back the actual configuration of a sensor. The actual configuration can
differ from the requested configuration. For example, if a particular sensor only supports a limited set of data rates,
the value read will reflect the actual rate the sensor uses.
The sh2_getMetadata() function reads out metadata record associated with a particular sensor. The metadata
includes information such as the resolution and scale of the sensor data.
Reading Sensors
• sh2_setSensorCallback()
If a sensor is enabled, it will produce periodic events to report its measurements. These are delivered to the
application code using a callback mechanism. The sh2_setSensorCallback() function registers the application's
callback function. Along with the function, an opaque data value called the cookie, is registered. Afterward, each
sensor event will result in one call to the callback with the cookie as one parameter and an sh2_SensorEvent_t
pointer as the other.
• sh2_getProdIds()
• sh2_getFrs()
• sh2_setFrs()
• sh2_getErrors()
• sh2_getCounts()
• sh2_clearCounts()
• sh2_setTareNow()
• sh2_clearTare()
• sh2_persistTare()
• sh2_setReorientation()
• sh2_reinitialize()
• sh2_saveDcdNow()
• sh2_getOscType()
• sh2_setCalConfig()
• sh2_setDcdAutoSave()
• sh2_flush()
A variety of utility functions provide control over many facets of the SensorHub's operation. Some of these functions
read and write FRS records (Non-volatile data, usually stored in Flash memory on the device.) Others provide
access to version information, internal counters, etc. The tare operations modify the reference frame used for
reporting rotation vectors.
See the reference section for details on each of these API calls.
Generated by Doxygen
3
API Conventions
The SH-2 API uses a set of conventions for function names, returns values and other aspects of its operation.
Naming Conventions
All public functions in the SH-2 API have the prefix "sh2_". This helps distiguish them from other application functions
or other APIs.
After the sh2_ prefix, the function name starts with a verb in lower case. (This is often "get" or "set".) Additional
words to describe the function each begin with upper case. So, for example, sh2_setSensorConfig() is the function
to set the configuration of a particular sensor.
Enumerations and macros (#defines) are named with the prefix SH2_.
Data types that are exposed through the API are named with the prefix sh2_ and end with the suffix _t. The word or
words between prefix and suffix are capitalized. So, for example, the sensor metadata record type is sh2_Sensor←-
Metadata_t.
Blocking calls
Most of the SH-2 SPI functions are blocking. That is, they only return after they have performed their function.
Return values
All SH-2 API functions return a status code. The values are listed in sh2_err.h. In general a successful API operation
will return SH2_OK, which is zero. If the operation failed for any reason, some other code will be returned. The
error return values are all less than zero.
Memory allocation
Generally, API functions that must return blocks of data require the caller to pass an address to a structure that will
receive the results.
The SH-2 HAL is an interface that adapts the SH-2 API to a particular hardware platform. Different platforms will
require different HAL implementations. So this software component must be developed by the system designer.
The HAL layer provides low-level communications and control functions needed by the driver and DFU (Download
Firmware Update) modules. Further details are described below for each HAL API function.
Since these functions must be implemented by the system developer, the descriptions that follow are requirements
that must be met in order for the SH-2 driver to work properly.
An example SH-2 HAL is provided for the BNO080 Developer's Kit for reference. The example is based on the
STM32F411 Nucleo eval board running FreeRTOS.
Generated by Doxygen
4 Hillcrest SH-2 sensor hub driver for MCU Applications
Initialization
The SH-2 HAL API doesn't specify a system initialization function, but most systems will require one. Any low level
interfaces, e.g. GPIO, I2C, SPI, etc, used for control of the SH-2 device should be initialized before the sh2_←-
initialize() function is used.
Device Reset
• sh2_hal_reset()
This function should perform a chip level reset on the sensor hub. It takes a flag, dfuMode, that indicates whether
the chip should be brought up in application mode or DFU mode. The reset process involves asserting the RSTN
signal on the sensor hub, setting the BOOTN signal according to the dfuMode flag, then deasserting RSTN. Timing
requirements for this process can be found in the SH-2 Reference Manual.
The HAL should store the dfuMode flag for future reference. The operation of some other HAL functions will depend
on the state of dfuMode.
The reset function also takes a callback function and cookie. These should be stored for use later. When messages
are received from the SH-2 device, they must be delivered to the driver by invoking the callback.
Communications
• sh2_hal_tx()
• sh2_hal_rx()
sh2_hal_tx() will be called by the driver (or DFU code) when it needs send a message to the SH-2 device. This
function should initiate the transmission but can return to the caller before the operation is complete.
For I2C and serial communications, the sh2_hal_tx() implementation is fairly straightforward: simply transmit the
given data. For SPI communications its a bit more complex, especially considering the timing requirements for DFU
mode.
In application mode with SPI, this function should initiate a write transaction by asserting WAKEN. The write trans-
action should continue, then, when the system responds to INTN being asserted by the sensor hub. (See Interrupt
Service for further detail). If the sh2_hal_tx function does not block during this time, it should copy the data being
transmitted.
For DFU mode, transmission can begin immediately but a different set of configuration and timing parameters need
to be used with the SPI bus. CPOL and CPHA should be 0. The SPI clock can be at most 1MHz. Furthermore the
timing of the operation needs to be carefully controlled. After asserting select, wait at least 20uS before transmitting
the first byte. Then, after each byte, delay 28uS before sending the next byte. Finally, after writing the last byte,
deassert select and wait 5ms before starting the next SPI operation. If this timing is not met, the DFU process can
fail.
sh2_hal_rx() is called only in DFU mode. For an I2C bus, this function should implement a simple i2c read of the
device. For SPI devices, it should perform a SPI operation sending NULL and placing the read data in the given
buffer.
Generated by Doxygen
5
Interrupt Service
In application mode (as opposed to dfu mode) the HAL needs to respond to interrupts from the SH-2 device. The
interrupt service routine needs to capture timestamps, initiate read operations and, for SPI devices, perform write
operations. Any data read from the SH-2 device as a result of an interrupt must be delivered to the driver via the
callback described above.
With the HAL autonomously performing read operations, it needs to know how many bytes of data to transfer. This
can be determined by peaking into the read data since the first two bytes of each SHTP transfer contain a maximum
read length.
• Initially, the host should read 2 bytes from the device. These will contain the first two bytes of the SHTP
header, containing the size of the SHTP payload to be transferred. (Let's call this value rxRemaining.)
• If 0 < rxRemaining <= max transfer length, read rxRemaining bytes. Afterward, set rxRemaining to 0.
• If rxRemaining > max transfer length, read max-transfer-length bytes. Afterward, set rxRemaining to rx←-
Remaining - max-transfer-length + 4. (The additional four bytes represent a new SHTP header that will be
generated.)
For SPI, the read length is determined in a similar manner but any SPI operation performed should transfer enough
bytes to accomodate the transmit buffer, if non-empty.
Thread Control
• sh2_hal_block()
• sh2_hal_unblock()
Some HAL implementations will use an operating system such as FreeRTOS while others will not.
If an OS is used, there are points in the SH-2 driver where the caller of an operation needs to block until the
operation completes. The SH-2 library calls sh2_hal_block and sh2_hal_unblock to implement the blocking in a
thread-friendly manner. (i.e., without busy waiting.)
The HAL implementation, in this case, should implement these using a binary semaphore.
If no OS is used and the HAL is implemented with blocking calls, the sh2_hal_block and sh2_hal_unblock calls can
be empty functions that return immediately.
See the HAL implementations in the BNO080 Nucleo Demo code for working examples of this interface.
Generated by Doxygen
6 Hillcrest SH-2 sensor hub driver for MCU Applications
Generated by Doxygen
Chapter 2
sh2_Accelerometer
Accelerometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
sh2_AmbientLight
Ambient Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
sh2_AsyncEvent
Asynchronous Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
sh2_CircleDetector
CircleDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
sh2_Counts
SensorHub Counter Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
sh2_ErrorRecord
SensorHub Error Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
sh2_FlipDetector
FlipDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
sh2_GyroIntegratedRV
HeartRateMonitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
sh2_Gyroscope
Gyroscope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
sh2_GyroscopeUncalibrated
Uncalibrated gyroscope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
sh2_HeartRateMonitor
HeartRateMonitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
sh2_Humidity
Humidity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
sh2_MagneticField
Magnetic field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
sh2_MagneticFieldUncalibrated
Uncalibrated magnetic field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
sh2_PersonalActivityClassifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
sh2_PickupDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
sh2_PocketDetector
PocketDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
sh2_Pressure
Atmospheric Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
sh2_ProductId_s
Product Id value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8 Data Structure Index
sh2_ProductIds_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
sh2_Proximity
Proximity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
sh2_Quaternion
Quaternion (double precision floating point representation.) . . . . . . . . . . . . . . . . . . . 21
sh2_RawAccelerometer
Raw Accelerometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
sh2_RawGyroscope
Raw gyroscope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
sh2_RawMagnetometer
Raw Magnetometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
sh2_Reserved
Reserved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
sh2_RotationVector
Rotation Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
sh2_RotationVectorWAcc
Rotation Vector with Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
sh2_SensorConfig
Sensor Configuration settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
sh2_SensorEvent
Sensor Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
sh2_SensorMetadata
Sensor Metadata Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
sh2_SensorValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
sh2_ShakeDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
sh2_SigMotion
SigMotion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
sh2_SleepDetector
SleepDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
sh2_StabilityClassifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
sh2_StabilityDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
sh2_StepCounter
StepCounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
sh2_StepDetector
StepDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
sh2_TapDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
sh2_Temperature
Temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
sh2_TiltDetector
TiltDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Generated by Doxygen
Chapter 3
File Index
sh2.h
API Definition for Hillcrest SH-2 Sensor Hub . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
sh2_err.h
Type definitions for Hillcrest SH-2 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
sh2_hal.h
Hardware Adaptation Layer API for SensorHub-2 (and BNO080) . . . . . . . . . . . . . . . . 50
sh2_SensorValue.h
Support for converting sensor events (messages) into natural data structures . . . . . . . . . 51
10 File Index
Generated by Doxygen
Chapter 4
Accelerometer.
#include <sh2_SensorValue.h>
Data Fields
• float x
• float y
• float z
Accelerometer.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Ambient Light.
#include <sh2_SensorValue.h>
Data Fields
• float value
Ambient Light. [lux].
12 Data Structure Documentation
Ambient Light.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Asynchronous Event.
#include <sh2.h>
Data Fields
• uint32_t eventId
• uint16_t frsType
Asynchronous Event.
Represents reset events and other non-sensor events received from SH-2 sensor hub.
The documentation for this struct was generated from the following file:
• sh2.h
circleDetector
#include <sh2_SensorValue.h>
Data Fields
• uint16_t circle
Generated by Doxygen
4.5 sh2_Counts Struct Reference 13
circleDetector
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
#include <sh2.h>
Data Fields
• uint32_t offered
[events]
• uint32_t accepted
[events]
• uint32_t on
[events]
• uint32_t attempted
[events]
The documentation for this struct was generated from the following file:
• sh2.h
#include <sh2.h>
Generated by Doxygen
14 Data Structure Documentation
Data Fields
• uint8_t severity
Error severity, 0: most severe.
• uint8_t sequence
Sequence number (by severity)
• uint8_t source
1-MotionEngine, 2-MotionHub, 3-SensorHub, 4-Chip
• uint8_t error
See SH-2 Reference Manual.
• uint8_t module
See SH-2 Reference Manual.
• uint8_t code
See SH-2 Reference Manual.
The documentation for this struct was generated from the following file:
• sh2.h
flipDetector
#include <sh2_SensorValue.h>
Data Fields
• uint16_t flip
flipDetector
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
4.8 sh2_GyroIntegratedRV Struct Reference 15
heartRateMonitor
#include <sh2_SensorValue.h>
Data Fields
• float i
Quaternion component i.
• float j
Quaternion component j.
• float k
Quaternion component k.
• float real
Quaternion component real.
• float angVelX
Angular velocity about x [rad/s].
• float angVelY
Angular velocity about y [rad/s].
• float angVelZ
Angular velocity about z [rad/s].
heartRateMonitor
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Gyroscope.
#include <sh2_SensorValue.h>
Data Fields
• float x
• float y
• float z
Generated by Doxygen
16 Data Structure Documentation
Gyroscope.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Uncalibrated gyroscope.
#include <sh2_SensorValue.h>
Data Fields
• float x
[rad/s]
• float y
[rad/s]
• float z
[rad/s]
• float biasX
[rad/s]
• float biasY
[rad/s]
• float biasZ
[rad/s]
Uncalibrated gyroscope.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
heartRateMonitor
#include <sh2_SensorValue.h>
Generated by Doxygen
4.12 sh2_Humidity Struct Reference 17
Data Fields
• uint16_t heartRate
heartRateMonitor
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Humidity.
#include <sh2_SensorValue.h>
Data Fields
• float value
Relative Humidity. [percent].
Humidity.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Magnetic field.
#include <sh2_SensorValue.h>
Generated by Doxygen
18 Data Structure Documentation
Data Fields
• float x
[uTesla]
• float y
[uTesla]
• float z
[uTesla]
Magnetic field.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
#include <sh2_SensorValue.h>
Data Fields
• float x
[uTesla]
• float y
[uTesla]
• float z
[uTesla]
• float biasX
[uTesla]
• float biasY
[uTesla]
• float biasZ
[uTesla]
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
4.15 sh2_PersonalActivityClassifier Struct Reference 19
Data Fields
• uint8_t page
• bool lastPage
• uint8_t mostLikelyState
• uint8_t confidence [10]
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Data Fields
• uint16_t pickup
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
pocketDetector
#include <sh2_SensorValue.h>
Data Fields
• uint16_t pocket
pocketDetector
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
20 Data Structure Documentation
Atmospheric Pressure.
#include <sh2_SensorValue.h>
Data Fields
• float value
Atmospheric Pressure. [hectopascals].
Atmospheric Pressure.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Product Id value.
#include <sh2.h>
Data Fields
• uint8_t resetCause
• uint8_t swVersionMajor
• uint8_t swVersionMinor
• uint32_t swPartNumber
• uint32_t swBuildNumber
• uint16_t swVersionPatch
• uint8_t reserved0
• uint8_t reserved1
Product Id value.
The documentation for this struct was generated from the following file:
• sh2.h
Generated by Doxygen
4.20 sh2_ProductIds_s Struct Reference 21
Data Fields
The documentation for this struct was generated from the following file:
• sh2.h
Proximity.
#include <sh2_SensorValue.h>
Data Fields
• float value
Proximity. [cm].
Proximity.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
#include <sh2.h>
Data Fields
• double x
• double y
• double z
• double w
Generated by Doxygen
22 Data Structure Documentation
The documentation for this struct was generated from the following file:
• sh2.h
Raw Accelerometer.
#include <sh2_SensorValue.h>
Data Fields
• int16_t x
[ADC counts]
• int16_t y
[ADC counts]
• int16_t z
[ADC counts]
• uint32_t timestamp
[uS]
Raw Accelerometer.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Raw gyroscope.
#include <sh2_SensorValue.h>
Generated by Doxygen
4.25 sh2_RawMagnetometer Struct Reference 23
Data Fields
• int16_t x
[ADC Counts]
• int16_t y
[ADC Counts]
• int16_t z
[ADC Counts]
• int16_t temperature
[ADC Counts]
• uint32_t timestamp
[uS]
Raw gyroscope.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Raw Magnetometer.
#include <sh2_SensorValue.h>
Data Fields
• int16_t x
[ADC Counts]
• int16_t y
[ADC Counts]
• int16_t z
[ADC Counts]
• uint32_t timestamp
[uS]
Raw Magnetometer.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
24 Data Structure Documentation
Reserved.
#include <sh2_SensorValue.h>
Data Fields
• float tbd
Reserved.
Reserved.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Rotation Vector.
#include <sh2_SensorValue.h>
Data Fields
• float i
Quaternion component i.
• float j
Quaternion component j.
• float k
Quaternion component k.
• float real
Quaternion component real.
Rotation Vector.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
4.28 sh2_RotationVectorWAcc Struct Reference 25
#include <sh2_SensorValue.h>
Data Fields
• float i
Quaternion component i.
• float j
Quaternion component j.
• float k
Quaternion component k.
• float real
Quaternion component, real.
• float accuracy
Accuracy estimate [radians].
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
#include <sh2.h>
Data Fields
• bool changeSensitivityEnabled
Enable reports on change.
• bool changeSensitivityRelative
Change reports relative (vs absolute)
• bool wakeupEnabled
Wake host on event.
• bool alwaysOnEnabled
Sensor remains on in sleep state.
• uint16_t changeSensitivity
Report-on-change threshold.
• uint32_t reportInterval_us
[uS] Report interval
• uint32_t batchInterval_us
[uS] Batch interval
• uint32_t sensorSpecific
See SH-2 Reference Manual for details.
Generated by Doxygen
26 Data Structure Documentation
The documentation for this struct was generated from the following file:
• sh2.h
Sensor Event.
#include <sh2.h>
Data Fields
• uint64_t timestamp_uS
• uint8_t reportId
• uint8_t ∗ pReport
• uint8_t len
Sensor Event.
The documentation for this struct was generated from the following file:
• sh2.h
#include <sh2.h>
Generated by Doxygen
4.31 sh2_SensorMetadata Struct Reference 27
Data Fields
• uint8_t meVersion
Motion Engine Version.
• uint8_t mhVersion
Motion Hub Version.
• uint8_t shVersion
SensorHub Version.
• uint32_t range
Same units as sensor reports.
• uint32_t resolution
Same units as sensor reports.
• uint16_t revision
Metadata record format revision.
• uint16_t power_mA
[mA] Fixed point 16Q10 format
• uint32_t minPeriod_uS
[uS]
• uint32_t fifoReserved
(Unused)
• uint32_t fifoMax
(Unused)
• uint32_t batchBufferBytes
(Unused)
• uint16_t qPoint1
q point for sensor values
• uint16_t qPoint2
q point for accuracy or bias fields
• uint32_t vendorIdLen
[bytes]
• char vendorId [48]
Vendor name and part number.
• uint32_t sensorSpecificLen
[bytes]
• uint8_t sensorSpecific [48]
See SH-2 Reference Manual.
The documentation for this struct was generated from the following file:
• sh2.h
Generated by Doxygen
28 Data Structure Documentation
Data Fields
• uint8_t sensorId
• uint8_t sequence
8-bit unsigned integer used to track reports.
• uint8_t status
bits 7-5: reserved, 4-2: exponent delay, 1-0: Accuracy
• uint64_t timestamp
• uint32_t delay
[uS] value is delay ∗ 2∧ exponent (see status)
• union {
sh2_RawAccelerometer_t rawAccelerometer
sh2_Accelerometer_t accelerometer
sh2_Accelerometer_t linearAcceleration
sh2_Accelerometer_t gravity
sh2_RawGyroscope_t rawGyroscope
sh2_Gyroscope_t gyroscope
sh2_GyroscopeUncalibrated_t gyroscopeUncal
sh2_RawMagnetometer_t rawMagnetometer
sh2_MagneticField_t magneticField
sh2_MagneticFieldUncalibrated_t magneticFieldUncal
sh2_RotationVectorWAcc_t rotationVector
sh2_RotationVector_t gameRotationVector
sh2_RotationVectorWAcc_t geoMagRotationVector
sh2_Pressure_t pressure
sh2_AmbientLight_t ambientLight
sh2_Humidity_t humidity
sh2_Proximity_t proximity
sh2_Temperature_t temperature
sh2_Reserved_t reserved
sh2_TapDetector_t tapDetector
sh2_StepDetector_t stepDetector
sh2_StepCounter_t stepCounter
sh2_SigMotion_t sigMotion
sh2_StabilityClassifier_t stabilityClassifier
sh2_ShakeDetector_t shakeDetector
sh2_FlipDetector_t flipDetector
sh2_PickupDetector_t pickupDetector
sh2_StabilityDetector_t stabilityDetector
sh2_PersonalActivityClassifier_t personalActivityClassifier
sh2_SleepDetector_t sleepDetector
sh2_TiltDetector_t tiltDetector
sh2_PocketDetector_t pocketDetector
sh2_CircleDetector_t circleDetector
sh2_HeartRateMonitor_t heartRateMonitor
sh2_RotationVectorWAcc_t arvrStabilizedRV
sh2_RotationVector_t arvrStabilizedGRV
sh2_GyroIntegratedRV_t gyroIntegratedRV
} un
Sensor Data.
Generated by Doxygen
4.33 sh2_ShakeDetector Struct Reference 29
The sequence number increments once for each report sent. Gaps in the sequence numbers indicate missing or
dropped reports.
[uS]
Sensor Data.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Data Fields
• uint16_t shake
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
SigMotion.
#include <sh2_SensorValue.h>
Generated by Doxygen
30 Data Structure Documentation
Data Fields
• uint16_t motion
SigMotion.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
sleepDetector
#include <sh2_SensorValue.h>
Data Fields
• uint8_t sleepState
sleepDetector
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Data Fields
• uint8_t classification
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
4.37 sh2_StabilityDetector Struct Reference 31
Data Fields
• uint16_t stability
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
StepCounter.
#include <sh2_SensorValue.h>
Data Fields
• uint32_t latency
Step counter latency [uS].
• uint16_t steps
Steps counted.
StepCounter.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
StepDetector.
#include <sh2_SensorValue.h>
Generated by Doxygen
32 Data Structure Documentation
Data Fields
• uint32_t latency
Step detect latency [uS].
StepDetector.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Data Fields
• uint8_t flags
TapDetector.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Temperature.
#include <sh2_SensorValue.h>
Data Fields
• float value
Temperature. [C].
Temperature.
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
4.42 sh2_TiltDetector Struct Reference 33
tiltDetector
#include <sh2_SensorValue.h>
Data Fields
• uint16_t tilt
tiltDetector
The documentation for this struct was generated from the following file:
• sh2_SensorValue.h
Generated by Doxygen
34 Data Structure Documentation
Generated by Doxygen
Chapter 5
File Documentation
#include <stdint.h>
#include <stdbool.h>
Data Structures
• struct sh2_AsyncEvent
Asynchronous Event.
• struct sh2_SensorEvent
Sensor Event.
• struct sh2_ProductId_s
Product Id value.
• struct sh2_ProductIds_s
• struct sh2_SensorConfig
Sensor Configuration settings.
• struct sh2_SensorMetadata
Sensor Metadata Record.
• struct sh2_ErrorRecord
SensorHub Error Record.
• struct sh2_Counts
SensorHub Counter Record.
• struct sh2_Quaternion
Quaternion (double precision floating point representation.)
36 File Documentation
Macros
Generated by Doxygen
5.1 sh2.h File Reference 37
Typedefs
Generated by Doxygen
38 File Documentation
Enumerations
Functions
Generated by Doxygen
5.1 sh2.h File Reference 39
Author
David Wheeler
Date
22 Sept 2015 The sh2 API provides functions for opening a session with the sensor hub and performing all
supported operations with it. This includes enabling sensors and reading events as well as other housekeeping
functions.
Generated by Doxygen
40 File Documentation
Asynchronous Event.
Represents reset events and other non-sensor events received from SH-2 sensor hub.
Product Id value.
Sensor Event.
Generated by Doxygen
5.1 sh2.h File Reference 41
Calibration result.
See the SH-2 Reference Manual for more information on each type.
Enumerator
Generated by Doxygen
42 File Documentation
Enumerator
Parameters
sensor←- which sensor to operate on.
Id
Returns
Returns
Returns
Generated by Doxygen
5.1 sh2.h File Reference 43
Returns
Parameters
Returns
Parameters
Returns
Parameters
sensor←- Which sensor to operate on.
Id
pCounts Pointer to Counts structure that will receive data.
Generated by Doxygen
44 File Documentation
Returns
Parameters
Returns
Parameters
Returns
Parameters
sensor←- Which sensor to query.
Id
pData Pointer to structure to receive the results.
Generated by Doxygen
5.1 sh2.h File Reference 45
Returns
Parameters
Returns
Parameters
prodIds Pointer to structure that will receive results.
Returns
Parameters
sensor←- Which sensor to query.
Id
config SensorConfig structure to store results.
Returns
Generated by Doxygen
46 File Documentation
This function should be called before any others in this API. The HAL and SHTP layers should be initialized BEFORE
calling sh2_init().
As part of the initialization process, a callback function is registered that will be invoked when the device completes
the reset process.
Parameters
resetCallback Will be called when the sensorhub completes the reset process.
resetCookie Will be passed to resetCallback.
Returns
Returns
Returns
Returns
Parameters
Generated by Doxygen
5.1 sh2.h File Reference 47
Returns
Parameters
Returns
Parameters
Returns
Set the current run-time sensor reorientation. (Set to zero to clear tare.)
Parameters
Returns
Generated by Doxygen
48 File Documentation
Parameters
callback A function that will be called each time a sensor event is received.
cookie A value that will be passed to the sensor callback function.
Returns
Parameters
Returns
Parameters
Returns
Returns
Generated by Doxygen
5.2 sh2_err.h File Reference 49
Macros
Author
David Wheeler
Date
22 May 2015 Struct and type definitions supporting the Hillcrest SH-2 SensorHub API.
General Error
Generated by Doxygen
50 File Documentation
Operation in progress
Success
#include <stdint.h>
#include <stdbool.h>
#include "sh2_hal_impl.h"
Typedefs
• typedef void sh2_rxCallback_t(void ∗cookie, uint8_t ∗pData, uint32_t len, uint32_t t_us)
Functions
Author
David Wheeler
Date
18 Nov 2016
Generated by Doxygen
5.4 sh2_SensorValue.h File Reference 51
Support for converting sensor events (messages) into natural data structures.
#include <stdint.h>
#include "sh2.h"
Data Structures
• struct sh2_RawAccelerometer
Raw Accelerometer.
• struct sh2_Accelerometer
Accelerometer.
• struct sh2_RawGyroscope
Raw gyroscope.
• struct sh2_Gyroscope
Gyroscope.
• struct sh2_GyroscopeUncalibrated
Uncalibrated gyroscope.
• struct sh2_RawMagnetometer
Raw Magnetometer.
• struct sh2_MagneticField
Magnetic field.
• struct sh2_MagneticFieldUncalibrated
Uncalibrated magnetic field.
• struct sh2_RotationVectorWAcc
Rotation Vector with Accuracy.
• struct sh2_RotationVector
Rotation Vector.
• struct sh2_Pressure
Atmospheric Pressure.
• struct sh2_AmbientLight
Ambient Light.
• struct sh2_Humidity
Humidity.
• struct sh2_Proximity
Proximity.
• struct sh2_Temperature
Temperature.
• struct sh2_Reserved
Reserved.
• struct sh2_TapDetector
• struct sh2_StepDetector
StepDetector.
• struct sh2_StepCounter
StepCounter.
• struct sh2_SigMotion
SigMotion.
• struct sh2_StabilityClassifier
Generated by Doxygen
52 File Documentation
• struct sh2_ShakeDetector
• struct sh2_FlipDetector
flipDetector
• struct sh2_PickupDetector
• struct sh2_StabilityDetector
• struct sh2_PersonalActivityClassifier
• struct sh2_SleepDetector
sleepDetector
• struct sh2_TiltDetector
tiltDetector
• struct sh2_PocketDetector
pocketDetector
• struct sh2_CircleDetector
circleDetector
• struct sh2_HeartRateMonitor
heartRateMonitor
• struct sh2_GyroIntegratedRV
heartRateMonitor
• struct sh2_SensorValue
Macros
• #define TAPDET_X (1)
TapDetector.
• #define TAPDET_X_POS (2)
• #define TAPDET_Y (4)
• #define TAPDET_Y_POS (8)
• #define TAPDET_Z (16)
• #define TAPDET_Z_POS (32)
• #define TAPDET_DOUBLE (64)
• #define STABILITY_CLASSIFIER_UNKNOWN (0)
StabilityClassifier.
• #define STABILITY_CLASSIFIER_ON_TABLE (1)
• #define STABILITY_CLASSIFIER_STATIONARY (2)
• #define STABILITY_CLASSIFIER_STABLE (3)
• #define STABILITY_CLASSIFIER_MOTION (4)
• #define SHAKE_X (1)
ShakeDetector.
• #define SHAKE_Y (2)
• #define SHAKE_Z (4)
• #define PICKUP_LEVEL_TO_NOT_LEVEL (1)
pickupDetector
• #define PICKUP_STOP_WITHIN_REGION (2)
• #define STABILITY_ENTERED (1)
stabilityDetector
• #define STABILITY_EXITED (2)
• #define PAC_UNKNOWN (0)
Personal Activity Classifier.
• #define PAC_IN_VEHICLE (1)
• #define PAC_ON_BICYCLE (2)
• #define PAC_ON_FOOT (3)
• #define PAC_STILL (4)
• #define PAC_TILTING (5)
• #define PAC_WALKING (6)
• #define PAC_RUNNING (7)
Generated by Doxygen
5.4 sh2_SensorValue.h File Reference 53
Typedefs
Generated by Doxygen
54 File Documentation
tiltDetector
• typedef struct sh2_PocketDetector sh2_PocketDetector_t
pocketDetector
• typedef struct sh2_CircleDetector sh2_CircleDetector_t
circleDetector
• typedef struct sh2_HeartRateMonitor sh2_HeartRateMonitor_t
heartRateMonitor
• typedef struct sh2_GyroIntegratedRV sh2_GyroIntegratedRV_t
heartRateMonitor
• typedef struct sh2_SensorValue sh2_SensorValue_t
Functions
Support for converting sensor events (messages) into natural data structures.
Author
David Wheeler
Date
10 Nov 2015
pickupDetector
ShakeDetector.
Generated by Doxygen
5.4 sh2_SensorValue.h File Reference 55
StabilityClassifier.
stabilityDetector
TapDetector.
Accelerometer.
Ambient Light.
circleDetector
flipDetector
Generated by Doxygen
56 File Documentation
heartRateMonitor
Gyroscope.
Uncalibrated gyroscope.
heartRateMonitor
Humidity.
Magnetic field.
pocketDetector
Generated by Doxygen
5.4 sh2_SensorValue.h File Reference 57
Atmospheric Pressure.
Proximity.
Raw Accelerometer.
Raw gyroscope.
Raw Magnetometer.
Reserved.
Rotation Vector.
Generated by Doxygen
58 File Documentation
SigMotion.
sleepDetector
StepCounter.
StepDetector.
Temperature.
tiltDetector
Generated by Doxygen
Index
heartRate SH2_TARE_BASIS_GEOMAGNETIC_ROTATI←-
sh2_HeartRateMonitor, 17 ON_VECTOR, 42
SH2_TARE_BASIS_ROTATION_VECTOR, 42
PAC_UNKNOWN SH2_TARE_X, 41
sh2_SensorValue.h, 54 SH2_TARE_Y, 41
PICKUP_LEVEL_TO_NOT_LEVEL SH2_TARE_Z, 41
sh2_SensorValue.h, 54 sh2_AsyncEvent_t, 40
pickup sh2_CalStatus_t, 41
sh2_PickupDetector, 19 sh2_Counts_t, 40
sh2_ErrorRecord_t, 40
SH2_ERR_BAD_PARAM
sh2_OscType_t, 41
sh2_err.h, 49
sh2_ProductId_t, 40
SH2_ERR_HUB
sh2_Quaternion_t, 40
sh2_err.h, 49
sh2_SensorConfig_t, 40
SH2_ERR_IO
sh2_SensorEvent_t, 40
sh2_err.h, 49
sh2_SensorId_e, 41
SH2_ERR_OP_IN_PROGRESS
sh2_SensorMetadata_t, 40
sh2_err.h, 49
sh2_TareAxis, 41
SH2_ERR_TIMEOUT
sh2_TareAxis_t, 41
sh2_err.h, 50
sh2_TareBasis, 41
SH2_ERR
sh2_TareBasis_t, 41
sh2_err.h, 49
sh2_clearCounts, 42
SH2_OK
sh2_clearDcdAndReset, 42
sh2_err.h, 50
sh2_clearTare, 42
SH2_TARE_BASIS_GAMING_ROTATION_VECTOR
sh2_finishCal, 42
sh2.h, 42
sh2_flush, 43
SH2_TARE_BASIS_GEOMAGNETIC_ROTATION_V←-
ECTOR sh2_getCalConfig, 43
sh2.h, 42 sh2_getCounts, 43
SH2_TARE_BASIS_ROTATION_VECTOR sh2_getErrors, 44
sh2.h, 42 sh2_getFrs, 44
SH2_TARE_X sh2_getMetadata, 44
sh2.h, 41 sh2_getOscType, 45
SH2_TARE_Y sh2_getProdIds, 45
sh2.h, 41 sh2_getSensorConfig, 45
SH2_TARE_Z sh2_initialize, 45
sh2.h, 41 sh2_persistTare, 46
SHAKE_X sh2_reinitialize, 46
sh2_SensorValue.h, 54 sh2_saveDcdNow, 46
STABILITY_CLASSIFIER_UNKNOWN sh2_setCalConfig, 46
sh2_SensorValue.h, 54 sh2_setDcdAutoSave, 47
STABILITY_ENTERED sh2_setFrs, 47
sh2_SensorValue.h, 55 sh2_setReorientation, 47
sensorId sh2_setSensorCallback, 47
sh2_SensorValue, 29 sh2_setSensorConfig, 48
sequence sh2_setTareNow, 48
sh2_SensorValue, 29 sh2_startCal, 48
sh2.h, 35 sh2_Accelerometer, 11
SH2_TARE_BASIS_GAMING_ROTATION_VE←- sh2_Accelerometer_t
CTOR, 42 sh2_SensorValue.h, 55
60 INDEX
sh2_AmbientLight, 11 sh2_Proximity_t
sh2_AmbientLight_t sh2_SensorValue.h, 57
sh2_SensorValue.h, 55 sh2_Quaternion, 21
sh2_AsyncEvent, 12 sh2_Quaternion_t
sh2_AsyncEvent_t sh2.h, 40
sh2.h, 40 sh2_RawAccelerometer, 22
sh2_CalStatus_t sh2_RawAccelerometer_t
sh2.h, 41 sh2_SensorValue.h, 57
sh2_CircleDetector, 12 sh2_RawGyroscope, 22
sh2_CircleDetector_t sh2_RawGyroscope_t
sh2_SensorValue.h, 55 sh2_SensorValue.h, 57
sh2_Counts, 13 sh2_RawMagnetometer, 23
sh2_Counts_t sh2_RawMagnetometer_t
sh2.h, 40 sh2_SensorValue.h, 57
sh2_ErrorRecord, 13 sh2_Reserved, 24
sh2_ErrorRecord_t sh2_Reserved_t
sh2.h, 40 sh2_SensorValue.h, 57
sh2_FlipDetector, 14 sh2_RotationVector, 24
sh2_FlipDetector_t sh2_RotationVector_t
sh2_SensorValue.h, 55 sh2_SensorValue.h, 57
sh2_GyroIntegratedRV_t sh2_RotationVectorWAcc, 25
sh2_SensorValue.h, 55 sh2_RotationVectorWAcc_t
sh2_GyroIntegratedRV, 15 sh2_SensorValue.h, 57
sh2_Gyroscope, 15 sh2_SensorConfig, 25
sh2_Gyroscope_t sh2_SensorConfig_t
sh2_SensorValue.h, 56 sh2.h, 40
sh2_GyroscopeUncalibrated, 16 sh2_SensorEvent, 26
sh2_GyroscopeUncalibrated_t sh2_SensorEvent_t
sh2_SensorValue.h, 56 sh2.h, 40
sh2_HeartRateMonitor, 16 sh2_SensorId_e
heartRate, 17 sh2.h, 41
sh2_HeartRateMonitor_t sh2_SensorMetadata, 26
sh2_SensorValue.h, 56 sh2_SensorMetadata_t
sh2_Humidity, 17 sh2.h, 40
sh2_Humidity_t sh2_SensorValue, 28
sh2_SensorValue.h, 56 sensorId, 29
sh2_MagneticField, 17 sequence, 29
sh2_MagneticField_t timestamp, 29
sh2_SensorValue.h, 56 un, 29
sh2_MagneticFieldUncalibrated, 18 sh2_SensorValue.h, 51
sh2_MagneticFieldUncalibrated_t PAC_UNKNOWN, 54
sh2_SensorValue.h, 56 PICKUP_LEVEL_TO_NOT_LEVEL, 54
sh2_OscType_t SHAKE_X, 54
sh2.h, 41 STABILITY_CLASSIFIER_UNKNOWN, 54
sh2_PersonalActivityClassifier, 19 STABILITY_ENTERED, 55
sh2_PickupDetector, 19 sh2_Accelerometer_t, 55
pickup, 19 sh2_AmbientLight_t, 55
sh2_PocketDetector, 19 sh2_CircleDetector_t, 55
sh2_PocketDetector_t sh2_FlipDetector_t, 55
sh2_SensorValue.h, 56 sh2_GyroIntegratedRV_t, 55
sh2_Pressure, 20 sh2_Gyroscope_t, 56
sh2_Pressure_t sh2_GyroscopeUncalibrated_t, 56
sh2_SensorValue.h, 56 sh2_HeartRateMonitor_t, 56
sh2_ProductId_s, 20 sh2_Humidity_t, 56
sh2_ProductId_t sh2_MagneticField_t, 56
sh2.h, 40 sh2_MagneticFieldUncalibrated_t, 56
sh2_ProductIds_s, 21 sh2_PocketDetector_t, 56
sh2_Proximity, 21 sh2_Pressure_t, 56
Generated by Doxygen
INDEX 61
sh2_Proximity_t, 57 SH2_OK, 50
sh2_RawAccelerometer_t, 57 sh2_finishCal
sh2_RawGyroscope_t, 57 sh2.h, 42
sh2_RawMagnetometer_t, 57 sh2_flush
sh2_Reserved_t, 57 sh2.h, 43
sh2_RotationVector_t, 57 sh2_getCalConfig
sh2_RotationVectorWAcc_t, 57 sh2.h, 43
sh2_SigMotion_t, 57 sh2_getCounts
sh2_SleepDetector_t, 58 sh2.h, 43
sh2_StepCounter_t, 58 sh2_getErrors
sh2_StepDetector_t, 58 sh2.h, 44
sh2_Temperature_t, 58 sh2_getFrs
sh2_TiltDetector_t, 58 sh2.h, 44
TAPDET_X, 55 sh2_getMetadata
sh2_ShakeDetector, 29 sh2.h, 44
sh2_SigMotion, 29 sh2_getOscType
sh2_SigMotion_t sh2.h, 45
sh2_SensorValue.h, 57 sh2_getProdIds
sh2_SleepDetector, 30 sh2.h, 45
sh2_SleepDetector_t sh2_getSensorConfig
sh2_SensorValue.h, 58 sh2.h, 45
sh2_StabilityClassifier, 30 sh2_hal.h, 50
sh2_StabilityDetector, 31 sh2_initialize
stability, 31 sh2.h, 45
sh2_StepCounter, 31 sh2_persistTare
sh2_StepCounter_t sh2.h, 46
sh2_SensorValue.h, 58 sh2_reinitialize
sh2_StepDetector, 31 sh2.h, 46
sh2_StepDetector_t sh2_saveDcdNow
sh2_SensorValue.h, 58 sh2.h, 46
sh2_setCalConfig
sh2_TapDetector, 32
sh2.h, 46
sh2_TareAxis
sh2_setDcdAutoSave
sh2.h, 41
sh2.h, 47
sh2_TareAxis_t
sh2_setFrs
sh2.h, 41
sh2.h, 47
sh2_TareBasis
sh2_setReorientation
sh2.h, 41
sh2.h, 47
sh2_TareBasis_t
sh2_setSensorCallback
sh2.h, 41
sh2.h, 47
sh2_Temperature, 32
sh2_setSensorConfig
sh2_Temperature_t
sh2.h, 48
sh2_SensorValue.h, 58
sh2_setTareNow
sh2_TiltDetector, 33
sh2.h, 48
sh2_TiltDetector_t
sh2_startCal
sh2_SensorValue.h, 58
sh2.h, 48
sh2_clearCounts
stability
sh2.h, 42
sh2_StabilityDetector, 31
sh2_clearDcdAndReset
sh2.h, 42 TAPDET_X
sh2_clearTare sh2_SensorValue.h, 55
sh2.h, 42 timestamp
sh2_err.h, 49 sh2_SensorValue, 29
SH2_ERR_BAD_PARAM, 49
SH2_ERR_HUB, 49 un
SH2_ERR_IO, 49 sh2_SensorValue, 29
SH2_ERR_OP_IN_PROGRESS, 49
SH2_ERR_TIMEOUT, 50
SH2_ERR, 49
Generated by Doxygen