2022-08-19 22:07:41 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022 Grinn
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_DRIVERS_SENSOR_INA23X_TRIGGER_H_
|
|
|
|
#define ZEPHYR_DRIVERS_SENSOR_INA23X_TRIGGER_H_
|
|
|
|
|
|
|
|
#include <zephyr/drivers/gpio.h>
|
|
|
|
#include <zephyr/drivers/sensor.h>
|
2022-10-04 22:34:24 +08:00
|
|
|
#include <zephyr/kernel.h>
|
2022-08-19 22:07:41 +08:00
|
|
|
|
|
|
|
struct ina23x_trigger {
|
|
|
|
struct gpio_callback gpio_cb;
|
|
|
|
struct k_work conversion_work;
|
|
|
|
sensor_trigger_handler_t handler_alert;
|
2023-03-23 00:51:49 +08:00
|
|
|
const struct sensor_trigger *trig_alert;
|
2022-08-19 22:07:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
int ina23x_trigger_mode_init(struct ina23x_trigger *trigg,
|
2022-11-02 23:41:38 +08:00
|
|
|
const struct gpio_dt_spec *alert_gpio);
|
2022-08-19 22:07:41 +08:00
|
|
|
|
|
|
|
#endif /* ZEPHYR_DRIVERS_SENSOR_INA23X_TRIGGER_H_ */
|