Skip to content

Commit 89754c1

Browse files
authored
Merge pull request #1 from tannewt/doc_fixup
Fix up docs
2 parents b6737dc + f15e345 commit 89754c1

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

README.rst

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Introduction
1010
:target: https://discord.gg/nBQh6qu
1111
:alt: Discord
1212
13+
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_MCP4725.svg?branch=master
14+
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_MCP4725
15+
:alt: Build Status
16+
1317
CircuitPython module for the MCP4725 digital to analog converter.
1418

1519
Dependencies

adafruit_mcp4725.py

+16-19
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
2222
"""
23-
`Adafruit_MCP4725`
24-
====================================================
23+
`adafruit_mcp4725` - MCP4725 digital to analog converter
24+
========================================================
2525
2626
CircuitPython module for the MCP4725 digital to analog converter. See
2727
examples/simpletest.py for a demo of the usage.
@@ -35,19 +35,17 @@
3535

3636

3737
# Internal constants:
38-
_MCP4725_DEFAULT_ADDRESS = const(0b01100010)
38+
_MCP4725_DEFAULT_ADDRESS = 0b01100010
3939
_MCP4725_WRITE_FAST_MODE = const(0b00000000)
4040

4141

4242
class MCP4725:
4343
"""MCP4725 12-bit digital to analog converter. This class has a similar
44-
interface as the CircuitPython AnalogOut class and can be used in place
45-
of that module. To construct pass the following parameters to the
46-
initializer:
47-
- i2c: The I2C bus.
44+
interface as the CircuitPython AnalogOut class and can be used in place
45+
of that module.
4846
49-
Optionally pass:
50-
- address: The address of the device if set differently from the default.
47+
:param ~busio.I2C i2c: The I2C bus.
48+
:param int address: The address of the device if set differently from the default.
5149
"""
5250

5351

@@ -99,11 +97,12 @@ def _read(self):
9997

10098
@property
10199
def value(self):
102-
"""Get and set the DAC value as a 16-bit unsigned value compatible
103-
with the AnalogOut class. Note that the MCP4725 is still just a 12-bit
104-
device so quantization will occur. If you'd like to instead deal with
105-
the raw 12-bit value use the raw_value property, or the normalized_value
106-
property to deal with a 0...1 float value.
100+
"""The DAC value as a 16-bit unsigned value compatible with the
101+
:py:class:`~analogio.AnalogOut` class.
102+
103+
Note that the MCP4725 is still just a 12-bit device so quantization will occur. If you'd
104+
like to instead deal with the raw 12-bit value use the raw_value property, or the
105+
normalized_value property to deal with a 0...1 float value.
107106
"""
108107
raw_value = self._read()
109108
# Scale up to 16-bit range.
@@ -118,9 +117,8 @@ def value(self, val):
118117

119118
@property
120119
def raw_value(self):
121-
"""Get and set the DAC value as a 12-bit unsigned value. This is the
122-
the true resolution of the DAC and will never peform scaling or run
123-
into quantization error.
120+
"""The DAC value as a 12-bit unsigned value. This is the the true resolution of the DAC
121+
and will never peform scaling or run into quantization error.
124122
"""
125123
return self._read()
126124

@@ -130,8 +128,7 @@ def raw_value(self, val):
130128

131129
@property
132130
def normalized_value(self):
133-
"""Get and set the DAC value as a floating point number in the range
134-
0 to 1.0.
131+
"""The DAC value as a floating point number in the range 0.0 to 1.0.
135132
"""
136133
return self._read()/4095.0
137134

conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Uncomment the below if you use native CircuitPython modules such as
1919
# digitalio, micropython and busio. List the modules you use. Without it, the
2020
# autodoc module docs will fail to generate with a warning.
21-
# autodoc_mock_imports = ["digitalio", "busio"]
21+
autodoc_mock_imports = ["micropython"]
2222

2323
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/bus_device/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
2424

0 commit comments

Comments
 (0)