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](https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.4.y-gh) . 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](https://source.android.com/devices/sensors/hal-interface.html)
STM Sensor HAL is leaning on [Linux IIO framework](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/iio) 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, LSM6DS0, LSM9DS0, LSM9DS1, LSM330D, LSM330DL, ISM330DLC, LSM6DSO, ASM330LHH, LSM6DSR, LSM6DSO32,
> LSM6DSOX, LSM6DSRX, LSM6DSO32X, ISM330DHCX, ASM330LHHX
### eCompass:
> LSM303AGR, LSM303AH, LSM303DLHC, LSM303DLH, LSM303DLM, ISM303DAC
### Accelerometer:
> LIS2DS12, LIS2HH12, LIS3DH, LIS3DHH, LIS2DW12, LIS331DLH, LIS2DG, LIS2DH, LIS2DH12, IIS2DH, IIS3DHHC, AIS2IH
### Gyroscope:
> L3GD20, L3GD20H, L3G4200D
### Magnetometer:
> LIS3MDL, LIS2MDL, IIS2MDC
### Pressure and Temperature:
> LPS22HB, LPS22HD, LPS25H, LPS331AP, LPS33HW, LPS35HW, LPS22HH, LPS27HHW
### 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*, *Temp.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 (only for Android version up to M included)
$mm sensors-defconfig (default configuration)
or
$mm sensors-menuconfig
otherwise after the initial build of Android and SensorHAL, move to SensorHAL path and load initial Android settings
"source android_data_config"
than run make command with one of the following options:
"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](https://source.android.com/source/requirements.html)
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) 2019 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.
没有合适的资源?快使用搜索试试~ 我知道了~
此存储库包含用于 MEMS Linux IIO 驱动程序的 ST Android传感器硬件抽象层 (HAL) C++
共116个文件
h:40个
cpp:40个
mk:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 64 浏览量
2022-07-14
14:33:10
上传
评论 1
收藏 251KB ZIP 举报
温馨提示
介绍 STM Android 传感器硬件抽象层 ( HAL ) 为 STM 传感器定义了一个标准接口,允许 Android 不知道较低级别的驱动程序实现。HAL 库被打包成模块 (.so) 文件并由 Android 系统在适当的时候加载。有关详细信息,请参阅AOSP HAL 接口 STM Sensor HAL 依靠Linux IIO 框架从传感器设备驱动程序中收集数据并将样本转发到 Android 框架 目前支持的传感器有: 惯性模块单元(IMU): LSM330, LSM330DLC, LSM6DS3, LSM6DS3H, LSM6DSM, LSM6DSL, LSM6DS0, LSM9DS0, LSM9DS1, LSM330D, LSM330DL, ISM330DLC, LSM6DSO, ASM330LHH, LSM6DSR, LSM6DSO32, LSM6DSOX, LSM6SMHRX, LSM6DSO32X, LSM6DSO32X, 电子罗盘: LSM303AGR、LSM303AH、LSM303DLHC 更多详情、使用方法,请下载后细读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
此存储库包含用于 MEMS Linux IIO 驱动程序的 ST Android传感器硬件抽象层 (HAL) C++
(116个子文件)
android_KK_defconfig 3KB
android_L_defconfig 3KB
android_M_defconfig 3KB
android_N_defconfig 3KB
android_O_defconfig 3KB
android_P_defconfig 3KB
android_Q_defconfig 3KB
android_R_defconfig 3KB
calibration_daemon.c 8KB
SensorHAL.cpp 104KB
HWSensorBase.cpp 27KB
utils.cpp 25KB
SensorBase.cpp 22KB
SWSensorBase.cpp 12KB
RingBuffer.cpp 10KB
Gyroscope.cpp 7KB
Accelerometer.cpp 7KB
Magnetometer.cpp 6KB
SWAccelMagnGyroFusion9X.cpp 5KB
selftest_tool.cpp 5KB
SWAccelMagnFusion6X.cpp 5KB
SWAccelGyroFusion6X.cpp 5KB
CircularBuffer.cpp 4KB
SWGameRotationVector.cpp 3KB
StepCounter.cpp 3KB
SelfTest.cpp 3KB
SWAccelerometerUncalibrated.cpp 3KB
SWGyroscopeUncalibrated.cpp 3KB
SWLinearAccel.cpp 3KB
DynamicSensorProxy.cpp 2KB
SWGravity.cpp 2KB
StepDetector.cpp 2KB
FlushBufferStack.cpp 2KB
SensorAdditionalInfo.cpp 2KB
Gesture.cpp 2KB
TiltSensor.cpp 2KB
ChangeODRTimestampStack.cpp 2KB
SWMagnetometerUncalibrated.cpp 2KB
SignificantMotion.cpp 2KB
RHumidity.cpp 2KB
Temp.cpp 2KB
Pressure.cpp 2KB
SWRotationVector.cpp 2KB
SWOrientation.cpp 1KB
DeviceOrientation.cpp 1KB
WristTiltGesture.cpp 1KB
SWGeoMagRotationVector.cpp 1KB
FlushRequested.cpp 1KB
SWVirtualGyroscope.cpp 1KB
file_contexts 209B
SensorBase.h 9KB
SensorHAL.h 7KB
utils.h 5KB
HWSensorBase.h 4KB
common_data.h 4KB
SWSensorBase.h 2KB
RingBuffer.h 2KB
Gyroscope.h 2KB
DynamicSensorProxy.h 2KB
CircularBuffer.h 2KB
Magnetometer.h 2KB
Accelerometer.h 1KB
SensorAdditionalInfo.h 1KB
FlushBufferStack.h 1KB
ChangeODRTimestampStack.h 1KB
SWAccelerometerUncalibrated.h 1KB
SWGyroscopeUncalibrated.h 1KB
SWGameRotationVector.h 1KB
SWLinearAccel.h 1KB
SelfTest.h 1KB
Gesture.h 1KB
FlushRequested.h 1KB
SWAccelMagnGyroFusion9X.h 1KB
SWGravity.h 1KB
StepDetector.h 1KB
StepCounter.h 1KB
SWAccelGyroFusion6X.h 1KB
SWAccelMagnFusion6X.h 1KB
SignificantMotion.h 1KB
WristTiltGesture.h 1KB
TiltSensor.h 1KB
DeviceOrientation.h 1KB
RHumidity.h 1KB
Pressure.h 1KB
Temp.h 1KB
SWMagnetometerUncalibrated.h 1KB
SWGeoMagRotationVector.h 1018B
SWVirtualGyroscope.h 991B
SWRotationVector.h 979B
SWOrientation.h 958B
Kconfig 1KB
kconfig-mconf 181KB
Kconfig_calibration 1KB
Kconfig_common 4KB
Kconfig_drivers 11KB
Kconfig_enable_sensors 10KB
Kconfig_fusion_config 735B
Makefile 5KB
README.md 5KB
CONTRIBUTING.md 2KB
共 116 条
- 1
- 2
资源评论
- _花花2023-07-26资源很好用,有较大的参考价值,资源不错,支持一下。
快撑死的鱼
- 粉丝: 1w+
- 资源: 9149
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功