Showing 1,188 changed files with 61,472 additions and 71,134 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
*.dxf binary
*.mpy binary
*.deb binary
*.zip binary

# These should also not be modified by git.
tests/basics/string_cr_conversion.py -text
tests/basics/string_crlf_conversion.py -text
ports/stm32/pybcdc.inf_template -text
ports/stm32/usbd_* -text
ports/stm32/usbdev/** -text
ports/stm32/usbhost/** -text
ports/cc3200/hal/aes.c -text
ports/cc3200/hal/aes.h -text
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*.bin
*.map
*.hex
!ports/nrf/**/bootloader/*.hex
*.dis
*.exe

Expand Down Expand Up @@ -58,3 +57,12 @@ TAGS
#################
*.orig

# Emacs backup files
####################
*~

*.DS_Store

# POEdit mo files
####################
*.mo
18 changes: 14 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url = https://github.com/atgreen/libffi
[submodule "lib/lwip"]
path = lib/lwip
url = http://git.savannah.gnu.org/r/lwip.git
url = https://git.savannah.gnu.org/r/lwip.git
[submodule "lib/berkeley-db-1.xx"]
path = lib/berkeley-db-1.xx
url = https://github.com/pfalcon/berkeley-db-1.xx
Expand Down Expand Up @@ -37,9 +37,9 @@
url = https://github.com/micropython/stm32lib
branch = work-F4-1.13.1+F7-1.5.0+L4-1.3.0
[submodule "atmel-samd/asf4"]
path = ports/atmel-samd/asf4
url = https://github.com/adafruit/asf4.git
branch = circuitpython
path = ports/atmel-samd/asf4
url = https://github.com/adafruit/asf4.git
branch = circuitpython
[submodule "tools/usb_descriptor"]
path = tools/usb_descriptor
url = https://github.com/adafruit/usb_descriptor.git
Expand Down Expand Up @@ -73,3 +73,13 @@
[submodule "frozen/Adafruit_CircuitPython_Crickit"]
path = frozen/Adafruit_CircuitPython_Crickit
url = https://github.com/adafruit/Adafruit_CircuitPython_Crickit
[submodule "ports/nrf/nrfx"]
path = ports/nrf/nrfx
url = https://github.com/NordicSemiconductor/nrfx.git
[submodule "lib/tinyusb"]
path = lib/tinyusb
url = https://github.com/hathach/tinyusb.git
branch = develop
[submodule "tools/huffman"]
path = tools/huffman
url = https://github.com/tannewt/huffman.git
69 changes: 36 additions & 33 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,42 @@ dist: trusty
language: c
compiler:
- gcc
git:
depth: 1

# Put a representative board from each port or sub-port near the top
# to determine more quickly whether that port is going to build or not.
env:
- TRAVIS_TEST=unix
- TRAVIS_TEST=docs
- TRAVIS_TEST=translations
- TRAVIS_BOARD=feather_huzzah
- TRAVIS_BOARD=arduino_zero
- TRAVIS_BOARD=circuitplayground_express
- TRAVIS_BOARD=pca10056
# The rest of the boards, in alphabetical order.
- TRAVIS_BOARD=trinket_m0
- TRAVIS_BOARD=feather_m4_express
- TRAVIS_BOARD=grandcentral_m4_express
- TRAVIS_BOARD=arduino_zero
- TRAVIS_BOARD=circuitplayground_express_crickit
- TRAVIS_BOARD=feather_m0_basic
- TRAVIS_BOARD=feather_m0_adalogger
- TRAVIS_BOARD=feather_m0_rfm69
- TRAVIS_BOARD=feather_m0_rfm9x
- TRAVIS_BOARD=feather_m0_basic
- TRAVIS_BOARD=feather_m0_express
- TRAVIS_BOARD=feather_m0_express_crickit
- TRAVIS_BOARD=feather_m4_express
- TRAVIS_BOARD=feather_m0_rfm69
- TRAVIS_BOARD=feather_m0_rfm9x
- TRAVIS_BOARD=feather_nrf52832
- TRAVIS_BOARD=feather_nrf52840_express
- TRAVIS_BOARD=feather_radiofruit_zigbee
- TRAVIS_BOARD=gemma_m0
- TRAVIS_BOARD=hallowing_m0_express
- TRAVIS_BOARD=itsybitsy_m0_express
- TRAVIS_BOARD=itsybitsy_m4_express
- TRAVIS_BOARD=metro_m0_express
- TRAVIS_BOARD=metro_m4_express
- TRAVIS_BOARD=pca10059
- TRAVIS_BOARD=pirkey_m0
- TRAVIS_BOARD=trinket_m0
- TRAVIS_BOARD=gemma_m0
- TRAVIS_BOARD=hallowing_m0_express
- TRAVIS_BOARD=feather52832
- TRAVIS_BOARD=pca10056
- TRAVIS_TEST=qemu
- TRAVIS_TEST=unix
- TRAVIS_TEST=docs
- TRAVIS_BOARD=trellis_m4_express

addons:
artifacts:
Expand All @@ -47,48 +58,38 @@ notifications:

before_script:
- sudo dpkg --add-architecture i386
- |
sudo apt-get install -y python3 gcc-multilib pkg-config libffi-dev libffi-dev:i386 qemu-system ||
sleep 30 ||
sudo apt-get install -y python3 gcc-multilib pkg-config libffi-dev libffi-dev:i386 qemu-system

- ([[ -z "$TRAVIS_TEST" ]] || sudo apt-get install -y qemu-system)
- ([[ -z "$TRAVIS_BOARD" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
- ([[ $TRAVIS_TEST != "qemu" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
- ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))

# For teensy build
- sudo apt-get install realpath
# For nrf builds
- ([[ $TRAVIS_BOARD != "feather52832" && $TRAVIS_BOARD != "pca10056" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh)
- ([[ $TRAVIS_BOARD != "feather_nrf52832" && $TRAVIS_BOARD != "feather_nrf52840_express" && $TRAVIS_BOARD != "pca10056" && $TRAVIS_BOARD != "pca10059" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh)
# For huzzah builds
- if [[ $TRAVIS_BOARD = "feather_huzzah" ]]; then wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz && tar xavf xtensa-lx106-elf-standalone.tar.gz; PATH=$(readlink -f xtensa-lx106-elf/bin):$PATH; fi
# For coverage testing (upgrade is used to get latest urllib3 version)
- ([[ -z "$TRAVIS_TEST" ]] || sudo apt-get install -y python3-pip)
- ([[ -z "$TRAVIS_TEST" ]] || sudo pip install --upgrade cpp-coveralls)
- ([[ $TRAVIS_TEST != "docs" ]] || sudo pip install 'Sphinx<1.8.0' sphinx-rtd-theme recommonmark)
- ([[ $TRAVIS_TEST != "translations" ]] || sudo pip3 install polib)
- gcc --version
- ([[ -z "$TRAVIS_BOARD" ]] || arm-none-eabi-gcc --version)
- ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || arm-none-eabi-gcc --version)
- python3 --version

script:
# Build mpy-cross first because other builds depend on it.
- echo 'Building mpy-cross' && echo -en 'travis_fold:start:mpy-cross\\r'
- make -C mpy-cross
- make -C mpy-cross -j2
- echo -en 'travis_fold:end:mpy-cross\\r'

- echo 'Building Adafruit binaries' && echo -en 'travis_fold:start:adafruit-bins\\r'
- ([[ -z "$TRAVIS_BOARD" ]] || tools/build_adafruit_bins.sh)
- echo -en 'travis_fold:end:adafruit-bins\\r'

- echo 'Building unix' && echo -en 'travis_fold:start:unix\\r'
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix deplibs)
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix)
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix coverage)
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix deplibs -j2)
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix -j2)
- ([[ $TRAVIS_TEST != "unix" ]] || make -C ports/unix coverage -j2)
- echo -en 'travis_fold:end:unix\\r'

- echo 'Building qemu' && echo -en 'travis_fold:start:qemu\\r'
- ([[ $TRAVIS_TEST != "qemu" ]] || make -C ports/qemu-arm test)
- echo -en 'travis_fold:end:qemu\\r'

# run tests without coverage info
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests -j1)
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests -j1 --emit native)
Expand All @@ -114,10 +115,12 @@ script:
- ([[ $TRAVIS_TEST != "docs" ]] || sphinx-build -E -W -b html . _build/html)
- echo -en 'travis_fold:end:build_docs\\r'

- (echo 'Building translations' && echo -en 'travis_fold:start:build_translations\\r')
- ([[ $TRAVIS_TEST != "translations" ]] || make check-translate)
- echo -en 'travis_fold:end:build_translations\\r'

# run coveralls coverage analysis (try to, even if some builds/tests failed)
#- (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)

after_failure:
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
- (grep "FAIL" ports/qemu-arm/build/console.out)
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ CONFDIR = .
FORCE = -E
VERBOSE = -v

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. 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 executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# 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
# executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand Down Expand Up @@ -190,3 +189,15 @@ pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

# phony target so we always run
all-source:

locale/circuitpython.pot: all-source
find . -iname "*.c" | xargs xgettext -L C --keyword=translate -F -o circuitpython.pot -p locale

translate: locale/circuitpython.pot
for po in $(shell ls locale/*.po); do msgmerge -U -F $$po locale/circuitpython.pot; done

check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
$(PYTHON) tools/check_translations.py $^
5 changes: 4 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,17 @@
"ports/cc3200",
"ports/cc3200/FreeRTOS",
"ports/cc3200/hal",
"ports/esp32",
"ports/esp8266/boards",
"ports/esp8266/common-hal",
"ports/esp8266/modules",
"ports/minimal",
"ports/nrf/device",
"ports/nrf/drivers",
"ports/nrf/hal",
"ports/nrf/modules",
"ports/nrf/nrfx",
"ports/nrf/peripherals",
"ports/nrf/usb",
"ports/pic16bit",
"ports/qemu-arm",
"ports/stm32",
Expand Down
13 changes: 13 additions & 0 deletions docs/drivers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ These libraries build on top of the low level APIs to simplify common tasks.
AVR programming <https://circuitpython.readthedocs.io/projects/avrprog/en/latest/>
DC Motor and Servo <https://circuitpython.readthedocs.io/projects/motor/en/latest/>
SD Card <https://circuitpython.readthedocs.io/projects/sd/en/latest/>
Image Load <https://circuitpython.readthedocs.io/projects/imageload/en/latest/>
LED Animation <https://circuitpython.readthedocs.io/projects/led-animation/en/latest/>

Blinky
--------
Expand All @@ -77,6 +79,7 @@ Multi-color led drivers.
NeoPixel <https://circuitpython.readthedocs.io/projects/neopixel/en/latest/>
DotStar <https://circuitpython.readthedocs.io/projects/dotstar/en/latest/>
WS2801 <https://circuitpython.readthedocs.io/projects/ws2801/en/latest/>
Pixie <https://circuitpython.readthedocs.io/projects/pixie/en/latest/>

Displays
-------------
Expand All @@ -91,6 +94,7 @@ Drivers used to display information. Either pixel or segment based.
IS31FL3731 Charlieplexed LED Matrix <https://circuitpython.readthedocs.io/projects/is31fl3731/en/latest/>
MAX7219 LED Matrix <https://circuitpython.readthedocs.io/projects/max7219/en/latest/>
SSD1306 OLED Driver <https://circuitpython.readthedocs.io/projects/ssd1306/en/latest/>
E-Paper Display <https://circuitpython.readthedocs.io/projects/epd/en/latest/>

Real-time clocks
-----------------
Expand Down Expand Up @@ -120,6 +124,7 @@ Motion relating sensing including ``acceleration``, ``magnetic``, ``gyro``, and
LSM9DS0 Accelerometer, Magnetometer, Gyroscope and Temperature <https://circuitpython.readthedocs.io/projects/lsm9ds0/en/latest/>
LSM9DS1 Accelerometer, Magnetometer, Gyroscope and Temperature <https://circuitpython.readthedocs.io/projects/lsm9ds1/en/latest/>
MMA8451 3 axis accelerometer <https://circuitpython.readthedocs.io/projects/mma8451/en/latest/>
L3GD20 Gyroscope <https://circuitpython.readthedocs.io/projects/l3gd20/en/latest/>

Environmental Sensors
----------------------
Expand All @@ -145,6 +150,8 @@ equivalent carbon dioxide (``eco2`` / ``eCO2``), and total volatile organic comp
SHT31-D Temperature and Humidity <https://circuitpython.readthedocs.io/projects/sht31d/en/latest/>
Si7021 Temperature and Humidity <https://circuitpython.readthedocs.io/projects/si7021/en/latest/>
Thermistor Temperature <https://circuitpython.readthedocs.io/projects/thermistor/en/latest/>
TMP007 Contactless Temperature <https://circuitpython.readthedocs.io/projects/tmp007/en/latest/>
MLX90614 Contactless Temperature <https://circuitpython.readthedocs.io/projects/mlx90614/en/latest/>

Light Sensors
---------------
Expand All @@ -171,6 +178,7 @@ These sensors measure the ``distance`` to another object and may also measure li

VL6180x 5 - 100 mm <https://circuitpython.readthedocs.io/projects/vl6180x/en/latest/>
VL53L0x ~30 - 1000 mm <https://circuitpython.readthedocs.io/projects/vl53l0x/en/latest/>
HC-SR04 ultrasonic range sensors <https://circuitpython.readthedocs.io/projects/hcsr04/en/latest/>

Radio
--------
Expand All @@ -181,6 +189,7 @@ These chips communicate to other's over radio.

RFM9x LoRa <https://circuitpython.readthedocs.io/projects/rfm9x/en/latest/>
RFM69 Packet Radio <https://circuitpython.readthedocs.io/projects/rfm69/en/latest/>
PN532 NFC/RFID <https://circuitpython.readthedocs.io/projects/pn532/en/latest/>

IO Expansion
--------------
Expand All @@ -200,6 +209,8 @@ These provide functionality similar to `analogio`, `digitalio`, `pulseio`, and `
TLC5947 24 x 12-bit PWM Driver <https://circuitpython.readthedocs.io/projects/tlc5947/en/latest/>
TLC59711 12 x 16-bit PWM Driver <https://circuitpython.readthedocs.io/projects/tlc59711/en/latest/>
MPR121 Capacitive Touch Sensor <https://circuitpython.readthedocs.io/projects/mpr121/en/latest/>
TCA9548 I2C Multiplexer <https://circuitpython.readthedocs.io/projects/tca9548a/en/latest/>
MCP3xxx SPI ADC <https://circuitpython.readthedocs.io/projects/mcp3xxx/en/latest/>

Miscellaneous
----------------
Expand All @@ -216,3 +227,5 @@ Miscellaneous
VC0706 TTL Camera <https://circuitpython.readthedocs.io/projects/vc0706/en/latest/>
INA219 High Side Current <https://circuitpython.readthedocs.io/projects/ina219/en/latest/>
Fingerprint <https://circuitpython.readthedocs.io/projects/fingerprint/en/latest/>
STMPE610 Resistive Touchscreen <https://circuitpython.readthedocs.io/projects/stmpe610/en/latest/>
Matrix Keypad <https://circuitpython.readthedocs.io/projects/matrixkeypad/en/latest/>
4 changes: 2 additions & 2 deletions docs/library/array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Classes

.. method:: append(val)

Append new element to the end of array, growing it.
Append new element ``val`` to the end of array, growing it.

.. method:: extend(iterable)

Append new elements as contained in an iterable to the end of
Append new elements as contained in `iterable` to the end of
array, growing it.
2 changes: 1 addition & 1 deletion docs/library/btree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:synopsis: simple BTree database

The ``btree`` module implements a simple key-value database using external
storage (disk files, or in general case, a random-access stream). Keys are
storage (disk files, or in general case, a random-access ``stream``). Keys are
stored sorted in the database, and besides efficient retrieval by a key
value, a database also supports efficient ordered range scans (retrieval
of values with the keys in a given range). On the application interface
Expand Down
8 changes: 8 additions & 0 deletions docs/library/framebuf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ Constants

Red Green Blue (16-bit, 5+6+5) color format

.. data:: framebuf.GS2_HMSB

Grayscale (2-bit) color format

.. data:: framebuf.GS4_HMSB

Grayscale (4-bit) color format

.. data:: framebuf.GS8

Grayscale (8-bit) color format
Loading