Skip to content

Commit 2531c23

Browse files
authored
Merge pull request #23 from adafruit/REUSE
Ran pre-commit, added licenses
2 parents c75b00e + bfa973b commit 2531c23

18 files changed

+454
-57
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
*.mpy
26
.idea
37
__pycache__
@@ -8,4 +12,4 @@ bundles
812
*.DS_Store
913
.eggs
1014
dist
11-
**/*.egg-info
15+
**/*.egg-info

.pylintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
[MASTER]
26

37
# A comma-separated list of package or module names from where C extensions may

.readthedocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
python:
26
version: 3
37
requirements_file: requirements.txt

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
3+
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
4+
SPDX-License-Identifier: CC-BY-4.0
5+
-->
6+
17
# Adafruit Community Code of Conduct
28

39
## Our Pledge
@@ -43,7 +49,7 @@ Examples of unacceptable behavior by participants include:
4349

4450
The goal of the standards and moderation guidelines outlined here is to build
4551
and maintain a respectful community. We ask that you don’t just aim to be
46-
"technically unimpeachable", but rather try to be your best self.
52+
"technically unimpeachable", but rather try to be your best self.
4753

4854
We value many things beyond technical expertise, including collaboration and
4955
supporting others within our community. Providing a positive experience for
@@ -74,9 +80,9 @@ You may report in the following ways:
7480
In any situation, you may send an email to <[email protected]>.
7581

7682
On the Adafruit Discord, you may send an open message from any channel
77-
to all Community Moderators by tagging @community moderators. You may
78-
also send an open message from any channel, or a direct message to
79-
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
83+
to all Community Moderators by tagging @community moderators. You may
84+
also send an open message from any channel, or a direct message to
85+
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
8086
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
8187

8288
Email and direct message reports will be kept confidential.

LICENSES/CC-BY-4.0.txt

Lines changed: 324 additions & 0 deletions
Large diffs are not rendered by default.

LICENSES/MIT.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License Copyright (c) <year> <copyright holders>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice (including the next
11+
paragraph) shall be included in all copies or substantial portions of the
12+
Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSES/Unlicense.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
4+
this software, either in source code form or as a compiled binary, for any
5+
purpose, commercial or non-commercial, and by any means.
6+
7+
In jurisdictions that recognize copyright laws, the author or authors of this
8+
software dedicate any and all copyright interest in the software to the public
9+
domain. We make this dedication for the benefit of the public at large and
10+
to the detriment of our heirs and successors. We intend this dedication to
11+
be an overt act of relinquishment in perpetuity of all present and future
12+
rights to this software under copyright law.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
19+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
20+
please refer to <https://unlicense.org/>

README.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
3+
SPDX-License-Identifier: MIT

adafruit_fram.py

Lines changed: 35 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
# The MIT License (MIT)
1+
# SPDX-FileCopyrightText: 2018 Michael Schroeder for Adafruit Industries
22
#
3-
# Copyright (c) 2018 Michael Schroeder
4-
#
5-
# Permission is hereby granted, free of charge, to any person obtaining a copy
6-
# of this software and associated documentation files (the "Software"), to deal
7-
# in the Software without restriction, including without limitation the rights
8-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
# copies of the Software, and to permit persons to whom the Software is
10-
# furnished to do so, subject to the following conditions:
11-
#
12-
# The above copyright notice and this permission notice shall be included in
13-
# all copies or substantial portions of the Software.
14-
#
15-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
# THE SOFTWARE.
3+
# SPDX-License-Identifier: MIT
4+
225
"""
236
`adafruit_fram`
247
====================================================
@@ -88,9 +71,9 @@ def __init__(self, max_size, write_protect=False, wp_pin=None):
8871

8972
@property
9073
def write_wraparound(self):
91-
""" Determines if sequential writes will wrapaound highest memory address
92-
(``len(FRAM) - 1``) address. If ``False``, and a requested write will
93-
extend beyond the maximum size, an exception is raised.
74+
"""Determines if sequential writes will wrapaound highest memory address
75+
(``len(FRAM) - 1``) address. If ``False``, and a requested write will
76+
extend beyond the maximum size, an exception is raised.
9477
"""
9578
return self._wraparound
9679

@@ -102,44 +85,44 @@ def write_wraparound(self, value):
10285

10386
@property
10487
def write_protected(self):
105-
""" The status of write protection. Default value on initialization is
106-
``False``.
88+
"""The status of write protection. Default value on initialization is
89+
``False``.
10790
108-
When a ``WP`` pin is supplied during initialization, or using
109-
``write_protect_pin``, the status is tied to that pin and enables
110-
hardware-level protection.
91+
When a ``WP`` pin is supplied during initialization, or using
92+
``write_protect_pin``, the status is tied to that pin and enables
93+
hardware-level protection.
11194
112-
When no ``WP`` pin is supplied, protection is only at the software
113-
level in this library.
95+
When no ``WP`` pin is supplied, protection is only at the software
96+
level in this library.
11497
"""
11598
return self._wp if self._wp_pin is None else self._wp_pin.value
11699

117100
def __len__(self):
118-
""" The size of the current FRAM chip. This is one more than the highest
119-
address location that can be read or written to.
101+
"""The size of the current FRAM chip. This is one more than the highest
102+
address location that can be read or written to.
120103
121-
.. code-block:: python
104+
.. code-block:: python
122105
123-
fram = adafruit_fram.FRAM_xxx() # xxx = 'I2C' or 'SPI'
106+
fram = adafruit_fram.FRAM_xxx() # xxx = 'I2C' or 'SPI'
124107
125-
# size returned by len()
126-
len(fram)
108+
# size returned by len()
109+
len(fram)
127110
128-
# can be used with range
129-
for i in range(0, len(fram))
111+
# can be used with range
112+
for i in range(0, len(fram))
130113
"""
131114
return self._max_size
132115

133116
def __getitem__(self, address):
134-
""" Read the value at the given index, or values in a slice.
117+
"""Read the value at the given index, or values in a slice.
135118
136-
.. code-block:: python
119+
.. code-block:: python
137120
138-
# read single index
139-
fram[0]
121+
# read single index
122+
fram[0]
140123
141-
# read values 0 thru 9 with a slice
142-
fram[0:9]
124+
# read values 0 thru 9 with a slice
125+
fram[0:9]
143126
"""
144127
if isinstance(address, int):
145128
if not 0 <= address < self._max_size:
@@ -172,15 +155,15 @@ def __getitem__(self, address):
172155
return read_buffer
173156

174157
def __setitem__(self, address, value):
175-
""" Write the value at the given starting index.
158+
"""Write the value at the given starting index.
176159
177-
.. code-block:: python
160+
.. code-block:: python
178161
179-
# write single index
180-
fram[0] = 1
162+
# write single index
163+
fram[0] = 1
181164
182-
# write values 0 thru 4 with a list
183-
fram[0] = [0,1,2,3]
165+
# write values 0 thru 4 with a list
166+
fram[0] = [0,1,2,3]
184167
"""
185168
if self.write_protected:
186169
raise RuntimeError("FRAM currently write protected.")
@@ -212,7 +195,7 @@ def _write(self, start_address, data, wraparound):
212195

213196

214197
class FRAM_I2C(FRAM):
215-
""" I2C class for FRAM.
198+
"""I2C class for FRAM.
216199
217200
:param: ~busio.I2C i2c_bus: The I2C bus the FRAM is connected to.
218201
:param: int address: I2C address of FRAM. Default address is ``0x50``.
@@ -291,7 +274,7 @@ def write_protected(self, value):
291274

292275

293276
class FRAM_SPI(FRAM):
294-
""" SPI class for FRAM.
277+
"""SPI class for FRAM.
295278
296279
:param: ~busio.SPI spi_bus: The SPI bus the FRAM is connected to.
297280
:param: ~digitalio.DigitalInOut spi_cs: The SPI CS pin.

docs/_static/favicon.ico.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries
2+
3+
SPDX-License-Identifier: CC-BY-4.0

docs/api.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# -*- coding: utf-8 -*-
22

3+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
4+
#
5+
# SPDX-License-Identifier: MIT
6+
37
import os
48
import sys
59

docs/examples.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/index.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

examples/fram_i2c_simpletest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
## Simple Example For CircuitPython/Python I2C FRAM Library
25

36
import board

examples/fram_spi_simpletest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
## Simple Example For CircuitPython/Python SPI FRAM Library
25

36
import board

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
Adafruit-Blinka
26
adafruit-circuitpython-busdevice

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""A setuptools based setup module.
26
37
See:

0 commit comments

Comments
 (0)