Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice

This commit is contained in:
sommersoft 2019-07-31 16:44:43 -05:00
commit 9939d0c4f4
652 changed files with 66125 additions and 7800 deletions

5
.gitignore vendored
View File

@ -12,6 +12,8 @@
# Packages # Packages
############ ############
dist/
*.egg-info
# Logs and Databases # Logs and Databases
###################### ######################
@ -25,6 +27,7 @@
###################### ######################
build/ build/
bin/ bin/
circuitpython-stubs/
# Test failure outputs # Test failure outputs
###################### ######################
@ -66,3 +69,5 @@ TAGS
# POEdit mo files # POEdit mo files
#################### ####################
*.mo *.mo
.vscode

9
.gitmodules vendored
View File

@ -5,9 +5,6 @@
[submodule "lib/libffi"] [submodule "lib/libffi"]
path = lib/libffi path = lib/libffi
url = https://github.com/atgreen/libffi url = https://github.com/atgreen/libffi
[submodule "lib/lwip"]
path = lib/lwip
url = https://git.savannah.gnu.org/r/lwip.git
[submodule "lib/berkeley-db-1.xx"] [submodule "lib/berkeley-db-1.xx"]
path = lib/berkeley-db-1.xx path = lib/berkeley-db-1.xx
url = https://github.com/pfalcon/berkeley-db-1.xx url = https://github.com/pfalcon/berkeley-db-1.xx
@ -95,3 +92,9 @@
[submodule "frozen/pew-pewpew-standalone-10.x"] [submodule "frozen/pew-pewpew-standalone-10.x"]
path = frozen/pew-pewpew-standalone-10.x path = frozen/pew-pewpew-standalone-10.x
url = https://github.com/pewpew-game/pew-pewpew-standalone-10.x.git url = https://github.com/pewpew-game/pew-pewpew-standalone-10.x.git
[submodule "frozen/circuitpython-stage"]
path = frozen/circuitpython-stage
url = https://github.com/python-ugame/circuitpython-stage.git
[submodule "ports/stm32f4/stm32f4"]
path = ports/stm32f4/stm32f4
url = https://github.com/adafruit/stm32f4.git

View File

@ -1,2 +1,10 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
python: python:
version: 3 version: 3
install:
- requirements: docs/requirements.txt

View File

@ -21,11 +21,11 @@ git:
# that SDK is shortest and add it there. In the case of major re-organizations, # that SDK is shortest and add it there. In the case of major re-organizations,
# just try to make the builds "about equal in run time" # just try to make the builds "about equal in run time"
env: env:
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini" TRAVIS_SDK=arm:nrf - TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="trinket_m0_haxpress circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr electronut_labs_blip" TRAVIS_SDK=arm:nrf
- TRAVIS_BOARDS="metro_m0_express metro_m4_express pirkey_m0 trellis_m4_express trinket_m0 sparkfun_lumidrive sparkfun_redboard_turbo" TRAVIS_SDK=arm - TRAVIS_BOARDS="metro_m0_express metro_m4_express metro_m4_airlift_lite pirkey_m0 trellis_m4_express trinket_m0 sparkfun_lumidrive sparkfun_redboard_turbo bast_pro_mini_m0 datum_distance pyruler" TRAVIS_SDK=arm
- TRAVIS_BOARDS="feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32" TRAVIS_SDK=arm - TRAVIS_BOARDS="cp32-m4 feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32 uchip escornabot_makech pygamer_advance datum_imu" TRAVIS_SDK=arm
- TRAVIS_BOARDS="feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero" TRAVIS_SDK=arm - TRAVIS_BOARDS="feather_m0_supersized feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite ugame10 robohatmm1_m0 robohatmm1_m4 datum_light" TRAVIS_SDK=arm
- TRAVIS_BOARDS="circuitplayground_express_crickit feather_m0_adalogger feather_m0_basic feather_m0_express catwan_usbstick pyportal sparkfun_samd21_mini sparkfun_samd21_dev" TRAVIS_SDK=arm - TRAVIS_BOARDS="datalore_ip_m4 circuitplayground_express_crickit feather_m0_adalogger feather_m0_basic feather_m0_express catwan_usbstick pyportal sparkfun_samd21_mini sparkfun_samd21_dev pybadge pybadge_airlift datum_weather" TRAVIS_SDK=arm
addons: addons:
artifacts: artifacts:
@ -33,6 +33,16 @@ addons:
- $(ls -d1 bin/*/*/* | tr "\n" ":") - $(ls -d1 bin/*/*/* | tr "\n" ":")
target_paths: / target_paths: /
# Some deploy jobs take over 10 minutes so use this keep alive hack to make sure Travis doesn't kill us.
before_deploy: |
function keep_alive() {
while true; do
echo -en "\a"
sleep 5
done
}
keep_alive &
deploy: deploy:
provider: releases provider: releases
api_key: api_key:
@ -61,7 +71,6 @@ before_script:
- function var_search () { case "$1" in *$2*) true;; *) false;; esac; } - function var_search () { case "$1" in *$2*) true;; *) false;; esac; }
- sudo dpkg --add-architecture i386 - sudo dpkg --add-architecture i386
- (! var_search "${TRAVIS_SDK-}" arm || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~xenial1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb)) - (! var_search "${TRAVIS_SDK-}" arm || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~xenial1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
# For huzzah builds # For huzzah builds
@ -70,11 +79,16 @@ before_script:
# For coverage testing (upgrade is used to get latest urllib3 version) # For coverage testing (upgrade is used to get latest urllib3 version)
- sudo apt-get install -y python3-pip - sudo apt-get install -y python3-pip
- pip3 install --user sh click - pip3 install --user sh click setuptools
- ([[ -z "$TRAVIS_TESTS" ]] || sudo pip install --upgrade cpp-coveralls) - ([[ -z "$TRAVIS_TESTS" ]] || sudo pip install --upgrade cpp-coveralls)
- (! var_search "${TRAVIS_TESTS-}" docs || pip install --user Sphinx sphinx-rtd-theme recommonmark) - (! var_search "${TRAVIS_TESTS-}" docs || sudo apt-get install -y librsvg2-bin)
- (! var_search "${TRAVIS_TESTS-}" docs || pip3 install --user Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter)
- (! var_search "${TRAVIS_TESTS-}" translations || pip3 install --user polib) - (! var_search "${TRAVIS_TESTS-}" translations || pip3 install --user polib)
# Check if there's any board missing in TRAVIS_BOARDS
- cd tools && python3 -u travis_new_boards_check.py
- cd ..
# report some good version numbers to the build # report some good version numbers to the build
- gcc --version - gcc --version
- (! var_search "${TRAVIS_SDK-}" arm || arm-none-eabi-gcc --version) - (! var_search "${TRAVIS_SDK-}" arm || arm-none-eabi-gcc --version)

View File

@ -14,7 +14,15 @@ If you have an employment contract with your employer please make sure that they
don't automatically own your work product. Make sure to get any necessary approvals don't automatically own your work product. Make sure to get any necessary approvals
before contributing. Another term for this contribution off-hours is moonlighting. before contributing. Another term for this contribution off-hours is moonlighting.
## Getting started ## Ways to contribute
As CircuitPython grows, there are more and more ways to contribute. Here are some ideas:
* Build a project with CircuitPython and share how to do it online.
* Test the latest libraries and CircuitPython versions with your projects and file issues for any bugs you find.
* Contribute Python code to CircuitPython libraries that support new devices or features of an existing device.
* Contribute C code to CircuitPython which fixes an open issue or adds a new feature.
## Getting started with C
CircuitPython developer Dan Halbert (@dhalbert) has written up build instructions using native build CircuitPython developer Dan Halbert (@dhalbert) has written up build instructions using native build
tools [here](https://learn.adafruit.com/building-circuitpython). tools [here](https://learn.adafruit.com/building-circuitpython).

View File

@ -1,4 +1,4 @@
# Makefile for Sphinx documentation # Top-level Makefile for documentation builds and miscellaneous tasks.
# #
# You can set these variables from the command line. # You can set these variables from the command line.
@ -17,6 +17,13 @@ CONFDIR = .
FORCE = -E FORCE = -E
VERBOSE = -v VERBOSE = -v
# path to generated type stubs
STUBDIR = circuitpython-stubs
# Run "make VALIDATE= stubs" to avoid validating generated stub files
VALIDATE = -v
# path to pypi source distributions
DISTDIR = dist
# Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the # Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the
# full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the # full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the
# executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) # executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
@ -29,7 +36,9 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(BASEOPTS)
# the i18n builder cannot share the environment and doctrees with the others # the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(BASEOPTS) I18NSPHINXOPTS = $(BASEOPTS)
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/nrf py shared-bindings shared-module supervisor
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext stubs
help: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"
@ -58,6 +67,7 @@ help:
clean: clean:
rm -rf $(BUILDDIR)/* rm -rf $(BUILDDIR)/*
rm -rf $(STUBDIR) $(DISTDIR) *.egg-info
html: html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@ -194,10 +204,18 @@ pseudoxml:
all-source: all-source:
locale/circuitpython.pot: all-source locale/circuitpython.pot: all-source
find . -iname "*.c" | xargs xgettext -L C -s --no-location --keyword=translate -o circuitpython.pot -p locale find $(TRANSLATE_SOURCES) -iname "*.c" -print0 | (LC_ALL=C sort -z) | xargs -0 xgettext -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale
translate: locale/circuitpython.pot translate: locale/circuitpython.pot
for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --no-location locale/circuitpython.pot; done for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done
check-translate: locale/circuitpython.pot $(wildcard locale/*.po) check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
$(PYTHON) tools/check_translations.py $^ $(PYTHON) tools/check_translations.py $^
stubs:
rst2pyi $(VALIDATE) shared-bindings/ $(STUBDIR)
python setup.py sdist
update-frozen-libraries:
@echo "Updating all frozen libraries to latest tagged version."
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done

View File

@ -1,94 +1,46 @@
Adafruit CircuitPython CircuitPython
====================== =============
.. image:: https://github.com/adafruit/circuitpython/blob/master/logo/CircuitPython_Repo_header_logo.png .. image:: https://s3.amazonaws.com/adafruit-circuit-python/CircuitPython_Repo_header_logo.png
|Build Status| |Doc Status| |License| |Discord| |Build Status| |Doc Status| |License| |Discord|
`Status <#status>`__ \| `Supported Boards <#supported-boards>`__ `circuitpython.org <https://circuitpython.org>`__ \| `Get CircuitPython <#get-circuitpython>`__ \|
\| `Download <#download>`__ \| `Documentation <#documentation>`__ \| `Contributing <#contributing>`__ \|
`Documentation <#documentation>`__ \| `Branding <#branding>`__ \| `Differences from Micropython <#differences-from-micropython>`__ \|
`Contributing <#contributing>`__ \| `Differences from `Project Structure <#project-structure>`__
Micropython <#differences-from-micropython>`__ \| `Project
Structure <#project-structure>`__
**CircuitPython** is an *education friendly* open source derivative of **CircuitPython** is a *beginner friendly*, open source version of Python for tiny, inexpensive
`MicroPython <https://micropython.org>`_. CircuitPython supports use computers called microcontrollers. Microcontrollers are the brains of many electronics including a
on educational development boards designed and sold by wide variety of development boards used to build hobby projects and prototypes. CircuitPython in
`Adafruit <https://adafruit.com>`_. Adafruit CircuitPython features electronics is one of the best ways to learn to code because it connects code to reality. Simply
unified Python core APIs and a growing list of Adafruit libraries and install CircuitPython on a supported board via drag and drop and then edit a ``code.py`` file on
drivers of that work with it. the CIRCUITPY drive. The code will automatically reload. No software installs are needed besides a
text editor (we recommend `Mu <https://codewith.mu/>`_ for beginners.)
Status CircuitPython features unified Python core APIs and a growing list of 150+ device libraries and
------ drivers that work with it. These libraries also work on single board computers with regular
Python via the `Adafruit Blinka Library <https://github.com/adafruit/Adafruit_Blinka>`_.
This project is stable. Most APIs should be stable going forward. Those CircuitPython is based on `MicroPython <https://micropython.org>`_. See
that change will change on major version numbers such as 2.0.0 and `below <#differences-from-micropython>`_ for differences. CircuitPython development is sponsored by
3.0.0. `Adafruit <https://adafruit.com>`_ and is available on their educational development boards. Please
support both MicroPython and Adafruit.
Supported Boards Get CircuitPython
---------------- ------------------
Designed for CircuitPython Official binaries for all supported boards are available through
~~~~~~~~~~~~~~~~~~~~~~~~~~ `circuitpython.org/downloads <https://circuitpython.org/downloads>`_. The site includes stable, unstable and
continuous builds. Full release notes and assets are available through
**M0 Boards** `GitHub releases <https://github.com/adafruit/circuitpython/releases>`_ as well.
- `Adafruit CircuitPlayground Express <https://www.adafruit.com/product/3333>`__ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart>`__)
- `Adafruit Feather M0 Express <https://www.adafruit.com/product/3403>`__ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython/kattni-circuitpython>`__)
- `Adafruit Gemma M0 <https://www.adafruit.com/product/3501>`__ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-gemma-m0/circuitpython>`__)
- `Adafruit Hallowing M0 Express <https://www.adafruit.com/product/3900>`__ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-hallowing/circuitpython>`__)
- `Adafruit ItsyBitsy M0 Express <https://www.adafruit.com/product/3727>`_ (`CircuitPython Guide <https://learn.adafruit.com/introducing-itsy-bitsy-m0/circuitpython>`__)
- `Adafruit Metro M0 Express <https://www.adafruit.com/product/3505>`_ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-metro-m0-express-designed-for-circuitpython/circuitpython>`__)
- `Adafruit Trinket M0 <https://www.adafruit.com/product/3500>`__ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/circuitpython>`__)
**M4 Boards**
- `Adafruit Feather M4 Express <https://www.adafruit.com/product/3857>`__ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/circuitpython>`__)
- `Adafruit ItsyBitsy M4 Express <https://www.adafruit.com/product/3800>`__ (`CircuitPython Guide <https://learn.adafruit.com/introducing-adafruit-itsybitsy-m4/circuitpython>`__)
- `Adafruit Metro M4 Express <https://www.adafruit.com/product/3382>`__ (`CircuitPython Guide <https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51/circuitpython>`__)
Other
~~~~~
- `Adafruit Feather HUZZAH <https://www.adafruit.com/products/2821>`__
- `Adafruit Feather M0
Basic <https://www.adafruit.com/products/2772>`__
- `Adafruit Feather M0 Bluefruit
LE <https://www.adafruit.com/products/2995>`__ (uses M0 Basic
binaries)
- `Adafruit Feather M0
Adalogger <https://www.adafruit.com/product/2796>`__ (MicroSD card
supported using the `Adafruit CircuitPython SD
library <https://github.com/adafruit/Adafruit_CircuitPython_SD>`__)
- `Arduino Zero <https://www.arduino.cc/en/Main/ArduinoBoardZero>`__
- `Arduino MKR Zero <https://store.arduino.cc/arduino-mkrzero>`__ (MicroSD card
supported using the `Adafruit CircuitPython SD
library <https://github.com/adafruit/Adafruit_CircuitPython_SD>`__)
"Third-party" or "non-Adafruit" boards
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- `Electronic Cats Meow Meow <https://electroniccats.com/gomeow/>`__
- `Electronic Cats CatWAN USB Stick <https://electroniccats.com/producto/catwan_usb_stick/>`__
Download
--------
Official binaries are available through the `latest GitHub
releases <https://github.com/adafruit/circuitpython/releases>`__.
Continuous (one per commit) builds are available
`here <https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin>`__
and includes experimental hardware support.
Documentation Documentation
------------- -------------
Guides and videos are available through the `Adafruit Learning Guides and videos are available through the `Adafruit Learning
System <https://learn.adafruit.com/>`__ under the `CircuitPython System <https://learn.adafruit.com/>`__ under the `CircuitPython
category <https://learn.adafruit.com/category/circuitpython>`__ and category <https://learn.adafruit.com/category/circuitpython>`__. An API
`MicroPython
category <https://learn.adafruit.com/category/micropython>`__. An API
reference is also available on `Read the Docs reference is also available on `Read the Docs
<http://circuitpython.readthedocs.io/en/latest/?>`__. A collection of awesome <http://circuitpython.readthedocs.io/en/latest/?>`__. A collection of awesome
resources can be found at `Awesome CircuitPython <https://github.com/adafruit/awesome-circuitpython>`__. resources can be found at `Awesome CircuitPython <https://github.com/adafruit/awesome-circuitpython>`__.
@ -111,7 +63,29 @@ Contributors who follow the `Code of
Conduct <https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md>`__ Conduct <https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md>`__
are welcome to submit pull requests and they will be promptly reviewed are welcome to submit pull requests and they will be promptly reviewed
by project admins. Please join the by project admins. Please join the
`Discord <https://discord.gg/nBQh6qu>`__ too. `Discord <https://adafru.it/discord>`__ too.
Branding
------------
While we are happy to see CircuitPython forked and modified, we'd appreciate it if forked releases
not use the name "CircuitPython" or the Blinka logo. "CircuitPython" means something special to
us and those who learn about it. As a result, we'd like to make sure products referring to it meet a
common set of requirements.
If you'd like to use the term "CircuitPython" and Blinka for your product here is what we ask:
* Your product is supported by the primary
`"adafruit/circuitpython" <https://github.com/adafruit/circuitpython>`_ repo. This way we can
update any custom code as we update the CircuitPython internals.
* Your product is listed on `circuitpython.org <https:/circuitpython.org>`__ (source
`here <https://github.com/adafruit/circuitpython-org/>`_). This is to ensure that a user of your
product can always download the latest version of CircuitPython from the standard place.
* Your product has a user accessible USB plug which appears as a CIRCUITPY drive when plugged in.
If you choose not to meet these requirements, then we ask you call your version of CircuitPython
something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is
"CircuitPython-compatible" if most CircuitPython drivers will work with it.
-------------- --------------
@ -120,15 +94,14 @@ Differences from `MicroPython <https://github.com/micropython/micropython>`__
CircuitPython: CircuitPython:
- includes a ports for MicroChip SAMD21 (Commonly known as M0 in Adafruit - includes ports for MicroChip SAMD21 (Commonly known as M0 in Adafruit
product names) and SAMD51 (M4). product names) and SAMD51 (M4).
- supports only SAMD21, SAMD51, and ESP8266 ports. An nRF port is under - supports only SAMD21, SAMD51, and nRF52840 ports.
development.
- tracks MicroPython's releases (not master). - tracks MicroPython's releases (not master).
- Longints (arbitrary-length integers) are enabled for most M0 - floats (aka decimals) are enabled for all builds.
Express boards (those boards with SPI flash chips external - error messages are translated into 10+ languages.
to the microcontroller), and for all M4 builds. - does not support concurrency within Python (including interrupts and threading). Some concurrency
Longints are disabled on other boards due to lack of flash space. is achieved with native modules for tasks that require it such as audio file playback.
Behavior Behavior
~~~~~~~~ ~~~~~~~~
@ -142,8 +115,8 @@ Behavior
output is written to ``boot_out.txt``. output is written to ``boot_out.txt``.
- ``code.py`` (or ``main.py``) is run after every reload until it - ``code.py`` (or ``main.py``) is run after every reload until it
finishes or is interrupted. After it is done running, the vm and finishes or is interrupted. After it is done running, the vm and
hardware is reinitialized. **This means you cannot read state from hardware is reinitialized. **This means you cannot read state from**
``code.py`` in the REPL anymore.** CircuitPython's goal for this ``code.py`` **in the REPL anymore.** CircuitPython's goal for this
change includes reduce confusion about pins and memory being used. change includes reduce confusion about pins and memory being used.
- After ``code.py`` the REPL can be entered by pressing any key. It no - After ``code.py`` the REPL can be entered by pressing any key. It no
longer shares state with ``code.py`` so it is a fresh vm. longer shares state with ``code.py`` so it is a fresh vm.
@ -153,12 +126,23 @@ Behavior
causes nasty crashes by making it available through mass storage causes nasty crashes by making it available through mass storage
after the crash. A reset (the button) is needed after its fixed to after the crash. A reset (the button) is needed after its fixed to
get back into normal mode. get back into normal mode.
- RGB status LED indicating CircuitPython state, and errors through a sequence of colored flashes.
- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with
``samd.disable_autoreload()``)
- Entering the REPL after the main code is finished requires a key press which enters the REPL and
disables autoreload.
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,
``main.txt``
- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``,
``boot.txt``
API API
~~~ ~~~
- Unified hardware APIs: `audioio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/audioio/__init__.html>`_, `analogio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/analogio/__init__.html>`_, `bleio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bleio/__init__.html>`_, `busio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/__init__.html>`_, `digitalio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/digitalio/__init__.html>`_, `pulseio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/pulseio/__init__.html>`_, `touchio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/touchio/__init__.html>`_, `microcontroller <https://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/__init__.html>`_, `board <https://circuitpython.readthedocs.io/en/latest/shared-bindings/board/__init__.html>`_, `bitbangio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bitbangio/__init__.html>`_ - Unified hardware APIs. Documented
- No ``machine`` API on Atmel SAMD21 port. `on ReadTheDocs <https://circuitpython.readthedocs.io/en/latest/shared-bindings/index.html>`_.
- API docs are rST within the C files in ``shared-bindings``.
- No ``machine`` API.
Modules Modules
~~~~~~~ ~~~~~~~
@ -178,18 +162,6 @@ Modules
- tick count is available as - tick count is available as
`time.monotonic() <https://circuitpython.readthedocs.io/en/latest/shared-bindings/time/__init__.html#time.monotonic>`__ `time.monotonic() <https://circuitpython.readthedocs.io/en/latest/shared-bindings/time/__init__.html#time.monotonic>`__
atmel-samd21 features
~~~~~~~~~~~~~~~~~~~~~
- RGB status LED
- Auto-reload after file write over mass storage. (Disable with
``samd.disable_autoreload()``)
- Wait state after boot and main run, before REPL.
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,
``main.txt``
- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``,
``boot.txt``
-------------- --------------
Project Structure Project Structure
@ -231,40 +203,14 @@ Ports
Ports include the code unique to a microcontroller line and also Ports include the code unique to a microcontroller line and also
variations based on the board. variations based on the board.
- ``atmel-samd`` Support for SAMD21 based boards such as `Arduino - ``atmel-samd`` Support for SAMD21 and SAMD51 based boards.
Zero <https://www.arduino.cc/en/Main/ArduinoBoardZero>`__, `Adafruit - ``nrf`` Support for the nRF52840 based boards.
Feather M0 Basic <https://www.adafruit.com/products/2772>`__, and - ``unix`` Support for UNIX. Only used for automated testing.
`Adafruit Feather M0 Bluefruit
LE <https://www.adafruit.com/products/2995>`__.
- ``bare-arm`` A bare minimum version of MicroPython for ARM MCUs.
- ``cc3200`` Support for boards based
`CC3200 <http://www.ti.com/product/CC3200>`__ from TI such as the
`WiPy 1.0 <https://www.pycom.io/solutions/py-boards/wipy1/>`__.
- ``esp8266`` Support for boards based on ESP8266 WiFi modules such as
the `Adafruit Feather
HUZZAH <https://www.adafruit.com/products/2821>`__.
- ``minimal`` A minimal MicroPython port. Start with this if you want
to port MicroPython to another microcontroller.
- ``pic16bit`` Support for 16-bit PIC microcontrollers.
- ``qemu-arm`` Support for ARM emulation through
`QEMU <https://qemu.org>`__.
- ``stmhal`` Support for boards based on STM32 microcontrollers
including the MicroPython flagship
`PyBoard <https://store.micropython.org/store/#/products/PYBv1_1>`__.
- ``teensy`` Support for the Teensy line of boards such as the `Teensy
3.1 <https://www.pjrc.com/teensy/teensy31.html>`__.
- ``unix`` Support for UNIX.
- ``windows`` Support for
`Windows <https://www.microsoft.com/en-us/windows/>`__.
- ``zephyr`` Support for `Zephyr <https://www.zephyrproject.org/>`__, a
real-time operating system by the Linux Foundation.
CircuitPython only maintains the ``atmel-samd`` and ``esp8266`` ports. The remaining port directories not listed above are in the repo to maintain compatibility with the
The rest are here to maintain compatibility with the `MicroPython <https://github.com/micropython/micropython>`__ parent project.
`MicroPython <https://github.com/micropython/micropython>`__ parent
project.
`back to top <#adafruit-circuitpython>`__ `back to top <#circuitpython>`__
.. |Build Status| image:: https://travis-ci.com/adafruit/circuitpython.svg?branch=master .. |Build Status| image:: https://travis-ci.com/adafruit/circuitpython.svg?branch=master
:target: https://travis-ci.org/adafruit/circuitpython :target: https://travis-ci.org/adafruit/circuitpython
@ -272,5 +218,5 @@ project.
:target: http://circuitpython.readthedocs.io/ :target: http://circuitpython.readthedocs.io/
.. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg .. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg
:target: https://adafru.it/discord :target: https://adafru.it/discord
.. |License| image:: https://github.com/adafruit/circuitpython/blob/master/logo/license-MIT-brightgreen.svg .. |License| image:: https://img.shields.io/badge/License-MIT-brightgreen.svg
:target: https://opensource.org/licenses/MIT :target: https://choosealicense.com/licenses/mit/

26
conf.py
View File

@ -13,6 +13,7 @@
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # serve to show the default.
import json
import sys import sys
import os import os
@ -24,8 +25,20 @@ from recommonmark.parser import CommonMarkParser
sys.path.insert(0, os.path.abspath('docs')) sys.path.insert(0, os.path.abspath('docs'))
sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('.'))
import shared_bindings_matrix
master_doc = 'docs/index' master_doc = 'docs/index'
# Grab the JSON values to use while building the module support matrix
# in 'shared-bindings/index.rst'
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
html_context = {
'support_matrix': modules_support_matrix
}
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
@ -37,9 +50,12 @@ needs_sphinx = '1.3'
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinx.ext.doctest', 'sphinx.ext.doctest',
'sphinxcontrib.rsvgconverter',
'sphinx.ext.intersphinx', 'sphinx.ext.intersphinx',
'sphinx.ext.todo', 'sphinx.ext.todo',
'sphinx.ext.coverage' 'sphinx.ext.coverage',
'rstjinja',
'c2rst'
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
@ -48,8 +64,7 @@ templates_path = ['templates']
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = ['.rst', '.md', '.c', '.h'] source_suffix = ['.rst', '.md', '.c', '.h']
source_parsers = {'.md': CommonMarkParser, source_parsers = {'.md': CommonMarkParser}
'.c': "c2rst.CStrip", '.h': "c2rst.CStrip"}
# The encoding of source files. # The encoding of source files.
#source_encoding = 'utf-8-sig' #source_encoding = 'utf-8-sig'
@ -83,6 +98,7 @@ version = release = '0.0.0'
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
exclude_patterns = ["**/build*", exclude_patterns = ["**/build*",
".git",
".venv", ".venv",
".direnv", ".direnv",
"docs/README.md", "docs/README.md",
@ -120,6 +136,10 @@ exclude_patterns = ["**/build*",
"ports/nrf/nrfx", "ports/nrf/nrfx",
"ports/nrf/peripherals", "ports/nrf/peripherals",
"ports/nrf/usb", "ports/nrf/usb",
"ports/stm32f4/stm32f4",
"ports/stm32f4/peripherals",
"ports/stm32f4/ref",
"ports/stm32f4/README.md",
"ports/pic16bit", "ports/pic16bit",
"ports/qemu-arm", "ports/qemu-arm",
"ports/stm32", "ports/stm32",

View File

@ -1,19 +1,31 @@
import sphinx.parsers def c2rst(app, docname, source):
""" Pre-parse '.c' & '.h' files that contain rST source.
"""
# Make sure we're outputting HTML
if app.builder.format != 'html':
return
class CStrip(sphinx.parsers.Parser): fname = app.env.doc2path(docname)
def __init__(self): if (not fname.endswith(".c") and
self.rst_parser = sphinx.parsers.RSTParser() not fname.endswith(".h")):
#print("skipping:", fname)
return
def parse(self, inputstring, document): src = source[0]
# This setting is missing starting with Sphinx 1.7.1 so we set it ourself.
document.settings.tab_width = 4 stripped = []
document.settings.character_level_inline_markup = False for line in src.split("\n"):
stripped = [] line = line.strip()
for line in inputstring.split("\n"): if line == "//|":
line = line.strip() stripped.append("")
if line == "//|": elif line.startswith("//| "):
stripped.append("") stripped.append(line[len("//| "):])
elif line.startswith("//| "): stripped = "\r\n".join(stripped)
stripped.append(line[len("//| "):])
stripped = "\r\n".join(stripped) rendered = app.builder.templates.render_string(
self.rst_parser.parse(stripped, document) stripped, app.config.html_context
)
source[0] = rendered
def setup(app):
app.connect("source-read", c2rst)

View File

@ -60,6 +60,7 @@ For example, a user can then use ``deinit()```::
import digitalio import digitalio
import board import board
import time
led = digitalio.DigitalInOut(board.D13) led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT led.direction = digitalio.Direction.OUTPUT
@ -79,6 +80,7 @@ Alternatively, using a ``with`` statement ensures that the hardware is deinitial
import digitalio import digitalio
import board import board
import time
with digitalio.DigitalInOut(board.D13) as led: with digitalio.DigitalInOut(board.D13) as led:
led.direction = digitalio.Direction.OUTPUT led.direction = digitalio.Direction.OUTPUT
@ -500,6 +502,8 @@ properties.
+-----------------------+-----------------------+-------------------------------------------------------------------------+ +-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``value`` | int | 16-bit Analog value, unit-less | | ``value`` | int | 16-bit Analog value, unit-less |
+-----------------------+-----------------------+-------------------------------------------------------------------------+ +-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``weight`` | float | grams (g) |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
Adding native modules Adding native modules
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -182,7 +182,7 @@ Exceptions
.. exception:: OSError .. exception:: OSError
|see_cpython| `OSError`. CircuitPython doesn't implement the ``errno`` |see_cpython| :py:class:`cpython:OSError`. CircuitPython doesn't implement the ``errno``
attribute, instead use the standard way to access exception arguments: attribute, instead use the standard way to access exception arguments:
``exc.args[0]``. ``exc.args[0]``.
@ -198,11 +198,11 @@ Exceptions
.. exception:: SystemExit .. exception:: SystemExit
|see_cpython| :py:class:`python:SystemExit`. |see_cpython| :py:class:`cpython:SystemExit`.
.. exception:: TypeError .. exception:: TypeError
|see_cpython| :py:class:`python:TypeError`. |see_cpython| :py:class:`cpython:TypeError`.
.. exception:: ValueError .. exception:: ValueError

View File

@ -5,6 +5,7 @@
.. include:: ../templates/unsupported_in_circuitpython.inc .. include:: ../templates/unsupported_in_circuitpython.inc
.. module:: network .. module:: network
:noindex:
:synopsis: network configuration :synopsis: network configuration
This module provides network drivers and routing configuration. To use this This module provides network drivers and routing configuration. To use this

3
docs/requirements.txt Normal file
View File

@ -0,0 +1,3 @@
sphinx==1.8.5
recommonmark==0.5.0
sphinxcontrib-svg2pdfconverter==0.1.0

24
docs/rstjinja.py Normal file
View File

@ -0,0 +1,24 @@
# Derived from code on Eric Holscher's blog, found at:
# https://www.ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
def rstjinja(app, docname, source):
"""
Render our pages as a jinja template for fancy templating goodness.
"""
# Make sure we're outputting HTML
if app.builder.format != 'html':
return
# we only want our one jinja template to run through this func
if "shared-bindings/support_matrix" not in docname:
return
src = source[0]
print(docname)
rendered = app.builder.templates.render_string(
src, app.config.html_context
)
source[0] = rendered
def setup(app):
app.connect("source-read", rstjinja)

View File

@ -0,0 +1,244 @@
# The MIT License (MIT)
#
# Copyright (c) 2019 Michael Schroeder
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
import json
import os
import re
SUPPORTED_PORTS = ["atmel-samd", "nrf"]
def parse_port_config(contents, chip_keyword=None):
""" Compile a dictionary of port-wide module configs, which may
be categorized by chipset.
"""
chip_fam = "all"
ifeq_found = False
port_config_results = {"all": []}
chip_pattern = ""
if chip_keyword:
chip_pattern = (
re.compile("(?<=ifeq\s\(\$\({}\)\,)(\w+)".format(chip_keyword))
)
for line in contents:
if chip_keyword:
if not ifeq_found:
check_ifeq = chip_pattern.search(line)
if check_ifeq:
ifeq_found = True
chip_fam = check_ifeq.group(1)
#print("found chip:", chip_fam)
else:
ifeq_found = False
chip_fam = "all"
else:
if "endif" in line:
ifeq_found = False
chip_fam = "all"
if "CIRCUITPY_" in line:
if chip_fam in port_config_results:
port_config_results[chip_fam].append(line.rstrip("\n"))
else:
port_config_results[chip_fam] = [line.rstrip("\n")]
#print(port_config_results)
return port_config_results
def get_shared_bindings():
""" Get a list of modules in shared-bindings based on folder names
"""
return [item for item in os.listdir("./shared-bindings")]
def read_mpconfig():
""" Open 'circuitpy_mpconfig.mk' and return the contents.
"""
configs = []
with open("py/circuitpy_mpconfig.mk") as mpconfig:
configs = mpconfig.read()
return configs
def build_module_map():
""" Establish the base of the JSON file, based on the contents from
`configs`. Base will contain module names, if they're part of
the `FULL_BUILD`, or their default value (0 | 1).
"""
base = dict()
modules = get_shared_bindings()
configs = read_mpconfig()
full_build = False
for module in modules:
full_name = module
search_name = module.lstrip("_")
re_pattern = "CIRCUITPY_{}\s=\s(.+)".format(search_name.upper())
find_config = re.search(re_pattern, configs)
#print(module, "|", find_config)
if not find_config:
continue
full_build = int("FULL_BUILD" in find_config.group(0))
#print(find_config[1])
if not full_build:
default_val = find_config.group(1)
else:
default_val = "None"
base[search_name] = {
"name": full_name,
"full_build": str(full_build),
"default_value": default_val,
"excluded": {}
}
return base
def get_excluded_boards(base):
""" Cycles through each board's `mpconfigboard.mk` file to determine
if each module is included or not. Boards are selected by existence
in a port listed in `SUPPORTED_PORTS` (e.g. `/port/nrf/feather_52840`)
Boards are further categorized by their respective chipset (SAMD21,
SAMD51, nRF52840, etc.)
"""
modules = list(base.keys())
re_board_chip = None
chip_keyword = None
for port in SUPPORTED_PORTS:
# each port appears to use its own define for the chipset
if port in ["atmel-samd"]:
re_board_chip = re.compile("CHIP_FAMILY\s=\s(\w+)")
chip_keyword = "CHIP_FAMILY"
elif port in ["nrf"]:
re_board_chip = re.compile("MCU_VARIANT\s=\s(\w+)")
port_dir = "ports/{}".format(port)
port_config_contents = ""
with open(os.path.join(port_dir, "mpconfigport.mk")) as port_config:
port_config_contents = port_config.readlines()
port_config = parse_port_config(port_config_contents, chip_keyword)
for entry in os.scandir(os.path.join(port_dir, "boards")):
if not entry.is_dir():
continue
contents = ""
board_dir = os.path.join(entry.path, "mpconfigboard.mk")
with open(board_dir) as board:
contents = board.read()
board_chip = re_board_chip.search(contents)
#print(entry.name, board_chip.group(1))
if not board_chip:
board_chip = "Unknown Chip"
else:
board_chip = board_chip.group(1)
# add port_config results to contents
contents += "\n" + "\n".join(port_config["all"])
if board_chip in port_config:
contents += "\n" + "\n".join(port_config[board_chip])
for module in modules:
board_is_excluded = False
# check if board uses `SMALL_BUILD`. if yes, and current
# module is marked as `FULL_BUILD`, board is excluded
small_build = re.search("CIRCUITPY_SMALL_BUILD = 1", contents)
if small_build and base[module]["full_build"] == "1":
board_is_excluded = True
# check if module is specifically disabled for this board
re_pattern = "CIRCUITPY_{}\s=\s(\w)".format(module.upper())
find_module = re.search(re_pattern, contents)
if not find_module:
# check if default inclusion is off ('0'). if the board doesn't
# have it explicitly enabled, its excluded.
if base[module]["default_value"] == "0":
board_is_excluded = True
else:
if (find_module.group(1) == "0" and
find_module.group(1) != base[module]["default_value"]):
board_is_excluded = True
if board_is_excluded:
if board_chip in base[module]["excluded"]:
base[module]["excluded"][board_chip].append(entry.name)
else:
base[module]["excluded"][board_chip] = [entry.name]
#print(json.dumps(base, indent=2))
return base
def support_matrix_excluded_boards():
""" Compiles a list of available modules, and which board definitions
do not include them.
"""
base = build_module_map()
return get_excluded_boards(base)
def support_matrix_by_board():
""" Compiles a list of the available core modules available for each
board.
"""
base = build_module_map()
base_with_exclusions = get_excluded_boards(base)
boards = dict()
for port in SUPPORTED_PORTS:
port_dir = "ports/{}/boards".format(port)
for entry in os.scandir(port_dir):
if not entry.is_dir():
continue
board_modules = []
board_name = entry.name
board_contents = ""
with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name:
board_contents = get_name.read()
board_name_re = re.search("(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
board_contents)
if board_name_re:
board_name = board_name_re.group(1).strip('"')
for module in base_with_exclusions.keys():
#print(module)
board_has_module = True
if base_with_exclusions[module]["excluded"]:
for port in base_with_exclusions[module]["excluded"].values():
#print(port)
if entry.name in port:
board_has_module = False
if board_has_module:
board_modules.append(base_with_exclusions[module]["name"])
boards[board_name] = sorted(board_modules)
#print(json.dumps(boards, indent=2))
return boards

View File

@ -39,7 +39,7 @@
#include "lib/oofatfs/ff.h" #include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h" #include "extmod/vfs_fat.h"
#include "lib/timeutils/timeutils.h" #include "lib/timeutils/timeutils.h"
#include "supervisor/filesystem.h"
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"
#if _MAX_SS == _MIN_SS #if _MAX_SS == _MIN_SS
@ -99,6 +99,12 @@ STATIC mp_obj_t fat_vfs_make_new(const mp_obj_type_t *type, size_t n_args, const
return MP_OBJ_FROM_PTR(vfs); return MP_OBJ_FROM_PTR(vfs);
} }
STATIC void verify_fs_writable(fs_user_mount_t *vfs) {
if (!filesystem_is_writable_by_python(vfs)) {
mp_raise_OSError(MP_EROFS);
}
}
#if _FS_REENTRANT #if _FS_REENTRANT
STATIC mp_obj_t fat_vfs_del(mp_obj_t self_in) { STATIC mp_obj_t fat_vfs_del(mp_obj_t self_in) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(self_in); mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(self_in);
@ -201,6 +207,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(fat_vfs_ilistdir_obj, 1, 2, fat_vfs_i
STATIC mp_obj_t fat_vfs_remove_internal(mp_obj_t vfs_in, mp_obj_t path_in, mp_int_t attr) { STATIC mp_obj_t fat_vfs_remove_internal(mp_obj_t vfs_in, mp_obj_t path_in, mp_int_t attr) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in); mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
verify_fs_writable(self);
const char *path = mp_obj_str_get_str(path_in); const char *path = mp_obj_str_get_str(path_in);
FILINFO fno; FILINFO fno;
@ -235,9 +242,26 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(fat_vfs_rmdir_obj, fat_vfs_rmdir);
STATIC mp_obj_t fat_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t path_out) { STATIC mp_obj_t fat_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t path_out) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in); mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
verify_fs_writable(self);
const char *old_path = mp_obj_str_get_str(path_in); const char *old_path = mp_obj_str_get_str(path_in);
const char *new_path = mp_obj_str_get_str(path_out); const char *new_path = mp_obj_str_get_str(path_out);
FRESULT res = f_rename(&self->fatfs, old_path, new_path);
// Check to see if we're moving a directory into itself. This occurs when we're moving a
// directory where the old path is a prefix of the new and the next character is a "/" and thus
// preserves the original directory name.
FILINFO fno;
FRESULT res = f_stat(&self->fatfs, old_path, &fno);
if (res != FR_OK) {
mp_raise_OSError(fresult_to_errno_table[res]);
}
if ((fno.fattrib & AM_DIR) != 0 &&
strlen(new_path) > strlen(old_path) &&
new_path[strlen(old_path)] == '/' &&
strncmp(old_path, new_path, strlen(old_path)) == 0) {
mp_raise_OSError(MP_EINVAL);
}
res = f_rename(&self->fatfs, old_path, new_path);
if (res == FR_EXIST) { if (res == FR_EXIST) {
// if new_path exists then try removing it (but only if it's a file) // if new_path exists then try removing it (but only if it's a file)
fat_vfs_remove_internal(vfs_in, path_out, 0); // 0 == file attribute fat_vfs_remove_internal(vfs_in, path_out, 0); // 0 == file attribute
@ -255,6 +279,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(fat_vfs_rename_obj, fat_vfs_rename);
STATIC mp_obj_t fat_vfs_mkdir(mp_obj_t vfs_in, mp_obj_t path_o) { STATIC mp_obj_t fat_vfs_mkdir(mp_obj_t vfs_in, mp_obj_t path_o) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in); mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
verify_fs_writable(self);
const char *path = mp_obj_str_get_str(path_o); const char *path = mp_obj_str_get_str(path_o);
FRESULT res = f_mkdir(&self->fatfs, path); FRESULT res = f_mkdir(&self->fatfs, path);
if (res == FR_OK) { if (res == FR_OK) {
@ -419,6 +444,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(fat_vfs_getlabel_obj, vfs_fat_getlabel);
STATIC mp_obj_t vfs_fat_setlabel(mp_obj_t self_in, mp_obj_t label_in) { STATIC mp_obj_t vfs_fat_setlabel(mp_obj_t self_in, mp_obj_t label_in) {
fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in); fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in);
verify_fs_writable(self);
const char *label_str = mp_obj_str_get_str(label_in); const char *label_str = mp_obj_str_get_str(label_in);
FRESULT res = f_setlabel(&self->fatfs, label_str); FRESULT res = f_setlabel(&self->fatfs, label_str);
if (res != FR_OK) { if (res != FR_OK) {

@ -1 +1 @@
Subproject commit 3e6bf71c75c9ed4ada51ab69f8bd196dad18c0c1 Subproject commit b9280af5142fc41639229544678e23b5cca07c3a

@ -1 +1 @@
Subproject commit 1d38fd81edd30f1bd70c0cfe77819ab610ea89a3 Subproject commit 154b74de020764597ba49f0d1e8cc18d55b3643b

@ -1 +1 @@
Subproject commit a1686803566793ec2de7e043bf6822e47cfa31d1 Subproject commit 617bb0787f2c61283d248632a62b27be80f64b29

@ -1 +1 @@
Subproject commit dbfabac857123443506a3a1de9b5917d58248820 Subproject commit 89faee0eb08a6855e14f117c514fecf2dd90769d

@ -1 +1 @@
Subproject commit aa4428f304b982aa19a5800822e78c47dc8a3b6c Subproject commit 70865ac6e09f821b26ec727e2df300a6d9ebf6b3

@ -1 +1 @@
Subproject commit a03f9011279f9e630549432589463912831fcee1 Subproject commit bd7ddc67dc86f7ad0115f58ab80d5605739c6482

@ -1 +1 @@
Subproject commit a8894480283e3b81f39a3db5716b443963abc56f Subproject commit ddc74844983b35b027bd45091c7b8bb3c8d7a2d1

@ -1 +1 @@
Subproject commit 6e35cd2b40575a20e2904b096508325cef4a71d3 Subproject commit c0bdd8b10383725ee9293f5d88fb8d47eb1272bd

@ -1 +1 @@
Subproject commit 2df8a671a5a3d055b75df278fb354b558718b56d Subproject commit f1171f94083ba64d153ff3f90eeb07500331d6e1

@ -0,0 +1 @@
Subproject commit 6d1ae72916cf240ea86185c45f844d59f56d8ec3

@ -1 +0,0 @@
Subproject commit 5b8b5d459e7dd890724515bbfad86c705234f9ec

@ -1 +1 @@
Subproject commit 55874813f82157b7509729b1a0c66e68f86e2d07 Subproject commit 1ee9ef4f2b7c6acfab6c398a4f57ca22036958f7

View File

@ -103,9 +103,11 @@ STATIC void strn_print_strn(void *data, const char *str, size_t len) {
strn_print_env->remain -= len; strn_print_env->remain -= len;
} }
#if defined(__GNUC__) && !defined(__clang__) #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
// uClibc requires this alias to be defined, or there may be link errors // uClibc requires this alias to be defined, or there may be link errors
// when linkings against it statically. // when linkings against it statically.
// GCC 9 gives a warning about missing attributes so it's excluded until
// uClibc+GCC9 support is needed.
int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias ("vsnprintf"))); int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias ("vsnprintf")));
#endif #endif

View File

@ -131,7 +131,9 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
// at the moment, the value of SystemExit is unused // at the moment, the value of SystemExit is unused
ret = pyexec_system_exit; ret = pyexec_system_exit;
} else { } else {
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); if ((mp_obj_t) nlr.ret_val != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) {
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
}
ret = PYEXEC_EXCEPTION; ret = PYEXEC_EXCEPTION;
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2630
locale/en_x_pirate.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2704
locale/pl.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2741
locale/zh_Latn_pinyin.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="78" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h47v20H0z"/><path fill="#4c1" d="M47 0h31v20H47z"/><path fill="url(#b)" d="M0 0h78v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text><text x="245" y="140" transform="scale(.1)" textLength="370">license</text><text x="615" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">MIT</text><text x="615" y="140" transform="scale(.1)" textLength="210">MIT</text></g> <head xmlns=""/></svg>

Before

Width:  |  Height:  |  Size: 963 B

66
main.c
View File

@ -43,14 +43,13 @@
#include "lib/mp-readline/readline.h" #include "lib/mp-readline/readline.h"
#include "lib/utils/pyexec.h" #include "lib/utils/pyexec.h"
#include "background.h"
#include "mpconfigboard.h" #include "mpconfigboard.h"
#include "shared-module/displayio/__init__.h"
#include "supervisor/cpu.h" #include "supervisor/cpu.h"
#include "supervisor/memory.h" #include "supervisor/memory.h"
#include "supervisor/port.h" #include "supervisor/port.h"
#include "supervisor/filesystem.h" #include "supervisor/filesystem.h"
#include "supervisor/shared/autoreload.h" #include "supervisor/shared/autoreload.h"
#include "supervisor/shared/board_busses.h"
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"
#include "supervisor/shared/rgb_led_status.h" #include "supervisor/shared/rgb_led_status.h"
#include "supervisor/shared/safe_mode.h" #include "supervisor/shared/safe_mode.h"
@ -58,10 +57,18 @@
#include "supervisor/shared/stack.h" #include "supervisor/shared/stack.h"
#include "supervisor/serial.h" #include "supervisor/serial.h"
#if CIRCUITPY_DISPLAYIO
#include "shared-module/displayio/__init__.h"
#endif
#if CIRCUITPY_NETWORK #if CIRCUITPY_NETWORK
#include "shared-module/network/__init__.h" #include "shared-module/network/__init__.h"
#endif #endif
#if CIRCUITPY_BOARD
#include "shared-module/board/__init__.h"
#endif
void do_str(const char *src, mp_parse_input_kind_t input_kind) { void do_str(const char *src, mp_parse_input_kind_t input_kind) {
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0); mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0);
if (lex == NULL) { if (lex == NULL) {
@ -86,6 +93,8 @@ void start_mp(supervisor_allocation* heap) {
reset_status_led(); reset_status_led();
autoreload_stop(); autoreload_stop();
background_tasks_reset();
// Stack limit should be less than real stack size, so we have a chance // Stack limit should be less than real stack size, so we have a chance
// to recover from limit hit. (Limit is measured in bytes.) // to recover from limit hit. (Limit is measured in bytes.)
mp_stack_ctrl_init(); mp_stack_ctrl_init();
@ -139,8 +148,7 @@ void stop_mp(void) {
MP_STATE_VM(vfs_cur) = vfs; MP_STATE_VM(vfs_cur) = vfs;
#endif #endif
// Run any finalizers before we stop using the heap. gc_deinit();
gc_sweep_all();
} }
#define STRING_LIST(...) {__VA_ARGS__, ""} #define STRING_LIST(...) {__VA_ARGS__, ""}
@ -171,6 +179,24 @@ bool maybe_run_list(const char ** filenames, pyexec_result_t* exec_result) {
return true; return true;
} }
void cleanup_after_vm(supervisor_allocation* heap) {
// Turn off the display and flush the fileystem before the heap disappears.
#if CIRCUITPY_DISPLAYIO
reset_displays();
#endif
filesystem_flush();
stop_mp();
free_memory(heap);
supervisor_move_memory();
reset_port();
#if CIRCUITPY_BOARD
reset_board_busses();
#endif
reset_board();
reset_status_led();
}
bool run_code_py(safe_mode_t safe_mode) { bool run_code_py(safe_mode_t safe_mode) {
bool serial_connected_at_start = serial_connected(); bool serial_connected_at_start = serial_connected();
#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS
@ -214,18 +240,7 @@ bool run_code_py(safe_mode_t safe_mode) {
serial_write_compressed(translate("WARNING: Your code filename has two extensions\n")); serial_write_compressed(translate("WARNING: Your code filename has two extensions\n"));
} }
} }
// Turn off the display before the heap disappears. cleanup_after_vm(heap);
#if CIRCUITPY_DISPLAYIO
reset_displays();
#endif
stop_mp();
free_memory(heap);
supervisor_move_memory();
reset_port();
reset_board_busses();
reset_board();
reset_status_led();
if (result.return_code & PYEXEC_FORCED_EXIT) { if (result.return_code & PYEXEC_FORCED_EXIT) {
return reload_requested; return reload_requested;
@ -353,13 +368,7 @@ void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
boot_output_file = NULL; boot_output_file = NULL;
#endif #endif
// Reset to remove any state that boot.py setup. It should only be used to cleanup_after_vm(heap);
// change internal state that's not in the heap.
reset_port();
reset_board();
stop_mp();
free_memory(heap);
supervisor_move_memory();
} }
} }
@ -376,11 +385,7 @@ int run_repl(void) {
} else { } else {
exit_code = pyexec_friendly_repl(); exit_code = pyexec_friendly_repl();
} }
reset_port(); cleanup_after_vm(heap);
reset_board();
stop_mp();
free_memory(heap);
supervisor_move_memory();
autoreload_resume(); autoreload_resume();
return exit_code; return exit_code;
} }
@ -455,6 +460,11 @@ void gc_collect(void) {
// This collects root pointers from the VFS mount table. Some of them may // This collects root pointers from the VFS mount table. Some of them may
// have lost their references in the VM even though they are mounted. // have lost their references in the VM even though they are mounted.
gc_collect_root((void**)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t)); gc_collect_root((void**)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t));
#if CIRCUITPY_DISPLAYIO
displayio_gc_collect();
#endif
// This naively collects all object references from an approximate stack // This naively collects all object references from an approximate stack
// range. // range.
gc_collect_root((void**)sp, ((uint32_t)&_estack - sp) / sizeof(uint32_t)); gc_collect_root((void**)sp, ((uint32_t)&_estack - sp) / sizeof(uint32_t));

View File

@ -78,6 +78,7 @@ endif
SRC_C = \ SRC_C = \
main.c \ main.c \
gccollect.c \ gccollect.c \
supervisor/stub/safe_mode.c \
supervisor/stub/stack.c \ supervisor/stub/stack.c \
supervisor/shared/translate.c supervisor/shared/translate.c

View File

@ -99,10 +99,9 @@ endif
#Debugging/Optimization #Debugging/Optimization
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
CFLAGS += -ggdb CFLAGS += -ggdb
# You may want to disable -flto if it interferes with debugging. # You may want to disable -flto if it interferes with debugging.
CFLAGS += -flto CFLAGS += -flto -flto-partition=none
# You may want to enable these flags to make setting breakpoints easier. # You may want to enable these flags to make setting breakpoints easier.
# CFLAGS += -fno-inline -fno-ipa-sra # CFLAGS += -fno-inline -fno-ipa-sra
ifeq ($(CHIP_FAMILY), samd21) ifeq ($(CHIP_FAMILY), samd21)
@ -112,13 +111,18 @@ else
# -finline-limit can shrink the image size. # -finline-limit can shrink the image size.
# -finline-limit=80 or so is similar to not having it on. # -finline-limit=80 or so is similar to not having it on.
# There is no simple default value, though. # There is no simple default value, though.
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
CFLAGS += -finline-limit=50 # Do a default shrink for small builds.
ifndef CFLAGS_INLINE_LIMIT
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
CFLAGS_INLINE_LIMIT = 50
endif
endif endif
ifdef CFLAGS_INLINE_LIMIT ifdef CFLAGS_INLINE_LIMIT
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
endif endif
CFLAGS += -flto CFLAGS += -flto -flto-partition=none
endif endif
CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)
@ -212,6 +216,7 @@ SRC_C = \
bindings/samd/__init__.c \ bindings/samd/__init__.c \
boards/$(BOARD)/board.c \ boards/$(BOARD)/board.c \
boards/$(BOARD)/pins.c \ boards/$(BOARD)/pins.c \
eic_handler.c \
fatfs_port.c \ fatfs_port.c \
freetouch/adafruit_ptc.c \ freetouch/adafruit_ptc.c \
lib/libc/string0.c \ lib/libc/string0.c \

View File

@ -124,15 +124,20 @@ Setup
----- -----
An ARM compiler is required for the build, along with the associated binary An ARM compiler is required for the build, along with the associated binary
utilities. On Ubuntu, these can be installed as follows: utilities. They can be installed as follows:
.. code-block:: shell - Ubuntu
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa .. code-block:: shell
sudo apt-get install gcc-arm-embedded
On Arch Linux the compiler is available for via the package sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
``arm-none-eabi-gcc``. sudo apt-get install gcc-arm-embedded
- Arch Linux
.. code-block:: shell
sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib
For other systems, the `GNU Arm Embedded Toolchain <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`_ For other systems, the `GNU Arm Embedded Toolchain <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`_
may be available in binary form. may be available in binary form.

View File

@ -29,8 +29,8 @@
#include "samd/events.h" #include "samd/events.h"
#include "samd/dma.h" #include "samd/dma.h"
#include "shared-bindings/audioio/RawSample.h" #include "shared-bindings/audiocore/RawSample.h"
#include "shared-bindings/audioio/WaveFile.h" #include "shared-bindings/audiocore/WaveFile.h"
#include "py/mpstate.h" #include "py/mpstate.h"
#include "py/runtime.h" #include "py/runtime.h"

View File

@ -29,8 +29,8 @@
#include "extmod/vfs_fat.h" #include "extmod/vfs_fat.h"
#include "py/obj.h" #include "py/obj.h"
#include "shared-module/audioio/RawSample.h" #include "shared-module/audiocore/RawSample.h"
#include "shared-module/audioio/WaveFile.h" #include "shared-module/audiocore/WaveFile.h"
typedef struct { typedef struct {
mp_obj_t sample; mp_obj_t sample;

View File

@ -27,6 +27,7 @@
#include "audio_dma.h" #include "audio_dma.h"
#include "tick.h" #include "tick.h"
#include "supervisor/filesystem.h"
#include "supervisor/usb.h" #include "supervisor/usb.h"
#include "py/runtime.h" #include "py/runtime.h"
@ -41,8 +42,20 @@ volatile uint64_t last_finished_tick = 0;
bool stack_ok_so_far = true; bool stack_ok_so_far = true;
static bool running_background_tasks = false;
void background_tasks_reset(void) {
running_background_tasks = false;
}
void run_background_tasks(void) { void run_background_tasks(void) {
// Don't call ourselves recursively.
if (running_background_tasks) {
return;
}
assert_heap_ok(); assert_heap_ok();
running_background_tasks = true;
#if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAMD51) #if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAMD51)
audio_dma_background(); audio_dma_background();
#endif #endif
@ -53,7 +66,9 @@ void run_background_tasks(void) {
#if CIRCUITPY_NETWORK #if CIRCUITPY_NETWORK
network_module_background(); network_module_background();
#endif #endif
filesystem_background();
usb_background(); usb_background();
running_background_tasks = false;
assert_heap_ok(); assert_heap_ok();
last_finished_tick = ticks_ms; last_finished_tick = ticks_ms;

View File

@ -29,6 +29,7 @@
#include <stdbool.h> #include <stdbool.h>
void background_tasks_reset(void);
void run_background_tasks(void); void run_background_tasks(void);
void run_background_vm_tasks(void); void run_background_vm_tasks(void);
bool background_tasks_ok(void); bool background_tasks_ok(void);

View File

@ -7,9 +7,9 @@
#define MICROPY_HW_LED_STATUS (&pin_PB23) #define MICROPY_HW_LED_STATUS (&pin_PB23)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) #define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SCL (&pin_PA09)
#define DEFAULT_I2C_BUS_SDA (&pin_PA08) #define DEFAULT_I2C_BUS_SDA (&pin_PA08)

View File

@ -4,11 +4,10 @@ USB_PID = 0x8053
USB_PRODUCT = "Arduino MKR1300" USB_PRODUCT = "Arduino MKR1300"
USB_MANUFACTURER = "Arduino" USB_MANUFACTURER = "Arduino"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21 CHIP_FAMILY = samd21
CIRCUITPY_FREQUENCYIO = 0 INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0

View File

@ -1,7 +1,5 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = { STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB02) },

View File

@ -5,9 +5,9 @@
#define MICROPY_PORT_B (0) #define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0) #define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) #define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SCL (&pin_PA09)
#define DEFAULT_I2C_BUS_SDA (&pin_PA08) #define DEFAULT_I2C_BUS_SDA (&pin_PA08)

View File

@ -1,14 +1,14 @@
LD_FILE = boards/samd21x18-bootloader.ld LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x239A USB_VID = 0x239A
USB_PID = 0x8035 USB_PID = 0x8050
USB_PRODUCT = "Arduino MKRZero" USB_PRODUCT = "Arduino MKRZero"
USB_MANUFACTURER = "Arduino" USB_MANUFACTURER = "Arduino"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1 INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1 CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A SUPEROPT_GC = 0
CHIP_FAMILY = samd21
CIRCUITPY_FREQUENCYIO = 0

View File

@ -1,7 +1,5 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = { STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB02) },

View File

@ -10,9 +10,9 @@
#define MICROPY_PORT_B (PORT_PB03) #define MICROPY_PORT_B (PORT_PB03)
#define MICROPY_PORT_C (0) #define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) #define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22) #define DEFAULT_I2C_BUS_SDA (&pin_PA22)

View File

@ -4,11 +4,11 @@ USB_PID = 0x824D
USB_PRODUCT = "Arduino Zero" USB_PRODUCT = "Arduino Zero"
USB_MANUFACTURER = "Arduino" USB_MANUFACTURER = "Arduino"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1 INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1 CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A SUPEROPT_GC = 0
CHIP_FAMILY = samd21
CIRCUITPY_FREQUENCYIO = 0

View File

@ -1,7 +1,5 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = { STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) },

View File

@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "boards/board.h"
void board_init(void)
{
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,53 @@
#define MICROPY_HW_BOARD_NAME "Electronic Cats Bast Pro Mini M0"
#define MICROPY_HW_MCU_NAME "samd21e18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
#define DEFAULT_I2C_BUS_SCL (&pin_PA08)
#define DEFAULT_I2C_BUS_SDA (&pin_PA09)
#define DEFAULT_SPI_BUS_SCK (&pin_PA17)
#define DEFAULT_SPI_BUS_MOSI (&pin_PA16)
#define DEFAULT_SPI_BUS_MISO (&pin_PA19)
#define DEFAULT_UART_BUS_RX (&pin_PA01)
#define DEFAULT_UART_BUS_TX (&pin_PA00)
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PA12 1
#define IGNORE_PIN_PA13 1
#define IGNORE_PIN_PA20 1
#define IGNORE_PIN_PA21 1
// USB is always used.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
#define IGNORE_PIN_PA30 1
#define IGNORE_PIN_PA31 1
#define IGNORE_PIN_PB01 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PB04 1
#define IGNORE_PIN_PB05 1
#define IGNORE_PIN_PB06 1
#define IGNORE_PIN_PB07 1
#define IGNORE_PIN_PB08 1
#define IGNORE_PIN_PB09 1
#define IGNORE_PIN_PB10 1
#define IGNORE_PIN_PB11 1
#define IGNORE_PIN_PB12 1
#define IGNORE_PIN_PB13 1
#define IGNORE_PIN_PB14 1
#define IGNORE_PIN_PB15 1
#define IGNORE_PIN_PB16 1
#define IGNORE_PIN_PB17 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PB30 1
#define IGNORE_PIN_PB31 1
#define IGNORE_PIN_PB00 1

View File

@ -0,0 +1,12 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x1209
USB_PID = 0xBAB3
USB_PRODUCT = "Bast Pro Mini M0"
USB_MANUFACTURER = "Electronic Cats"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1

View File

@ -0,0 +1,36 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA23) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA28) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,47 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "common-hal/microcontroller/Pin.h"
void board_init(void) {
// Don't reset:
// - USB Host Enable Pin
// - reset pin of the USB Hub
//
// If either are reset, USB devices will disconnect when the MCU restarts
never_reset_pin_number(PIN_PA07);
never_reset_pin_number(PIN_PB08);
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,37 @@
#define MICROPY_HW_BOARD_NAME "Capable Robot Programmable USB Hub"
#define MICROPY_HW_MCU_NAME "samd51g19"
#define CIRCUITPY_MCU_FAMILY samd51
#define MICROPY_HW_LED_STATUS (&pin_PA22)
// These are pins not to reset.
// QSPI Data pins
#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11)
// QSPI CS, and QSPI SCK
#define MICROPY_PORT_B (PORT_PB10 | PORT_PB11)
#define MICROPY_PORT_C (0)
#define MICROPY_PORT_D (0)
#define AUTORESET_DELAY_MS 500
// If you change this, then make sure to update the linker scripts as well to
// make sure you don't overwrite code
#define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22)
#define DEFAULT_SPI_BUS_SCK (&pin_PA01)
#define DEFAULT_SPI_BUS_MOSI (&pin_PA00)
#define DEFAULT_SPI_BUS_MISO (&pin_PB23)
#define DEFAULT_UART_BUS_RX (&pin_PA16)
#define DEFAULT_UART_BUS_TX (&pin_PA17)
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,18 @@
LD_FILE = boards/samd51x19-bootloader-external-flash.ld
USB_VID = 0x04D8
USB_PID = 0xEDB3
USB_PRODUCT = "Programmable USB Hub"
USB_MANUFACTURER = "Capable Robot Components"
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ
# No I2S on SAMD51G
CIRCUITPY_AUDIOBUSIO = 0
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0

View File

@ -0,0 +1,36 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_ANMB), MP_ROM_PTR(&pin_PA02) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ANVLIM), MP_ROM_PTR(&pin_PA04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_AN5V), MP_ROM_PTR(&pin_PA05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MBPWM), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MBINT), MP_ROM_PTR(&pin_PA15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MBCS), MP_ROM_PTR(&pin_PA18) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MBRST), MP_ROM_PTR(&pin_PB09) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PA19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA20) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_USBHEN), MP_ROM_PTR(&pin_PA07) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_USBRST), MP_ROM_PTR(&pin_PB08) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PA13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA01) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA00) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB23) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -7,13 +7,13 @@
#define MICROPY_PORT_B (0) #define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0) #define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define DEFAULT_SPI_BUS_SCK (&pin_PA19) #define DEFAULT_SPI_BUS_SCK (&pin_PA19)
#define DEFAULT_SPI_BUS_MOSI (&pin_PA18) #define DEFAULT_SPI_BUS_MOSI (&pin_PA18)
#define DEFAULT_SPI_BUS_MISO (&pin_PA22) #define DEFAULT_SPI_BUS_MISO (&pin_PA22)
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) #define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define IGNORE_PIN_PA00 1 #define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1 #define IGNORE_PIN_PA01 1

View File

@ -1,12 +1,12 @@
LD_FILE = boards/samd21x18-bootloader.ld LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0xBAB2 USB_VID = 0x1209
USB_PID = 0x1209 USB_PID = 0xBAB2
USB_PRODUCT = "CatWAN USBStick" USB_PRODUCT = "CatWAN USBStick"
USB_MANUFACTURER = "Electronic Cats" USB_MANUFACTURER = "Electronic Cats"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1 INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1 CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

View File

@ -1,7 +1,5 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = { STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA30) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA31) },

View File

@ -4,6 +4,9 @@ USB_PID = 0x8019
USB_PRODUCT = "CircuitPlayground Express" USB_PRODUCT = "CircuitPlayground Express"
USB_MANUFACTURER = "Adafruit Industries LLC" USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1 SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
@ -12,9 +15,10 @@ LONGINT_IMPL = MPZ
# Make room for frozen libs. # Make room for frozen libs.
CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CHIP_VARIANT = SAMD21G18A SUPEROPT_GC = 0
CHIP_FAMILY = samd21 CFLAGS_INLINE_LIMIT = 55
# Include these Python libraries in firmware. # Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
@ -23,6 +27,3 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor
#Adding per @danh to reduce memory usage and get the latest changes in
CFLAGS_INLINE_LIMIT = 55

View File

@ -1,7 +1,5 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = { STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA02) },

View File

@ -4,21 +4,24 @@ USB_PID = 0x8019
USB_PRODUCT = "CircuitPlayground Express with Crickit libraries" USB_PRODUCT = "CircuitPlayground Express with Crickit libraries"
USB_MANUFACTURER = "Adafruit Industries LLC" USB_MANUFACTURER = "Adafruit Industries LLC"
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
# Turn off longints for Crickit build to make room for additional frozen libs.
LONGINT_IMPL = NONE
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_PIXELBUF = 0
CIRCUITPY_FREQUENCYIO = 0
CHIP_VARIANT = SAMD21G18A CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21 CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
# Turn off features and optimizations for Crickit build to make room for additional frozen libs.
LONGINT_IMPL = NONE
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_PIXELBUF = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
SUPEROPT_GC = 0
CFLAGS_INLINE_LIMIT = 55 CFLAGS_INLINE_LIMIT = 55
# Include these Python libraries in firmware. # Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground

View File

@ -1,7 +1,5 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = { STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA02) },

View File

@ -1,13 +1,13 @@
#define MICROPY_HW_BOARD_NAME "CP32-M4" #define MICROPY_HW_BOARD_NAME "CP32-M4"
#define MICROPY_HW_MCU_NAME "samd51g19" #define MICROPY_HW_MCU_NAME "samd51j20"
#define MICROPY_HW_APA102_MOSI (&pin_PA17) #define MICROPY_HW_APA102_MOSI (&pin_PA12)
#define MICROPY_HW_APA102_SCK (&pin_PA16) #define MICROPY_HW_APA102_SCK (&pin_PA13)
#define CIRCUITPY_MCU_FAMILY samd51 #define CIRCUITPY_MCU_FAMILY samd51
#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11| PORT_PA16| PORT_PA17) #define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11| PORT_PA12| PORT_PA13)
#define MICROPY_PORT_B ( PORT_PB10 | PORT_PB11) #define MICROPY_PORT_B ( PORT_PB10 | PORT_PB11)
#define MICROPY_PORT_C (0) #define MICROPY_PORT_C (0)
#define MICROPY_PORT_D (0) #define MICROPY_PORT_D (0)
@ -27,5 +27,5 @@
#define DEFAULT_SPI_BUS_MOSI (&pin_PA23) #define DEFAULT_SPI_BUS_MOSI (&pin_PA23)
#define DEFAULT_SPI_BUS_MISO (&pin_PA21) #define DEFAULT_SPI_BUS_MISO (&pin_PA21)
#define DEFAULT_UART_BUS_RX (&pin_PA12) #define DEFAULT_UART_BUS_RX (&pin_PB17)
#define DEFAULT_UART_BUS_TX (&pin_PA13) #define DEFAULT_UART_BUS_TX (&pin_PB16)

View File

@ -1,17 +1,18 @@
LD_FILE = boards/samd51x19-bootloader-external-flash.ld LD_FILE = boards/samd51x20-bootloader-external-flash.ld
USB_VID = 0x239A USB_VID = 0x239A
USB_PID = 0x8021 USB_PID = 0x8021
USB_PRODUCT = "CP32-M4" USB_PRODUCT = "CP32-M4"
USB_MANUFACTURER = "Nadda-Reel Company LLC" USB_MANUFACTURER = "Nadda-Reel Company LLC"
CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1 QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q128JV_PM" EXTERNAL_FLASH_DEVICES = "W25Q128JV_PM"
# No I2S on SAMD51G CIRCUITPY_PS2IO = 1
# No I2S on SAMD51G.
CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOBUSIO = 0
# No touch on SAMD51 yet # No touch on SAMD51 yet.
CIRCUITPY_TOUCHIO = 0 CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51

View File

@ -1,38 +1,48 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
// This mapping only includes functional names because pins broken // This mapping only includes functional names because pins broken
// out on connectors are labeled with their MCU name available from // out on connectors are labeled with their MCU name available from
// microcontroller.pin. // microcontroller.pin.
STATIC const mp_rom_map_elem_t board_global_dict_table[] = { STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_P), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_P), MP_ROM_PTR(&pin_PA02) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB08) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SW3_4), MP_ROM_PTR(&pin_PB09) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SW1_2), MP_ROM_PTR(&pin_PA04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_N), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_N), MP_ROM_PTR(&pin_PA05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED), MP_ROM_PTR(&pin_PA15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_BACKLIGHT_PWM), MP_ROM_PTR(&pin_PB09) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SW9), MP_ROM_PTR(&pin_PA06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SW1_2), MP_ROM_PTR(&pin_PA06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SW7), MP_ROM_PTR(&pin_PA07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SW3_4), MP_ROM_PTR(&pin_PB08) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_BACKLIGHT_PWM), MP_ROM_PTR(&pin_PA12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SW5), MP_ROM_PTR(&pin_PB12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR3), MP_ROM_PTR(&pin_PA13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SW7), MP_ROM_PTR(&pin_PB06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SW5), MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SW8), MP_ROM_PTR(&pin_PB03) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR4), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SW9), MP_ROM_PTR(&pin_PB05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SW10), MP_ROM_PTR(&pin_PB04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR3), MP_ROM_PTR(&pin_PB07) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR4), MP_ROM_PTR(&pin_PA20) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED), MP_ROM_PTR(&pin_PA18) }, { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR5), MP_ROM_PTR(&pin_PA22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SW6), MP_ROM_PTR(&pin_PA19) }, { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_SW6), MP_ROM_PTR(&pin_PA21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS0), MP_ROM_PTR(&pin_PA20) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MISO), MP_ROM_PTR(&pin_PA21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD0), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_SCK), MP_ROM_PTR(&pin_PA22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD1), MP_ROM_PTR(&pin_PA18) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MOSI), MP_ROM_PTR(&pin_PA23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD2), MP_ROM_PTR(&pin_PB13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD3), MP_ROM_PTR(&pin_PB14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_PB15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_SCK), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MOSI), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MISO), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS0), MP_ROM_PTR(&pin_PA19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS1), MP_ROM_PTR(&pin_PA27) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_PA23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS1), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR5), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_SW8), MP_ROM_PTR(&pin_PB02) },
{ MP_ROM_QSTR(MP_QSTR_SW10), MP_ROM_PTR(&pin_PB03) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },

View File

@ -4,17 +4,16 @@ USB_PID = 0x0001
USB_PRODUCT = "Datalore IP M4" USB_PRODUCT = "Datalore IP M4"
USB_MANUFACTURER = "TG-Boards" USB_MANUFACTURER = "TG-Boards"
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JV_IQ, W25Q16JV_IM"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD51J19A CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51 CHIP_FAMILY = samd51
# No touch on SAMD51 yet QSPI_FLASH_FILESYSTEM = 1
CIRCUITPY_TOUCHIO = 0 EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JV_IQ, W25Q16JV_IM"
LONGINT_IMPL = MPZ
CIRCUITPY_NETWORK = 1 CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500 MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_PS2IO = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0

View File

@ -1,7 +1,5 @@
#include "shared-bindings/board/__init__.h" #include "shared-bindings/board/__init__.h"
#include "supervisor/shared/board_busses.h"
// This mapping only includes functional names because pins broken // This mapping only includes functional names because pins broken
// out on connectors are labeled with their MCU name available from // out on connectors are labeled with their MCU name available from
// microcontroller.pin. // microcontroller.pin.

View File

@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "boards/board.h"
void board_init(void)
{
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,29 @@
// LEDs
#define MICROPY_HW_LED_STATUS (&pin_PA17)
#define MICROPY_HW_LED_TX &pin_PA27
#define MICROPY_HW_LED_RX &pin_PA17
#define MICROPY_HW_BOARD_NAME "J&J Studios datum-Distance"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22)
#define DEFAULT_SPI_BUS_SCK (&pin_PB11)
#define DEFAULT_SPI_BUS_MOSI (&pin_PB10)
#define DEFAULT_SPI_BUS_MISO (&pin_PA12)
#define DEFAULT_UART_BUS_RX (&pin_PA11)
#define DEFAULT_UART_BUS_TX (&pin_PA10)
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,14 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x04D8
USB_PID = 0xEE8C
USB_PRODUCT = "datum-Distance"
USB_MANUFACTURER = "J&J Studios LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0

View File

@ -0,0 +1,27 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "boards/board.h"
void board_init(void)
{
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,29 @@
// LEDs
#define MICROPY_HW_LED_STATUS (&pin_PA17)
#define MICROPY_HW_LED_TX &pin_PA27
#define MICROPY_HW_LED_RX &pin_PA17
#define MICROPY_HW_BOARD_NAME "J&J Studios datum-IMU"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22)
#define DEFAULT_SPI_BUS_SCK (&pin_PB11)
#define DEFAULT_SPI_BUS_MOSI (&pin_PB10)
#define DEFAULT_SPI_BUS_MISO (&pin_PA12)
#define DEFAULT_UART_BUS_RX (&pin_PA11)
#define DEFAULT_UART_BUS_TX (&pin_PA10)
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,14 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x04D8
USB_PID = 0xEE8D
USB_PRODUCT = "datum-IMU"
USB_MANUFACTURER = "J&J Studios LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0

View File

@ -0,0 +1,29 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA03) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "boards/board.h"
void board_init(void)
{
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,29 @@
// LEDs
#define MICROPY_HW_LED_STATUS (&pin_PA17)
#define MICROPY_HW_LED_TX &pin_PA27
#define MICROPY_HW_LED_RX &pin_PA17
#define MICROPY_HW_BOARD_NAME "J&J Studios datum-Light"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22)
#define DEFAULT_SPI_BUS_SCK (&pin_PB11)
#define DEFAULT_SPI_BUS_MOSI (&pin_PB10)
#define DEFAULT_SPI_BUS_MISO (&pin_PA12)
#define DEFAULT_UART_BUS_RX (&pin_PA11)
#define DEFAULT_UART_BUS_TX (&pin_PA10)
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,14 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x04D8
USB_PID = 0xEE8E
USB_PRODUCT = "datum-Light"
USB_MANUFACTURER = "J&J Studios LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0

View File

@ -0,0 +1,27 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "boards/board.h"
void board_init(void)
{
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,29 @@
// LEDs
#define MICROPY_HW_LED_STATUS (&pin_PA17)
#define MICROPY_HW_LED_TX &pin_PA27
#define MICROPY_HW_LED_RX &pin_PA17
#define MICROPY_HW_BOARD_NAME "J&J Studios datum-Weather"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22)
#define DEFAULT_SPI_BUS_SCK (&pin_PB11)
#define DEFAULT_SPI_BUS_MOSI (&pin_PB10)
#define DEFAULT_SPI_BUS_MISO (&pin_PA12)
#define DEFAULT_UART_BUS_RX (&pin_PA11)
#define DEFAULT_UART_BUS_TX (&pin_PA10)
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,14 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x04D8
USB_PID = 0xEE8F
USB_PRODUCT = "datum-Weather"
USB_MANUFACTURER = "J&J Studios LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0

View File

@ -0,0 +1,27 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Andrés Sabas for Electronic Cats
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "boards/board.h"
void board_init(void)
{
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,34 @@
#define MICROPY_HW_BOARD_NAME "Escornabot Makech"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_HW_LED_STATUS (&pin_PA02)
// These are pins not to reset.
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
// If you change this, then make sure to update the linker scripts as well to
// make sure you don't overwrite code.
#define CIRCUITPY_INTERNAL_NVM_SIZE 256
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define CALIBRATE_CRYSTALLESS 1
// Explanation of how a user got into safe mode.
#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up"
#define DEFAULT_I2C_BUS_SCL (&pin_PA08)
#define DEFAULT_I2C_BUS_SDA (&pin_PA09)
#define DEFAULT_SPI_BUS_SCK (&pin_PA14)
#define DEFAULT_SPI_BUS_MOSI (&pin_PA19)
#define DEFAULT_SPI_BUS_MISO (&pin_PA20)
#define DEFAULT_UART_BUS_RX (&pin_PA01)
#define DEFAULT_UART_BUS_TX (&pin_PA00)
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,14 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x1209
USB_PID = 0xBAB6
USB_PRODUCT = "Escornabot Makech"
USB_MANUFACTURER = "Electronic Cats"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
SUPEROPT_GC = 0

View File

@ -0,0 +1,58 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
//LEDs
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) },
// Buttons
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA03) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA01) },
// Motors
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA28) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) },
// Buzzer
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA13) },
//UART
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA00) },
// I2C
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) },
// SPI
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA13) },
// ESP control
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA20) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PA21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PA23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

Some files were not shown because too many files have changed in this diff Show More