Skip to content

Commit

Permalink
Merge pull request #2 from dcooperdalrymple/main
Browse files Browse the repository at this point in the history
Upgraded library to support most features of WM8960 I2C protocol
  • Loading branch information
tannewt authored Sep 9, 2024
2 parents cf3620d + 5ae8bc5 commit bba4f61
Show file tree
Hide file tree
Showing 18 changed files with 3,167 additions and 130 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: Unlicense

default_language_version:
# force all unspecified python hooks to run python3.11
python: python3.11

repos:
- repo: https://github.com/python/black
rev: 23.3.0
Expand Down
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)
MIT License

Copyright (c) 2023 Scott Shawcroft for Adafruit Industries
Copyright (c) 2024 Cooper Dalrymple

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 Down
49 changes: 18 additions & 31 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
Introduction
============


.. image:: https://readthedocs.org/projects/adafruit-circuitpython-wm8960/badge/?version=latest
:target: https://docs.circuitpython.org/projects/wm8960/en/latest/
:alt: Documentation Status


.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord


.. image:: https://github.com/adafruit/Adafruit_CircuitPython_WM8960/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_WM8960/actions
:alt: Build Status


.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black

Barebones CircuitPython driver for WM8960 Stereo CODEC

CircuitPython driver for WM8960 Stereo CODEC

Dependencies
=============
Expand All @@ -32,27 +26,18 @@ This driver depends on:
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_
or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_.
This is easily achieved by downloading `the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_ or individual libraries can be installed using `circup <https://github.com/adafruit/circup>`_.

This library is designed to help facilite the I2C connection with a WM8960 audio codec to configure it to be used for DAC, ADC, headphone and speaker functionality.


.. todo:: Describe the Adafruit product this library works with. For PCBs, you can also add the
image from the assets folder in the PCB's GitHub repo.

`Purchase one from the Adafruit shop <http://www.adafruit.com/products/>`_
This library has been tested using an RP2040 on CircuitPython 9.1.1 and the `SparkFun Audio Codec PBreakout - WM8960 <https://www.sparkfun.com/products/21250>`_.

Installing from PyPI
=====================
.. note:: This library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!
.. note:: This library is not available on PyPI yet. Install documentation is included as a standard element. Stay tuned for PyPI availability!

.. todo:: Remove the above note if PyPI version is/will be available at time of release.
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from PyPI <https://pypi.org/project/adafruit-circuitpython-wm8960/>`_.

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-wm8960/>`_.
To install for current user:

.. code-block:: shell
Expand Down Expand Up @@ -100,19 +85,21 @@ Or the following command to update an existing version:
Usage Example
=============

.. todo:: Add a quick, simple example. It and other examples should live in the
examples folder and be included in docs/examples.rst.
.. code-block:: python
# Monitor Stereo Input: INPUT3 => Output Mixer => Headphones
import board
from adafruit_wm8960 import Input, WM8960
codec = WM8960(board.I2C())
codec.input = Input.LINE3
codec.gain = 0.5
codec.monitor = 1.0
codec.headphone = 0.5
Documentation
=============
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/wm8960/en/latest/>`_.

For information on building library documentation, please check out
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/adafruit_wm8960/en/latest/>`_.

Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_WM8960/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Contributions are welcome! Please read our `Code of Conduct <https://github.com/adafruit/Adafruit_CircuitPython_WM8960/blob/HEAD/CODE_OF_CONDUCT.md>`_ before contributing to help this project stay welcoming.
1 change: 1 addition & 0 deletions README.rst.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
SPDX-FileCopyrightText: Copyright (c) 2023 Scott Shawcroft for Adafruit Industries
SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
SPDX-License-Identifier: MIT
68 changes: 0 additions & 68 deletions adafruit_wm8960.py

This file was deleted.

Loading

0 comments on commit bba4f61

Please sign in to comment.