Skip to content

Commit 5947fb9

Browse files
committed
added robohatmm1 board to seesaw library
1 parent 1d12cfc commit 5947fb9

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

adafruit_seesaw/robohat.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2019 wallarug for Robotics Masters
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.
22+
# pylint: disable=missing-docstring,invalid-name,too-many-public-methods,too-few-public-methods
23+
24+
from micropython import const
25+
26+
__version__ = "0.0.0-auto.0"
27+
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_seesaw.git"
28+
29+
30+
# The ordering here reflects the seesaw firmware (mm1_hat) pinmap for Robo HAT MM1,
31+
# not logical ordering of the HAT terminals.
32+
33+
_MM1_D0 = const(55) # (RX to RPI_TX)
34+
_MM1_D1 = const(54) # (TX to RPI_RX)
35+
_MM1_D2 = const(34) # ADC (GPS_TX)
36+
_MM1_D3 = const(35) # ADC (GPS_RX)
37+
_MM1_D4 = const(0) # (GPS_SDA)
38+
_MM1_D5 = const(1) # (GPS_SCL)
39+
_MM1_D6 = const(28) # (POWER_ENABLE)
40+
_MM1_D7 = const(2) # (BATTERY)
41+
_MM1_D8 = const(20) # (NEOPIXEL)
42+
_MM1_D9 = const(43) # PWM (SPI_SCK)
43+
_MM1_D10 = const(41) # PWM (SPI_SS)
44+
_MM1_D11 = const(42) # PWM (SPI_MOSI)
45+
_MM1_D12 = const(40) # PWM (SPI_MISO)
46+
_MM1_D13 = const(21) # LED
47+
_MM1_D14 = const(3) # (POWER_OFF)
48+
49+
_MM1_SERVO8 = const(8)
50+
_MM1_SERVO7 = const(9)
51+
_MM1_SERVO6 = const(10)
52+
_MM1_SERVO5 = const(11)
53+
_MM1_SERVO4 = const(19)
54+
_MM1_SERVO3 = const(18)
55+
_MM1_SERVO2 = const(17)
56+
_MM1_SERVO1 = const(16)
57+
58+
_MM1_RCH1 = const(7)
59+
_MM1_RCH2 = const(6)
60+
_MM1_RCH3 = const(5)
61+
_MM1_RCH4 = const(4)
62+
63+
64+
# seesaw firmware has indexed lists of pins by function.
65+
# These "pin" numbers map to real PAxx, PBxx pins on the board implementing seesaaw
66+
# They may or may not match.
67+
# See seesaw/include/SeesawConfig.h and seesaw/boards/robohatmm1/board_config.h for the pin choices.
68+
69+
# You must look at both files and combine the defaults in SeesawConfig.h with the
70+
# overrides in robohatmm1/board_config.h.
71+
# PA<nn> pins are nn
72+
# PB<nn> pins are 32+nn
73+
74+
class MM1_Pinmap:
75+
# seesaw firmware (mm1_hat) analog pin map:
76+
# analog[0]:47 analog[1]:48 analog[2]: analog[3]:
77+
# analog[4]: analog[5]: analog[6]: analog[7]:
78+
#
79+
analog_pins = (_MM1_SIGNAL3, _MM1_SIGNAL2)
80+
81+
pwm_width = 16
82+
83+
# seesaw firmware (mm1_hat) pwm pin map:
84+
# pwm[0]: pwm[1]: pwm[2]: pwm[3]: pwm[4]: pwm[5]:
85+
# pwm[6]: pwm[7]: pwm[8]: pwm[9]: pwm[10]: pwm[11]:
86+
#
87+
pwm_pins = (_MM1_SERVO1, _MM1_SERVO2, _MM1_SERVO3, _MM1_SERVO4,
88+
_MM1_SERVO5, _MM1_SERVO6, _MM1_SERVO7, _MM1_SERVO8,
89+
_MM1_SIGNAL12, _MM1_SIGNAL10, _MM1_SIGNAL11, _MM1_SIGNAL9)
90+
91+
# seesaw firmware touch pin map:
92+
# touch[0]: 7 touch[1]: 6 touch[2]: 5 touch[3]: 4
93+
touch_pins = (_MM1_RCH1, _MM1_RCH2, _MM1_RCH3, _MM1_RCH4)

0 commit comments

Comments
 (0)