Zephyr Sensor Devices

Overview

Zephyr provides a way to enable the legacy cros-ec sensor drivers. This is done through both enabling Kconfig options and adding nodes to the devicetree.

Kconfig Options

Kconfig OptionDefaultDocumentation
CONFIG_PLATFORM_EC_ACCELGYRO_BMI160nBMI160
CONFIG_PLATFORM_EC_ACCELGYRO_BMI260nBMI260
CONFIG_PLATFORM_EC_ACCELGYRO_BMI3XXnBMI3XX
CONFIG_PLATFORM_EC_ACCELGYRO_ICM426XXnICM426XX
CONFIG_PLATFORM_EC_ACCELGYRO_ICM42607nICM42607
CONFIG_PLATFORM_EC_ACCELGYRO_LSM6DSOnLSM6DSO
CONFIG_PLATFORM_EC_ACCEL_BMA255nBMA255
CONFIG_PLATFORM_EC_ACCEL_BMA4XXnBMA4XX
CONFIG_PLATFORM_EC_ACCEL_KX022nKX022
CONFIG_PLATFORM_EC_ACCEL_LIS2DW12nLIS2DW12
CONFIG_PLATFORM_EC_ALS_TCS3400nTCS3400
CONFIG_PLATFORM_EC_ALS_VEML3328n[VEML3328]

CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM choice

The following choice is available only when one of the CONFIG_PLATFORM_EC_ACCELGYRO_BMI* configs are selected.

Kconfig choiceDocumentation
CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_SPIBMI COMM SPI
CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2CBMI COMM I2C

CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM choice

The following choice is available only when one of the CONFIG_PLATFORM_EC_ACCELGYRO_ICM* configs are selected.

Kconfig choiceDocumentation
CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM_SPIICM COMM SPI
CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM_I2CICM COMM I2C

Devicetree Nodes

Detail the devicetree nodes that configure the feature.

Note - avoid documenting node properties here. Point to the relevant .yaml file instead, which contains the authoritative definition.

Board Specific Code

Document any board specific routines that a user must create to successfully compile and run. For many features, this can section can be empty.

Threads

Document any threads enabled by this feature.

Testing and Debugging

Provide any tips for testing and debugging the EC feature.

Example

Provide code snippets from a working board to walk the user through all code that must be created to enable this feature.