1
- # The MIT License (MIT)
1
+ # SPDX-FileCopyrightText: Bryan Siepert 2019 for Adafruit Industries
2
2
#
3
- # Copyright (c) 2019 Bryan Siepert for Adafruit Industries
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # SPDX-License-Identifier: MIT
4
+
22
5
"""
23
6
`adafruit_ina260`
24
7
================================================================================
69
52
class Mode :
70
53
"""Modes avaible to be set
71
54
72
- +--------------------+---------------------------------------------------------------------+
73
- | Mode | Description |
74
- +====================+=====================================================================+
75
- | ``Mode.CONTINUOUS``| Default: The sensor will continuously measure the bus voltage and |
76
- | | shunt voltage across the shunt resistor to calculate ``power`` and |
77
- | | ``current`` |
78
- +--------------------+---------------------------------------------------------------------+
79
- | ``Mode.TRIGGERED`` | The sensor will immediately begin measuring and calculating current,|
80
- | | bus voltage, and power. Re-set this mode to initiate another |
81
- | | measurement |
82
- +--------------------+---------------------------------------------------------------------+
83
- | ``Mode.SHUTDOWN`` | Shutdown the sensor, reducing the quiescent current and turning off|
84
- | | current into the device inputs. Set another mode to re-enable |
85
- +--------------------+---------------------------------------------------------------------+
55
+ +--------------------+---------------------------------------------------------------------+
56
+ | Mode | Description |
57
+ +====================+=====================================================================+
58
+ | ``Mode.CONTINUOUS``| Default: The sensor will continuously measure the bus voltage and |
59
+ | | shunt voltage across the shunt resistor to calculate ``power`` and |
60
+ | | ``current`` |
61
+ +--------------------+---------------------------------------------------------------------+
62
+ | ``Mode.TRIGGERED`` | The sensor will immediately begin measuring and calculating current,|
63
+ | | bus voltage, and power. Re-set this mode to initiate another |
64
+ | | measurement |
65
+ +--------------------+---------------------------------------------------------------------+
66
+ | ``Mode.SHUTDOWN`` | Shutdown the sensor, reducing the quiescent current and turning off|
67
+ | | current into the device inputs. Set another mode to re-enable |
68
+ +--------------------+---------------------------------------------------------------------+
86
69
87
70
"""
88
71
@@ -94,25 +77,25 @@ class Mode:
94
77
class ConversionTime :
95
78
"""Options for ``current_conversion_time`` or ``voltage_conversion_time``
96
79
97
- +----------------------------------+------------------+
98
- | ``ConversionTime`` | Time |
99
- +==================================+==================+
100
- | ``ConversionTime.TIME_140_us`` | 140 us |
101
- +----------------------------------+------------------+
102
- | ``ConversionTime.TIME_204_us`` | 204 us |
103
- +----------------------------------+------------------+
104
- | ``ConversionTime.TIME_332_us`` | 332 us |
105
- +----------------------------------+------------------+
106
- | ``ConversionTime.TIME_558_us`` | 588 us |
107
- +----------------------------------+------------------+
108
- | ``ConversionTime.TIME_1_1_ms`` | 1.1 ms (Default) |
109
- +----------------------------------+------------------+
110
- | ``ConversionTime.TIME_2_116_ms`` | 2.116 ms |
111
- +----------------------------------+------------------+
112
- | ``ConversionTime.TIME_4_156_ms`` | 4.156 ms |
113
- +----------------------------------+------------------+
114
- | ``ConversionTime.TIME_8_244_ms`` | 8.244 ms |
115
- +----------------------------------+------------------+
80
+ +----------------------------------+------------------+
81
+ | ``ConversionTime`` | Time |
82
+ +==================================+==================+
83
+ | ``ConversionTime.TIME_140_us`` | 140 us |
84
+ +----------------------------------+------------------+
85
+ | ``ConversionTime.TIME_204_us`` | 204 us |
86
+ +----------------------------------+------------------+
87
+ | ``ConversionTime.TIME_332_us`` | 332 us |
88
+ +----------------------------------+------------------+
89
+ | ``ConversionTime.TIME_558_us`` | 588 us |
90
+ +----------------------------------+------------------+
91
+ | ``ConversionTime.TIME_1_1_ms`` | 1.1 ms (Default) |
92
+ +----------------------------------+------------------+
93
+ | ``ConversionTime.TIME_2_116_ms`` | 2.116 ms |
94
+ +----------------------------------+------------------+
95
+ | ``ConversionTime.TIME_4_156_ms`` | 4.156 ms |
96
+ +----------------------------------+------------------+
97
+ | ``ConversionTime.TIME_8_244_ms`` | 8.244 ms |
98
+ +----------------------------------+------------------+
116
99
117
100
"""
118
101
@@ -129,25 +112,25 @@ class ConversionTime:
129
112
class AveragingCount :
130
113
"""Options for ``averaging_count``
131
114
132
- +-------------------------------+------------------------------------+
133
- | ``AveragingCount`` | Number of measurements to average |
134
- +===============================+====================================+
135
- | ``AveragingCount.COUNT_1`` | 1 (Default) |
136
- +-------------------------------+------------------------------------+
137
- | ``AveragingCount.COUNT_4`` | 4 |
138
- +-------------------------------+------------------------------------+
139
- | ``AveragingCount.COUNT_16`` | 16 |
140
- +-------------------------------+------------------------------------+
141
- | ``AveragingCount.COUNT_64`` | 64 |
142
- +-------------------------------+------------------------------------+
143
- | ``AveragingCount.COUNT_128`` | 128 |
144
- +-------------------------------+------------------------------------+
145
- | ``AveragingCount.COUNT_256`` | 256 |
146
- +-------------------------------+------------------------------------+
147
- | ``AveragingCount.COUNT_512`` | 512 |
148
- +-------------------------------+------------------------------------+
149
- | ``AveragingCount.COUNT_1024`` | 1024 |
150
- +-------------------------------+------------------------------------+
115
+ +-------------------------------+------------------------------------+
116
+ | ``AveragingCount`` | Number of measurements to average |
117
+ +===============================+====================================+
118
+ | ``AveragingCount.COUNT_1`` | 1 (Default) |
119
+ +-------------------------------+------------------------------------+
120
+ | ``AveragingCount.COUNT_4`` | 4 |
121
+ +-------------------------------+------------------------------------+
122
+ | ``AveragingCount.COUNT_16`` | 16 |
123
+ +-------------------------------+------------------------------------+
124
+ | ``AveragingCount.COUNT_64`` | 64 |
125
+ +-------------------------------+------------------------------------+
126
+ | ``AveragingCount.COUNT_128`` | 128 |
127
+ +-------------------------------+------------------------------------+
128
+ | ``AveragingCount.COUNT_256`` | 256 |
129
+ +-------------------------------+------------------------------------+
130
+ | ``AveragingCount.COUNT_512`` | 512 |
131
+ +-------------------------------+------------------------------------+
132
+ | ``AveragingCount.COUNT_1024`` | 1024 |
133
+ +-------------------------------+------------------------------------+
151
134
152
135
"""
153
136
@@ -167,8 +150,8 @@ class AveragingCount:
167
150
class INA260 :
168
151
"""Driver for the INA260 power and current sensor.
169
152
170
- :param ~busio.I2C i2c_bus: The I2C bus the INA260 is connected to.
171
- :param address: The I2C device address for the sensor. Default is ``0x40``.
153
+ :param ~busio.I2C i2c_bus: The I2C bus the INA260 is connected to.
154
+ :param address: The I2C device address for the sensor. Default is ``0x40``.
172
155
173
156
"""
174
157
0 commit comments