bosch,bmp581 (on spi bus)

Description

The BMP581 is a Barometric pressure sensor on SPI. See more info at:
https://www.bosch-sensortec.com/products/environmental-sensors/pressure-sensors/bmp581/

When setting the sensor DTS properties, make sure to include
bmp581.h and use the macros defined there.

Examples

#include <zephyr/dt-bindings/sensor/bmp581.h>

&spi0 {
    bmp581: bmp581@0 {
        compatible = "bosch,bmp581";
        reg = <0>;
        spi-max-frequency = <12000000>;
        odr = <BMP581_DT_ODR_50_HZ>;
        press-osr = <BMP581_DT_OVERSAMPLING_8X>;
        temp-osr = <BMP581_DT_OVERSAMPLING_4X>;
        press-iir = <BMP581_DT_IIR_FILTER_COEFF_7>;
        temp-iir = <BMP581_DT_IIR_FILTER_COEFF_3>;
        power-mode = <BMP581_DT_MODE_NORMAL>;
    };
};

Properties

Properties not inherited from the base binding file.

Name

Type

Details

spi-max-frequency

int

Maximum clock frequency of device's SPI interface in Hz

This property is required.

duplex

int

Duplex mode, full or half. By default it's always full duplex thus 0
as this is, by far, the most common mode.
Use the macros not the actual enum value, here is the concordance
list (see dt-bindings/spi/spi.h)
  0    SPI_FULL_DUPLEX
  2048 SPI_HALF_DUPLEX

Default value: 0

Legal values: 0, 2048

frame-format

int

Motorola or TI frame format. By default it's always Motorola's,
thus 0 as this is, by far, the most common format.
Use the macros not the actual enum value, here is the concordance
list (see dt-bindings/spi/spi.h)
  0     SPI_FRAME_FORMAT_MOTOROLA
  32768 SPI_FRAME_FORMAT_TI

Default value: 0

Legal values: 0, 32768

spi-cpol

boolean

SPI clock polarity which indicates the clock idle state.
If it is used, the clock idle state is logic high; otherwise, low.

spi-cpha

boolean

SPI clock phase that indicates on which edge data is sampled.
If it is used, data is sampled on the second edge; otherwise, on the first edge.

spi-lsb-first

boolean

The device requires least significant bit first data mode.

spi-hold-cs

boolean

In some cases, it is necessary for the master to manage SPI chip select
under software control, so that multiple spi transactions can be performed
without releasing it. A typical use case is variable length SPI packets
where the first spi transaction reads the length and the second spi transaction
reads length bytes.

spi-cs-high

boolean

The device requires the chip select to be active high.

spi-interframe-delay-ns

int

Delay in nanoseconds between SPI words.
Default of 0 is special value which will assume to mean half of the SCK period.

Default value: 0

spi-cs-setup-delay-ns

int

Delay in nanoseconds to be introduced by the controller after CS is asserted.
Also known as enable lead time.

spi-cs-hold-delay-ns

int

Delay in nanoseconds to be introduced by the controller before the CS is de-asserted.
 Also known as enable lag time.

supply-gpios

phandle-array

GPIO specifier that controls power to the device.

This property should be provided when the device has a dedicated
switch that controls power to the device.  The supply state is
entirely the responsibility of the device driver.

Contrast with vin-supply.

vin-supply

phandle

Reference to the regulator that controls power to the device.
The referenced devicetree node must have a regulator compatible.

This property should be provided when device power is supplied
by a shared regulator.  The supply state is dependent on the
request status of all devices fed by the regulator.

Contrast with supply-gpios.  If both properties are provided
then the regulator must be requested before the supply GPIOS is
set to an active state, and the supply GPIOS must be set to an
inactive state before releasing the regulator.

int-gpios

phandle-array

Interrupt pin.
The interrupt pin of BMP581 is open-drain, active low. If connected directly to the MCU, the pin should be configured as pull-up, active low.

odr

int

Output data rate. Please note this is only valid on BMP581_DT_MODE_NORMAL.
Default is power-on reset.

Default value: 0x1c

Legal values: 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f

press-osr

int

Pressure oversampling rate.
Default is power-on reset.

Default value: 0x0

Legal values: 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7

temp-osr

int

Temperature oversampling rate.
Default is power-on reset.

Default value: 0x0

Legal values: 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7

power-mode

int

Power mode.
Default favors ease of use by simply setting ODR and OSR. Otherwise user
needs to look into driver details, as the other modes require some quirks
(e.g: Forced mode does not just work).

Default value: 1

Legal values: 1, 2, 3

press-iir

int

Pressure IIR filter coefficient.
Default is power-on reset (bypass).

Default value: 0x0

Legal values: 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7

temp-iir

int

Temperature IIR filter coefficient.
Default is power-on reset (bypass).

Default value: 0x0

Legal values: 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7

fifo-watermark

int

Specify the FIFO watermark level in frame count.
Only supports frames with both Pressure and Temperature
Valid range: 1 - 15

int-active-low

boolean

Configure the INT pin as active low. Defaults to active high.
The GPIO flags on the int-gpios property must agree with this setting
(e.g. GPIO_ACTIVE_LOW when this property is present).

int-open-drain

boolean

Configure the INT pin as open-drain. Defaults to push-pull.

friendly-name

string

Human readable string describing the sensor. It can be used to
distinguish multiple instances of the same model (e.g., lid accelerometer
vs. base accelerometer in a laptop) to a host operating system.

This property is defined in the Generic Sensor Property Usages of the HID
Usage Tables specification
(https://usb.org/sites/default/files/hut1_3_0.pdf, section 22.5).