* Introduction
* Integration details
* More information
* Copyright
Introduction
This repository contains Linux kernel (v3.10, v3.4) with STMicroelectronics MEMS sensor support. STM sensor drivers are located under the directory drivers/input/misc/st organized by sensor type:
Data collected by STM sensors are pushed to userland through the Linux kernel Input framework using EV_MSC events. User space applications can get sensor events by reading the related input device created in the /dev directory. Please see Input for more information.
All STM MEMS sensors support I2C/SPI digital interface. Please refer to I2C and SPI for detailed documentation.
Integration details
In order to explain how to integrate STM sensors in a different kernel, please consider the following LSM6DSM IMU example
Source code integration
Copy driver source code into the target directory (e.g. drivers/input/misc)
Edit related Kconfig (e.g. drivers/input/misc/Kconfig) to include LSM6DSM support:
source "drivers/input/misc/lsm6dsm/Kconfig"
Edit related Makefile (e.g. drivers/input/misc/Makefile) adding the following line:
obj-y += lsm6dsm/
Device Tree configuration
To enable driver probing, add the lsm6dsm node to the platform device tree as described below.
Required properties:
- compatible: "st,lsm6dsm"
- reg: the I2C address or SPI chip select the device will respond to
- interrupt-parent: phandle to the parent interrupt controller as documented in interrupts
- interrupts: interrupt mapping for IRQ as documented in interrupts
Recommended properties for SPI bus usage:
- spi-max-frequency: maximum SPI bus frequency as documented in SPI
Optional properties:
- st,drdy-int-pin: MEMS sensor interrupt line to use (default 1)
请发表评论