Skip to main content
The Qualcomm® system-on-chip (SoC) includes an application processor that runs the Linux operating system, a low-power application digital signal processor (aDSP), and other processors. The low-power processor runs the real-time operating system (RTOS) to handle the sensor data streaming using QSH framework. The aDSP supports the following for QSH operations:
  • GPIOs configurable as serial bus: serial peripheral interface (SPI), inter-integrated circuit (I2C), improved I2C (I3C), and universal asynchronous receiver/transmitter (UART).
  • Serial buses in low-power mode.
  • Dedicated local memory, also known as the island in QSH.
QSH provides a framework to use data from a wide range of sensors. The sensor data is useful in fields, such as IoT, gaming, health, and fitness. A device can have more than one sensor of a given type. For example, a flip-phone has an accelerometer placed on each of the two planes. The published attributes and capabilities distinguish each accelerometer sensor. The QSH client APIs let you access the availability, attributes, and capabilities of a sensor on the platform. Use the same QSH client APIs to get the sensor data from the QSH framework. The QSH framework APIs include QSH client APIs and sensor APIs to perform the following sensor-related tasks:
  • Identify the sensors available on a development kit.
  • Determine sensor capabilities using attributes, such as supported sample rate, maximum range, manufacturer, power requirement, and resolution.
  • Collect and provide data according to the configuration, thereby enabling sensors with a specified sample rate.
The QSH framework provides access to both hardware-based and software-based sensors.

Hardware-based sensors

Hardware-based sensors are physical sensors that gather data by directly measuring specific environmental properties, such as acceleration, magnetic field, pressure, humidity, light, and angular velocity. The following table lists the hardware-based sensors that the QSH framework supports:
Sensor nameSensor typeDescriptionProto API
AccelerometeraccelMeasures the acceleration applied to a device on all the 3 physical axes (x, y, and z) in meter/second square (m/s2)sns_accel.proto
GyroscopegyroMeasures the rate of rotation of a device around each of the 3 physical axes (x, y, and z) in radians/second (rad/s)sns_gyro.proto
Sensor temperaturesensor_temperatureMeasures the temperature of the sensor in degrees Celsius (°C)sns_sensor_temperature.proto
MagnetometermagMeasures the ambient magnetic field for all the 3 physical axes (x, y, and z) in microteslasns_mag.proto
ProximityproximityMeasures the proximity of an object and provides near/far eventssns_proximity.proto
Ambient lightambient_lightMeasures the ambient light level illumination in lux (lx)sns_ambient_light.proto
PressurepressureMeasures the ambient air pressure in hectoPascal (hPa)sns_pressure.proto
HumidityhumidityMeasures the relative ambient humidity in percentage (%)sns_humidity.proto
Ambient temperatureambient_temperatureProvides the ambient room temperature in degrees Celsius (°C)sns_ambient_temperature.proto
HallhallMeasures the magnetic field and provides a magnet near/far indicationsns_hall.proto
Capacitive proximitysarDetects human object proximity using change in capacitance and reports near/far eventssns_sar.proto

Software-based sensors

Software-based sensors, also known as virtual sensors, are algorithms that gather data from one or more physical sensors and generate the intended output. The common examples are:
  • Gravity
  • Step counter
  • Game rotation vector (GRV)
The following table lists the software-based sensors that the QSH framework supports:
Sensor nameSensor typeProto APIDescription
Absolute motion detectoramdsns_amd.proto
  • Reports a stationary state event when the device is at absolute rest. For example, the device is placed on a stationary object, such as desk or table.
  • Reports a moving state event when the device transitions from absolute rest to moving state. For example, the device is lifted from a desk or table.
  • Uses the accelerometer motion detect interrupt to reduce the power.
Relative motion detectorrmdsns_rmd.protoReports a stationary state when the device isn’t moving significantly with respect to gravity.
Significant motion detector (SMD)sig_motionsns_sig_motion.proto
  • Triggers when detecting a significant motion that might lead to a change in the user location. For example, walking, biking, or sitting in a moving car, coach, or train.
  • The following examples don’t trigger a significant motion: The device is in a pocket and the person remains stationary. The device is on a table and the table shakes a bit.
  • Reporting mode: Single response, after the notification sensor automatically disables itself.
Pedometerpedometersns_pedometer.protoReports the number of step counts to the client.
Step detectorstep_detectsns_step_detect.protoDetects steps and generates an event for each step.
Tilt detectortiltsns_tilt.protoGenerates an event each time there is a tilt. The direction of the 2-second window, with average gravity changing by at least 35 degrees since the activation or the last event generated by the sensor, defines a tilt event.
Tilt to waketilt_to_wakesns_tilt_to_wake.protoDetects the substantial device rotation gesture event when the picked device is in a specific range of the pitch and roll angles.
Gyroscope calibrationgyro_calsns_gyro_cal.proto
  • A low-power dynamic calibration algorithm for gyroscopes.
  • Validated across multiple gyroscope parts from different vendors.
Magnetometer calibrationmag_calsns_mag_cal.proto
  • A low-power dynamic calibration algorithm for the magnetometer sensor.
  • Validated across multiple magnetometer parts from different vendors.
Game rotation vector (GRV)game_rvsns_game_rv.proto
  • Reports the orientation of the device that is relative to an unspecified coordinate frame.
  • Obtains the orientation through integration of accelerometer and gyroscope readings. Therefore, the y-axis points to an arbitrary reference rather than north.
Gravity/linear accelerationgravitysns_gravity.proto
  • Provides a three-dimensional vector indicating the direction and magnitude of gravity.
  • Determines the relative orientation of the device in space.
Persistent stationary detectorpersist_stationary_detectsns_persist_stationary_detect.protoReports an event when the device is stationary for at least 5 seconds.
Persistent motion detectorpersist_motion_detectsns_persist_motion_detect.protoReports an event when the device is in motion for at least 5 seconds.
Device orientationdevice_orientsns_device_orient.protoReports whether the device is in portrait mode or landscape mode.
Geomagnetic rotation vectorgeomag_rvsns_geomag_rv.protoReports the orientation of the device relative to the east, north, up (ENU) coordinates frame; obtained through integration of accelerometer and magnetometer readings.
Rotation vector (RV)rotvsns_rotv.proto
  • Reports the orientation of the device relative to the ENU coordinates frame.
  • Unlike geomagnetic rotation vector, this sensor uses gyroscope.
  • Obtains orientation through the integration of accelerometer, gyroscope, and magnetometer readings.
Device position classifierdevice_position_classifiersns_dpc.protoProvides the device position information specifying if the device is in flat position or is at an angle with respect to the horizontal plane.
Activity recognition algorithmactivity_recognitionsns_activity_recognition.protoDetermines relative stationary states and classifications, for example walk, run, bike, car, nonmotorized vehicle, and motorized vehicle.
Distance bounddistance_boundsns_distance_bound.proto
  • Tracks the distance in meters, and reports to the client when the device covers the requested distance.
  • The client can query the accumulated distance any time before the device reaches the final distance.
Next steps