20
20
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
# THE SOFTWARE.
22
22
"""
23
- `Adafruit_TSL2591 `
23
+ `adafruit_tsl2591 `
24
24
====================================================
25
25
26
26
CircuitPython module for the TSL2591 precision light sensor. See
58
58
59
59
# User-facing constants:
60
60
GAIN_LOW = 0x00 # low gain (1x)
61
+ """Low gain (1x)"""
61
62
GAIN_MED = 0x10 # medium gain (25x)
63
+ """Medium gain (25x)"""
62
64
GAIN_HIGH = 0x20 # medium gain (428x)
65
+ """High gain (428x)"""
63
66
GAIN_MAX = 0x30 # max gain (9876x)
67
+ """Max gain (9876x)"""
64
68
INTEGRATIONTIME_100MS = 0x00 # 100 millis
69
+ """100 millis"""
65
70
INTEGRATIONTIME_200MS = 0x01 # 200 millis
71
+ """200 millis"""
66
72
INTEGRATIONTIME_300MS = 0x02 # 300 millis
73
+ """300 millis"""
67
74
INTEGRATIONTIME_400MS = 0x03 # 400 millis
75
+ """400 millis"""
68
76
INTEGRATIONTIME_500MS = 0x04 # 500 millis
77
+ """500 millis"""
69
78
INTEGRATIONTIME_600MS = 0x05 # 600 millis
79
+ """600 millis"""
70
80
#pylint: enable=bad-whitespace
71
81
72
82
73
83
class TSL2591 :
74
- """Create an instance of the TSL2591 high precision light sensor. Must
75
- specify:
76
- - i2c: The I2C bus connected to the sensor.
77
-
78
- Can optionally specify:
79
- - address: The I2C address of the sensor. If not specified the sensor
80
- default will be used.
84
+ """TSL2591 high precision light sensor.
85
+ :param busio.I2C i2c: The I2C bus connected to the sensor
86
+ :param int address: The I2C address of the sensor. If not specified
87
+ the sensor default will be used.
81
88
"""
82
89
83
90
# Class-level buffer to reduce memory usage and allocations.
@@ -141,10 +148,11 @@ def disable(self):
141
148
@property
142
149
def gain (self ):
143
150
"""Get and set the gain of the sensor. Can be a value of:
144
- - GAIN_LOW (1x)
145
- - GAIN_MED (25x)
146
- - GAIN_HIGH (428x)
147
- - GAIN_MAX (9876x)
151
+
152
+ - `GAIN_LOW` (1x)
153
+ - `GAIN_MED` (25x)
154
+ - `GAIN_HIGH` (428x)
155
+ - `GAIN_MAX` (9876x)
148
156
"""
149
157
control = self ._read_u8 (_TSL2591_REGISTER_CONTROL )
150
158
return control & 0b00110000
@@ -163,12 +171,12 @@ def gain(self, val):
163
171
@property
164
172
def integration_time (self ):
165
173
"""Get and set the integration time of the sensor. Can be a value of:
166
- - INTEGRATIONTIME_100MS (100 millis)
167
- - INTEGRATIONTIME_200MS (200 millis)
168
- - INTEGRATIONTIME_300MS (300 millis)
169
- - INTEGRATIONTIME_400MS (400 millis)
170
- - INTEGRATIONTIME_500MS (500 millis)
171
- - INTEGRATIONTIME_600MS (600 millis)
174
+ - ` INTEGRATIONTIME_100MS` (100 millis)
175
+ - ` INTEGRATIONTIME_200MS` (200 millis)
176
+ - ` INTEGRATIONTIME_300MS` (300 millis)
177
+ - ` INTEGRATIONTIME_400MS` (400 millis)
178
+ - ` INTEGRATIONTIME_500MS` (500 millis)
179
+ - ` INTEGRATIONTIME_600MS` (600 millis)
172
180
"""
173
181
control = self ._read_u8 (_TSL2591_REGISTER_CONTROL )
174
182
return control & 0b00000111
0 commit comments