BMX280THP(4)
π BMX280THP(4) β the bmx280thp girlies' guide π
okay so this is a page from the Kernel Interfaces Manual, bestie β we're talking a kernel driver today, and honestly? she's kind of iconic. let's get into it π«Ά
β¨ NAME β¨
bmx280thp β the driver for the Bosch BMP280/BME280 sensor chip, and she talks over the I2C bus π
πΈ SYNOPSIS πΈ
bmx280thp* at iic? addr 0x76
bmx280thp* at iic? addr 0x77
bmx280thp* at spi? slave 0
bmx280thp* at spi? slave 1
like, that's the whole vibe check right there. two addresses on iic, two slave selects on spi. pick your fighter π
π¦ DESCRIPTION π¦
so the bmx280thp driver is the one that gives you actual measurements β temperature, humidity and barometric pressure β from the BMP280 and BME280 sensors, and it feeds all of that through the envsys(4) framework. literally the whole point of her π₯°
the bmx280thp addr argument is what picks the address on the iic(4) bus, and the bmx280thp slave argument is what picks which chip select gets used on the spi(4) bus. iykyk.
and here's the slay part β the precision of the measurement, which is tied to the over sampling done on that measurement, can be changed through sysctl(8) nodes. so you're not stuck, you can tune her β¨
π SYSCTL VARIABLES π
the following sysctl(3) variables are provided, and yes you should be obsessed:
hw.bmx280thp0.osrs_thw.bmx280thp0.osrs_phw.bmx280thp0.osrs_h
these three control oversampling of temperature, pressure and humidity respectively. the valid values are 1, 2, 4, 8, and 16 times oversample. important note bestie: humidity is only available if the chip is a BME280 π«Ά
hw.bmx280thp0.irr_samples
IRR is a filter that can be used to reduce the noise in the measurement. the valid values are 1 (or off), 2, 5, 11 and 22 samples to reach >= 75% of the step response π
hw.bmx280thp0.waitfactor.thw.bmx280thp0.waitfactor.phw.bmx280thp0.waitfactor.h
these control the wait multiplication factor for a measurement cycle. the factor is different for temperature, pressure and humidity, and it's based upon the values of osrs_t, osrs_p and osrs_h. so if the chip isn't returning the correct measurements for a given over sampling, you can adjust the wait factors to allow more time for the measurement to complete successfully. she just needs a lil minute π
hw.bmx280thp0.debughw.bmx280thp0.dump_calibration
if the driver is compiled with BMX280_DEBUG, these nodes will appear π and they can be used to set the debugging level and provide the calibration constants β upon refresh β that are stored in the chip. since the constants are fixed, this is a boolean node and will reset back to false once one dump has been performed. one and done, no cap β¨
hw.bmx280thp0.readattempts
a status register tells the driver if the chip is busy with a measurement. this status register must be polled, and readattempts is the number of times that this poll will be performed. the default is 25, which should be more than enough for most purposes π
π₯ SEE ALSO π₯
envsys(4), iic(4), spi(4), envstat(8), sysctl(8)
go read them, she's worth it π§
π HISTORY π
the bmx280thp driver first appeared in NetBSD 10.0. a whole era, honestly π
π AUTHORS π
the bmx280thp driver was written by Brad Spencer <brad@anduin.eldar.org> β thank you king π
π BUGS π
the driver does not support the continuous read mode that the BMP280 and BME280 has. so like, that's a thing. not me being sad about it π
mwah, that's the whole page π this one came from the Debian crew, dated November 19, 2022, and it's filed under BMX280THP(4) β go measure something, bestie, and stay hydrated πβ¨
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2022 Brad Spencer <brad@anduin.eldar.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms