| 数据搜索系统,热门电子元器件搜索 |
|
AN4156 数据表(PDF) 5 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4156 数据表(HTML) 5 Page - STMicroelectronics |
|
5 / 12 page ![]() AN4156 Sensor HAL: files Doc ID 023584 Rev 1 5/12 2 Sensor HAL: files In this section we examine the sensor HAL library files and its architecture model. There are two configuration files in the library: configuration.h and sensors.h. The configuration.h file is used to set some parameters such as the names of the sensors, full scale defaults, names of the sysfs files, enable or disable debug information, etc. The sensors.h file is used to set the convert value of the data, the axis mapping through rotation matrices and the event type of the drivers. The UML graph of the HAL library structure is shown in Figure 4. The library is written in C++ language using the object-oriented approach, for each sensor there is a custom class file (AccelSensor.cpp, MagnSensor.cpp, GyroSensor.cpp and PressTempSensor.cpp) which extends the common base class (SensorBase.cpp). 2.1 Configuration.h As mentioned above, the configuration file is used to describe some parameters of the sensors. In this short paragraph we describe all the parameters and what they mean. An example of a configuration file for the LSM303DLHC accelerometer is shown in Figure 2. The first macro visible in this file, ANDROID_JELLY_BEAN, is used as the define if the library is built for Android Jelly Bean version (4.1). The parameters of the other sensors are the same as those used in this accelerometer example. .. ... /* ACCELEROMETER SENSOR \*/ #define SENSOR_ACC_LABEL “LSM303DLHC 3-axis Accelerometer“ #define SENSOR_ACC_INCLUDE_FILE_NAME “lsm303dlhc.h“ #define SENSOR_DATANAME_ACCELEROMETER LSM303DLHC_ACC_DEV_NAME #define ACCEL_DELAY_FILE_NAME “pollrate_ms“ #define ACCEL_ENABLE_FILE_NAME “enable_device” #define ACCEL_RANGE_FILE_NAME “range” #define ACCEL_MAX_RANGE 16*GRAVITY_EARTH #define ACCEL_MAX_ODR 400 #define ACCEL_POWER_CONSUMPTION 0.033f #define ACCEL_DEFAULT_FULLSCALE 4 ... .. 2.1.1 SENSOR_ACC_LABEL This macro is used to define the sensor name visible in the Android application. |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |