1 /* 2 * Copyright (c) 2022 Intel Corporation 3 * Copyright (c) 2023 Google LLC 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #ifndef ZEPHYR_DRIVERS_SENSOR_ICM42688_TRIGGER_H_ 9 #define ZEPHYR_DRIVERS_SENSOR_ICM42688_TRIGGER_H_ 10 11 #include <zephyr/device.h> 12 13 /** implement the trigger_set sensor api function */ 14 int icm42688_trigger_set(const struct device *dev, const struct sensor_trigger *trig, 15 sensor_trigger_handler_t handler); 16 17 /** 18 * @brief initialize the icm42688 trigger system 19 * 20 * @param dev icm42688 device pointer 21 * @return int 0 on success, negative error code otherwise 22 */ 23 int icm42688_trigger_init(const struct device *dev); 24 25 /** 26 * @brief enable the trigger gpio interrupt 27 * 28 * @param dev icm42688 device pointer 29 * @param new_cfg New configuration to use for the device 30 * @return int 0 on success, negative error code otherwise 31 */ 32 int icm42688_trigger_enable_interrupt(const struct device *dev, struct icm42688_cfg *new_cfg); 33 34 /** 35 * @brief lock access to the icm42688 device driver 36 * 37 * @param dev icm42688 device pointer 38 */ 39 void icm42688_lock(const struct device *dev); 40 41 /** 42 * @brief lock access to the icm42688 device driver 43 * 44 * @param dev icm42688 device pointer 45 */ 46 void icm42688_unlock(const struct device *dev); 47 48 #endif /* ZEPHYR_DRIVERS_SENSOR_ICM42688_TRIGGER_H_ */ 49