Skip to content

Commit

Permalink
Superclass Implementation
Browse files Browse the repository at this point in the history
Switch to a superclass implementation
Bump version
Bump copyright year
  • Loading branch information
santaimpersonator committed May 13, 2021
1 parent b9d6c6a commit 8550912
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 1,382 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright 2019 SparkFun Electronics
Copyright 2021 SparkFun Electronics

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

9 changes: 2 additions & 7 deletions docs/apiref.rst
@@ -1,10 +1,5 @@
API Reference
==============

.. automodule:: qwiic_micro_oled
:members:


.. autoclass:: QwiicMicroOled
:members:

.. automodapi:: qwiic_micro_oled
:inherited-members:
8 changes: 4 additions & 4 deletions docs/conf.py
Expand Up @@ -18,11 +18,11 @@
# -- Project information -----------------------------------------------------

project = 'sparkfun_qwiic_micro_oled'
copyright = '2019, SparkFun Electronics'
copyright = '2021, SparkFun Electronics'
author = 'SparkFun Electronics'

# The full version, including alpha/beta/rc tags
release = '0.9.0'
release = '0.10.0'


# -- General configuration ---------------------------------------------------
Expand All @@ -34,8 +34,8 @@
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'm2r'
]
'sphinx_automodapi.automodapi',
'm2r2'

source_suffix = ['.rst', '.md']
# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
@@ -1,5 +1,5 @@
.. sparkfun_qwiic documentation master file, created by
sphinx-quickstart on Tue Jul 2 11:01:40 2019.
sphinx-quickstart on Tue May 11 11:01:40 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.txt
@@ -1,2 +1,3 @@
m2r
sparkfun-qwiic-i2c
m2r2
sphinx-automodapi
sparkfun-qwiic-i2c
64 changes: 50 additions & 14 deletions qwiic_micro_oled/__init__.py → qwiic_micro_oled.py
@@ -1,18 +1,17 @@
#-----------------------------------------------------------------------------
# __init__.py
# qwiic_micro_oled.py
#
#------------------------------------------------------------------------
#
# Written by SparkFun Electronics, May 2021
#
# Written by SparkFun Electronics, May 2019
#
#
# More information on qwiic is at https://www.sparkfun.com/qwiic
# More information on qwiic is at https:= www.sparkfun.com/qwiic
#
# Do you like this library? Help support SparkFun. Buy a board!
#
#==================================================================================
# Copyright (c) 2019 SparkFun Electronics
# Copyright (c) 2021 SparkFun Electronics
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -32,21 +31,17 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#==================================================================================
#-----------------------------------------------------------------------------
# this package encapsulates the resources used for the Micro OLED board
#
#-----------------------------------------------------------------------------

#
# This is mostly a port of existing Arduino functionaly, so pylint is sad.
# The goal is to keep the public interface pthonic, but internal is internal
#
# pylint: disable=line-too-long
#
# pylint: disable=line-too-long, bad-whitespace, invalid-name, too-many-lines
# pylint: disable=too-many-lines, too-many-arguments, too-many-instance-attributes
# pylint: disable=too-many-public-methods

"""
qwiic_micro_oled
=================
====================
Python module for the [Qwiic Micro OLED Display](https://www.sparkfun.com/products/14532)
This python package is a port of the existing [SparkFun Micro OLED Arduino Library](https://github.com/sparkfun/SparkFun_Micro_OLED_Arduino_Library)
Expand All @@ -57,6 +52,47 @@
"""

from __future__ import print_function
import math
import qwiic_i2c

from qwiic_oled_base import QwiicOledBase

# Define the device name and I2C addresses. These are set in the class defintion
# as class variables, making them avilable without having to create a class instance.
#
# The name of this device - note this is private
_DEFAULT_NAME = "Qwiic Micro OLED (64x48)"

# Some devices have multiple availabel addresses - this is a list of these addresses.
# NOTE: The first address in this list is considered the default I2C address for the
# device.

_AVAILABLE_I2C_ADDRESS = [0x3D, 0x3C]
_LCDWIDTH = 64
_LCDHEIGHT = 48


class QwiicMicroOled(QwiicOledBase):
"""
QwiicMicroOled
:param address: The I2C address to use for the device.
If not provided, the default address is used.
:param i2c_driver: An existing i2c driver object. If not provided
a driver object is created.
:return: The OLED Display device object.
:rtype: Object
"""

# Constructor
device_name =_DEFAULT_NAME
available_addresses = _AVAILABLE_I2C_ADDRESS

def __init__(self, address=None, i2c_driver=None):

# Did the user specify an I2C address?
self.address = address if address is not None else self.available_addresses[0]

from .qwiic_micro_oled import QwiicMicroOled
# Instantiate OLED Display Driver - Base Class
super().__init__(address, _LCDWIDTH, _LCDHEIGHT, i2c_driver)
Binary file removed qwiic_micro_oled/fonts/0_font5x7.bin
Binary file not shown.
Binary file removed qwiic_micro_oled/fonts/1_font8x16.bin
Binary file not shown.
Binary file removed qwiic_micro_oled/fonts/2_7segment.bin
Binary file not shown.
Binary file removed qwiic_micro_oled/fonts/3_fontlargenumber.bin
Binary file not shown.
Binary file removed qwiic_micro_oled/fonts/4_fontlargeletter31x48.bin
Binary file not shown.

0 comments on commit 8550912

Please sign in to comment.