invensense,icm20689 (on spi bus)

Description

TDK InvenSense ICM-20689 6-axis SPI inertial sensor.

When setting the accel-fs, gyro-fs, accel-dlpf, or gyro-dlpf
properties, include <zephyr/dt-bindings/sensor/icm20689.h> and use
the macros defined there.

Examples

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

&spi0 {
    status = "okay";

    icm20689: icm20689@0 {
        compatible = "invensense,icm20689";
        reg = <0>;
        spi-max-frequency = <8000000>;

        int-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;

        accel-fs = <ICM20689_DT_ACCEL_FS_2G>;
        gyro-fs = <ICM20689_DT_GYRO_FS_250DPS>;

        accel-dlpf = <ICM20689_DT_ACCEL_DLPF_99_0HZ>;
        gyro-dlpf = <ICM20689_DT_GYRO_DLPF_41HZ>;

        smplrt-div = <9>;
    };
};

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.

Maximum value: 8000000

int-gpios

phandle-array

GPIO connected to the INT pin. The GPIO flags must describe
the interrupt polarity configured by the driver.

accel-fs

int

Initial accelerometer full-scale range in g.
The hardware reset value is 2 g.

Default value: 2

Legal values: 2, 4, 8, 16

gyro-fs

int

Initial gyroscope full-scale range in degrees per second.
The hardware reset value is 250 dps.

Default value: 250

Legal values: 250, 500, 1000, 2000

smplrt-div

int

Initial value written to the shared SMPLRT_DIV register.

For accelerometer filter modes with ACCEL_FCHOICE_B equal to zero,
the output data rate is 1000 / (1 + smplrt-div) Hz. Accelerometer
DLPF bypass has a fixed 4 kHz output data rate.

For gyroscope filter modes with FCHOICE_B equal to zero and DLPF_CFG
between 1 and 6, the output data rate is 1000 / (1 + smplrt-div) Hz.
Gyroscope DLPF_CFG values 0 and 7 have a fixed 8 kHz output data
rate, while DLPF bypass modes have a fixed 32 kHz output data rate.

Because SMPLRT_DIV is shared, it affects both sensor paths whenever
their selected filter modes use the divider.

Default value: 0

Value range: 0 to 255

accel-dlpf

int

Initial accelerometer filter configuration. The value packs
ACCEL_CONFIG2.A_DLPF_CFG into bits 2:0 and
ACCEL_CONFIG2.ACCEL_FCHOICE_B into bit 3.

Default value: 0

Legal values: 0, 1, 2, 3, 4, 5, 6, 7, 8

gyro-dlpf

int

Initial gyroscope filter configuration. The value packs
CONFIG.DLPF_CFG into bits 2:0 and GYRO_CONFIG.FCHOICE_B into
bits 4:3.

Default value: 0

Legal values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 16

axis-align-x

int

Align sensor channel x output with hardware orientation axis.
Defaults to x.

Default value: 0

Legal values: 0, 1, 2

axis-align-x-sign

int

Align sensor channel x output with hardware orientation axis sign component.
Defaults to positive.

Default value: 2

Legal values: 0, 2

axis-align-y

int

Align sensor channel y output with hardware orientation axis.
Defaults to y.

Default value: 1

Legal values: 0, 1, 2

axis-align-y-sign

int

Align sensor channel y output with hardware orientation axis sign component.
Defaults to positive.

Default value: 2

Legal values: 0, 2

axis-align-z

int

Align sensor channel z output with hardware orientation axis.
Defaults to z.

Default value: 2

Legal values: 0, 1, 2

axis-align-z-sign

int

Align sensor channel z output with hardware orientation axis sign component.
Defaults to positive.

Default value: 2

Legal values: 0, 2

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).

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 controller 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.