# sensor - [Introduction](#section11660541593) - [Directory Structure](#section161941989596) - [Usage](#section45490312053) - [Available APIs](#section14840627279) - [Usage Guidelines](#section460510231888) - [Repositories Involved](#section12495154795416) ## Introduction The sensor driver module provides and implements sensor-related Hardware Driver Interfaces \(HDIs\), including obtaining sensor information, enabling or disabling a sensor, subscribing to or unsubscribing from sensor data, and setting sensor options. These APIs make service development easier. **Figure 1** Sensor driver module architecture  ## Directory Structure The directory structure of the sensor driver module is as follows: ``` /drivers/peripheral/sensor ├── hal # HAL code │ └── include # HAL header files │ └── src # HAL code implementation ├── interfaces # Driver capability APIs provided for upper-layer services │ └── include # APIs exposed externally ├── test # Test code │ └── unittest # Unit test code ``` ## Usage This section uses the acceleration sensor as an example to describe how to use sensor APIs. ### Available APIs The HAL module of the sensor driver provides APIs that can be directly called by sensor services to obtain, set, and subscribe to or unsubscribe from sensor data. The following table lists the APIs provided by the sensor driver module. **Table 1** Major HDIs of the sensor module