2019-05-30 07:57:44 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2017-03-04 16:31:25 +08:00
|
|
|
/*
|
|
|
|
* ADXL345 3-Axis Digital Accelerometer
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 Eva Rachel Retuya <eraretuya@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ADXL345_H_
|
|
|
|
#define _ADXL345_H_
|
|
|
|
|
2023-09-03 17:00:51 +08:00
|
|
|
/*
|
|
|
|
* In full-resolution mode, scale factor is maintained at ~4 mg/LSB
|
|
|
|
* in all g ranges.
|
|
|
|
*
|
|
|
|
* At +/- 16g with 13-bit resolution, scale is computed as:
|
|
|
|
* (16 + 16) * 9.81 / (2^13 - 1) = 0.0383
|
|
|
|
*/
|
|
|
|
#define ADXL345_USCALE 38300
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The Datasheet lists a resolution of Resolution is ~49 mg per LSB. That's
|
|
|
|
* ~480mm/s**2 per LSB.
|
|
|
|
*/
|
|
|
|
#define ADXL375_USCALE 480000
|
2018-07-13 19:50:44 +08:00
|
|
|
|
2023-09-03 17:00:50 +08:00
|
|
|
struct adxl345_chip_info {
|
|
|
|
const char *name;
|
2023-09-03 17:00:51 +08:00
|
|
|
int uscale;
|
2023-09-03 17:00:50 +08:00
|
|
|
};
|
|
|
|
|
2022-02-22 17:00:05 +08:00
|
|
|
int adxl345_core_probe(struct device *dev, struct regmap *regmap);
|
2017-03-04 16:31:25 +08:00
|
|
|
|
|
|
|
#endif /* _ADXL345_H_ */
|