summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-04-27 16:45:10 -0700
committerScott Shawcroft <scott@tannewt.org>2020-04-27 16:45:10 -0700
commit755d404edf00ab99bb8497d2e4a36ba18dd17a69 (patch)
treea705a06789c0d9b182633ff669380e241b1acc59 /docs
parentf13de32208716387ca822fd25625325162b5c2f1 (diff)
parentfaa50df05fa11c3903934419a2ad7d7063cf23c7 (diff)
Merge remote-tracking branch 'adafruit/master' into lower_power
Diffstat (limited to 'docs')
-rw-r--r--docs/porting.rst42
-rw-r--r--docs/shared_bindings_matrix.py19
2 files changed, 48 insertions, 13 deletions
diff --git a/docs/porting.rst b/docs/porting.rst
index 6bb514458..d28f56f47 100644
--- a/docs/porting.rst
+++ b/docs/porting.rst
@@ -1,5 +1,5 @@
We love CircuitPython and would love to see it come to more microcontroller
-platforms. With 3.0 we've reworked CircuitPython to make it easier than ever to
+platforms. Since 3.0 we've reworked CircuitPython to make it easier than ever to
add support. While there are some major differences between ports, this page
covers the similarities that make CircuitPython what it is and how that core
fits into a variety of microcontrollers.
@@ -19,7 +19,7 @@ prepping file systems and automatically running user code on boot. In
CircuitPython we've dubbed this component the supervisor because it monitors
and facilitates the VMs which run user Python code. Porting involves the
supervisor because many of the tasks it does while interfacing with the
-hardware. Once its going though, the REPL works and debugging can migrate to a
+hardware. Once complete, the REPL works and debugging can migrate to a
Python based approach rather than C.
The third core piece is the plethora of low level APIs that CircuitPython
@@ -42,6 +42,44 @@ to the port's directory (in the top level until the ``ports`` directory is
present). This includes the Makefile and any C library resources. Make sure
these resources are compatible with the MIT License of the rest of the code!
+Circuitpython has a number of modules enabled by default in
+``py/circuitpy_mpconfig.mk``. Most of these modules will need to be disabled in
+``mpconfigboard.mk`` during the early stages of a port in order for it to
+compile. As the port progresses in module support, this list can be pruned down
+as a natural "TODO" list. An example minimal build list is shown below:
+
+.. code-block:: makefile
+
+ # These modules are implemented in ports/<port>/common-hal:
+ CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create
+ CIRCUITPY_DIGITALIO = 0 # Typically the second module to create
+ CIRCUITPY_ANALOGIO = 0
+ CIRCUITPY_BUSIO = 0
+ CIRCUITPY_NEOPIXEL_WRITE = 0
+ CIRCUITPY_PULSEIO = 0
+ CIRCUITPY_OS = 0
+ CIRCUITPY_NVM = 0
+ CIRCUITPY_AUDIOBUSIO = 0
+ CIRCUITPY_AUDIOIO = 0
+ CIRCUITPY_ROTARYIO = 0
+ CIRCUITPY_RTC = 0
+ CIRCUITPY_FREQUENCYIO = 0
+ CIRCUITPY_I2CSLAVE = 0
+ CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok)
+
+ # These modules are implemented in shared-module/ - they can be included in
+ # any port once their prerequisites in common-hal are complete.
+ CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO
+ CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO
+ CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar)
+ CIRCUITPY_RANDOM = 0 # Requires OS
+ CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
+ CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller
+ CIRCUITPY_USB_HID = 0 # Requires USB
+ CIRCUITPY_USB_MIDI = 0 # Requires USB
+ CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C
+ CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash
+
Step 2: Init
--------------
Once your build is setup, the next step should be to get your clocks going as
diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py
index e327d6ec6..d5f838f75 100644
--- a/docs/shared_bindings_matrix.py
+++ b/docs/shared_bindings_matrix.py
@@ -26,7 +26,7 @@ import os
import re
-SUPPORTED_PORTS = ["atmel-samd", "nrf", "mimxrt10xx"]
+SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm", "mimxrt10xx"]
def parse_port_config(contents, chip_keyword=None):
@@ -139,7 +139,10 @@ def get_excluded_boards(base):
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+)")
+ re_board_chip = re.compile(r"MCU_VARIANT\s=\s(\w+)")
+ elif port in ["stm"]:
+ re_board_chip = re.compile(r"MCU_SERIES\s*=\s*(\w+)")
+ chip_keyword = "MCU_SERIES"
port_dir = "ports/{}".format(port)
@@ -158,10 +161,10 @@ def get_excluded_boards(base):
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:
+ #print(entry.name, board_chip.group(1))
board_chip = board_chip.group(1)
# add port_config results to contents
@@ -172,18 +175,12 @@ def get_excluded_boards(base):
check_dependent_modules = dict()
for module in modules:
board_is_excluded = False
- # check if board uses `SMALL_BUILD`. if yes, and current
+ # check if board turns off `FULL_BUILD`. if yes, and current
# module is marked as `FULL_BUILD`, board is excluded
- small_build = re.search("CIRCUITPY_SMALL_BUILD = 1", contents)
+ small_build = re.search("CIRCUITPY_FULL_BUILD = 0", contents)
if small_build and base[module]["full_build"] == "1":
board_is_excluded = True
- # check if board uses `MINIMAL_BUILD`. if yes, and current
- # module is marked as `DEFAULT_BUILD`, board is excluded
- min_build = re.search("CIRCUITPY_MINIMAL_BUILD = 1", contents)
- if min_build and base[module]["default_value"] == "CIRCUITPY_DEFAULT_BUILD":
- board_is_excluded = True
-
# check if module is specifically disabled for this board
re_pattern = r"CIRCUITPY_{}\s=\s(\w)".format(module.upper())
find_module = re.search(re_pattern, contents)