1616
1717**Hardware:**
1818
19- * `Adafruit LIS331HH Breakout <https://www.adafruit.com/products/45XX >`_
20- * `Adafruit H3LIS331 Breakout <https://www.adafruit.com/products/45XX >`_
19+ * `Adafruit LIS331HH Breakout <https://www.adafruit.com/products/4626 >`_
20+ * `Adafruit H3LIS331 Breakout <https://www.adafruit.com/products/4627 >`_
2121
2222**Software and Dependencies:**
2323
2424* Adafruit CircuitPython firmware for the supported boards:
25- https://github.com/adafruit/circuitpython/releases
26-
27- * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
28- * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
25+ https://circuitpython.org/downloads
26+ * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
27+ * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
2928"""
3029
3130__version__ = "0.0.0-auto.0"
@@ -61,12 +60,16 @@ class ROByteArray:
6160 Values are FixNums that map to the values in the defined struct. See struct
6261 module documentation for struct format string and its possible value types.
6362
64- .. note:: This assumes the device addresses correspond to 8-bit bytes. This is not suitable for
65- devices with registers of other widths such as 16-bit.
63+ .. note::
64+ This assumes the device addresses correspond to 8-bit bytes.
65+ This is not suitable for devices with registers of other
66+ widths such as 16-bit.
6667
6768 :param int register_address: The register address to begin reading the array from
68- :param str struct_format : The struct format string for this register.
69+ :param str format_str : The struct format string for this register.
6970 :param int count: Number of elements in the array
71+
72+
7073 """
7174
7275 def __init__ ( # pylint: disable=too-many-arguments
@@ -203,7 +206,7 @@ class LIS331:
203206 **Cannot be instantiated directly**
204207
205208 :param ~busio.I2C i2c_bus: The I2C bus the LIS331 is connected to.
206- :param address: The I2C slave address of the sensor
209+ :param address: The I2C device address. Defaults to :const:`0x18`
207210
208211 """
209212
@@ -261,6 +264,7 @@ def hpf_reference(self):
261264 is a signed 8-bit number from -128 to 127. The value of each increment of 1 depends on the
262265 currently set measurement range and is approximate:
263266 #pylint: disable=line-too-long
267+
264268 +-------------------------------------------------------------+-------------------------------+
265269 | Range | Incremental value (LSB value) |
266270 +-------------------------------------------------------------+-------------------------------+
@@ -270,6 +274,7 @@ def hpf_reference(self):
270274 +-------------------------------------------------------------+-------------------------------+
271275 | ``LIS331HHRange.RANGE_24G`` or ``H3LIS331Range.RANGE_400G`` | ~63mg |
272276 +-------------------------------------------------------------+-------------------------------+
277+
273278 #pylint: enable=line-too-long
274279 """
275280
@@ -282,9 +287,10 @@ def hpf_reference(self, reference_value):
282287 self ._reference_value = reference_value
283288
284289 def zero_hpf (self ):
285- """When the high-pass filter is enabled with ``use_reference=False``, calling ``zero_hpf``
286- will set all measurements to zero immediately, avoiding the normal settling time seen when
287- using the high-pass filter without a ``hpf_reference``
290+ """When the high-pass filter is enabled with ``use_reference=False``,
291+ calling :meth:`zero_hpf` will set all measurements to zero immediately,
292+ avoiding the normal settling time seen when using the high-pass filter
293+ without a :meth:`hpf_reference`
288294 """
289295 self ._zero_hpf # pylint: disable=pointless-statement
290296
@@ -294,12 +300,14 @@ def enable_hpf(
294300 """Enable or disable the high-pass filter.
295301
296302 :param enabled: Enable or disable the filter. Default is `True` to enable
297- :param ~RateDivisor cutoff: A `RateDivisor` to set the high-pass cutoff frequency. Default\
298- is ``RateDivisor.ODR_DIV_50``. See ``RateDivisor`` for more information
303+ :param ``RateDivisor`` cutoff: A ``RateDivisor`` to set the high-pass
304+ cutoff frequency. Default is ``RateDivisor.ODR_DIV_50``. See ``RateDivisor``
305+ for more information
299306 :param use_reference: Determines if the filtered measurements are offset by a reference\
300- value. Default is false.
307+ value. Default is false.
301308
302- See section **4** of the LIS331DLH application note for more information `LIS331DLH application\
309+ See section **4** of the LIS331DLH application note for more information
310+ `LIS331DLH application
303311 note for more information <https://www.st.com/content/ccc/resource/technical/document/\
304312 application_note/b5/8e/58/69/cb/87/45/55/CD00215823.pdf/files/CD00215823.pdf/jcr:content/\
305313 translations/en.CD00215823.pdf>`_
@@ -311,7 +319,7 @@ def enable_hpf(
311319
312320 @property
313321 def data_rate (self ):
314- """Select the rate at which the accelerometer takes measurements. Must be a `Rate`"""
322+ """Select the rate at which the accelerometer takes measurements. Must be a `` Rate` `"""
315323 return self ._cached_data_rate
316324
317325 @data_rate .setter
@@ -330,8 +338,8 @@ def data_rate(self, new_rate_bits):
330338
331339 @property
332340 def mode (self ):
333- """The `Mode` power mode that the sensor is set to, as determined by the current
334- `data_rate`. To set the mode, use `data_rate` and the approprite ` Rate`"""
341+ """The :attr: `Mode` power mode that the sensor is set to, as determined by the current
342+ `data_rate`. To set the mode, use `data_rate` and the appropriate `` Rate` `"""
335343 mode_bits = self ._mode_and_rate ()[0 ]
336344 return mode_bits
337345
@@ -348,7 +356,7 @@ def _mode_and_rate(self, data_rate=None):
348356 @property
349357 def range (self ):
350358 """Adjusts the range of values that the sensor can measure, Note that larger ranges will be
351- less accurate. Must be a `H3LIS331Range` or `LIS331HHRange`"""
359+ less accurate. Must be a `` H3LIS331Range`` or `` LIS331HHRange` `"""
352360 return self ._range_bits
353361
354362 @range .setter
@@ -363,7 +371,7 @@ def range(self, new_range):
363371
364372 @property
365373 def acceleration (self ):
366- """The x, y, z acceleration values returned in a 3-tuple and are in m / s ^ 2."""
374+ """The x, y, z acceleration values returned in a 3-tuple and are in :math:` m / s ^ 2` ."""
367375
368376 raw_acceleration_bytes = self ._raw_acceleration
369377
@@ -385,7 +393,30 @@ class LIS331HH(LIS331):
385393 """Driver for the LIS331HH 3-axis high-g accelerometer.
386394
387395 :param ~busio.I2C i2c_bus: The I2C bus the LIS331 is connected to.
388- :param address: The I2C slave address of the sensor
396+ :param address: The I2C device address. Defaults to :const:`0x18`
397+
398+ **Quickstart: Importing and using the device**
399+
400+ Here is an example of using the :class:`LIS331` class.
401+ First you will need to import the libraries to use the sensor
402+
403+ .. code-block:: python
404+
405+ import board
406+ import adafruit_lis331
407+
408+ Once this is done you can define your `board.I2C` object and define your sensor object
409+
410+ .. code-block:: python
411+
412+ i2c = board.I2C() # uses board.SCL and board.SDA
413+ lis = adafruit_lis331.LIS331HH(i2c)
414+
415+ Now you have access to the :attr:`acceleration` attribute
416+
417+ .. code-block:: python
418+
419+ acceleration = lis.acceleration
389420
390421 """
391422
@@ -401,7 +432,32 @@ class H3LIS331(LIS331):
401432 """Driver for the H3LIS331 3-axis high-g accelerometer.
402433
403434 :param ~busio.I2C i2c_bus: The I2C bus the LIS331 is connected to.
404- :param address: The I2C slave address of the sensor
435+ :param address: The I2C slave address of the sensor. Defaults to :const:`0x18`
436+
437+ **Quickstart: Importing and using the device**
438+
439+ Here is an example of using the :class:`LIS331` class.
440+ First you will need to import the libraries to use the sensor
441+
442+ .. code-block:: python
443+
444+ import board
445+ import adafruit_lis331
446+
447+ Once this is done you can define your `board.I2C` object and define your sensor object
448+
449+ .. code-block:: python
450+
451+ i2c = board.I2C() # uses board.SCL and board.SDA
452+ lis = adafruit_lis331.H3LIS331(i2c)
453+
454+ Now you have access to the :attr:`acceleration` attribute
455+
456+ .. code-block:: python
457+
458+ acceleration = lis.acceleration
459+
460+
405461
406462 """
407463
0 commit comments