drivers/iio/pressure/bmp280.h

Source file repositories/reference/linux-study-clean/drivers/iio/pressure/bmp280.h

File Facts

System
Linux kernel
Corpus path
drivers/iio/pressure/bmp280.h
Extension
.h
Size
15632 bytes
Lines
552
Domain
Driver Families
Bucket
drivers/iio
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct bmp180_calib {
	s16 AC1;
	s16 AC2;
	s16 AC3;
	u16 AC4;
	u16 AC5;
	u16 AC6;
	s16 B1;
	s16 B2;
	s16 MB;
	s16 MC;
	s16 MD;
};

/* See datasheet Section 4.2.2. */
struct bmp280_calib {
	u16 T1;
	s16 T2;
	s16 T3;
	u16 P1;
	s16 P2;
	s16 P3;
	s16 P4;
	s16 P5;
	s16 P6;
	s16 P7;
	s16 P8;
	s16 P9;
	u8  H1;
	s16 H2;
	u8  H3;
	s16 H4;
	s16 H5;
	s8  H6;
};

/* See datasheet Section 3.11.1. */
struct bmp380_calib {
	u16 T1;
	u16 T2;
	s8  T3;
	s16 P1;
	s16 P2;
	s8  P3;
	s8  P4;
	u16 P5;
	u16 P6;
	s8  P7;
	s8  P8;
	s16 P9;
	s8  P10;
	s8  P11;
};

enum bmp280_op_mode {
	BMP280_SLEEP,
	BMP280_FORCED,
	BMP280_NORMAL,
};

struct bmp280_data {
	struct device *dev;
	struct mutex lock;
	struct regmap *regmap;
	struct completion done;
	bool use_eoc;
	bool trig_open_drain;
	bool trig_active_high;
	struct iio_trigger *trig;
	const struct bmp280_chip_info *chip_info;
	union {
		struct bmp180_calib bmp180;
		struct bmp280_calib bmp280;
		struct bmp380_calib bmp380;
	} calib;
	struct regulator_bulk_data supplies[BMP280_NUM_SUPPLIES];
	unsigned int start_up_time_us;

	/* log of base 2 of oversampling rate */
	u8 oversampling_press;
	u8 oversampling_temp;
	u8 oversampling_humid;
	u8 iir_filter_coeff;

	/*
	 * BMP380 devices introduce sampling frequency configuration. See
	 * datasheet sections 3.3.3. and 4.3.19 for more details.
	 *
	 * BMx280 devices allowed indirect configuration of sampling frequency
	 * changing the t_standby duration between measurements, as detailed on

Annotation

Implementation Notes