Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Merge pull request #4 from dglaude/patch-2
Browse files Browse the repository at this point in the history
Add support for FeatherS2 by Unexpected Maker
  • Loading branch information
Gadgetoid authored Jan 11, 2021
2 parents de2d3b7 + 37f1566 commit 2337001
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pin16.value = True
* M4 Express
* M0 Express
* nRF52840 Express
* Feather STM32F405 Express
* Feather S2

## Untested but should work
* Adafruit Feather M0 Adalogger
Expand Down
4 changes: 3 additions & 1 deletion library/pimoroni_physical_feather_pins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def pin28():
'Adafruit Feather M0 RFM9x with samd21g18' : "m0",

'Feather STM32F405 Express with STM32F405RG' : "stm32",

'FeatherS2 with ESP32S2' : "feathers2",
}

#m4.init(globals())
Expand All @@ -52,4 +54,4 @@ def pin28():
mod.init(globals())
#_case[_machine].init(globals())
except KeyError:
raise NotImplementedError("Sorry, '{}' is not supported currently".format(_machine))
raise NotImplementedError("Sorry, '{}' is not supported currently".format(_machine))
76 changes: 76 additions & 0 deletions library/pimoroni_physical_feather_pins/feathers2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
from . import pin_error
#import board
import microcontroller

def pin3():
return microcontroller.pin.GPIO0

def pin5():
return microcontroller.pin.GPIO17

def pin6():
return microcontroller.pin.GPIO18

def pin7():
return microcontroller.pin.GPIO13

def pin8():
return microcontroller.pin.GPIO12

def pin9():
return microcontroller.pin.GPIO6

def pin10():
return microcontroller.pin.GPIO5

def pin11():
return microcontroller.pin.GPIO36

def pin12():
return microcontroller.pin.GPIO35

def pin13():
return microcontroller.pin.GPIO37

def pin14():
return microcontroller.pin.GPIO44

def pin15():
return microcontroller.pin.GPIO43

def pin16():
# This is 3V3 LDO 2 OUTPUT
raise NotImplementedError

def pin17():
return microcontroller.pin.GPIO8

def pin18():
return microcontroller.pin.GPIO9

def pin19():
return microcontroller.pin.GPIO33

def pin20():
return microcontroller.pin.GPIO38

def pin21():
return microcontroller.pin.GPIO1

def pin22():
return microcontroller.pin.GPIO3

def pin23():
return microcontroller.pin.GPIO7

def pin24():
return microcontroller.pin.GPIO10

def pin25():
return microcontroller.pin.GPIO11

def init(scope):
"""Pull the pin definitions into the main module namespace"""
for key in globals().keys():
if key.startswith('pin'):
scope[key] = globals()[key]

0 comments on commit 2337001

Please sign in to comment.