MT2523 API Reference  LinkIt SDK v4
Sensor driver interface

The sensor driver interface facilitates the physical sensor driver porting. More...

Overview

The sensor driver interface facilitates the physical sensor driver porting.

Developers can easily enable/operate different physical sensors, such as accelerometer, gyroscope, and more using the interface APIs. An example to port the accelerometer driver is described below.

Macros

#define SENSOR_DEFAULT_DELAY   (200)
 Default delay between two consecutive sensor events in ms. More...
 
#define SENSOR_DELAY   0x01
 Command of setting a delay to a physical sensor driver. More...
 
#define SENSOR_ENABLE   0x02
 Command of enabling/disabling a physical sensor driver. More...
 
#define SENSOR_GET_DATA   0x04
 Command of getting data from a physical sensor driver. More...
 
#define SENSOR_CUST   0x08
 Command of setting the customization to a physical sensor driver. More...
 
#define SENSOR_BATCH   0x10
 Command of setting the batch timeout to a physical sensor driver. More...
 

Functions

int32_t sensor_driver_attach (uint32_t sensor_type, sensor_driver_object_t *obj)
 Registers the physical sensor driver. More...
 

Modules

 Struct
 
 Typedef
 

Macro Definition Documentation

#define SENSOR_BATCH   0x10

Command of setting the batch timeout to a physical sensor driver.

#define SENSOR_CUST   0x08

Command of setting the customization to a physical sensor driver.

#define SENSOR_DEFAULT_DELAY   (200)

Default delay between two consecutive sensor events in ms.

#define SENSOR_DELAY   0x01

Command of setting a delay to a physical sensor driver.

#define SENSOR_ENABLE   0x02

Command of enabling/disabling a physical sensor driver.

#define SENSOR_GET_DATA   0x04

Command of getting data from a physical sensor driver.

Function Documentation

int32_t sensor_driver_attach ( uint32_t  sensor_type,
sensor_driver_object_t obj 
)

Registers the physical sensor driver.

Parameters
[in]sensor_typeis the specified sensor type.
[in]objis of type sensor_driver_object_t for the registration.
Returns
>=0, if the operation completed successfully.