Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
siddacious committed Jan 30, 2020
1 parent 47a0100 commit 0bffd1b
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions adafruit_dps310.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,30 @@ def is_valid(cls, value):
return value in cls.string

class Mode(CV):
"""Options for ``mode``"""
"""Options for ``mode``
+--------------------------+------------------------------------------------------------------+
| Mode | Description |
+--------------------------+------------------------------------------------------------------+
| ``Mode.IDLE`` | Puts the sensor into a shutdown state |
+--------------------------+------------------------------------------------------------------+
| ``Mode.ONE_PRESSURE`` | Setting `mode` to ``Mode.ONE_PRESSURE`` takes a single pressure |
| | measurement then switches to ``Mode.IDLE`` |
+--------------------------+------------------------------------------------------------------+
| ``Mode.ONE_TEMPERATURE`` | Setting `mode` to ``Mode.ONE_TEMPERATURE`` takes a single |
| | temperature measurement then switches to ``Mode.IDLE`` |
+--------------------------+------------------------------------------------------------------+
| ``Mode.CONT_PRESSURE`` | Take pressure measurements at the current `pressure_rate`. |
| | `temperature` will not be updated |
+--------------------------+------------------------------------------------------------------+
| ``Mode.CONT_TEMP`` | Take temperature measurements at the current `temperature_rate`. |
| | `pressure` will not be updated |
+--------------------------+------------------------------------------------------------------+
| ``Mode.CONT_PRESTEMP`` | Take temperature and pressure measurements at the current |
| | `pressure_rate` and `temperature_rate` |
+--------------------------+------------------------------------------------------------------+
"""
pass #pylint: disable=unnecessary-pass

Mode.add_values((
Expand All @@ -101,7 +124,7 @@ class Mode(CV):
))

class Rate(CV):
"""Options for data_rate"""
"""Options for `pressure_rate` and `temperature_rate`"""
pass

Rate.add_values((
Expand All @@ -116,7 +139,7 @@ class Rate(CV):
))

class SampleCount(CV):
"""Options for oversample_count"""
"""Options for `temperature_oversample_count` and `pressure_oversample_count`"""
pass

SampleCount.add_values((
Expand Down Expand Up @@ -254,20 +277,19 @@ def pressure_ready(self):

@property
def mode(self):
"""An example"""
"""The measurement mode. Must be a `Mode`. See the `Mode` documentation for details"""
return self._mode_bits

@mode.setter
def mode(self, value):
"""Set the mode"""
if not Mode.is_valid(value):
raise AttributeError("mode must be an `Mode`")

self._mode_bits = value

@property
def pressure_rate(self):
"""Configure the pressure measurement rate. Must be a Rate"""
"""Configure the pressure measurement rate. Must be a `Rate`"""
return self._pressure_ratebits

@pressure_rate.setter
Expand All @@ -278,7 +300,7 @@ def pressure_rate(self, value):

@property
def pressure_oversample_count(self):
"""The number of samples taken per pressure measurement. Must be a SampleCount"""
"""The number of samples taken per pressure measurement. Must be a `SampleCount`"""
return self._pressure_osbits

@pressure_oversample_count.setter
Expand All @@ -292,7 +314,7 @@ def pressure_oversample_count(self, value):

@property
def temperature_rate(self):
"""Configure the temperature measurement rate. Must be a Rate"""
"""Configure the temperature measurement rate. Must be a `Rate`"""
return self._temp_ratebits

@temperature_rate.setter
Expand All @@ -303,7 +325,7 @@ def temperature_rate(self, value):

@property
def temperature_oversample_count(self):
"""The number of samples taken per temperature measurement. Must be a SampleCount"""
"""The number of samples taken per temperature measurement. Must be a `SampleCount`"""
return self._temp_osbits

@temperature_oversample_count.setter
Expand Down

0 comments on commit 0bffd1b

Please sign in to comment.