- QSH client APIs
- Sensor APIs
- Core framework
- Pre-implemented platform sensors
- Vendor-implemented sensors
- Test modules
| Term | Description |
|---|---|
| Sensor |
|
| Sensor instance |
|
| Sensor unique identifier (SUID) | A unique 128-bit ID for each sensor. |
| Service | A module that provides a synchronous interface for common utilities. |
| Data stream | A unique connection between a client and data source. |
| Request | A configuration message that a client sends to a sensor (see sns_request.h file). |
| Event | Asynchronous output data message that a sensor instance generates (see sns_sensor_event.h file). |
| Nanopb | A small code-size protocol buffer implemented in ANSI C. |
Figure: QSH architecture
-
Application processor software modules
- Client application: It has the application main() or entry function that interacts with the QSH client APIs on the application processor side.
- QSH client APIs: It offers high-level APIs to access services offered by QSH. It simplifies application development by abstracting system complexities and focusing on the application logic. For more information, see Qualcomm® sensing hub APIs.
-
Low-power processor software modules
- Client manager: The client manager is in charge of all communications of the low-power processor with the application processor. The following table describes key functionality of the client manager:
| Function | Description |
|---|---|
| Translate incoming requests | The client manager takes incoming requests and translates them into the nanopb protocol buffer format that the QSH can understand. For more information, see Nanopb Protocol Buffer In QSH. |
| Translate outgoing indications | The client manager receives event messages from the QSH and translates these event messages into outgoing indications in the nanopb protocol format that’s understandable outside the QSH. For more information, see Nanopb Protocol Buffer In QSH. |
| Guarantees batching options | If a client specifies certain batching (store/accumulate locally) options, the client manager ensures that they meet the batching options. The client manager checks that the data is grouped and sent in the same way that the client has specified, ensuring compliance with the criteria. |
- Service manager: QSH offers synchronous services through service manager. The sensor and sensor instance use a callback to connect to the service manager.
adsp_proc/qsh_platform/inc/sns_service.h file lists the QSH services. The build process downloads the adsp_proc repository. For more information, see Software build documentation. The following table describes the key QSH services that are essential for device drivers.
Table : QSH services
| QSH service | Description |
|---|---|
| Stream service |
|
| Attribute service |
|
| Diagnostic service |
|
| Event service |
|
| Power rail service |
|
| Synchronous COM port (SCP) service |
|
| General purpose IO (GPIO) service |
|
| Island service |
|
| File system service |
|
- Platform sensor: QSH provides certain built-in sensors for platform or hardware-specific abstraction that other sensors and sensor instances can use. The following table describes the platform sensors:
| Platform sensor | Description |
|---|---|
| Registry sensor |
|
| Timer sensor |
|
| Interrupt sensor |
|
| Asynchronous COM port (ASCP) sensor |
|
| SUID lookup sensor |
|
| Test sensor |
|
- QSH utilities: QSH provides several helper utilities for sensors and sensor instances. All the utilities are available in the
adsp_proc/qsh_platform/inc/utilsdirectory. The following table describes the key QSH utilities:
| QSH utility | Description |
|---|---|
| Nanopb encode/decode |
|
| Sensor utils |
|
| Attribute utils |
|
| Memory utils |
|
| Math utils |
|
| Printf utils |
|
- OS abstraction (OSA) provides a unified interface to operating system services, abstracting platform-specific implementations.
| OS abstraction (OSA) | Description |
|---|---|
| Thread management |
|
| Signal handling |
|
| Mutex and Synchronization |
|
- Platform abstraction layer (PAL) provides hardware and platform-specific abstractions for sensor drivers and framework components.
| Platform abstraction layer (PAL) | Description |
|---|---|
| GPIO abstraction |
|
| I2C/SPI bus abstraction |
|
| Interrupt handling |
|
| Clock and Power management |
|
| Register access |
|
| UART/Serial communication |
|
Sensors and sensor instances
QSH divides the sensor implementation in two logical units: sensor and sensor instance.-
Sensors are producers, consumers, or a combination of producers and consumers of asynchronous data.
- Each sensor can have one or more sensor instances.
- Any request to a sensor for data results in the creation of a sensor instance or sharing of an existing sensor instance.
-
The sensor creates sensor instances on demand.
- Sensors manage the lifecycle and configuration of their corresponding instances, and send configuration updates and initial state events to their clients.
- Each sensor instance operates with a specific client configuration.
- The sensor instance of a physical sensor programs the sensor hardware to operate at required configuration.
- Vendors must serve all client requests with a minimal number of sensor instances.
- The sensor instance generates and sends a stream of data to all the active clients.
-
Many sensors can share and configure a single sensor instance. This mode of operation is typical to a combo driver for hardware sensors, such as the following:
- Accelerometer and gyroscope
- Proximity and ambient light

