text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|>/* ST Microelectronics IIS3DWB accelerometer sensor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/iis3dwb.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_IIS3DWB_IIS3DWB_H_ #define ZEPHYR_DRIVERS_SENSOR_IIS3DWB_IIS...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics IIS3DWB accelerometer sensor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/iis3dwb.pdf */ #include "iis3dwb.h" #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(IIS3DWB_DECODER,...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ZEPHYR_DRIVERS_SENSOR_IIS3DWB_RTIO_H_ #include <zephyr/device.h> #include <zephyr/rtio/rtio.h> void iis3dwb_submit(const struct device *sensor, struct rtio_iodev_sqe *iodev_sqe); void iis3dwb_submit_stream(const struct device *sensor, struct rtio_iodev_sqe *iodev_sqe); void iis3dwb_stream_irq_handler(co...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics IIS3DWB accelerometer senor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/iis3dwb.pdf */ #include <zephyr/dt-bindings/sensor/iis3dwb.h> #include <zephyr/drivers/sensor.h> #include ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics IIS3DWB accelerometer senor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/iis3dwb.pdf */ #define DT_DRV_COMPAT st_iis3dwb #include <zephyr/kernel.h> #include <zephyr/drivers/senso...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics ISM330DHCX 6-axis IMU sensor driver * * Copyright (c) 2020 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/ism330dhcx.pdf */ #define DT_DRV_COMPAT st_ism330dhcx #include <zephyr/drivers/sensor.h> #include...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> DT_ANY_INST_ON_BUS_STATUS_OKAY(i2c) struct i2c_dt_spec i2c; #elif DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) struct spi_dt_spec spi; #endif /* DT_ANY_INST_ON_BUS_STATUS_OKAY(i2c) */ }; union samples { uint8_t raw[6]; struct { int16_t axis[3]; }; } __aligned(2); #define ISM330DHCX_SHUB_MAX_NUM_SLVS 2 ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics ISM330DHCX 6-axis IMU sensor driver * * Copyright (c) 2020 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/ism330dhcx.pdf */ #define DT_DRV_COMPAT st_ism330dhcx #include <string.h> #include <zephyr/driver...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>SH on */ ism330dhcx_shub_enable(dev, 1); ism330dhcx_shub_wait_completed(dev); return 0; } int ism330dhcx_shub_get_idx(enum sensor_channel type) { uint8_t n; struct ism330dhcx_shub_slist *sp; for (n = 0; n < num_ext_dev; n++) { sp = &ism330dhcx_shub_slist[shub_ext[n]]; if (sp->type == type) {...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>r) ism330dhcx_spi_write; data->ctx_spi.mdelay = (stmdev_mdelay_ptr) stmemsc_mdelay; data->ctx = &data->ctx_spi; data->ctx->handle = (void *)dev; return 0; } #endif /* DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) */ <|fim_prefix|>/* ST Microelectronics ISM330DHCX 6-axis IMU sensor driver * * Copyright (c) 2...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics ISM330DHCX 6-axis IMU sensor driver * * Copyright (c) 2020 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/ism330dhcx.pdf */ #define DT_DRV_COMPAT st_ism330dhcx #include <zephyr/kernel.h> #include <zephyr...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DE12 3-axis accelerometer sensor driver * * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2de12.pdf */ #define DT_DRV_COMPAT st_lis2de12 #include <zephyr/drivers/sensor.h> #inc...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>dif /* CONFIG_LIS2DE12_TRIGGER */ }; #ifdef CONFIG_LIS2DE12_TRIGGER int lis2de12_trigger_set(const struct device *dev, const struct sensor_trigger *trig, sensor_trigger_handler_t handler); int lis2de12_init_interrupt(const struct device *dev); #endif #endif /* ZEPHYR_DRIVERS_SENSOR_LIS2DE12_LIS2D...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DE12 3-axis accelerometer sensor driver * * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2de12.pdf */ #define DT_DRV_COMPAT st_lis2de12 #include <zephyr/kernel.h> #include <ze...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2017 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_lis2dh #include <zephyr/init.h> #include <zephyr/sys/byteorder.h> #include <zephyr/sys/__assert.h> #include <zephyr/logging/log.h> #include <zephyr/pm/device.h> #include <zephyr/drivers/sen...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2017 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_SENSOR_LIS2DH_LIS2DH_H_ #define ZEPHYR_DRIVERS_SENSOR_LIS2DH_LIS2DH_H_ #include <zephyr/kernel.h> #include <zephyr/device.h> #include <zephyr/sys/util.h> #include <stdint.h> #include <zephyr/d...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DH 3-axis accelerometer driver * * Copyright (c) 2020 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2dh.pdf */ #define DT_DRV_COMPAT st_lis2dh #include <string.h> #include <zephyr/drivers/i2c.h> ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DH 3-axis accelerometer driver * * Copyright (c) 2020 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2dh.pdf */ #define DT_DRV_COMPAT st_lis2dh #include <string.h> #include "lis2dh.h" #include <ze...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>n; } if (cfg->gpio_drdy.port && atomic_test_and_clear_bit(&lis2dh->trig_flags, TRIGGED_INT1)) { if (likely(lis2dh->handler_drdy != NULL)) { lis2dh->handler_drdy(dev, lis2dh->trig_drdy); } /* Reactivate level triggered interrupt if handler did not * disable itself */ if (likely(l...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DS12 3-axis accelerometer driver * * Copyright (c) 2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2ds12.pdf */ #define DT_DRV_COMPAT st_lis2ds12 #include <zephyr/drivers/sensor.h> #include <z...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DS12 3-axis accelerometer driver * * Copyright (c) 2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2ds12.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_LIS2DS12_LIS2DS12_H_ #define ZEPHYR_DRIVERS_SENSOR_...
fim
zephyrproject-rtos/zephyr
c
/* ST Microelectronics LIS2DS12 3-axis accelerometer driver * * Copyright (c) 2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2ds12.pdf */ #define DT_DRV_COMPAT st_lis2ds12 #include <zephyr/logging/log.h> #include "lis2ds12.h" LOG_M...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>id; uint8_t odr, fs; if (lis2du12_id_get(ctx, &chip_id) < 0) { LOG_ERR("Failed reading chip id"); return -EIO; } LOG_INF("chip id 0x%x", chip_id.whoami); if (chip_id.whoami != LIS2DU12_ID) { LOG_ERR("Invalid chip id 0x%x", chip_id.whoami); return -EIO; } /* reboot device */ if (lis2du1...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DU12 3-axis accelerometer sensor driver * * Copy<|fim_suffix|>[2]; sensor_trigger_handler_t handler_drdy_acc; const struct sensor_trigger *trig_drdy_acc; sensor_trigger_handler_t handler_delta_xyz_acc; const struct sensor_trigger *trig_delta_xyz_acc; #if defined(CONFIG_LI...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>u12->thread_stack, CONFIG_LIS2DU12_THREAD_STACK_SIZE, (k_thread_entry_t)lis2du12_thread, lis2du12, NULL, NULL, K_PRIO_COOP(CONFIG_LIS2DU12_THREAD_PRIORITY), 0, K_NO_WAIT); k_thread_name_set(&lis2du12->thread, dev->name); #elif defined(CONFIG_LIS2DU12_TRIGGER_GLOBAL_THREAD) lis2du12->work.han...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DUX12 3-axis accelerometer driver * * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2dux12.pdf */ #include <zephyr/drivers/sensor.h> #include <zephyr/kernel.h> #include <zephyr/...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DUX12 3-axis accelerometer driver * * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2dux12.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_LIS2DUX12_LIS2DUX12_H_ #define ZEPHYR_DRIVERS_SEN...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>_ctx_t *)&config->ctx; lis2dux12_pin_int_route_t pin_int = { 0 }; /* dummy read: re-trigger interrupt */ lis2dux12_md_t md = {.fs = LIS2DUX12_2g}; lis2dux12_xl_data_t buf; lis2dux12_xl_data_get(ctx, &md, &buf); pin_int.drdy = PROPERTY_ENABLE; /* Set pin interrupt */ if (config->drdy_pin == 1) ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DUX12 smart accelerometer APIs * * Copyright (c) 2024 STMicroelectronics * Copyright (c) 2023 PHYTEC Messtechnik GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <stdint.h> #include <stmemsc.h> #include "lis2dux12_reg.h" #include <zephyr/dt-bindings/sensor/lis2du...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DUX12 6-axis IMU sensor driver * * Copyright (c) 2023 Google LLC * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #include "lis2dux12.h" #include "lis2dux12_decoder.h" #include <zephyr/dt-bindings/sensor/lis2dux12.h> #include <zephyr/log...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>_mode_sel: 2; uint32_t fifo_count: 7; uint32_t reserved_1: 5; uint32_t accel_batch_odr: 3; uint32_t ts_batch_odr: 2; uint32_t reserved: 9; } __attribute__((__packed__)); struct lis2dux12_rtio_data { struct lis2dux12_decoder_header header; struct { uint8_t has_accel: 1; /* set if accel channel ha...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>g->count; uint32_t min_buf_len = sizeof(struct lis2dux12_rtio_data); uint64_t cycles; int rc = 0; uint8_t *buf; uint32_t buf_len; struct lis2dux12_rtio_data *edata; struct lis2dux12_data *data = dev->data; const struct lis2dux12_config *config = dev->config; const struct lis2dux12_chip_api *chip...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>2_RTIO_H_ */ <|fim_prefix|>/* ST Microelectronics LIS2DUX12 6-axis IMU sensor driver * * Copyright (c) 2023 Google LLC * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_SENSOR_LIS2DUX12_RTIO_H_ #define ZEPHYR_DRIVERS_SENSOR_LIS2DUX12_RTIO_H_ ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DUX12 6-axis IMU sensor driver * * Copyright (c) 2023 Google LLC * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/dt-bindings/sensor/lis2dux12.h> #include <zephyr/drivers/sensor.h> #include "lis2dux12.h" #include "lis2dux...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> if (ret < 0) { LOG_ERR("%s: Not able to initialize device interrupt", dev->name); return ret; } return gpio_pin_interrupt_configure_dt(data->drdy_gpio, GPIO_INT_EDGE_TO_ACTIVE); } <|fim_prefix|>/* ST Microelectronics LIS2DUX12 3-axis accelerometer driver * * Copyright (c) 2024 STMicroelectronics...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DUXS12 smart accelerometer APIs * * Copyright (c) 2024 STMicroelectronics * Copyright (c) 2023 PHYTEC Messtechnik GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include "lis2dux12.h" #include "lis2duxs12_api.h" #include <zephyr/logging/log.h> LOG_MODULE_DECLARE(LIS2DUX...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>12_LIS2DUXS12_API_H_ */ <|fim_prefix|>/* ST Microelectronics LIS2DUXS12 smart accelerometer APIs * * Copyright (c) 2024 STMicroelectronics * Copyright (c) 2023 PHYTEC Messtechnik GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <stdint.h> #include <stmemsc.h> #include "lis2duxs12_reg.h" #i...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>T_GET(inst), \ &lis2dw12_data_##inst, \ &lis2dw12_config_##inst, \ POST_KERNEL, \ CONFIG_SENSOR_INIT_PRIORITY, \ &lis2dw12_driver_api); /* * Instantiation macros used when a device is on a SPI bus. */ #ifdef CONFIG_LIS2DW12_TAP #define LIS2DW12_CONFIG_TAP(in...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2DW12 3-axis accelerometer driver * * Copyright (c) 2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2dw12.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_LIS2DW12_LIS2DW12_H_ #define ZEPHYR_DRIVERS_SENSOR_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>-EIO; } LOG_DBG("FREEFALL: threshold is %02x", cfg->freefall_threshold); rc = lis2dw12_ff_threshold_set(ctx, cfg->freefall_threshold); if (rc != 0) { LOG_ERR("Failed to set freefall threshold"); return -EIO; } return 0; } #endif /* CONFIG_LIS2DW12_FREEFALL */ int lis2dw12_init_interrupt(const ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2MDL 3-axis magnetometer sensor * * Copyright (c) 2018-2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2mdl.pdf */ #define DT_DRV_COMPAT st_lis2mdl #include <zephyr/init.h> #include <zephyr/sys...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LIS2MDL 3-axis magnetometer sensor * * Copyright (c) 2018-2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lis2mdl.pdf */ #ifndef __MAG_LIS2MDL_H #define __MAG_LIS2MDL_H #include <zephyr/drivers/gpio....
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> if (cfg->single_mode) { k_sem_give(&lis2mdl->fetch_sem); } gpio_pin_interrupt_configure_dt(&cfg->gpio_drdy, GPIO_INT_EDGE_TO_ACTIVE); } static void lis2mdl_gpio_callback(const struct device *dev, struct gpio_callback *cb, uint32_t pins) { struct lis2mdl_data *lis2mdl = CONTAINER_O...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_lis3mdl_magn #include <zephyr/drivers/i2c.h> #include <zephyr/init.h> #include <zephyr/sys/__assert.h> #include <zephyr/sys/byteorder.h> #include <zephyr/drivers/sensor.h> #include <zephyr/pm/device.h> #i...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>(0, 5, 0), /* 20 Hz */ LIS3MDL_ODR_BITS(0, 6, 0), /* 40 Hz */ LIS3MDL_ODR_BITS(0, 7, 0), /* 80 Hz */ LIS3MDL_ODR_BITS(3, 0, 1), /* 155 Hz */ LIS3MDL_ODR_BITS(2, 0, 1), /* 300 Hz */ LIS3MDL_ODR_BITS(1, 0, 1), /* 560 Hz */ LIS3MDL_ODR_BITS(0, 0, 1) /* 1000 Hz */ }; static const uint16_t lis3mdl_magn...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> const struct sensor_trigger *trig, sensor_trigger_handler_t handler) { struct lis3mdl_data *drv_data = dev->data; const struct lis3mdl_config *config = dev->config; int16_t buf[3]; int ret; if (!config->irq_gpio.port) { return -ENOTSUP; } __ASSERT_NO_MSG(trig->type == SENSOR_TRIG_DATA_REA...
fim
zephyrproject-rtos/zephyr
c
/* lps22hb.c - Driver for LPS22HB pressure and temperature sensor */ /* * Copyright (c) 2017 Linaro Limited * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_lps22hb_press #include <zephyr/drivers/sensor.h> #include <zephyr/kernel.h> #include <zephyr/device.h> #include <zephyr/init.h> #include ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* sensor_lps25hb.h - header file for LPS22HB pressure and temperature * sensor driver */ /* * Copyright (c) 2017 Linaro Limited * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_SENSOR_LPS22HB_LPS22HB_H_ #define ZEPHYR_DRIVERS_SENSOR_LPS22HB_LPS22HB_H_ #include <stdint.h> #includ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>CODE_1(DT_INST_ON_BUS(inst, spi), \ (LPS22HH_CONFIG_SPI(inst)), \ (COND_CODE_1(DT_INST_ON_BUS(inst, i3c), \ (LPS22HH_CONFIG_I3C_OR_I2C(inst)), \ (LPS22HH_CONFIG_I2C(inst))))); \ PM_DEVICE_DT_INST_DEFINE(inst, lps22hh_pm_action); \ SENSOR_...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LPS22HH pressure and temperature <|fim_suffix|> const struct spi_dt_spec spi; #endif #if DT_ANY_INST_ON_BUS_STATUS_OKAY(i3c) struct i3c_device_desc **i3c; #endif } stmemsc_cfg; uint8_t odr; #ifdef CONFIG_LPS22HH_TRIGGER struct gpio_dt_spec gpio_int; #endif #if DT_ANY_INST_ON_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>PIO_INT_EDGE_TO_ACTIVE); if (ret < 0) { LOG_ERR("%s: Not able to configure pin_int", dev->name); } } static void lps22hh_intr_callback(struct lps22hh_data *lps22hh) { #if defined(CONFIG_LPS22HH_TRIGGER_OWN_THREAD) k_sem_give(&lps22hh->intr_sem); #elif defined(CONFIG_LPS22HH_TRIGGER_GLOBAL_THREAD) k...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* lps25hb.c - Driver for LPS25HB pressure and temperature sensor */ /* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_lps25hb_press #include <zephyr/drivers/sensor.h> #include <zephyr/kernel.h> #include <zephyr/device.h> #include <zephyr/...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* sensor_lps25hb.h - header file for LPS25HB pressure and temperature * sensor driver */ /* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_SENSOR_LPS25HB_LPS25HB_H_ #define ZEPHYR_DRIVERS_SENSOR_L<|fim_suffix|>T_CTRL_REG1_DIFF_EN 3...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>_handle_interrupt, .trigger_set = ilps22qs_trigger_set, #endif }; <|fim_prefix|>/* ST Microelectronics ILPS22QS pressure and temperature sensor * * Copyright (c) 2023-2024 STMicroelectronics * Copyright (c) 2023 PHYTEC Messtechnik GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include "lps2xdf.h...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics ILPS22QS pressure and temperature sensor * * Copyright (c) 2023-2024 STMicroelectronics * Copyright <|fim_suffix|>ier: Apache-2.0 */ #include <stdint.h> #include <stmemsc.h> #include "ilps22qs_reg.h" #include <zephyr/drivers/sensor.h> #ifndef ZEPHYR_DRIVERS_SENSOR_ILPS22QS_I...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LPS22DF pressure and temperature sensor * * Copyright (c) 2023 STMicroelectronics * Copyright (c) 2023 PHYTEC Messtechnik GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include "lps2xdf.h" #include "lps22df.h" #include <zephyr/logging/log.h> LOG_MODULE_DECLARE(LPS2XDF, CON...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LPS22DF pressure and temperature sensor * * Copyright (c) 2023 STMicroelectronics * Copyright (c) 2023 PHYTEC Messtechnik GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <stdint.h> #include <stmemsc.h> #include "lps22df_reg.h" #include <zephyr/drivers/sensor.h> #i...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>mdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; lps28dfw_data_t raw_data; lps28dfw_md_t md; md.fs = cfg->fs; if (trig->chan != SENSOR_CHAN_ALL) { LOG_WRN("trigger set not supported on this channel."); return -ENOTSUP; } lps28dfw->handler_drdy = handler; lps28dfw->data_ready_trigger = trig; if ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>: Apache-2.0 */ #include <stdint.h> #include <stmemsc.h> #include <zephyr/drivers/sensor.h> #include "lps28dfw_reg.h" #ifndef ZEPHYR_DRIVERS_SENSOR_LPS28DFW_LPS28DFW_H_ #define ZEPHYR_DRIVERS_SENSOR_LPS28DFW_LPS28DFW_H_ extern const struct lps2xdf_chip_api st_lps28dfw_chip_api; #endif /* ZEPHYR_DRI...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> \ IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, fs), \ (.fs = DT_INST_PROP(inst, fs),)) \ IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, drdy_gpios), \ (LPS2XDF_CFG_IRQ(inst))) #define LPS2XDF_SPI_OPERATION (SPI_WORD_SET(8) | SP...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>2xdf_config_interrupt)(const struct device *dev); typedef void (*api_lps2xdf_handle_interrupt)(const struct device *dev); typedef int (*api_lps2xdf_trigger_set)(const struct device *dev, const struct sensor_trigger *trig, sensor_trigger_handler_t handler); #endif struct lps2xdf_chip...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>back(lps2xdf); return 0; } #endif int lps2xdf_init_interrupt(const struct device *dev, enum sensor_variant variant) { struct lps2xdf_data *lps2xdf = dev->data; const struct lps2xdf_config *cfg = dev->config; int ret; /* setup data ready gpio interrupt */ if (!gpio_is_ready_dt(&cfg->gpio_int) && !...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2018 Philémon Jaermann * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_lsm303dlhc_magn #include <zephyr/drivers/i2c.h> #include <zephyr/init.h> #include <zephyr/drivers/sensor.h> #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(lsm303dlhc_magn, CONFIG_SENSOR_LOG_LEVEL); ...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2018 Philémon Jaermann * * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SENSOR_LSM303DLHC_MAGN_ #define __SENSOR_LSM303DLHC_MAGN_ #include <zephyr/drivers/i2c.h> #define LSM303_DLHC_MAGN_X_EN_BIT BIT(0) #define LSM303DLHC_MAGN_Y_EN_BIT BIT(1) #define LSM303DLHC_MAGN_Z_EN_BIT BIT(2) #define...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* lsm6ds0.c - Driver for LSM6DS0 accelerometer, gyroscope and * temperature sensor */ /* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_lsm6ds0 #include <zephyr/drivers/sensor.h> #include <zephyr/kernel.h> #include <zephyr/device.h> #in...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* sensor_lsm6ds0.h - header file for LSM6DS0 accelerometer, gyroscope and * temperature sensor driver */ /* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_SENSOR_LSM6DS0_LSM6DS0_H_ #define ZEPHYR_DRIVERS_SENSOR_LSM6DS0_LSM6DS0_H_ #include...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> { LOG_DBG("failed to set accelerometer sampling rate"); return -EIO; } return 0; } #endif #ifdef LSM6DSL_ACCEL_FS_RUNTIME static int lsm6dsl_accel_range_set(const struct device *dev, int32_t range) { int fs; struct lsm6dsl_data *data = dev->data; fs = lsm6dsl_accel_range_to_fs_val(range); if...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* sensor_lsm6dsl.h - header file for LSM6DSL accelerometer, gyroscope and * temperature sensor driver */ /* * Copyright (c) 2017 Linaro Limited * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_SENSOR_LSM6DSL_LSM6DSL_H_ #define ZEPHYR_DRIVERS_SENSOR_LSM6DSL_LSM6DSL_H_ #include <z...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>reg = lsm6dsl_i2c_update_reg, }; int lsm6dsl_i2c_init(const struct device *dev) { struct lsm6dsl_data *data = dev->data; const struct lsm6dsl_config *cfg = dev->config; data->hw_tf = &lsm6dsl_i2c_transfer_fn; if (!device_is_ready(cfg->bus_cfg.i2c.bus)) { return -ENODEV; } return 0; } #endif /*...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2018 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/device.h> #include <zephyr/drivers/i2c.h> #include <zephyr/sys/__assert.h> #include <zephyr/sys/util.h> #include <zephyr/kernel.h> #include <zephyr/drivers/sensor.h> #include <zephyr/logging/log.h> #include "lsm...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>set rx = { .buffers = rx_buf, .count = 2 }; if (len > 64) { return -EIO; } if (spi_transceive_dt(&cfg->bus_cfg.spi, &tx, &rx)) { return -EIO; } return 0; } static int lsm6dsl_raw_write(const struct device *dev, uint8_t reg_addr, uint8_t *value, uint8_t len) { const struct lsm6d...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2018 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_lsm6dsl #include <zephyr/device.h> #include <zephyr/drivers/i2c.h> #include <zephyr/sys/__assert.h> #include <zephyr/sys/util.h> #include <zephyr/kernel.h> #include <zephyr/drivers/sensor.h...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSO 6-axis IMU sensor driver * * Copyright (c) 2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dso.pdf */ #include <zephyr/drivers/sensor.h> #include <zephyr/kernel.h> #include <zephyr/device....
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSO 6-axis IMU sensor driver * * Copyright (c) 2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dso.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_LSM6DSO_LSM6DSO_H_ #define ZEPHYR_DRIVERS_SENSOR_LSM6DSO...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSO 6-axis IMU sensor driver * * Copyright (c) 2019 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dso.pdf */ #define DT_DRV_COMPAT st_lsm6dso #include <zephyr/device.h> #include <zephyr/drivers/...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>>gpio_cb, lsm6dso_gpio_callback, BIT(cfg->gpio_drdy.pin)); if (gpio_add_callback(cfg->gpio_drdy.port, &lsm6dso->gpio_cb) < 0) { LOG_DBG("Could not set gpio callback"); return -EIO; } /* set data ready mode on int1/int2 */ LOG_DBG("drdy_pulsed is %d", (int)cfg->drdy_pulsed); lsm6dso...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>(chip_id != LSM6DSO16IS_ID) { LOG_DBG("Invalid chip id 0x%x", chip_id); return -EIO; } /* reset device */ if (lsm6dso16is_software_reset(ctx) < 0) { return -EIO; } fs = cfg->accel_range; LOG_DBG("accel range is %d", fs); if (lsm6dso16is_accel_set_fs_raw(dev, fs) < 0) { LOG_ERR("failed to ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>sor_trigger_handler_t handler_drdy_gyr; const struct sensor_trigger *trig_drdy_gyr; sensor_trigger_handler_t handler_drdy_temp; const struct sensor_trigger *trig_drdy_temp; #if defined(CONFIG_LSM6DSO16IS_TRIGGER_OWN_THREAD) K_KERNEL_STACK_MEMBER(thread_stack, CONFIG_LSM6DSO16IS_THREAD_STACK_SIZE); s...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>et(ctx, LSM6DSO16IS_ONLY_FIRST_CYCLE) < 0) { LOG_DBG("shub: error setting write once"); return -EIO; } for (n = 0; n < ARRAY_SIZE(lsm6dso16is_shub_slist); n++) { if (data->num_ext_dev >= LSM6DSO16IS_SHUB_MAX_NUM_TARGETS) { break; } chip_id = 0; sp = &lsm6dso16is_shub_slist[n]; /* ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSO16IS 6-axis IMU sensor driver * * Copyright (c) 2023 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dso16is.pdf */ #define DT_DRV_COMPAT st_lsm6dso16is #include <zephyr/kernel.h> #include <zep...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>han, attr, val); #if defined(CONFIG_LSM6DSV16X_SENSORHUB) case SENSOR_CHAN_MAGN_XYZ: case SENSOR_CHAN_PRESS: case SENSOR_CHAN_HUMIDITY: if (!data->shub_inited) { LOG_ERR("shub not inited."); return -ENOTSUP; } return lsm6dsv16x_shub_config(dev, chan, attr, val); #endif /* CONFIG_LSM6DSV16X...
fim
zephyrproject-rtos/zephyr
c
/* ST Microelectronics LSM6DSV16X 6-axis IMU sensor driver * * Copyright (c) 2023 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dsv16x.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_LSM6DSV16X_LSM6DSV16X_H_ #define ZEPHYR_DRIVERS_SENSOR_LSM6DSV16...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSV16X 6-axis IMU sensor driver * * Copyright (c) 2023 Google LLC * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #include "lsm6dsv16x.h" #include "lsm6dsv16x_decoder.h" #include <zephyr/dt-bindings/sensor/lsm6dsv16x.h> #include <zephyr...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>dr: 3; uint16_t reserved_2: 1; } __attribute__((__packed__)); struct lsm6dsv16x_rtio_data { struct lsm6dsv16x_decoder_header header; struct { uint8_t has_accel: 1; /* set if accel channel has data */ uint8_t has_gyro: 1; /* set if gyro channel has data */ uint8_t has_temp: 1; /* set if temp ch...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSV16X 6-axis IMU sensor driver * * Copyright (c) 2023 Google LLC * Copyright (c) 2024 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/sensor.h> #include "lsm6dsv16x.h" #include "lsm6dsv16x_rtio.h" #include "lsm6dsv16x_decoder.h" #in...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>tribute attr, struct sensor_value *val); void lsm6dsv16x_submit(const struct device *sensor, struct rtio_iodev_sqe *iodev_sqe); void lsm6dsv16x_submit_stream(const struct device *sensor, struct rtio_iodev_sqe *iodev_sqe); void lsm6dsv16x_stream_irq_handler(const struct device *dev); #endif /* ZEPHYR_DRI...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>m6dsv16x_config *config = dev->config; struct rtio *rtio = lsm6dsv16x->rtio_ctx; #endif uint64_t cycles; int rc; if (lsm6dsv16x->streaming_sqe == NULL) { return; } rc = sensor_clock_get_cycles(&cycles); if (rc != 0) { LOG_ERR("Failed to get sensor clock cycles"); rtio_iodev_sqe_err(lsm6dsv1...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>LOG_DBG("shub: invalid chip id 0x%x", chip_id); continue; } LOG_INF("shub: Ext Device Chip Id: %02x", chip_id); sp->ext_i2c_addr = sp->i2c_addr[i]; data->shub_ext[data->num_ext_dev++] = n; } LOG_DBG("shub: dev %s - num_ext_dev %d", dev->name, data->num_ext_dev); if (data->num_ext_dev == 0)...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSV16X 6-axis IMU sensor driver * * Copyright (c) 2023 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dsv16x.pdf */ #include <zephyr/kernel.h> #include <zephyr/drivers/sensor.h> #include <zephyr/d...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSVXXX family IMU sensor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/ism6hg256x.pdf */ #include "ism6hg256x.h" #include <zephyr/logging/log.h> LOG_MODULE_DECLARE(LSM6DSVXXX,...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/ism6hg256x.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_ISM6HG256X_H_ #define ZEPHYR_DRIVERS_SENSOR_ISM6HG256X_H_ #include <stdint.h> #include <stmemsc.h> #include "lsm6dsvxxx.h" #include "ism6hg256x_reg.h" #include <zephyr/drivers/s...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSVXXX family IMU sensor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dsv320x.pdf */ #include "lsm6dsv320x.h" #include <zephyr/logging/log.h> LOG_MODULE_DECLARE(LSM6DSVXX...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSVXXX family IMU sensor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dsv320x.pdf */ #ifndef ZEPHYR_DRIVERS_SENSOR_LSM6DSV320X_H_ #define ZEPHYR_DRIVERS_SENSOR_LSM6DSV320X_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>v->config; stmdev_ctx_t *ctx = (stmdev_ctx_t *)&config->ctx; /* enable drdy on int1/int2 in pulse mode */ lsm6dsv80x_data_ready_mode_t drdy = (config->drdy_pulsed) ? LSM6DSV80X_DRDY_PULSED : LSM6DSV80X_DRDY_LATCHED; if (lsm6dsv80x_data_ready_mode_set(ctx, drdy)) { return -EIO; } return 0; } #e...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>efine ZEPHYR_DRIVERS_SENSOR_LSM6DSV80X_H_ #include <stdint.h> #include <stmemsc.h> #include "lsm6dsvxxx.h" #include "lsm6dsv80x_reg.h" #include <zephyr/drivers/sensor.h> extern const struct lsm6dsvxxx_chip_api st_lsm6dsv80x_chip_api; extern const int8_t st_lsm6dsv80x_accel_bit_shift[]; extern const in...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSVXXX family IMU sensor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dsv320x.pdf */ #include <zephyr/drivers/sensor.h> #include <zephyr/kernel.h> #include <zephyr/device....
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>(const struct device *dev, const struct sensor_decoder_api **decoder); void lsm6dsvxxx_rtio_rd_transaction(const struct device *dev, uint8_t *regs, uint8_t regs_num, struct spi_buf *buf, struct rtio_iodev_sqe *iodev_sqe, rtio_callback_t complete_op_cb); #ifdef CONFIG_LSM6DSVXXX_TRIGGE...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* ST Microelectronics LSM6DSVXXX family IMU sensor * * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 * * Datasheet: * https://www.st.com/resource/en/datasheet/lsm6dsv320x.pdf * https://www.st.com/resource/en/datasheet/lsm6dsv80x.pdf */ #include "lsm6dsvxxx.h" #in...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>R_LSM6DSVXXX_RTIO_H_ #define ZEPHYR_DRIVERS_SENSOR_LSM6DSVXXX_RTIO_H_ #include <zephyr/device.h> #include <zephyr/rtio/rtio.h> #include <zephyr/rtio/work.h> void lsm6dsvxxx_submit(const struct device *sensor, struct rtio_iodev_sqe *iodev_sqe); void lsm6dsvxxx_submit_stream(const struct device *sensor, s...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>nst struct gpio_dt_spec *irq_gpio = data->drdy_gpio; struct sensor_read_config *read_config; /* At this point, no sqe request is queued should be considered as a bug */ __ASSERT_NO_MSG(data->streaming_sqe != NULL); read_config = (struct sensor_read_config *)data->streaming_sqe->sqe.iodev->data; __A...
fim
zephyrproject-rtos/zephyr
c