Zephyr API Documentation
4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ina230.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 The Chromium OS Authors
3
* Copyright (c) 2021 Grinn
4
*
5
* SPDX-License-Identifier: Apache-2.0
6
*/
7
13
14
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_INA230_H_
15
#define ZEPHYR_INCLUDE_DT_BINDINGS_INA230_H_
16
17
#include <
zephyr/dt-bindings/dt-util.h
>
18
25
32
#define INA230_SHUNT_VOLTAGE_OVER BIT(15)
33
#define INA230_SHUNT_VOLTAGE_UNDER BIT(14)
34
#define INA230_BUS_VOLTAGE_OVER BIT(13)
35
#define INA230_BUS_VOLTAGE_UNDER BIT(12)
36
#define INA230_OVER_LIMIT_POWER BIT(11)
37
#define INA230_CONVERSION_READY BIT(10)
38
#define INA230_ALERT_FUNCTION_FLAG BIT(4)
39
#define INA230_CONVERSION_READY_FLAG BIT(3)
40
#define INA230_MATH_OVERFLOW_FLAG BIT(2)
41
#define INA230_ALERT_POLARITY BIT(1)
42
#define INA230_ALERT_LATCH_ENABLE BIT(0)
44
52
#define INA230_OPER_MODE_POWER_DOWN 0x00
53
#define INA230_OPER_MODE_SHUNT_VOLTAGE_TRIG 0x01
54
#define INA230_OPER_MODE_BUS_VOLTAGE_TRIG 0x02
55
#define INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG 0x03
56
#define INA230_OPER_MODE_SHUNT_VOLTAGE_CONT 0x05
57
#define INA230_OPER_MODE_BUS_VOLTAGE_CONT 0x06
58
#define INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT 0x07
60
68
#define INA230_CONV_TIME_140 0x00
69
#define INA230_CONV_TIME_204 0x01
70
#define INA230_CONV_TIME_332 0x02
71
#define INA230_CONV_TIME_588 0x03
72
#define INA230_CONV_TIME_1100 0x04
73
#define INA230_CONV_TIME_2116 0x05
74
#define INA230_CONV_TIME_4156 0x06
75
#define INA230_CONV_TIME_8244 0x07
77
85
#define INA230_AVG_MODE_1 0x00
86
#define INA230_AVG_MODE_4 0x01
87
#define INA230_AVG_MODE_16 0x02
88
#define INA230_AVG_MODE_64 0x03
89
#define INA230_AVG_MODE_128 0x04
90
#define INA230_AVG_MODE_256 0x05
91
#define INA230_AVG_MODE_512 0x06
92
#define INA230_AVG_MODE_1024 0x07
94
103
#define INA230_CONFIG(mode, \
104
svct, \
105
bvct, \
106
avg) \
107
(((avg) << 9) | ((bvct) << 6) | ((svct) << 3) | (mode))
108
110
111
#endif
/* ZEPHYR_INCLUDE_DT_BINDINGS_INA230_H_ */
dt-util.h
zephyr
dt-bindings
sensor
ina230.h
Generated on
for Zephyr API Documentation by
1.16.1