Skip to content

Commit dbbd87a

Browse files
authored
Add docstrings explaining the parameters
1 parent 6374df7 commit dbbd87a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

adafruit_ssd1306.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,14 @@ def text(self, string, xpos, ypos, col=1):
131131
self.framebuf.text(string, xpos, ypos, col)
132132

133133
class SSD1306_I2C(_SSD1306):
134-
""" I2C class for SSD1306
134+
"""
135+
I2C class for SSD1306
136+
137+
:param width: the width of the physical screen in pixels,
138+
:param height: the height of the physical screen in pixels,
139+
:param i2c: the I2C peripheral to use,
140+
:param addr: the 8-bit bus address of the device,
141+
:param external_vcc: whether external high-voltage source is connected.
135142
"""
136143

137144
def __init__(self, width, height, i2c, *, addr=0x3c, external_vcc=False):
@@ -167,7 +174,15 @@ def poweron(self):
167174

168175
#pylint: disable-msg=too-many-arguments
169176
class SSD1306_SPI(_SSD1306):
170-
""" SPI class for SSD1306
177+
"""
178+
SPI class for SSD1306
179+
180+
:param width: the width of the physical screen in pixels,
181+
:param height: the height of the physical screen in pixels,
182+
:param spi: the SPI peripheral to use,
183+
:param dc: the data/command pin to use (often labeled "D/C"),
184+
:param res: the reset pin to use,
185+
:param cs: the chip-select pin to use (sometimes labeled "SS").
171186
"""
172187
def __init__(self, width, height, spi, dc, res, cs, *,
173188
external_vcc=False, baudrate=8000000, polarity=0, phase=0):

0 commit comments

Comments
 (0)