Compare commits
12 commits
pylint_upd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96546f4852 | ||
|
|
9cfa47adde | ||
|
|
74d4851cba | ||
|
|
251ee26bc8 | ||
|
|
5eb2b03e3c | ||
|
|
aec253be41 | ||
|
|
9b2c39886c | ||
|
|
adc9969d52 | ||
|
|
70c43fea68 | ||
|
|
e01711ad0f | ||
|
|
5df78d997a | ||
|
|
477f67c794 |
7 changed files with 142 additions and 113 deletions
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
|
|
@ -40,9 +40,12 @@ jobs:
|
||||||
source actions-ci/install.sh
|
source actions-ci/install.sh
|
||||||
- name: Pip install pylint, black, & Sphinx
|
- name: Pip install pylint, black, & Sphinx
|
||||||
run: |
|
run: |
|
||||||
pip install pylint black==19.10b0 Sphinx sphinx-rtd-theme
|
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
|
||||||
- name: Library version
|
- name: Library version
|
||||||
run: git describe --dirty --always --tags
|
run: git describe --dirty --always --tags
|
||||||
|
- name: Check formatting
|
||||||
|
run: |
|
||||||
|
black --check --target-version=py35 .
|
||||||
- name: PyLint
|
- name: PyLint
|
||||||
run: |
|
run: |
|
||||||
pylint $( find . -path './adafruit*.py' )
|
pylint $( find . -path './adafruit*.py' )
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ Examples of unacceptable behavior by participants include:
|
||||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||||
asked
|
asked
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Promoting or spreading disinformation, lies, or conspiracy theories against
|
||||||
|
a person, group, organisation, project, or community
|
||||||
* Public or private harassment
|
* Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or electronic
|
* Publishing others' private information, such as a physical or electronic
|
||||||
address, without explicit permission
|
address, without explicit permission
|
||||||
|
|
@ -41,7 +43,7 @@ Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
The goal of the standards and moderation guidelines outlined here is to build
|
The goal of the standards and moderation guidelines outlined here is to build
|
||||||
and maintain a respectful community. We ask that you don’t just aim to be
|
and maintain a respectful community. We ask that you don’t just aim to be
|
||||||
"technically unimpeachable", but rather try to be your best self.
|
"technically unimpeachable", but rather try to be your best self.
|
||||||
|
|
||||||
We value many things beyond technical expertise, including collaboration and
|
We value many things beyond technical expertise, including collaboration and
|
||||||
supporting others within our community. Providing a positive experience for
|
supporting others within our community. Providing a positive experience for
|
||||||
|
|
@ -72,10 +74,10 @@ You may report in the following ways:
|
||||||
In any situation, you may send an email to <support@adafruit.com>.
|
In any situation, you may send an email to <support@adafruit.com>.
|
||||||
|
|
||||||
On the Adafruit Discord, you may send an open message from any channel
|
On the Adafruit Discord, you may send an open message from any channel
|
||||||
to all Community Helpers by tagging @community moderators. You may also send an
|
to all Community Moderators by tagging @community moderators. You may
|
||||||
open message from any channel, or a direct message to @kattni#1507,
|
also send an open message from any channel, or a direct message to
|
||||||
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
|
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
|
||||||
@Andon#8175.
|
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
|
||||||
|
|
||||||
Email and direct message reports will be kept confidential.
|
Email and direct message reports will be kept confidential.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Introduction
|
||||||
:alt: Documentation Status
|
:alt: Documentation Status
|
||||||
|
|
||||||
.. image:: https://img.shields.io/discord/327254708534116352.svg
|
.. image:: https://img.shields.io/discord/327254708534116352.svg
|
||||||
:target: https://discord.gg/nBQh6qu
|
:target: https://adafru.it/discord
|
||||||
:alt: Discord
|
:alt: Discord
|
||||||
|
|
||||||
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305/workflows/Build%20CI/badge.svg
|
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305/workflows/Build%20CI/badge.svg
|
||||||
|
|
|
||||||
|
|
@ -52,21 +52,21 @@ __version__ = "0.0.0-auto.0"
|
||||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305.git"
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305.git"
|
||||||
|
|
||||||
_INIT_SEQUENCE = (
|
_INIT_SEQUENCE = (
|
||||||
b"\xAE\x00" # DISPLAY_OFF
|
b"\xAE\x00" # DISPLAY_OFF
|
||||||
b"\xd5\x01\x80" # SET_DISP_CLK_DIV
|
b"\xd5\x01\x80" # SET_DISP_CLK_DIV
|
||||||
b"\xA1\x00" # Column 127 is segment 0
|
b"\xA1\x00" # Column 127 is segment 0
|
||||||
b"\xA8\x01\x3F" # Mux ratio is 1/64
|
b"\xA8\x01\x3F" # Mux ratio is 1/64
|
||||||
b"\xad\x01\x8e" # Set Master Configuration
|
b"\xad\x01\x8e" # Set Master Configuration
|
||||||
b"\xd8\x01\x05" # Set Area Color Mode On/Off & Low Power Display Mode
|
b"\xd8\x01\x05" # Set Area Color Mode On/Off & Low Power Display Mode
|
||||||
b"\x20\x01\x00" # Set memory addressing to horizontal mode.
|
b"\x20\x01\x00" # Set memory addressing to horizontal mode.
|
||||||
b"\x40\x01\x2E" # SET_DISP_START_LINE ADD
|
b"\x40\x01\x2E" # SET_DISP_START_LINE ADD
|
||||||
b"\xc8\x00" # Set COM Output Scan Direction 64 to 1
|
b"\xc8\x00" # Set COM Output Scan Direction 64 to 1
|
||||||
b"\xda\x01\x12" # Set com configuration
|
b"\xda\x01\x12" # Set com configuration
|
||||||
b"\x91\x04\x3f\x3f\x3f\x3f" # Current drive pulse width of BANK0, Color A, Band C.
|
b"\x91\x04\x3f\x3f\x3f\x3f" # Current drive pulse width of BANK0, Color A, Band C.
|
||||||
b"\xd9\x01\xd2" # Set pre-charge period orig: 0xd9, 0x22 if self.external_vcc else 0xf1,
|
b"\xd9\x01\xd2" # Set pre-charge period orig: 0xd9, 0x22 if self.external_vcc else 0xf1,
|
||||||
b"\xdb\x01\x34" # Set vcom configuration 0xdb, 0x30, $ 0.83* Vcc
|
b"\xdb\x01\x34" # Set vcom configuration 0xdb, 0x30, $ 0.83* Vcc
|
||||||
b"\xA6\x00" # Normal display
|
b"\xA6\x00" # Normal display
|
||||||
b"\xA4\x00" # output follows RAM contents SET_ENTIRE_ON
|
b"\xA4\x00" # output follows RAM contents SET_ENTIRE_ON
|
||||||
b"\x8d\x01\x14" # Enable charge pump
|
b"\x8d\x01\x14" # Enable charge pump
|
||||||
b"\xAF\x00\x00" # DISPLAY_ON
|
b"\xAF\x00\x00" # DISPLAY_ON
|
||||||
)
|
)
|
||||||
|
|
@ -74,6 +74,7 @@ _INIT_SEQUENCE = (
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
class SSD1305(displayio.Display):
|
class SSD1305(displayio.Display):
|
||||||
"""SSD1305 driver"""
|
"""SSD1305 driver"""
|
||||||
|
|
||||||
def __init__(self, bus, **kwargs):
|
def __init__(self, bus, **kwargs):
|
||||||
colstart = 0
|
colstart = 0
|
||||||
# Patch the init sequence for 32 pixel high displays.
|
# Patch the init sequence for 32 pixel high displays.
|
||||||
|
|
@ -82,12 +83,22 @@ class SSD1305(displayio.Display):
|
||||||
height = kwargs["height"]
|
height = kwargs["height"]
|
||||||
if "rotation" in kwargs and kwargs["rotation"] % 180 != 0:
|
if "rotation" in kwargs and kwargs["rotation"] % 180 != 0:
|
||||||
height = kwargs["width"]
|
height = kwargs["width"]
|
||||||
init_sequence[9] = height - 1 # patch mux ratio
|
init_sequence[9] = height - 1 # patch mux ratio
|
||||||
|
|
||||||
if kwargs["height"] == 32:
|
if kwargs["height"] == 32:
|
||||||
colstart = 4
|
colstart = 4
|
||||||
super().__init__(bus, init_sequence, **kwargs, color_depth=1, grayscale=True,
|
super().__init__(
|
||||||
pixels_in_byte_share_row=False,
|
bus,
|
||||||
set_column_command=0x21, set_row_command=0x22, data_as_commands=True,
|
init_sequence,
|
||||||
set_vertical_scroll=0xd3, brightness_command=0x81,
|
**kwargs,
|
||||||
single_byte_bounds=True, colstart=colstart)
|
color_depth=1,
|
||||||
|
grayscale=True,
|
||||||
|
pixels_in_byte_share_row=False,
|
||||||
|
set_column_command=0x21,
|
||||||
|
set_row_command=0x22,
|
||||||
|
data_as_commands=True,
|
||||||
|
set_vertical_scroll=0xD3,
|
||||||
|
brightness_command=0x81,
|
||||||
|
single_byte_bounds=True,
|
||||||
|
colstart=colstart,
|
||||||
|
)
|
||||||
|
|
|
||||||
112
docs/conf.py
112
docs/conf.py
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
sys.path.insert(0, os.path.abspath('..'))
|
|
||||||
|
sys.path.insert(0, os.path.abspath(".."))
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -10,10 +11,10 @@ sys.path.insert(0, os.path.abspath('..'))
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
'sphinx.ext.autodoc',
|
"sphinx.ext.autodoc",
|
||||||
'sphinx.ext.intersphinx',
|
"sphinx.ext.intersphinx",
|
||||||
'sphinx.ext.napoleon',
|
"sphinx.ext.napoleon",
|
||||||
'sphinx.ext.todo',
|
"sphinx.ext.todo",
|
||||||
]
|
]
|
||||||
|
|
||||||
# TODO: Please Read!
|
# TODO: Please Read!
|
||||||
|
|
@ -23,29 +24,32 @@ extensions = [
|
||||||
autodoc_mock_imports = ["displayio"]
|
autodoc_mock_imports = ["displayio"]
|
||||||
|
|
||||||
|
|
||||||
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
|
intersphinx_mapping = {
|
||||||
|
"python": ("https://docs.python.org/3.4", None),
|
||||||
|
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
|
||||||
|
}
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ["_templates"]
|
||||||
|
|
||||||
source_suffix = '.rst'
|
source_suffix = ".rst"
|
||||||
|
|
||||||
# The master toctree document.
|
# The master toctree document.
|
||||||
master_doc = 'index'
|
master_doc = "index"
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Adafruit DisplayIO_SSD1305 Library'
|
project = "Adafruit DisplayIO_SSD1305 Library"
|
||||||
copyright = u'2019 Melissa LeBlanc-Williams'
|
copyright = "2019 Melissa LeBlanc-Williams"
|
||||||
author = u'Melissa LeBlanc-Williams'
|
author = "Melissa LeBlanc-Williams"
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = u'1.0'
|
version = "1.0"
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = u'1.0'
|
release = "1.0"
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|
@ -57,7 +61,7 @@ language = None
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
# This patterns also effect to html_static_path and html_extra_path
|
# This patterns also effect to html_static_path and html_extra_path
|
||||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
# documents.
|
# documents.
|
||||||
|
|
@ -69,7 +73,7 @@ default_role = "any"
|
||||||
add_function_parentheses = True
|
add_function_parentheses = True
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
pygments_style = 'sphinx'
|
pygments_style = "sphinx"
|
||||||
|
|
||||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||||
todo_include_todos = False
|
todo_include_todos = False
|
||||||
|
|
@ -84,59 +88,62 @@ napoleon_numpy_docstring = False
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
#
|
#
|
||||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
|
||||||
|
|
||||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||||
try:
|
try:
|
||||||
import sphinx_rtd_theme
|
import sphinx_rtd_theme
|
||||||
html_theme = 'sphinx_rtd_theme'
|
|
||||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
|
html_theme = "sphinx_rtd_theme"
|
||||||
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
|
||||||
except:
|
except:
|
||||||
html_theme = 'default'
|
html_theme = "default"
|
||||||
html_theme_path = ['.']
|
html_theme_path = ["."]
|
||||||
else:
|
else:
|
||||||
html_theme_path = ['.']
|
html_theme_path = ["."]
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ["_static"]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to use as a favicon of
|
# The name of an image file (relative to this directory) to use as a favicon of
|
||||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||||
# pixels large.
|
# pixels large.
|
||||||
#
|
#
|
||||||
html_favicon = '_static/favicon.ico'
|
html_favicon = "_static/favicon.ico"
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
# Output file base name for HTML help builder.
|
||||||
htmlhelp_basename = 'AdafruitDisplayio_ssd1305Librarydoc'
|
htmlhelp_basename = "AdafruitDisplayio_ssd1305Librarydoc"
|
||||||
|
|
||||||
# -- Options for LaTeX output ---------------------------------------------
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
|
||||||
latex_elements = {
|
latex_elements = {
|
||||||
# The paper size ('letterpaper' or 'a4paper').
|
# The paper size ('letterpaper' or 'a4paper').
|
||||||
#
|
#
|
||||||
# 'papersize': 'letterpaper',
|
# 'papersize': 'letterpaper',
|
||||||
|
# The font size ('10pt', '11pt' or '12pt').
|
||||||
# The font size ('10pt', '11pt' or '12pt').
|
#
|
||||||
#
|
# 'pointsize': '10pt',
|
||||||
# 'pointsize': '10pt',
|
# Additional stuff for the LaTeX preamble.
|
||||||
|
#
|
||||||
# Additional stuff for the LaTeX preamble.
|
# 'preamble': '',
|
||||||
#
|
# Latex figure (float) alignment
|
||||||
# 'preamble': '',
|
#
|
||||||
|
# 'figure_align': 'htbp',
|
||||||
# Latex figure (float) alignment
|
|
||||||
#
|
|
||||||
# 'figure_align': 'htbp',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
(master_doc, 'AdafruitDisplayIO_SSD1305Library.tex', u'AdafruitDisplayIO_SSD1305 Library Documentation',
|
(
|
||||||
author, 'manual'),
|
master_doc,
|
||||||
|
"AdafruitDisplayIO_SSD1305Library.tex",
|
||||||
|
"AdafruitDisplayIO_SSD1305 Library Documentation",
|
||||||
|
author,
|
||||||
|
"manual",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# -- Options for manual page output ---------------------------------------
|
# -- Options for manual page output ---------------------------------------
|
||||||
|
|
@ -144,8 +151,13 @@ latex_documents = [
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
(master_doc, 'AdafruitDisplayIO_SSD1305library', u'Adafruit DisplayIO_SSD1305 Library Documentation',
|
(
|
||||||
[author], 1)
|
master_doc,
|
||||||
|
"AdafruitDisplayIO_SSD1305library",
|
||||||
|
"Adafruit DisplayIO_SSD1305 Library Documentation",
|
||||||
|
[author],
|
||||||
|
1,
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
# -- Options for Texinfo output -------------------------------------------
|
# -- Options for Texinfo output -------------------------------------------
|
||||||
|
|
@ -154,7 +166,13 @@ man_pages = [
|
||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
(master_doc, 'AdafruitDisplayIO_SSD1305Library', u'Adafruit DisplayIO_SSD1305 Library Documentation',
|
(
|
||||||
author, 'AdafruitDisplayIO_SSD1305Library', 'One line description of project.',
|
master_doc,
|
||||||
'Miscellaneous'),
|
"AdafruitDisplayIO_SSD1305Library",
|
||||||
|
"Adafruit DisplayIO_SSD1305 Library Documentation",
|
||||||
|
author,
|
||||||
|
"AdafruitDisplayIO_SSD1305Library",
|
||||||
|
"One line description of project.",
|
||||||
|
"Miscellaneous",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,16 @@ oled_reset = board.D9
|
||||||
spi = board.SPI()
|
spi = board.SPI()
|
||||||
oled_cs = board.D5
|
oled_cs = board.D5
|
||||||
oled_dc = board.D6
|
oled_dc = board.D6
|
||||||
display_bus = displayio.FourWire(spi, command=oled_dc, chip_select=oled_cs,
|
display_bus = displayio.FourWire(
|
||||||
baudrate=1000000, reset=oled_reset)
|
spi, command=oled_dc, chip_select=oled_cs, baudrate=1000000, reset=oled_reset
|
||||||
|
)
|
||||||
|
|
||||||
# Use for I2C
|
# Use for I2C
|
||||||
# i2c = board.I2C()
|
# i2c = board.I2C()
|
||||||
# display_bus = displayio.I2CDisplay(i2c, device_address=0x3c, reset=oled_reset)
|
# display_bus = displayio.I2CDisplay(i2c, device_address=0x3c, reset=oled_reset)
|
||||||
|
|
||||||
WIDTH = 128
|
WIDTH = 128
|
||||||
HEIGHT = 64 # Change to 32 if needed
|
HEIGHT = 64 # Change to 32 if needed
|
||||||
BORDER = 8
|
BORDER = 8
|
||||||
FONTSCALE = 1
|
FONTSCALE = 1
|
||||||
|
|
||||||
|
|
@ -38,29 +39,33 @@ display.show(splash)
|
||||||
|
|
||||||
color_bitmap = displayio.Bitmap(display.width, display.height, 1)
|
color_bitmap = displayio.Bitmap(display.width, display.height, 1)
|
||||||
color_palette = displayio.Palette(1)
|
color_palette = displayio.Palette(1)
|
||||||
color_palette[0] = 0xFFFFFF # White
|
color_palette[0] = 0xFFFFFF # White
|
||||||
|
|
||||||
bg_sprite = displayio.TileGrid(color_bitmap,
|
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
|
||||||
pixel_shader=color_palette,
|
|
||||||
x=0, y=0)
|
|
||||||
splash.append(bg_sprite)
|
splash.append(bg_sprite)
|
||||||
|
|
||||||
# Draw a smaller inner rectangle
|
# Draw a smaller inner rectangle
|
||||||
inner_bitmap = displayio.Bitmap(display.width - BORDER * 2, display.height - BORDER * 2, 1)
|
inner_bitmap = displayio.Bitmap(
|
||||||
|
display.width - BORDER * 2, display.height - BORDER * 2, 1
|
||||||
|
)
|
||||||
inner_palette = displayio.Palette(1)
|
inner_palette = displayio.Palette(1)
|
||||||
inner_palette[0] = 0x000000 # Black
|
inner_palette[0] = 0x000000 # Black
|
||||||
inner_sprite = displayio.TileGrid(inner_bitmap,
|
inner_sprite = displayio.TileGrid(
|
||||||
pixel_shader=inner_palette,
|
inner_bitmap, pixel_shader=inner_palette, x=BORDER, y=BORDER
|
||||||
x=BORDER, y=BORDER)
|
)
|
||||||
splash.append(inner_sprite)
|
splash.append(inner_sprite)
|
||||||
|
|
||||||
# Draw a label
|
# Draw a label
|
||||||
text = "Hello World!"
|
text = "Hello World!"
|
||||||
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFFFF)
|
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFFFF)
|
||||||
text_width = text_area.bounding_box[2] * FONTSCALE
|
text_width = text_area.bounding_box[2] * FONTSCALE
|
||||||
text_group = displayio.Group(max_size=10, scale=FONTSCALE, x=display.width // 2 - text_width // 2,
|
text_group = displayio.Group(
|
||||||
y=display.height // 2)
|
max_size=10,
|
||||||
text_group.append(text_area) # Subgroup for text scaling
|
scale=FONTSCALE,
|
||||||
|
x=display.width // 2 - text_width // 2,
|
||||||
|
y=display.height // 2,
|
||||||
|
)
|
||||||
|
text_group.append(text_area) # Subgroup for text scaling
|
||||||
splash.append(text_group)
|
splash.append(text_group)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
|
||||||
54
setup.py
54
setup.py
|
|
@ -6,6 +6,7 @@ https://github.com/pypa/sampleproject
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
# To use a consistent encoding
|
# To use a consistent encoding
|
||||||
from codecs import open
|
from codecs import open
|
||||||
from os import path
|
from os import path
|
||||||
|
|
@ -13,52 +14,41 @@ from os import path
|
||||||
here = path.abspath(path.dirname(__file__))
|
here = path.abspath(path.dirname(__file__))
|
||||||
|
|
||||||
# Get the long description from the README file
|
# Get the long description from the README file
|
||||||
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
|
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
||||||
long_description = f.read()
|
long_description = f.read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='adafruit-circuitpython-displayio-ssd1305',
|
name="adafruit-circuitpython-displayio-ssd1305",
|
||||||
|
|
||||||
use_scm_version=True,
|
use_scm_version=True,
|
||||||
setup_requires=['setuptools_scm'],
|
setup_requires=["setuptools_scm"],
|
||||||
|
description="DisplayIO driver for SSD1305 monochrome displays",
|
||||||
description='DisplayIO driver for SSD1305 monochrome displays',
|
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type='text/x-rst',
|
long_description_content_type="text/x-rst",
|
||||||
|
|
||||||
# The project's main homepage.
|
# The project's main homepage.
|
||||||
url='https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305',
|
url="https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305",
|
||||||
|
|
||||||
# Author details
|
# Author details
|
||||||
author='Adafruit Industries',
|
author="Adafruit Industries",
|
||||||
author_email='circuitpython@adafruit.com',
|
author_email="circuitpython@adafruit.com",
|
||||||
|
install_requires=["Adafruit-Blinka"],
|
||||||
install_requires=[
|
|
||||||
'Adafruit-Blinka'
|
|
||||||
],
|
|
||||||
|
|
||||||
# Choose your license
|
# Choose your license
|
||||||
license='MIT',
|
license="MIT",
|
||||||
|
|
||||||
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 3 - Alpha',
|
"Development Status :: 3 - Alpha",
|
||||||
'Intended Audience :: Developers',
|
"Intended Audience :: Developers",
|
||||||
'Topic :: Software Development :: Libraries',
|
"Topic :: Software Development :: Libraries",
|
||||||
'Topic :: System :: Hardware',
|
"Topic :: System :: Hardware",
|
||||||
'License :: OSI Approved :: MIT License',
|
"License :: OSI Approved :: MIT License",
|
||||||
'Programming Language :: Python :: 3',
|
"Programming Language :: Python :: 3",
|
||||||
'Programming Language :: Python :: 3.4',
|
"Programming Language :: Python :: 3.4",
|
||||||
'Programming Language :: Python :: 3.5',
|
"Programming Language :: Python :: 3.5",
|
||||||
],
|
],
|
||||||
|
|
||||||
# What does your project relate to?
|
# What does your project relate to?
|
||||||
keywords='adafruit blinka circuitpython micropython displayio_ssd1305 displayio ssd1305 '
|
keywords="adafruit blinka circuitpython micropython displayio_ssd1305 displayio ssd1305 "
|
||||||
'oled',
|
"oled",
|
||||||
|
|
||||||
# You can just specify the packages manually here if your project is
|
# You can just specify the packages manually here if your project is
|
||||||
# simple. Or you can use find_packages().
|
# simple. Or you can use find_packages().
|
||||||
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
|
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
|
||||||
# CHANGE `py_modules=['...']` TO `packages=['...']`
|
# CHANGE `py_modules=['...']` TO `packages=['...']`
|
||||||
py_modules=['adafruit_displayio_ssd1305'],
|
py_modules=["adafruit_displayio_ssd1305"],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue