@@ -156,17 +156,55 @@ class Resolution(CV):
156
156
| :py:const:`Resolution.RESOLUTION_20BIT` | 20 bits |
157
157
+-----------------------------------------+------------------------------------------------------+
158
158
159
+
159
160
"""
160
161
161
162
162
163
Resolution .add_values (
163
164
(
164
- ("RESOLUTION_20BIT" , 0 , "20" , None ),
165
- ("RESOLUTION_19BIT" , 1 , "19" , None ),
166
- ("RESOLUTION_18BIT" , 2 , "18" , None ),
167
- ("RESOLUTION_17BIT" , 3 , "17" , None ),
168
- ("RESOLUTION_16BIT" , 4 , "16" , None ),
169
- ("RESOLUTION_13BIT" , 5 , "13" , None ),
165
+ ("RESOLUTION_20BIT" , 0 , "20 bits" , None ),
166
+ ("RESOLUTION_19BIT" , 1 , "19 bits" , None ),
167
+ ("RESOLUTION_18BIT" , 2 , "18 bits" , None ),
168
+ ("RESOLUTION_17BIT" , 3 , "17 bits" , None ),
169
+ ("RESOLUTION_16BIT" , 4 , "16 bits" , None ),
170
+ ("RESOLUTION_13BIT" , 5 , "13 bits" , None ),
171
+ )
172
+ )
173
+
174
+
175
+ class MeasurementDelay (CV ):
176
+ """Options for `measurement_delay`
177
+
178
+ +-------------------------------------------+--------------------------------------+
179
+ | MeasurementDelay | Time Between Measurement Cycles (ms) |
180
+ +===========================================+======================================+
181
+ | :py:const:`MeasurementDelay.DELAY_25MS` | 25 |
182
+ +-------------------------------------------+--------------------------------------+
183
+ | :py:const:`MeasurementDelay.DELAY_50MS` | 50 |
184
+ +-------------------------------------------+--------------------------------------+
185
+ | :py:const:`MeasurementDelay.DELAY_100MS` | 100 |
186
+ +-------------------------------------------+--------------------------------------+
187
+ | :py:const:`MeasurementDelay.DELAY_200MS` | 200 |
188
+ +-------------------------------------------+--------------------------------------+
189
+ | :py:const:`MeasurementDelay.DELAY_500MS` | 500 |
190
+ +-------------------------------------------+--------------------------------------+
191
+ | :py:const:`MeasurementDelay.DELAY_1000MS` | 1000 |
192
+ +-------------------------------------------+--------------------------------------+
193
+ | :py:const:`MeasurementDelay.DELAY_2000MS` | 2000 |
194
+ +-------------------------------------------+--------------------------------------+
195
+
196
+ """
197
+
198
+
199
+ MeasurementDelay .add_values (
200
+ (
201
+ ("DELAY_25MS" , 0 , "25" , None ),
202
+ ("DELAY_50MS" , 1 , "50" , None ),
203
+ ("DELAY_100MS" , 2 , "100" , None ),
204
+ ("DELAY_200MS" , 3 , "200" , None ),
205
+ ("DELAY_500MS" , 4 , "500" , None ),
206
+ ("DELAY_1000MS" , 5 , "1000" , None ),
207
+ ("DELAY_2000MS" , 6 , "2000" , None ),
170
208
)
171
209
)
172
210
@@ -181,6 +219,8 @@ class LTR390: # pylint:disable=too-many-instance-attributes
181
219
182
220
_gain_bits = RWBits (3 , _GAIN , 0 )
183
221
_resolution_bits = RWBits (3 , _MEAS_RATE , 4 )
222
+ _measurement_delay_bits = RWBits (3 , _MEAS_RATE , 0 )
223
+ _rate_bits = RWBits (3 , _MEAS_RATE , 4 )
184
224
_int_src_bits = RWBits (2 , _INT_CFG , 4 )
185
225
_int_persistance_bits = RWBits (4 , _INT_PST , 4 )
186
226
@@ -308,3 +348,15 @@ def enable_alerts(self, enable, source, persistance):
308
348
else :
309
349
raise AttributeError ("interrupt source must be UV or ALS" )
310
350
self ._int_persistance_bits = persistance
351
+
352
+ @property
353
+ def measurement_delay (self ):
354
+ """The delay between measurements. This can be used to set the measurement rate which
355
+ affects the sensors power usage."""
356
+ return self ._measurement_delay_bits
357
+
358
+ @measurement_delay .setter
359
+ def measurement_delay (self , value ):
360
+ if not MeasurementDelay .is_valid (value ):
361
+ raise AttributeError ("measurement_delay must be a MeasurementDelay" )
362
+ self ._measurement_delay_bits = value
0 commit comments