Code Monkey home page Code Monkey logo

stmems_android_sensor_hal_iio's Introduction

Index

* Introduction
* Software architecture and Integration details
* STM proprietary libraries
* More information
* Copyright

Introduction

The STM Android sensor Hardware Abstraction Layer (HAL) defines a standard interface for STM sensors allowing Android to be agnostic about lower-level driver implementations . The HAL library is packaged into modules (.so) file and loaded by the Android system at the appropriate time. For more information see AOSP HAL Interface

STM Sensor HAL is leaning on Linux IIO framework to gather data from sensor device drivers and to forward samples to the Android Framework

Currently supported sensors are:

Inertial Module Unit (IMU):

LSM330, LSM330DLC, LSM6DS3, LSM6DS3H, LSM6DSM, LSM6DSL, LSM9DS0, LSM9DS1, LSM330D, LSM330DL, ISM330DLC, LSM6DSO, ASM330LHH

eCompass:

LSM303AGR, LSM303AH, LSM303DLHC, LSM303DLH, LSM303DLM, ISM303DAC

Accelerometer:

LIS2DS12, LIS2HH12, LIS3DH, LIS3DHH, LIS2DW12, LIS331DLH, LIS2DG, LIS2DH, LIS2DH12, IIS2DH, IIS3DHHC

Gyroscope:

L3GD20, L3GD20H, L3G4200D,

Magnetometer:

LIS3MDL, LIS2MDL, IIS2MDC

Pressure and Temperature:

LPS22HB, LPS22HD, LPS25H, LPS331AP, LPS33HW, LPS35HW, LPS22HH

Humidity and Temperature:

HTS221

Software architecture and Integration details

STM Sensor HAL is written in C++ language using object-oriented design. For each hw sensor there is a custom class file (Accelerometer.cpp, Magnetometer.cpp, Gyroscope.cpp, Pressure.cpp and RHumidity.cpp) which extends the common base class (SensorBase.cpp).

Copy the HAL source code into <AOSP_DIR>/hardware/STMicroelectronics/SensorHAL_IIO folder. During building process Android will include automatically the SensorHAL Android.mk. In <AOSP_DIR>/device/<vendor>/<board>/device.mk add package build information:

PRODUCT_PACKAGES += sensors.{TARGET_BOARD_PLATFORM}

Note: device.mk can not read $(TARGET_BOARD_PLATFORM) variable, read and replace the value from your BoardConfig.mk (e.g. PRODUCT_PACKAGES += sensors.msm8974 for Nexus 5)

To compile the SensorHAL_IIO just build AOSP source code from $TOP folder

$ cd <AOSP_DIR>
$ source build/envsetup.sh
$ lunch <select target platform>
$ make V=99

The compiled library will be placed in <AOSP_DIR>/out/target/product/<board>/system/vendor/lib/hw/sensor.{TARGET_BOARD_PLATFORM}.so

To configure sensor the Sensor HAL IIO use mm utility from HAL root folder (up to Android M version included)

$mm sensors-defconfig       (default configuration)

or

$mm sensors-menuconfig

otherwise from SensorHAL_IIO root folder (since Android N to latest version):

"make sensors-defconfig"    Set to default configuration

"make sensors-menuconfig"   Text based color menus, radiolists & dialogs.

"make sensors-cleanconf"    Delete hal_config, hal_config.old and configuration.h files.

For more information on compiling an Android project, please consult the AOSP website

STM proprietary libraries

STM proprietary libraries are used to define composite sensors based on hardware (accelerometer, gyroscope, magnetometer) or to provide sensor calibration

SENSOR_FUSION:

The STM Sensor Fusion library is a complete 9-axis/6-axis solution which combines the measurements from a 3-axis gyroscope, a 3-axis magnetometer and a 3-axis accelerometer to provide a robust absolute orientation vector and game orientation vector

GEOMAG_FUSION:

The STM GeoMag Fusion library is a complete 6-axis solution which combines the measurements from a 3-axis magnetometer and a 3-axis accelerometer to provide a robust geomagnetic orientation vector

GBIAS:

The STM Gbias Calibration library provides an efficient gyroscope bias runtime compensation

MAGCALIB:

The STM Magnetometer Calibration library provides an accurate magnetometer Hard Iron (HI) and Soft Iron (SI) runtime compensation

ACC_CALIB:

The STM Accelerometer Calibration library provide an afficient accelerometer offset runtime compensation

To enable STM proprietary libraries please use mm utility

$mm sensors-menuconfig

The release of STM proprietary libraries is subject to signature of a License User Agreement (LUA); please contact an STMicroelectronics sales office and representatives for further information.

Copyright

Copyright (C) 2017 STMicroelectronics

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

stmems_android_sensor_hal_iio's People

Contributors

mariotesi avatar ciocca-d avatar

Watchers

James Cloos avatar Daniel  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.