/* * This driver tries to support the "digital" accelerometer chips from * STMicroelectronics such as LIS3LV02DL, LIS302DL, LIS3L02DQ, LIS331DL, * LIS331DLH, LIS35DE, or LIS202DL. They are very similar in terms of * programming, with almost the same registers. In addition to differing * on physical properties, they differ on the number of axes (2/3), * precision (8/12 bits), and special features (freefall detection, * click...). Unfortunately, not all the differences can be probed via * a register. They can be connected either via I²C or SPI.
*/
union axis_conversion { struct { int x, y, z;
}; int as_array[3];
};
struct lis3lv02d { void *bus_priv; /* used by the bus layer only */ struct device *pm_dev; /* for pm_runtime purposes */ int (*init) (struct lis3lv02d *lis3); int (*write) (struct lis3lv02d *lis3, int reg, u8 val); int (*read) (struct lis3lv02d *lis3, int reg, u8 *ret); int (*blkread) (struct lis3lv02d *lis3, int reg, int len, u8 *ret); int (*reg_ctrl) (struct lis3lv02d *lis3, bool state);
int *odrs; /* Supported output data rates */
u8 *regs; /* Regs to store / restore */ int regs_size;
u8 *reg_cache; bool regs_stored;
u8 odr_mask; /* ODR bit mask */
u8 whoami; /* indicates measurement precision */
s16 (*read_data) (struct lis3lv02d *lis3, int reg); int mdps_max_val; int pwron_delay; int scale; /* * relationship between 1 LBS and mG * (1/1000th of earth gravity)
*/
struct input_dev *idev; /* input device */ struct faux_device *fdev; /* faux device */ struct regulator_bulk_data regulators[2];
atomic_t count; /* interrupt count after last read */ union axis_conversion ac; /* hw -> logical axis */ int mapped_btns[3];
u32 irq; /* IRQ number */ struct fasync_struct *async_queue; /* queue for the misc device */
wait_queue_head_t misc_wait; /* Wait queue for the misc device */ unsignedlong misc_opened; /* bit0: whether the device is open */ struct miscdevice miscdev;
int data_ready_count[2];
atomic_t wake_thread; unsignedchar irq_cfg; unsignedint shift_adj;
struct lis3lv02d_platform_data *pdata; /* for passing board config */ struct mutex mutex; /* Serialize poll and selftest */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.