Skip to content

Commit fcbdd57

Browse files
authored
Merge pull request #1 from tannewt/lint
Update for byte knobs and lint.
2 parents 94f5a00 + 3546e6c commit fcbdd57

File tree

6 files changed

+36
-25
lines changed

6 files changed

+36
-25
lines changed

README.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ Installing from PyPI
3131
.. note:: This library is not available on PyPI yet. Install documentation is included
3232
as a standard element. Stay tuned for PyPI availability!
3333

34-
.. todo:: Remove the above note if PyPI version is/will be available at time of release.
35-
If the library is not planned for PyPI, remove the entire 'Installing from PyPI' section.
36-
3734
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
3835
PyPI <https://pypi.org/project/adafruit-circuitpython-ssd1322/>`_. To install for current user:
3936

@@ -59,7 +56,26 @@ To install in a virtual environment in your current project:
5956
Usage Example
6057
=============
6158

62-
.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
59+
.. code-block:: python
60+
61+
import time
62+
import board
63+
import busio
64+
import displayio
65+
import adafruit_ssd1322
66+
67+
displayio.release_displays()
68+
69+
# This pinout works on a Metro and may need to be altered for other boards.
70+
spi = busio.SPI(board.SCL, board.SDA)
71+
tft_cs = board.D6
72+
tft_dc = board.D9
73+
tft_reset = board.D5
74+
75+
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs,
76+
reset=tft_reset, baudrate=1000000)
77+
time.sleep(1)
78+
display = adafruit_ssd1322.SSD1322(display_bus, width=256, height=64, colstart=28)
6379
6480
Contributing
6581
============

adafruit_ssd1322.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,14 @@
3333
3434
**Hardware:**
3535
36-
.. todo:: Add links to any specific hardware product page(s), or category page(s). Use unordered list & hyperlink rST
37-
inline format: "* `Link Text <url>`_"
36+
* 3.12" Newhaven Display 256x64 Grayscale Blue OLED:
37+
https://www.newhavendisplay.com/nhd31225664ucb2-p-3622.html
3838
3939
**Software and Dependencies:**
4040
41-
* Adafruit CircuitPython firmware for the supported boards:
41+
* Adafruit CircuitPython 5+ firmware for the supported boards:
4242
https://github.com/adafruit/circuitpython/releases
4343
44-
.. todo:: Uncomment or remove the Bus Device and/or the Register library dependencies based on the library's use of either.
45-
46-
# * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
47-
# * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
4844
"""
4945

5046
import displayio
@@ -73,7 +69,8 @@
7369
b"\xb8\x0f\x00\x01\x02\x03\x04\x05\x06\x07\x08\x10\x40\x90\xa0\xb0\xb4" # Set graytable
7470
# b"\xb9\x00" # Set_Linear_Gray_Scale_Table();//set default linear gray scale table
7571
b"\xb1\x01\xe2" # Set_Phase_Length(0xE2);// Set Phase 1 as 5 Clocks & Phase 2 as 14 Clocks
76-
b"\xd1\x02\xa2\x20" # Set_Display_Enhancement_B(0x20);// Enhance Driving Scheme Capability (0x00/0x20)
72+
# Set_Display_Enhancement_B(0x20);// Enhance Driving Scheme Capability (0x00/0x20)
73+
b"\xd1\x02\xa2\x20"
7774
b"\xbb\x01\x1f" # Set_Precharge_Voltage(0x1F);// Set Pre-Charge Voltage Level as 0.60*VCC
7875
b"\xb6\x01\x08" # Set_Precharge_Period(0x08);// Set Second Pre-Charge Period as 8 Clocks
7976
b"\xbe\x01\x07" # Set_VCOMH(0x07);// Set Common Pins Deselect Voltage Level as 0.86*VCC
@@ -95,4 +92,4 @@ def __init__(self, bus, **kwargs):
9592
super().__init__(bus, _INIT_SEQUENCE, **kwargs, color_depth=4, grayscale=True,
9693
set_column_command=0x15, set_row_command=0x75,
9794
set_vertical_scroll=0xd3, write_ram_command=0x5c,
98-
single_byte_bounds=True)
95+
single_byte_bounds=True, reverse_pixels_in_byte=True, bytes_per_cell=2)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Uncomment the below if you use native CircuitPython modules such as
2121
# digitalio, micropython and busio. List the modules you use. Without it, the
2222
# autodoc module docs will fail to generate with a warning.
23-
# autodoc_mock_imports = ["digitalio", "busio"]
23+
autodoc_mock_imports = ["displayio"]
2424

2525

2626
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}

docs/index.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
27-
the toctree above for use later.
28-
2926
.. toctree::
3027
:caption: Related Products
3128

32-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
33-
the toctree above for use later.
29+
3.12" Newhaven Display 256x64 Grayscale Blue OLED <https://www.newhavendisplay.com/nhd31225664ucb2-p-3622.html>
3430

3531
.. toctree::
3632
:caption: Other Links

examples/ssd1322_gamma.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import time
12
import board
3+
import busio
24
import displayio
35
import adafruit_ssd1322
4-
import busio
5-
import time
66

77
displayio.release_displays()
88

@@ -12,7 +12,8 @@
1212
tft_dc = board.D9
1313
tft_reset = board.D5
1414

15-
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset, baudrate=1000000)
15+
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset,
16+
baudrate=1000000)
1617
time.sleep(1)
1718
display = adafruit_ssd1322.SSD1322(display_bus, width=256, height=64, colstart=28)
1819

examples/ssd1322_simpletest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import time
12
import board
3+
import busio
24
import displayio
35
import adafruit_ssd1322
4-
import busio
5-
import time
66

77
displayio.release_displays()
88

@@ -12,6 +12,7 @@
1212
tft_dc = board.D9
1313
tft_reset = board.D5
1414

15-
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset, baudrate=1000000)
15+
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs,
16+
reset=tft_reset, baudrate=1000000)
1617
time.sleep(1)
1718
display = adafruit_ssd1322.SSD1322(display_bus, width=256, height=64, colstart=28)

0 commit comments

Comments
 (0)