1 /* 2 * Copyright (c) 2021 Grinn 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_DRIVERS_SENSOR_INA23X_COMMON_H_ 8 #define ZEPHYR_DRIVERS_SENSOR_INA23X_COMMON_H_ 9 10 #include <stdint.h> 11 12 #include <zephyr/drivers/i2c.h> 13 #include <zephyr/sys/util_macro.h> 14 15 /** 16 * @brief Macro used to check if the current's LSB is 1mA 17 */ 18 #define INA23X_CURRENT_LSB_1MA 1 19 20 int ina23x_reg_read_24(const struct i2c_dt_spec *bus, uint8_t reg, uint32_t *val); 21 int ina23x_reg_read_16(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t *val); 22 int ina23x_reg_write(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t val); 23 24 #endif /* ZEPHYR_DRIVERS_SENSOR_INA23X_COMMON_H_ */ 25