Linux Kernel
3.7.1
|
#include <linux/device.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/input/adxl34x.h>
#include <linux/module.h>
#include "adxl34x.h"
Go to the source code of this file.
Data Structures | |
struct | axis_triple |
struct | adxl34x |
Macros | |
#define | DEVID 0x00 /* R Device ID */ |
#define | THRESH_TAP 0x1D /* R/W Tap threshold */ |
#define | OFSX 0x1E /* R/W X-axis offset */ |
#define | OFSY 0x1F /* R/W Y-axis offset */ |
#define | OFSZ 0x20 /* R/W Z-axis offset */ |
#define | DUR 0x21 /* R/W Tap duration */ |
#define | LATENT 0x22 /* R/W Tap latency */ |
#define | WINDOW 0x23 /* R/W Tap window */ |
#define | THRESH_ACT 0x24 /* R/W Activity threshold */ |
#define | THRESH_INACT 0x25 /* R/W Inactivity threshold */ |
#define | TIME_INACT 0x26 /* R/W Inactivity time */ |
#define | ACT_INACT_CTL 0x27 /* R/W Axis enable control for activity and */ |
#define | THRESH_FF 0x28 /* R/W Free-fall threshold */ |
#define | TIME_FF 0x29 /* R/W Free-fall time */ |
#define | TAP_AXES 0x2A /* R/W Axis control for tap/double tap */ |
#define | ACT_TAP_STATUS 0x2B /* R Source of tap/double tap */ |
#define | BW_RATE 0x2C /* R/W Data rate and power mode control */ |
#define | POWER_CTL 0x2D /* R/W Power saving features control */ |
#define | INT_ENABLE 0x2E /* R/W Interrupt enable control */ |
#define | INT_MAP 0x2F /* R/W Interrupt mapping control */ |
#define | INT_SOURCE 0x30 /* R Source of interrupts */ |
#define | DATA_FORMAT 0x31 /* R/W Data format control */ |
#define | DATAX0 0x32 /* R X-Axis Data 0 */ |
#define | DATAX1 0x33 /* R X-Axis Data 1 */ |
#define | DATAY0 0x34 /* R Y-Axis Data 0 */ |
#define | DATAY1 0x35 /* R Y-Axis Data 1 */ |
#define | DATAZ0 0x36 /* R Z-Axis Data 0 */ |
#define | DATAZ1 0x37 /* R Z-Axis Data 1 */ |
#define | FIFO_CTL 0x38 /* R/W FIFO control */ |
#define | FIFO_STATUS 0x39 /* R FIFO status */ |
#define | TAP_SIGN 0x3A /* R Sign and source for tap/double tap */ |
#define | ORIENT_CONF 0x3B /* R/W Orientation configuration */ |
#define | ORIENT 0x3C /* R Orientation status */ |
#define | ID_ADXL345 0xE5 |
#define | ID_ADXL346 0xE6 |
#define | DATA_READY (1 << 7) |
#define | SINGLE_TAP (1 << 6) |
#define | DOUBLE_TAP (1 << 5) |
#define | ACTIVITY (1 << 4) |
#define | INACTIVITY (1 << 3) |
#define | FREE_FALL (1 << 2) |
#define | WATERMARK (1 << 1) |
#define | OVERRUN (1 << 0) |
#define | ACT_ACDC (1 << 7) |
#define | ACT_X_EN (1 << 6) |
#define | ACT_Y_EN (1 << 5) |
#define | ACT_Z_EN (1 << 4) |
#define | INACT_ACDC (1 << 3) |
#define | INACT_X_EN (1 << 2) |
#define | INACT_Y_EN (1 << 1) |
#define | INACT_Z_EN (1 << 0) |
#define | SUPPRESS (1 << 3) |
#define | TAP_X_EN (1 << 2) |
#define | TAP_Y_EN (1 << 1) |
#define | TAP_Z_EN (1 << 0) |
#define | ACT_X_SRC (1 << 6) |
#define | ACT_Y_SRC (1 << 5) |
#define | ACT_Z_SRC (1 << 4) |
#define | ASLEEP (1 << 3) |
#define | TAP_X_SRC (1 << 2) |
#define | TAP_Y_SRC (1 << 1) |
#define | TAP_Z_SRC (1 << 0) |
#define | LOW_POWER (1 << 4) |
#define | RATE(x) ((x) & 0xF) |
#define | PCTL_LINK (1 << 5) |
#define | PCTL_AUTO_SLEEP (1 << 4) |
#define | PCTL_MEASURE (1 << 3) |
#define | PCTL_SLEEP (1 << 2) |
#define | PCTL_WAKEUP(x) ((x) & 0x3) |
#define | SELF_TEST (1 << 7) |
#define | SPI (1 << 6) |
#define | INT_INVERT (1 << 5) |
#define | FULL_RES (1 << 3) |
#define | JUSTIFY (1 << 2) |
#define | RANGE(x) ((x) & 0x3) |
#define | RANGE_PM_2g 0 |
#define | RANGE_PM_4g 1 |
#define | RANGE_PM_8g 2 |
#define | RANGE_PM_16g 3 |
#define | ADXL_FULLRES_MAX_VAL 4096 |
#define | ADXL_FIXEDRES_MAX_VAL 512 |
#define | FIFO_MODE(x) (((x) & 0x3) << 6) |
#define | FIFO_BYPASS 0 |
#define | FIFO_FIFO 1 |
#define | FIFO_STREAM 2 |
#define | FIFO_TRIGGER 3 |
#define | TRIGGER (1 << 5) |
#define | SAMPLES(x) ((x) & 0x1F) |
#define | FIFO_TRIG (1 << 7) |
#define | ENTRIES(x) ((x) & 0x3F) |
#define | XSIGN (1 << 6) |
#define | YSIGN (1 << 5) |
#define | ZSIGN (1 << 4) |
#define | XTAP (1 << 3) |
#define | YTAP (1 << 2) |
#define | ZTAP (1 << 1) |
#define | ORIENT_DEADZONE(x) (((x) & 0x7) << 4) |
#define | ORIENT_DIVISOR(x) ((x) & 0x7) |
#define | ADXL346_2D_VALID (1 << 6) |
#define | ADXL346_2D_ORIENT(x) (((x) & 0x3) >> 4) |
#define | ADXL346_3D_VALID (1 << 3) |
#define | ADXL346_3D_ORIENT(x) ((x) & 0x7) |
#define | ADXL346_2D_PORTRAIT_POS 0 /* +X */ |
#define | ADXL346_2D_PORTRAIT_NEG 1 /* -X */ |
#define | ADXL346_2D_LANDSCAPE_POS 2 /* +Y */ |
#define | ADXL346_2D_LANDSCAPE_NEG 3 /* -Y */ |
#define | ADXL346_3D_FRONT 3 /* +X */ |
#define | ADXL346_3D_BACK 4 /* -X */ |
#define | ADXL346_3D_RIGHT 2 /* +Y */ |
#define | ADXL346_3D_LEFT 5 /* -Y */ |
#define | ADXL346_3D_TOP 1 /* +Z */ |
#define | ADXL346_3D_BOTTOM 6 /* -Z */ |
#define | ADXL_X_AXIS 0 |
#define | ADXL_Y_AXIS 1 |
#define | ADXL_Z_AXIS 2 |
#define | AC_READ(ac, reg) ((ac)->bops->read((ac)->dev, reg)) |
#define | AC_WRITE(ac, reg, val) ((ac)->bops->write((ac)->dev, reg, val)) |
Functions | |
void | adxl34x_suspend (struct adxl34x *ac) |
EXPORT_SYMBOL_GPL (adxl34x_suspend) | |
void | adxl34x_resume (struct adxl34x *ac) |
EXPORT_SYMBOL_GPL (adxl34x_resume) | |
struct adxl34x * | adxl34x_probe (struct device *dev, int irq, bool fifo_delay_default, const struct adxl34x_bus_ops *bops) |
EXPORT_SYMBOL_GPL (adxl34x_probe) | |
int | adxl34x_remove (struct adxl34x *ac) |
EXPORT_SYMBOL_GPL (adxl34x_remove) | |
MODULE_AUTHOR ("Michael Hennerich <[email protected]>") | |
MODULE_DESCRIPTION ("ADXL345/346 Three-Axis Digital Accelerometer Driver") | |
MODULE_LICENSE ("GPL") | |
#define ACT_INACT_CTL 0x27 /* R/W Axis enable control for activity and */ |
#define ACT_TAP_STATUS 0x2B /* R Source of tap/double tap */ |
#define BW_RATE 0x2C /* R/W Data rate and power mode control */ |
#define ORIENT_CONF 0x3B /* R/W Orientation configuration */ |
#define POWER_CTL 0x2D /* R/W Power saving features control */ |
#define TAP_AXES 0x2A /* R/W Axis control for tap/double tap */ |
#define TAP_SIGN 0x3A /* R Sign and source for tap/double tap */ |
EXPORT_SYMBOL_GPL | ( | adxl34x_suspend | ) |
EXPORT_SYMBOL_GPL | ( | adxl34x_resume | ) |
EXPORT_SYMBOL_GPL | ( | adxl34x_probe | ) |
EXPORT_SYMBOL_GPL | ( | adxl34x_remove | ) |
MODULE_AUTHOR | ( | "Michael Hennerich <[email protected]>" | ) |
MODULE_DESCRIPTION | ( | "ADXL345/346 Three-Axis Digital Accelerometer Driver" | ) |
MODULE_LICENSE | ( | "GPL" | ) |