15
15
16
16
**Hardware:**
17
17
18
- * LPS25HB Breakout https://www.adafruit.com/products/4530
18
+ * Adafruit `LPS25 Pressure SensorLPS25HB Breakout
19
+ <https://www.adafruit.com/product/4530>`_ (Product ID: 4530)
20
+
21
+ * Adafruit `LPS22 Pressure Sensor LPS22HB Breakout
22
+ <https://www.adafruit.com/product/4633>`_ (Product ID: 4633)
19
23
20
24
**Software and Dependencies:**
21
- * Adafruit CircuitPython firmware for the supported boards:
25
+
26
+ * Adafruit CircuitPython firmware for the supported boards:
22
27
https://circuitpythohn.org/downloads
23
- * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
24
- * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
28
+
29
+ * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
30
+
31
+ * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
25
32
26
33
"""
27
34
__version__ = "0.0.0-auto.0"
@@ -68,7 +75,7 @@ class CV:
68
75
69
76
@classmethod
70
77
def add_values (cls , value_tuples ):
71
- "creates CV entires "
78
+ """ creates CV entries"" "
72
79
cls .string = {}
73
80
cls .lsb = {}
74
81
@@ -80,7 +87,7 @@ def add_values(cls, value_tuples):
80
87
81
88
@classmethod
82
89
def is_valid (cls , value ):
83
- "Returns true if the given value is a member of the CV"
90
+ """ Returns true if the given value is a member of the CV"" "
84
91
return value in cls .string
85
92
86
93
@@ -122,8 +129,9 @@ class LPS2X: # pylint: disable=too-many-instance-attributes
122
129
"""Base class ST LPS2x family of pressure sensors
123
130
124
131
:param ~busio.I2C i2c_bus: The I2C bus the sensor is connected to.
125
- :param address: The I2C device address for the sensor. Default is ``0x5d`` but will accept
126
- ``0x5c`` when the ``SDO`` pin is connected to Ground.
132
+ :param int address: The I2C device address for the sensor.
133
+ Default is :const:`0x5d` but will accept :const:`0x5c` when
134
+ the ``SDO`` pin is connected to Ground.
127
135
128
136
"""
129
137
@@ -142,7 +150,7 @@ def __init__(self, i2c_bus, address=_LPS2X_DEFAULT_ADDRESS, chip_id=None):
142
150
sleep (0.010 ) # delay 10ms for first reading
143
151
144
152
def initialize (self ): # pylint: disable=no-self-use
145
- """Configure the sensor with the default settings. For use after calling `reset() `"""
153
+ """Configure the sensor with the default settings. For use after calling :meth: `reset`"""
146
154
raise RuntimeError (
147
155
"LPS2X Base class cannot be instantiated directly. Use LPS22 or LPS25 instead"
148
156
) # override in subclass
@@ -165,7 +173,7 @@ def pressure(self):
165
173
166
174
@property
167
175
def temperature (self ):
168
- """The current temperature measurement in degrees C """
176
+ """The current temperature measurement in degrees Celsius """
169
177
170
178
raw_temperature = self ._raw_temperature
171
179
return (
@@ -174,8 +182,9 @@ def temperature(self):
174
182
175
183
@property
176
184
def data_rate (self ):
177
- """The rate at which the sensor measures ``pressure`` and ``temperature``. ``data_rate``
178
- shouldbe set to one of the values of ``adafruit_lps2x.Rate``."""
185
+ """The rate at which the sensor measures :attr:`pressure` and
186
+ :attr:`temperature`. :attr:`data_rate` should be set to one of
187
+ the values of :class:`adafruit_lps2x.Rate`"""
179
188
return self ._data_rate
180
189
181
190
@data_rate .setter
@@ -190,8 +199,8 @@ class LPS25(LPS2X):
190
199
"""Library for the ST LPS25 pressure sensors
191
200
192
201
:param ~busio.I2C i2c_bus: The I2C bus the LPS25HB is connected to.
193
- :param address: The I2C device address for the sensor . Default is `` 0x5d` ` but will accept
194
- `` 0x5c` ` when the ``SDO`` pin is connected to Ground.
202
+ :param int address: The I2C device address. Default is :const:` 0x5d` but will accept
203
+ :const:` 0x5c` when the ``SDO`` pin is connected to Ground.
195
204
196
205
"""
197
206
@@ -218,7 +227,9 @@ def __init__(self, i2c_bus, address=_LPS2X_DEFAULT_ADDRESS):
218
227
# self._inc_spi_flag = 0x40
219
228
220
229
def initialize (self ):
221
- """Configure the sensor with the default settings. For use after calling `reset()`"""
230
+ """Configure the sensor with the default settings.
231
+ For use after calling :func:`LPS2X.reset`
232
+ """
222
233
self .enabled = True
223
234
self .data_rate = Rate .LPS25_RATE_25_HZ # pylint:disable=no-member
224
235
@@ -230,8 +241,8 @@ class LPS22(LPS2X):
230
241
"""Library for the ST LPS22 pressure sensors
231
242
232
243
:param ~busio.I2C i2c_bus: The I2C bus the LPS22HB is connected to.
233
- :param address: The I2C device address for the sensor . Default is `` 0x5d` ` but will accept
234
- `` 0x5c` ` when the ``SDO`` pin is connected to Ground.
244
+ :param address: The I2C device address. Default is :const:` 0x5d` but will accept
245
+ :const:` 0x5c` when the ``SDO`` pin is connected to Ground.
235
246
236
247
"""
237
248
@@ -256,7 +267,9 @@ def __init__(self, i2c_bus, address=_LPS2X_DEFAULT_ADDRESS):
256
267
self ._temp_offset = 0
257
268
258
269
def initialize (self ):
259
- """Configure the sensor with the default settings. For use after calling `reset()`"""
270
+ """Configure the sensor with the default settings.
271
+ For use after calling :func:`LPS2X.reset`
272
+ """
260
273
self .data_rate = Rate .LPS22_RATE_75_HZ # pylint:disable=no-member
261
274
262
275
# void configureInterrupt(bool activelow, bool opendrain, bool data_ready,
0 commit comments