Skip to content

Commit 6d85e9b

Browse files
authored
Merge pull request #112 from todbot/main
Support ATtiny1616 and ATtiny816 boards
2 parents 276028d + 1221dbb commit 6d85e9b

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

adafruit_seesaw/attinyx16.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-FileCopyrightText: 2017 Dean Miller for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
# pylint: disable=missing-docstring,invalid-name,too-many-public-methods,too-few-public-methods
6+
"""
7+
`adafruit_seesaw.attinyx16` - Pin definition for Adafruit ATtinyx16 Breakout with seesaw
8+
==================================================================================
9+
"""
10+
11+
__version__ = "0.0.0+auto.0"
12+
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_seesaw.git"
13+
14+
15+
class ATtinyx16_Pinmap:
16+
"""This class is automatically used by `adafruit_seesaw.seesaw.Seesaw` when
17+
a ATtinyx16 Breakout (PID 5690, PID 5681) is detected.
18+
19+
It is also a reference for the capabilities of each pin."""
20+
21+
"""The pins capable of analog output"""
22+
analog_pins = (0, 1, 2, 3, 4, 5, 14, 15, 16)
23+
24+
"""The effective bit resolution of the PWM pins"""
25+
pwm_width = 16 # we dont actually use all 16 bits but whatever
26+
27+
"""The pins capable of PWM output"""
28+
pwm_pins = (0, 1, 7, 11, 16)
29+
30+
"""No pins on this board are capable of touch input"""
31+
touch_pins = ()

adafruit_seesaw/seesaw.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ def const(x):
117117
# TODO: update when we get real PID
118118
_CRICKIT_PID = const(9999)
119119
_ROBOHATMM1_PID = const(9998)
120+
_5690_PID = const(5690)
121+
_5681_PID = const(5681)
120122

121123

122124
class Seesaw:
@@ -161,6 +163,10 @@ def __init__(self, i2c_bus, addr=0x49, drdy=None, reset=True):
161163
from adafruit_seesaw.robohat import MM1_Pinmap
162164

163165
self.pin_mapping = MM1_Pinmap
166+
elif pid in (_5690_PID, _5681_PID):
167+
from adafruit_seesaw.attinyx16 import ATtinyx16_Pinmap
168+
169+
self.pin_mapping = ATtinyx16_Pinmap
164170
elif self.chip_id == _SAMD09_HW_ID_CODE:
165171
from adafruit_seesaw.samd09 import SAMD09_Pinmap
166172

0 commit comments

Comments
 (0)