Electronic Components Datasheet Search
  English  ▼

X  

AN4156 Datasheet(PDF) 5 Page - STMicroelectronics

Part # AN4156
Description  Hardware abstraction layer for Android
PDF  12 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN4156 Datasheet(HTML) 5 Page - STMicroelectronics

  AN4156 Datasheet HTML 1Page - STMicroelectronics AN4156 Datasheet HTML 2Page - STMicroelectronics AN4156 Datasheet HTML 3Page - STMicroelectronics AN4156 Datasheet HTML 4Page - STMicroelectronics AN4156 Datasheet HTML 5Page - STMicroelectronics AN4156 Datasheet HTML 6Page - STMicroelectronics AN4156 Datasheet HTML 7Page - STMicroelectronics AN4156 Datasheet HTML 8Page - STMicroelectronics AN4156 Datasheet HTML 9Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 5 / 12 page
background image
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.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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