├── .github └── FUNDING.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE ├── Makefile ├── README.rst ├── VERSION.txt ├── bin ├── build.sh ├── compile_ino.py ├── dbgen.py ├── docgen.py ├── make_frozen.py ├── mpy-cross-i686-darwin ├── mpy-cross-i686-linux ├── mpy-cross-i686.exe ├── mpy-cross-x86_64-darwin ├── mpy-cross-x86_64-linux ├── mpy-tool-wrapper.py └── release.py ├── codecov.yml ├── docs ├── Makefile ├── README.rst ├── boards.rst ├── boards │ ├── arduino_due.rst │ ├── cygwin.rst │ ├── esp01.rst │ ├── esp12e.rst │ ├── esp32_devkitc.rst │ ├── linux.rst │ ├── nano32.rst │ ├── nodemcu.rst │ └── photon.rst ├── conf.py ├── developer-guide.rst ├── developer-guide │ └── releasing.rst ├── examples.rst ├── examples │ ├── blink.rst │ ├── blink │ │ └── source-code.rst │ ├── ds18b20.rst │ ├── ds18b20 │ │ └── source-code.rst │ ├── hello_world.rst │ ├── hello_world │ │ └── source-code.rst │ ├── interactive.rst │ ├── select.rst │ ├── select │ │ └── source-code.rst │ ├── tcp_server.rst │ └── tcp_server │ │ └── source-code.rst ├── getting-started.rst ├── images │ ├── Arduino_Logo.png │ ├── Pumbaa.odp │ ├── Simba_Logo.jpg │ ├── architecture.jpg │ ├── build.sh │ ├── logo.jpg │ └── platformio-logo.png ├── index.rst ├── library-reference.rst ├── library-reference │ ├── micropython.rst │ ├── micropython │ │ ├── gc.rst │ │ └── micropython.rst │ ├── pumbaa.rst │ ├── pumbaa │ │ ├── board.rst │ │ ├── drivers.rst │ │ ├── inet.rst │ │ ├── kernel.rst │ │ ├── sync.rst │ │ └── text.rst │ ├── standard.rst │ └── standard │ │ ├── _thread.rst │ │ ├── array.rst │ │ ├── binascii.rst │ │ ├── cmath.rst │ │ ├── collections.rst │ │ ├── hashlib.rst │ │ ├── io.rst │ │ ├── json.rst │ │ ├── math.rst │ │ ├── os.rst │ │ ├── random.rst │ │ ├── re.rst │ │ ├── select.rst │ │ ├── socket.rst │ │ ├── ssl.rst │ │ ├── struct.rst │ │ ├── sys.rst │ │ ├── time.rst │ │ └── zlib.rst ├── license.rst ├── requirements.txt ├── sphinx.mk ├── user-guide.rst ├── user-guide │ ├── build-system.rst │ ├── configuration.rst │ ├── environment-setup.rst │ └── hello-world-application.rst └── videos.rst ├── examples ├── Makefile ├── blink │ ├── Makefile │ └── main.py ├── default-configuration │ ├── Makefile │ └── main.py ├── ds18b20 │ ├── Makefile │ └── main.py ├── eeprom_i2c │ ├── Makefile │ └── main.py ├── ftp_server │ ├── Makefile │ ├── config.h │ ├── ftp_server.py │ └── main.py ├── hello_world │ ├── Makefile │ └── main.py ├── http_server │ ├── Makefile │ ├── main.py │ └── websocket_client.py ├── https_server │ ├── Makefile │ ├── README.rst │ └── main.py ├── interactive │ ├── Makefile │ ├── README.rst │ └── main.py ├── interactive_full │ ├── Makefile │ ├── README.rst │ └── config.h ├── minimal-configuration │ ├── Makefile │ └── main.py ├── music_player │ ├── Makefile │ ├── README.rst │ ├── main.py │ └── music_player.py ├── select │ ├── Makefile │ ├── config.h │ └── main.py ├── ssl_client │ ├── Makefile │ ├── README.rst │ ├── client.py │ ├── main.py │ ├── server.crt │ ├── server.csr │ ├── server.key │ ├── server.orig.key │ └── server.py ├── ssl_server │ ├── Makefile │ ├── README.rst │ ├── client.py │ ├── main.py │ ├── server.crt │ ├── server.csr │ ├── server.key │ ├── server.orig.key │ └── server.py ├── tcp_server │ ├── Makefile │ └── main.py ├── timer │ ├── Makefile │ └── main.py └── ws2812 │ ├── Makefile │ └── main.py ├── make ├── app.mk ├── arduino │ ├── arduino.py │ ├── esp │ │ ├── boards.txt │ │ ├── package_pumbaa_esp_index.json │ │ └── platform.txt │ ├── esp32 │ │ ├── boards.txt │ │ ├── package_pumbaa_esp32_index.json │ │ └── platform.txt │ └── sam │ │ ├── boards.txt │ │ ├── package_pumbaa_sam_index.json │ │ └── platform.txt ├── platformio.sconscript └── platformio │ ├── arduino_due │ └── genhdr │ │ ├── qstrdefs.generated.h │ │ └── qstrdefs.preprocessed.h │ ├── manifest.json │ ├── nano32 │ └── genhdr │ │ ├── qstrdefs.generated.h │ │ └── qstrdefs.preprocessed.h │ └── platformio.py ├── package.json ├── setup.sh ├── src ├── boards │ ├── arduino_due │ │ ├── gccollect.c │ │ ├── gchelper.S │ │ ├── memory.h │ │ ├── module_board.c │ │ └── simba_board.h │ ├── esp01 │ │ ├── board.mk │ │ ├── memory.h │ │ ├── module_board.c │ │ └── simba_board.h │ ├── esp12e │ │ ├── board.mk │ │ ├── memory.h │ │ ├── module_board.c │ │ └── simba_board.h │ ├── esp32_devkitc │ │ ├── board.mk │ │ ├── memory.h │ │ ├── module_board.c │ │ └── simba_board.h │ ├── linux │ │ ├── gccollect.c │ │ ├── module_board.c │ │ └── simba_board.h │ ├── nano32 │ │ ├── board.mk │ │ ├── memory.h │ │ ├── module_board.c │ │ └── simba_board.h │ ├── nodemcu │ │ ├── board.mk │ │ ├── memory.h │ │ ├── module_board.c │ │ └── simba_board.h │ └── photon │ │ ├── gccollect.c │ │ ├── gchelper.S │ │ ├── memory.h │ │ ├── module_board.c │ │ └── simba_board.h ├── builtin_help.c ├── builtin_input.c ├── config.h ├── main.c ├── mcus │ ├── esp32 │ │ └── gccollect.c │ └── esp8266 │ │ ├── gccollect.c │ │ ├── gchelper.S │ │ └── ld │ │ ├── pumbaa.common.ld │ │ ├── pumbaa.flash.1m.ld │ │ ├── pumbaa.flash.4m.ld │ │ ├── pumbaa.flash.512k.ld │ │ └── pumbaa.rom.addr.ld ├── module_drivers.c ├── module_drivers │ ├── class_adc.c │ ├── class_adc.h │ ├── class_can.c │ ├── class_can.h │ ├── class_dac.c │ ├── class_dac.h │ ├── class_ds18b20.c │ ├── class_ds18b20.h │ ├── class_eeprom_i2c.c │ ├── class_eeprom_i2c.h │ ├── class_esp_wifi.c │ ├── class_esp_wifi.h │ ├── class_exti.c │ ├── class_exti.h │ ├── class_flash.c │ ├── class_flash.h │ ├── class_i2c.c │ ├── class_i2c.h │ ├── class_i2c_soft.c │ ├── class_i2c_soft.h │ ├── class_owi.c │ ├── class_owi.h │ ├── class_pin.c │ ├── class_pin.h │ ├── class_sd.c │ ├── class_sd.h │ ├── class_spi.c │ ├── class_spi.h │ ├── class_uart.c │ ├── class_uart.h │ ├── class_ws2812.c │ └── class_ws2812.h ├── module_inet.c ├── module_inet │ ├── class_http_server.c │ ├── class_http_server.h │ ├── class_http_server_websocket.c │ └── class_http_server_websocket.h ├── module_io.c ├── module_kernel.c ├── module_kernel │ ├── class_timer.c │ └── class_timer.h ├── module_os.c ├── module_select.c ├── module_socket.c ├── module_ssl.c ├── module_sync.c ├── module_sync │ ├── class_event.c │ ├── class_event.h │ ├── class_queue.c │ └── class_queue.h ├── module_sys.c ├── module_text.c ├── module_thread.c ├── module_time.c ├── port │ ├── genhdr │ │ └── mpversion.h │ ├── lexer_port.c │ ├── mpconfigport.h │ ├── mphalport.h │ ├── mpthreadport.h │ └── port.c ├── pumbaa.h ├── pumbaa.mk ├── pumbaa_config_default.h ├── py │ └── harness.py └── simba_config.h └── tst ├── all ├── Makefile ├── config.h └── main.py ├── drivers ├── adc │ ├── Makefile │ └── adc_suite.py ├── can │ ├── Makefile │ ├── can_suite.py │ └── config.h ├── dac │ ├── Makefile │ └── dac_suite.py ├── ds18b20 │ ├── Makefile │ ├── config.h │ └── ds18b20_suite.py ├── espressif_wifi │ └── espressif_wifi_suite.py ├── exti │ ├── Makefile │ └── exti_suite.py ├── flash │ ├── Makefile │ └── flash_suite.py ├── i2c │ ├── Makefile │ ├── config.h │ └── i2c_suite.py ├── owi │ ├── Makefile │ ├── config.h │ └── owi_suite.py ├── pin │ ├── Makefile │ └── pin_suite.py ├── sd │ ├── Makefile │ └── sd_suite.py ├── spi │ ├── Makefile │ └── spi_suite.py └── uart │ ├── Makefile │ └── uart_suite.py ├── inet ├── http_server │ ├── Makefile │ ├── config.h │ └── http_server_suite.py └── ssl │ ├── Makefile │ ├── config.h │ └── ssl_suite.py ├── kernel └── timer │ ├── Makefile │ └── timer_suite.py ├── os ├── Makefile ├── config.h └── os_suite.py ├── select ├── Makefile └── select_suite.py ├── smoke ├── Makefile ├── config.h ├── other.py └── smoke_suite.py ├── socket ├── Makefile ├── config.h └── socket_suite.py ├── stubs ├── can_stub.c ├── ds18b20_stub.c ├── flash_stub.c ├── fs_stub.c ├── i2c_stub.c ├── owi_stub.c ├── sd_stub.c ├── socket_stub.c ├── ssl_stub.c └── stubs.h ├── sync ├── event │ ├── Makefile │ └── event_suite.py └── queue │ ├── Makefile │ └── queue_suite.py └── thread ├── Makefile └── thread_suite.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: eerimoq 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | build/ 3 | TAGS 4 | .TAGS 5 | settings.bin 6 | docs/_build 7 | 8 | coverage.* 9 | 10 | # Coverage output. 11 | tst/*/*/amber.png 12 | tst/*/*/emerald.png 13 | tst/*/*/gcov.css 14 | tst/*/*/glass.png 15 | tst/*/*/index.html 16 | tst/*/*/index-sort-f.html 17 | tst/*/*/index-sort-l.html 18 | tst/*/*/ruby.png 19 | tst/*/*/snow.png 20 | tst/*/*/updown.png 21 | tst/*/*/micropython 22 | tst/*/*/src 23 | tst/*/*/simba 24 | tst/*/*/tst 25 | 26 | tst/*/amber.png 27 | tst/*/emerald.png 28 | tst/*/gcov.css 29 | tst/*/glass.png 30 | tst/*/index.html 31 | tst/*/index-sort-f.html 32 | tst/*/index-sort-l.html 33 | tst/*/ruby.png 34 | tst/*/snow.png 35 | tst/*/updown.png 36 | tst/*/micropython 37 | tst/*/src 38 | tst/*/simba 39 | tst/*/tst 40 | 41 | examples/*/*/amber.png 42 | examples/*/*/emerald.png 43 | examples/*/*/gcov.css 44 | examples/*/*/glass.png 45 | examples/*/*/index.html 46 | examples/*/*/index-sort-f.html 47 | examples/*/*/index-sort-l.html 48 | examples/*/*/ruby.png 49 | examples/*/*/snow.png 50 | examples/*/*/updown.png 51 | 52 | *.passed 53 | 54 | pumbaa-arduino 55 | database.json -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "simba"] 2 | path = simba 3 | url = https://github.com/eerimoq/simba 4 | [submodule "micropython"] 5 | path = micropython 6 | url = https://github.com/eerimoq/micropython.git 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | dist: trusty 4 | 5 | before_install: 6 | - sudo apt-get update -qq 7 | - sudo apt-get install -qq lcov -y 8 | - source setup.sh 9 | - gcc --version 10 | - g++ --version 11 | - ld --version 12 | 13 | script: make -s travis -j $(cat /proc/cpuinfo | grep processor | wc -l) 14 | 15 | after_success: 16 | - make codecov-coverage 17 | - bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2017, Erik Moqvist 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | |buildstatus|_ 2 | |codecov|_ 3 | 4 | About 5 | ===== 6 | 7 | `Pumbaa` is `Python` on top of `Simba`. See 8 | http://pumbaa.readthedocs.org for further details. 9 | 10 | The implementation is a port of `MicroPython`, designed for embedded 11 | devices with limited amount of RAM and code memory. 12 | 13 | Try it out! 14 | =========== 15 | 16 | 1. Download the `Arduino IDE`_ and install Pumbaa using the Boards Manager. 17 | 18 | .. code-block:: text 19 | 20 | https://raw.githubusercontent.com/eerimoq/pumbaa-releases/master/arduino/sam/package_pumbaa_sam_index.json 21 | https://raw.githubusercontent.com/eerimoq/pumbaa-releases/master/arduino/esp32/package_pumbaa_esp32_index.json 22 | 23 | 2. Select a Pumbaa board. 24 | 3. Open the interactive example. 25 | 4. Upload! 26 | 27 | See the `Pumbaa documentation`_ for detailed step-by-step instructions. 28 | 29 | .. |buildstatus| image:: https://travis-ci.org/eerimoq/pumbaa.svg 30 | .. _buildstatus: https://travis-ci.org/eerimoq/pumbaa 31 | 32 | .. |codecov| image:: https://codecov.io/gh/eerimoq/pumbaa/branch/master/graph/badge.svg 33 | .. _codecov: https://codecov.io/gh/eerimoq/pumbaa 34 | 35 | .. _Arduino IDE: https://www.arduino.cc/en/Main/Software 36 | .. _Pumbaa documentation: http://pumbaa.readthedocs.io/en/latest/getting-started.html#arduino-arduino-ide 37 | -------------------------------------------------------------------------------- /VERSION.txt: -------------------------------------------------------------------------------- 1 | 3.0.3 2 | -------------------------------------------------------------------------------- /bin/compile_ino.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import print_function 4 | 5 | import sys 6 | import os 7 | import subprocess 8 | import make_frozen 9 | 10 | 11 | def main(): 12 | ino_cpp = sys.argv[-3] 13 | main_py = os.path.join(os.path.dirname(sys.argv[-3]), "main.py") 14 | 15 | # Copy the .ino.cpp to main.py. 16 | with open(main_py, "w") as fout: 17 | with open(ino_cpp) as fin: 18 | for line in fin: 19 | fout.write(line) 20 | 21 | # Generate the frozen module and write it to .ino.cpp. 22 | frozen = make_frozen.generate_frozen([main_py]) 23 | with open(ino_cpp, "w") as fout: 24 | fout.write(frozen) 25 | subprocess.check_call(sys.argv[1:]) 26 | 27 | 28 | if __name__ == '__main__': 29 | main() 30 | -------------------------------------------------------------------------------- /bin/mpy-cross-i686-darwin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/bin/mpy-cross-i686-darwin -------------------------------------------------------------------------------- /bin/mpy-cross-i686-linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/bin/mpy-cross-i686-linux -------------------------------------------------------------------------------- /bin/mpy-cross-i686.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/bin/mpy-cross-i686.exe -------------------------------------------------------------------------------- /bin/mpy-cross-x86_64-darwin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/bin/mpy-cross-x86_64-darwin -------------------------------------------------------------------------------- /bin/mpy-cross-x86_64-linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/bin/mpy-cross-x86_64-linux -------------------------------------------------------------------------------- /bin/mpy-tool-wrapper.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Wrapper for mpy-cross.py. 4 | # 5 | 6 | from __future__ import print_function 7 | 8 | import sys 9 | import os 10 | import subprocess 11 | 12 | 13 | def main(): 14 | command = sys.argv[3:] 15 | env = dict(os.environ, PYTHONPATH=sys.argv[2]) 16 | with open(sys.argv[1], 'w') as f: 17 | f.write(subprocess.check_output(command, env=env).decode("utf-8")) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | ignore: 3 | - "simba/*" 4 | - "micropython/*" 5 | - "src/boards/*" 6 | - "tst/*" -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all doxygen sphinx clean 2 | 3 | all: 4 | $(MAKE) doxygen 5 | $(MAKE) sphinx 6 | 7 | doxygen: 8 | doxygen doxygen.cfg 9 | 10 | sphinx: 11 | $(MAKE) -f sphinx.mk html 12 | echo "Run 'firefox `readlink -f _build/html/index.html`' to view the generated documentation." 13 | 14 | sphinx-clean: 15 | $(MAKE) -f sphinx.mk clean 16 | 17 | clean: 18 | rm -rf xml 19 | $(MAKE) -f sphinx.mk clean 20 | -------------------------------------------------------------------------------- /docs/README.rst: -------------------------------------------------------------------------------- 1 | Documentation 2 | ============= 3 | 4 | The documentation is generated to ``.html`` from ``.rst`` files using 5 | `Sphinx`. 6 | 7 | .. code-block:: text 8 | 9 | cd .. && make doc && firefox doc/_build/html/index.html 10 | -------------------------------------------------------------------------------- /docs/boards.rst: -------------------------------------------------------------------------------- 1 | Boards 2 | ====== 3 | 4 | The boards supported by `Pumbaa`. 5 | 6 | .. toctree:: 7 | :glob: 8 | :titlesonly: 9 | :maxdepth: 1 10 | 11 | boards/* 12 | -------------------------------------------------------------------------------- /docs/boards/cygwin.rst: -------------------------------------------------------------------------------- 1 | Cygwin 2 | ====== 3 | -------------------------------------------------------------------------------- /docs/developer-guide.rst: -------------------------------------------------------------------------------- 1 | Developer Guide 2 | =============== 3 | 4 | This guide is intended for developers of the Pumbaa Embedded 5 | Programming Platform. Users are advised to read the :doc:`user-guide` 6 | instead. 7 | 8 | **Contents:** 9 | 10 | .. toctree:: 11 | :glob: 12 | :maxdepth: 1 13 | 14 | developer-guide/releasing 15 | -------------------------------------------------------------------------------- /docs/examples.rst: -------------------------------------------------------------------------------- 1 | Examples 2 | ======== 3 | 4 | Below is a list of simple examples that are useful to understand the 5 | basics of `Pumbaa`. 6 | 7 | There are a lot more :github-tree:`examples` and 8 | :github-tree:`unit tests` on Github that shows how to use most of 9 | the `Pumbaa` modules. 10 | 11 | .. toctree:: 12 | :maxdepth: 1 13 | :glob: 14 | 15 | examples/* 16 | -------------------------------------------------------------------------------- /docs/examples/blink.rst: -------------------------------------------------------------------------------- 1 | Blink 2 | ===== 3 | 4 | About 5 | ----- 6 | 7 | Turn a LED on and off periodically once a second. This example 8 | illustrates how to use digital pins and sleep a thread. 9 | 10 | .. raw:: html 11 | 12 | 13 |
14 |
15 | 16 | Source code 17 | ----------- 18 | 19 | .. include:: blink/source-code.rst 20 | 21 | The source code can also be found on Github in the 22 | :github-tree:`examples/blink` folder. 23 | 24 | Build and run 25 | ------------- 26 | 27 | Build and upload the application. 28 | 29 | .. code-block:: text 30 | 31 | $ cd examples/blink 32 | $ make -s BOARD= upload 33 | -------------------------------------------------------------------------------- /docs/examples/blink/source-code.rst: -------------------------------------------------------------------------------- 1 | .. code-block:: python 2 | 3 | # 4 | # @section License 5 | # 6 | # The MIT License (MIT) 7 | # 8 | # Copyright (c) 2016-2017, Erik Moqvist 9 | # 10 | # Permission is hereby granted, free of charge, to any person 11 | # obtaining a copy of this software and associated documentation 12 | # files (the "Software"), to deal in the Software without 13 | # restriction, including without limitation the rights to use, copy, 14 | # modify, merge, publish, distribute, sublicense, and/or sell copies 15 | # of the Software, and to permit persons to whom the Software is 16 | # furnished to do so, subject to the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be 19 | # included in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 25 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 26 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 27 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | # SOFTWARE. 29 | # 30 | # This file is part of the Pumbaa project. 31 | # 32 | 33 | 34 | import time 35 | import board 36 | from drivers import Pin 37 | 38 | LED = Pin(board.PIN_LED, Pin.OUTPUT) 39 | 40 | while True: 41 | LED.toggle() 42 | time.sleep(0.5) 43 | 44 | -------------------------------------------------------------------------------- /docs/examples/ds18b20.rst: -------------------------------------------------------------------------------- 1 | Ds18b20 2 | ======= 3 | 4 | About 5 | ----- 6 | 7 | Read and print the room temperature measured with a DS18B20 sensor. 8 | 9 | .. raw:: html 10 | 11 | 12 |
13 |
14 | 15 | Source code 16 | ----------- 17 | 18 | .. include:: ds18b20/source-code.rst 19 | 20 | The source code can also be found on Github in the 21 | :github-tree:`examples/ds18b20` folder. 22 | 23 | Build and run 24 | ------------- 25 | 26 | Build and upload the application. 27 | 28 | .. code-block:: text 29 | 30 | $ cd examples/ds18b20 31 | $ make -s BOARD= upload 32 | -------------------------------------------------------------------------------- /docs/examples/hello_world.rst: -------------------------------------------------------------------------------- 1 | Hello World 2 | =========== 3 | 4 | About 5 | ----- 6 | 7 | This application prints "Hello world!" to standard output. 8 | 9 | Source code 10 | ----------- 11 | 12 | .. include:: hello_world/source-code.rst 13 | 14 | The source code can also be found on Github in the 15 | :github-tree:`examples/hello_world` folder. 16 | 17 | Build and run 18 | ------------- 19 | 20 | Build and run the application. 21 | 22 | .. code-block:: text 23 | 24 | $ cd examples/hello_world 25 | $ make -s BOARD= run 26 | ... 27 | Hello world! 28 | $ 29 | -------------------------------------------------------------------------------- /docs/examples/hello_world/source-code.rst: -------------------------------------------------------------------------------- 1 | .. code-block:: python 2 | 3 | # 4 | # @section License 5 | # 6 | # The MIT License (MIT) 7 | # 8 | # Copyright (c) 2016-2017, Erik Moqvist 9 | # 10 | # Permission is hereby granted, free of charge, to any person 11 | # obtaining a copy of this software and associated documentation 12 | # files (the "Software"), to deal in the Software without 13 | # restriction, including without limitation the rights to use, copy, 14 | # modify, merge, publish, distribute, sublicense, and/or sell copies 15 | # of the Software, and to permit persons to whom the Software is 16 | # furnished to do so, subject to the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be 19 | # included in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 25 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 26 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 27 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | # SOFTWARE. 29 | # 30 | # This file is part of the Pumbaa project. 31 | # 32 | 33 | 34 | print('Hello world!') 35 | 36 | -------------------------------------------------------------------------------- /docs/examples/interactive.rst: -------------------------------------------------------------------------------- 1 | Interactive 2 | =========== 3 | 4 | About 5 | ----- 6 | 7 | This application is a Python interpreter! 8 | 9 | When the application starts it tries to run the script ``main.py`` 10 | from the file system. After the script ends the `Python` interactive 11 | interpreter is started. 12 | 13 | The serial port baudrate is 38400. 14 | 15 | Example script 16 | -------------- 17 | 18 | Here is an example of how to write a script ``main.py`` using the 19 | interpreter. 20 | 21 | 1. Start the serial monitor. 22 | 23 | 2. Create ``main.py`` and write ``print('Hello World!\n')`` to 24 | it. This file will be executed everytime the board starts. 25 | 26 | .. code-block:: text 27 | 28 | MicroPython v1.8.3-88-gf98bb2d on 2016-09-17; Arduino Due with SAM3X8E 29 | Type "help()" for more information. 30 | >>> with open("main.py", "w") as f: 31 | ... f.write("print('Hello World!\n')") 32 | >>> 33 | 34 | 3. Restart the board and you'll see ``Hello World!`` on the screen! 35 | 36 | .. code-block:: text 37 | 38 | Hello World! 39 | 40 | MicroPython v1.8.3-88-gf98bb2d on 2016-09-17; Arduino Due with SAM3X8E 41 | Type "help()" for more information. 42 | >>> 43 | 44 | 4. Done! 45 | 46 | The example can be found on Github in the 47 | :github-tree:`examples/interactive` folder. 48 | 49 | Build and run 50 | ------------- 51 | 52 | Build and run the application. 53 | 54 | .. code-block:: text 55 | 56 | $ cd examples/interactive 57 | $ make -s BOARD=arduino_due run 58 | ... 59 | MicroPython v1.8.3-88-gf98bb2d on 2016-09-17; Arduino Due with SAM3X8E 60 | Type "help()" for more information. 61 | >>> 62 | -------------------------------------------------------------------------------- /docs/examples/select.rst: -------------------------------------------------------------------------------- 1 | Select 2 | ===== 3 | 4 | About 5 | ----- 6 | 7 | Setup three channels, add them to a :class:`poll object` and wait for events to 8 | occur. 9 | 10 | Three channels are polled: 11 | 12 | 1. An :class:`event channel` that waits for a button 13 | to be pressed. 14 | 2. A :class:`queue channel` that the string "foo" is 15 | written to in the script. 16 | 3. A :class:`socket channel` waiting for UDP 17 | packets. 18 | 19 | NOTE: Change the UDP configuration to match your setup. 20 | 21 | Source code 22 | ----------- 23 | 24 | .. include:: select/source-code.rst 25 | 26 | The source code can also be found on Github in the 27 | :github-tree:`examples/select` folder. 28 | 29 | Build and run 30 | ------------- 31 | 32 | Build and upload the application. 33 | 34 | .. code-block:: text 35 | 36 | $ cd examples/blink 37 | $ make -s BOARD=esp12e CDEFS_EXTRA="CONFIG_START_NETWORK_INTERFACE_WIFI_SSID=ssid CONFIG_START_NETWORK_INTERFACE_WIFI_PASSWORD=password" run 38 | ... 39 | queue: b'foo' 40 | 41 | At this point the application is waiting for an event to occur. Send a 42 | UDP packet to it from your PC using Python. 43 | 44 | .. code-block:: python 45 | 46 | >>> import socket 47 | >>> udp = socket.socket(type=socket.SOCK_DGRAM) 48 | >>> udp.sendto('bar', ('192.168.1.103', 30303)) 49 | 50 | The written packet is received by the application and printed. 51 | 52 | .. code-block:: text 53 | 54 | udp: b'bar' 55 | -------------------------------------------------------------------------------- /docs/examples/tcp_server.rst: -------------------------------------------------------------------------------- 1 | TCP Server 2 | ========== 3 | 4 | About 5 | ----- 6 | 7 | Create a listening TCP socket waiting for a client to connect. The 8 | server reads one byte at a time from the socket and writes it back to 9 | the client. 10 | 11 | Source code 12 | ----------- 13 | 14 | .. include:: tcp_server/source-code.rst 15 | 16 | The source code can also be found on Github in the 17 | :github-tree:`examples/tcp_server` folder. 18 | 19 | Build and run 20 | ------------- 21 | 22 | Build and upload the application. 23 | 24 | .. code-block:: text 25 | 26 | $ cd examples/tcp_server 27 | $ make -s BOARD= upload 28 | -------------------------------------------------------------------------------- /docs/images/Arduino_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/docs/images/Arduino_Logo.png -------------------------------------------------------------------------------- /docs/images/Pumbaa.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/docs/images/Pumbaa.odp -------------------------------------------------------------------------------- /docs/images/Simba_Logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/docs/images/Simba_Logo.jpg -------------------------------------------------------------------------------- /docs/images/architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/docs/images/architecture.jpg -------------------------------------------------------------------------------- /docs/images/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # export slides to pdf and then convert them to jpg 6 | sudo soffice --headless --convert-to pdf Pumbaa.odp 7 | convert -density 150 Pumbaa.pdf -quality 95 Pumbaa.jpg 8 | 9 | # crop exported slides 10 | convert Pumbaa-0.jpg -crop 860x320+400+460 logo.jpg 11 | convert Pumbaa-1.jpg -crop 1120x900+210+230 architecture.jpg 12 | 13 | rm -f Pumbaa.pdf 14 | rm Pumbaa-*.jpg 15 | -------------------------------------------------------------------------------- /docs/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/docs/images/logo.jpg -------------------------------------------------------------------------------- /docs/images/platformio-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eerimoq/pumbaa/352aa59d213f10dc7e0181b75c04ffc2afa1d1e3/docs/images/platformio-logo.png -------------------------------------------------------------------------------- /docs/library-reference.rst: -------------------------------------------------------------------------------- 1 | Library Reference 2 | ================= 3 | 4 | Here is a list of builtin modules in `Pumbaa`. 5 | 6 | .. toctree:: 7 | :maxdepth: 3 8 | :numbered: 9 | :titlesonly: 10 | 11 | library-reference/standard 12 | library-reference/micropython 13 | library-reference/pumbaa 14 | -------------------------------------------------------------------------------- /docs/library-reference/micropython.rst: -------------------------------------------------------------------------------- 1 | MicroPython modules 2 | =================== 3 | 4 | MicroPython specific modules. 5 | 6 | .. toctree:: 7 | :numbered: 8 | :titlesonly: 9 | 10 | micropython/gc 11 | micropython/micropython 12 | -------------------------------------------------------------------------------- /docs/library-reference/micropython/gc.rst: -------------------------------------------------------------------------------- 1 | :mod:`gc` --- Garbage Collector management 2 | ========================================== 3 | 4 | .. module:: gc 5 | :synopsis: Garbage Collector management. 6 | 7 | ---------------------------------------------- 8 | 9 | 10 | .. function:: gc.enable() 11 | 12 | Enable automatic garbage collection. 13 | 14 | 15 | .. function:: gc.disable() 16 | 17 | Disable automatic garbage collection. Heap memory can still be 18 | allocated, and garbage collection can still be initiated manually 19 | using ``gc.collect()``. 20 | 21 | 22 | .. function:: gc.collect() 23 | 24 | Run a garbage collection. 25 | 26 | 27 | .. function:: gc.mem_alloc() 28 | 29 | Returns the number of bytes allocated on the heap. 30 | 31 | 32 | .. function:: gc.mem_free() 33 | 34 | Returns the number of bytes available on the heap. 35 | -------------------------------------------------------------------------------- /docs/library-reference/micropython/micropython.rst: -------------------------------------------------------------------------------- 1 | :mod:`micropython` --- Access and control MicroPython internals 2 | =============================================================== 3 | 4 | .. module:: micropython 5 | :synopsis: Access and control MicroPython internals. 6 | 7 | ---------------------------------------------- 8 | 9 | 10 | .. function:: micropython.mem_info([verbose]) 11 | 12 | Print information about currently used memory. If the `verbose` 13 | argument is given then extra information is printed. 14 | 15 | The information that is printed is implementation dependent, but 16 | currently includes the amount of stack and heap used. In verbose 17 | mode it prints out the entire heap indicating which blocks are used 18 | and which are free. 19 | 20 | 21 | .. function:: micropython.qstr_info([verbose]) 22 | 23 | Print information about currently interned strings. If the 24 | `verbose` argument is given then extra information is printed. 25 | 26 | The information that is printed is implementation dependent, but 27 | currently includes the number of interned strings and the amount of 28 | RAM they use. In verbose mode it prints out the names of all 29 | RAM-interned strings. 30 | 31 | 32 | .. function:: micropython.alloc_emergency_exception_buf(size) 33 | 34 | Allocate `size` bytes of RAM for the emergency exception buffer (a 35 | good size is around 100 bytes). The buffer is used to create 36 | exceptions in cases when normal RAM allocation would fail (eg 37 | within an interrupt handler) and therefore give useful traceback 38 | information in these situations. 39 | 40 | A good way to use this function is to put it at the start of your 41 | main script (eg main.py) and then the emergency exception buffer 42 | will be active for all the code following it. 43 | -------------------------------------------------------------------------------- /docs/library-reference/pumbaa.rst: -------------------------------------------------------------------------------- 1 | Pumbaa modules 2 | ============== 3 | 4 | This part of the Library Reference contains Pumbaa specific 5 | modules. 6 | 7 | .. toctree:: 8 | :numbered: 9 | :titlesonly: 10 | 11 | pumbaa/kernel 12 | pumbaa/sync 13 | pumbaa/drivers 14 | pumbaa/inet 15 | pumbaa/text 16 | pumbaa/board 17 | -------------------------------------------------------------------------------- /docs/library-reference/pumbaa/board.rst: -------------------------------------------------------------------------------- 1 | :mod:`board` --- Board devices 2 | ============================== 3 | 4 | .. module:: board 5 | :synopsis: Board devices. 6 | 7 | The board module is board unique. This page shows the general 8 | structure of those modules. 9 | 10 | ---------------------------------------------- 11 | 12 | 13 | .. data:: PIN_ 14 | 15 | Pin devices. 16 | 17 | 18 | .. data:: EXTI_ 19 | 20 | External interrupt devices. 21 | 22 | 23 | .. data:: PWM_ 24 | 25 | PWM devices. 26 | 27 | 28 | .. data:: ADC_ 29 | 30 | ADC devices. 31 | 32 | 33 | .. data:: DAC_ 34 | 35 | DAC devices. 36 | 37 | 38 | .. data:: FLASH_ 39 | 40 | Flash devices. 41 | 42 | 43 | .. data:: SPI_ 44 | 45 | SPI devices. 46 | -------------------------------------------------------------------------------- /docs/library-reference/pumbaa/sync.rst: -------------------------------------------------------------------------------- 1 | :mod:`sync` --- Thread synchroniztion 2 | ===================================== 3 | 4 | .. module:: sync 5 | :synopsis: Thread synchroniztion. 6 | 7 | Thread synchronization refers to the idea that multiple threads are to 8 | join up or handshake at a certain point, in order to reach an 9 | agreement or commit to a certain sequence of action. 10 | 11 | Simba documentation: `sync`_ 12 | 13 | ---------------------------------------------- 14 | 15 | 16 | .. class:: sync.Event() 17 | 18 | Initialize given event object. 19 | 20 | Simba documentation: `sync/event`_ 21 | 22 | 23 | .. method:: read(mask) 24 | 25 | Wait for an event to occur and return a mask of all active 26 | events. 27 | 28 | 29 | .. method:: write(mask) 30 | 31 | Write given event(s) to the channel. 32 | 33 | 34 | .. method:: size() 35 | 36 | Get the number of event(s) set in the channel. 37 | 38 | 39 | .. class:: sync.Queue() 40 | 41 | Initialize given queue object. 42 | 43 | Simba documentation: `sync/queue`_ 44 | 45 | 46 | .. method:: read(size) 47 | 48 | Reads up to `size` number of bytes from the queue and returns 49 | them as a string. Raises an exception on error. 50 | 51 | 52 | .. method:: write(string) 53 | 54 | Write given `string` to the queue. Returns the number of bytes 55 | written. Raises an exception on error. 56 | 57 | 58 | .. method:: size() 59 | 60 | Get the number of bytes available to read. 61 | 62 | 63 | .. _sync: http://simba-os.readthedocs.io/en/latest/library-reference/sync.html 64 | .. _sync/event: http://simba-os.readthedocs.io/en/latest/library-reference/sync/event.html 65 | .. _sync/queue: http://simba-os.readthedocs.io/en/latest/library-reference/sync/queue.html 66 | -------------------------------------------------------------------------------- /docs/library-reference/pumbaa/text.rst: -------------------------------------------------------------------------------- 1 | :mod:`text` --- Text parsing, editing and colorization 2 | ====================================================== 3 | 4 | .. module:: text 5 | :synopsis: Text parsing, editing and colorization. 6 | 7 | Simba documentation: `text`_ 8 | 9 | ---------------------------------------------- 10 | 11 | 12 | .. function:: text.emacs([path]) 13 | 14 | Start the Emacs text editor. Automatically opens file at `path` if 15 | given. 16 | 17 | 18 | .. _text: http://simba-os.readthedocs.io/en/latest/library-reference/text.html 19 | -------------------------------------------------------------------------------- /docs/library-reference/standard.rst: -------------------------------------------------------------------------------- 1 | Standard Library modules 2 | ======================== 3 | 4 | Python Standard Library modules. Only a subset of the cPython module 5 | functionality is implemented in MicroPython. 6 | 7 | .. toctree:: 8 | :numbered: 9 | :titlesonly: 10 | 11 | standard/array 12 | standard/binascii 13 | standard/cmath 14 | standard/collections 15 | standard/hashlib 16 | standard/io 17 | standard/json 18 | standard/math 19 | standard/os 20 | standard/random 21 | standard/select 22 | standard/socket 23 | standard/ssl 24 | standard/struct 25 | standard/sys 26 | standard/_thread 27 | standard/time 28 | standard/zlib 29 | -------------------------------------------------------------------------------- /docs/library-reference/standard/hashlib.rst: -------------------------------------------------------------------------------- 1 | :mod:`hashlib` --- Secure hashes and message digests 2 | ==================================================== 3 | 4 | .. module:: hashlib 5 | :synopsis: Secure hashes and message digests. 6 | 7 | This module implements a common interface to many different secure 8 | hash and message digest algorithms. Included are the FIPS secure hash 9 | algorithms SHA256. 10 | 11 | ---------------------------------------------- 12 | 13 | There is one constructor method named for each type of hash. All 14 | return a hash object with the same simple interface. For example: use 15 | ``sha256()`` to create a SHA-256 hash object. You can now feed this 16 | object with bytes-like objects (normally bytes) using the ``update()`` 17 | method. At any point you can ask it for the digest of the 18 | concatenation of the data fed to it so far using the ``digest()`` or 19 | ``hexdigest()`` methods. 20 | 21 | .. code-block:: python 22 | 23 | >>> import hashlib 24 | >>> m = hashlib.sha256() 25 | >>> m.update(b"Nobody inspects") 26 | >>> m.update(b" the spammish repetition") 27 | >>> m.digest() 28 | b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06' 29 | -------------------------------------------------------------------------------- /docs/library-reference/standard/json.rst: -------------------------------------------------------------------------------- 1 | :mod:`json` --- JSON encoder and decoder 2 | ======================================== 3 | 4 | .. module:: json 5 | :synopsis: JSON encoder and decoder. 6 | 7 | JSON (JavaScript Object Notation) is a lightweight data interchange 8 | format inspired by JavaScript object literal syntax. 9 | 10 | ---------------------------------------------- 11 | 12 | 13 | .. function:: json.dumps(obj) 14 | 15 | Serialize `obj` to a JSON formatted str using this conversion 16 | table. 17 | 18 | 19 | .. function:: json.loads(s) 20 | 21 | Deserialize `s` (a str instance containing a JSON document) to a 22 | Python object using this conversion table. 23 | -------------------------------------------------------------------------------- /docs/library-reference/standard/os.rst: -------------------------------------------------------------------------------- 1 | :mod:`os` --- Miscellaneous operating system interfaces 2 | ======================================================= 3 | 4 | .. module:: os 5 | :synopsis: Miscellaneous operating system interfaces. 6 | 7 | This module provides a portable way of using operating system 8 | dependent functionality. 9 | 10 | ---------------------------------------------- 11 | 12 | 13 | .. function:: os.uname() 14 | 15 | Returns information identifying the current operating system. The 16 | return value is an object with five attributes: 17 | 18 | - sysname - operating system name 19 | - nodename - name of machine on network (implementation-defined) 20 | - release - operating system release 21 | - version - operating system version 22 | - machine - hardware identifier 23 | 24 | 25 | .. function:: os.getcwd() 26 | 27 | Return a string representing the current working directory. 28 | 29 | 30 | .. function:: os.listdir(path='.') 31 | 32 | Return a list containing the names of the entries in the directory 33 | given by path. The list is in arbitrary order, and does not include 34 | the special entries ``'.'`` and ``'..'`` even if they are present 35 | in the directory. 36 | 37 | 38 | .. function:: os.stat() 39 | 40 | Return a `stat_result` object for this entry. 41 | 42 | 43 | .. function:: os.system(command) 44 | 45 | Returns the output of given file system command. Raises ``OSError`` 46 | if the command is missing or fails to execute. 47 | 48 | 49 | .. function:: os.format(path) 50 | 51 | Format file system at given path. All data in the file system will 52 | be lost. 53 | -------------------------------------------------------------------------------- /docs/library-reference/standard/re.rst: -------------------------------------------------------------------------------- 1 | :mod:`re` --- Regular expression operations 2 | =========================================== 3 | 4 | .. module:: re 5 | :synopsis: Regular expression operations. 6 | 7 | ---------------------------------------------- 8 | -------------------------------------------------------------------------------- /docs/library-reference/standard/struct.rst: -------------------------------------------------------------------------------- 1 | :mod:`struct` --- Interpret strings as packed binary data 2 | ========================================================= 3 | 4 | .. module:: struct 5 | :synopsis: Interpret strings as packed binary data. 6 | 7 | ---------------------------------------------- 8 | -------------------------------------------------------------------------------- /docs/library-reference/standard/time.rst: -------------------------------------------------------------------------------- 1 | :mod:`time` --- Time access and conversions 2 | ============================================ 3 | 4 | .. module:: time 5 | :synopsis: Time access and conversions. 6 | 7 | This module provides various time-related functions. 8 | 9 | ---------------------------------------------- 10 | 11 | 12 | .. function:: time.sleep(secs) 13 | 14 | Suspend execution of the calling thread for the given number of 15 | seconds. The argument may be a floating point number to indicate a 16 | more precise sleep time. The actual suspension time may be less 17 | than that requested because any caught signal will terminate the 18 | `sleep()` following execution of that signal’s catching 19 | routine. Also, the suspension time may be longer than requested by 20 | an arbitrary amount because of the scheduling of other activity in 21 | the system. 22 | 23 | 24 | .. function:: time.sleep_ms(msecs) 25 | 26 | Same as `sleep()` but sleep for `msecs` number of milliseconds. 27 | 28 | 29 | .. function:: time.sleep_us(usecs) 30 | 31 | Same as `sleep()` but sleep for `usecs` number of microseconds. 32 | 33 | 34 | .. function:: time.time() 35 | 36 | Return the time in seconds since the epoch as a floating point 37 | number. Note that even though the time is always returned as a 38 | floating point number, not all systems provide time with a better 39 | precision than 1 second. While this function normally returns 40 | non-decreasing values, it can return a lower value than a previous 41 | call if the system clock has been set back between the two calls. 42 | 43 | -------------------------------------------------------------------------------- /docs/library-reference/standard/zlib.rst: -------------------------------------------------------------------------------- 1 | :mod:`zlib` --- Compression compatible with gzip 2 | ================================================ 3 | 4 | .. module:: zlib 5 | :synopsis: Compression compatible with gzip. 6 | 7 | Decompress compressed data. 8 | 9 | ---------------------------------------------- 10 | 11 | 12 | .. function:: zlib.decompress(data) 13 | 14 | Decompresses the bytes in `data`, returning a bytes object 15 | containing the uncompressed data. 16 | -------------------------------------------------------------------------------- /docs/license.rst: -------------------------------------------------------------------------------- 1 | License 2 | ======= 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2014-2017, Erik Moqvist 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | breathe 2 | -------------------------------------------------------------------------------- /docs/user-guide.rst: -------------------------------------------------------------------------------- 1 | User Guide 2 | ========== 3 | 4 | This guide is intended for users of the Pumbaa Embedded Programming 5 | Platform. 6 | 7 | The `Pumbaa` installation guide can be found on the 8 | :doc:`getting-started` page. 9 | 10 | Software architecture 11 | --------------------- 12 | 13 | Below is a picture of the `Pumbaa` software architecture. At the 14 | bottom is the hardware. On top of the hardware is the `Simba` 15 | operating system, that implementes all low level functionality; 16 | kernel, drivers, filesystems, networking, etc. `MicroPython` 17 | implements the Python 3 language and a many Python standard library 18 | modules. The user application on the right can be implemented in a mix 19 | of Python and C code depending of the requirements. Normally the whole 20 | application is implemnted in Python. 21 | 22 | .. image:: images/architecture.jpg 23 | :width: 90% 24 | :align: center 25 | :target: _images/architecture.jpg 26 | 27 | **Contents:** 28 | 29 | .. toctree:: 30 | :glob: 31 | :maxdepth: 1 32 | 33 | user-guide/build-system 34 | user-guide/configuration 35 | user-guide/environment-setup 36 | user-guide/hello-world-application 37 | -------------------------------------------------------------------------------- /docs/user-guide/build-system.rst: -------------------------------------------------------------------------------- 1 | Build system 2 | ============ 3 | 4 | PlatformIO 5 | ---------- 6 | 7 | All Python source files in your project's ``src/`` folder will be 8 | uploaded to the board automatically as frozen modules. 9 | 10 | See the `PlatformIO website`_ for more information. 11 | 12 | Arduino IDE 13 | ----------- 14 | 15 | The build system only allows a single Python script file, the Arduino 16 | sketch ``.ino``. 17 | 18 | See the `Arduino website`_ for more information. 19 | 20 | Simba build system 21 | ------------------ 22 | 23 | The make variable ``PYSRC`` is list of all Python script files. 24 | 25 | See the `Simba documentation`_ for more information. 26 | 27 | .. _PlatformIO website: http://docs.platformio.org/en/latest/core.html 28 | 29 | .. _Arduino website: https://www.arduino.cc 30 | 31 | .. _Simba documentation: http://simba-os.readthedocs.io/en/latest/user-guide/build-system.html 32 | -------------------------------------------------------------------------------- /docs/user-guide/environment-setup.rst: -------------------------------------------------------------------------------- 1 | Environment setup 2 | ================= 3 | 4 | The first step is always to setup the `Pumbaa` environment. It's a 5 | simple matter of sourcing a setup-script in the pumbaa root folder. 6 | 7 | This step only applies to the `Simba build system`, and not to the 8 | `Arduino IDE` or `PlatformIO`. 9 | 10 | .. code-block:: text 11 | 12 | $ source setup.sh 13 | -------------------------------------------------------------------------------- /docs/user-guide/hello-world-application.rst: -------------------------------------------------------------------------------- 1 | Hello World application 2 | ======================= 3 | 4 | Let's start with the `Pumbaa` "Hello World" application. It 5 | examplifies what an application is and how to build and run it. 6 | 7 | It consists of two files; ``main.py`` and ``Makefile``. 8 | 9 | main.py 10 | ------- 11 | 12 | :github-blob:`main.py` is the main 13 | script of the application. 14 | 15 | .. code-block:: python 16 | 17 | print("Hello world!") 18 | 19 | Makefile 20 | -------- 21 | 22 | :github-blob:`Makefile` contains build 23 | configuration of the application. 24 | 25 | .. code-block:: makefile 26 | 27 | NAME = hello_world 28 | BOARD ?= linux 29 | 30 | PUMBAA_ROOT ?= ../.. 31 | include $(PUMBAA_ROOT)/make/app.mk 32 | 33 | Build and run 34 | ------------- 35 | 36 | Compile, link and run it by typing the commands below in a shell: 37 | 38 | .. code-block:: text 39 | 40 | $ cd examples/hello_world 41 | $ make -s run 42 | 43 | Hello world! 44 | $ 45 | 46 | Cross-compile, link and then run on an Arduino Due: 47 | 48 | .. code-block:: text 49 | 50 | $ cd examples/hello_world 51 | $ make -s BOARD=arduino_due run 52 | 53 | Hello world! 54 | $ 55 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | EXAMPLES = \ 2 | blink \ 3 | hello_world \ 4 | interactive \ 5 | timer 6 | 7 | all: 8 | for example in $(EXAMPLES) ; do \ 9 | $(MAKE) -C $$example all ; \ 10 | done 11 | 12 | clean: 13 | for example in $(EXAMPLES) ; do \ 14 | $(MAKE) -C $$example clean ; \ 15 | done 16 | -------------------------------------------------------------------------------- /examples/blink/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = blink 33 | BOARD ?= linux 34 | 35 | PUMBAA_ROOT ?= ../.. 36 | include $(PUMBAA_ROOT)/make/app.mk 37 | -------------------------------------------------------------------------------- /examples/blink/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | import time 33 | import board 34 | from drivers import Pin 35 | 36 | LED = Pin(board.PIN_LED, Pin.OUTPUT) 37 | 38 | while True: 39 | LED.toggle() 40 | time.sleep(0.5) 41 | -------------------------------------------------------------------------------- /examples/default-configuration/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = default_configuration 33 | BOARD ?= linux 34 | 35 | PUMBAA_ROOT ?= ../.. 36 | include $(PUMBAA_ROOT)/make/app.mk 37 | -------------------------------------------------------------------------------- /examples/default-configuration/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | -------------------------------------------------------------------------------- /examples/ds18b20/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = ds18b20 33 | BOARD ?= linux 34 | TIMEOUT ?= 30 35 | 36 | PUMBAA_ROOT ?= ../.. 37 | include $(PUMBAA_ROOT)/make/app.mk 38 | -------------------------------------------------------------------------------- /examples/eeprom_i2c/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = eeprom_i2c 33 | BOARD ?= linux 34 | 35 | PUMBAA_ROOT ?= ../.. 36 | include $(PUMBAA_ROOT)/make/app.mk 37 | -------------------------------------------------------------------------------- /examples/eeprom_i2c/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | from drivers import I2C, EepromI2C 32 | 33 | # Change those to match your EEPROM. 34 | EEPROM_I2C_ADDRESS = 0x57 35 | EEPROM_SIZE = 32768 36 | 37 | i2c = I2C(0) 38 | i2c.start() 39 | eeprom = EepromI2C(i2c, EEPROM_I2C_ADDRESS, EEPROM_SIZE) 40 | 41 | address = 0 42 | data = b'Hello World!' 43 | 44 | print('Writing {} to EEPROM address {}:'.format(data, address)) 45 | 46 | eeprom.write(address, data) 47 | read_data = eeprom.read(address, 12) 48 | 49 | print('Read {} from EEPROM address {}.'.format(read_data, address)) 50 | -------------------------------------------------------------------------------- /examples/ftp_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = ftp_server 33 | BOARD ?= linux 34 | 35 | PYSRC += ftp_server.py 36 | 37 | PUMBAA_ROOT ?= ../.. 38 | include $(PUMBAA_ROOT)/make/app.mk 39 | -------------------------------------------------------------------------------- /examples/ftp_server/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #ifndef CONFIG_ASSERT 35 | # define CONFIG_ASSERT 0 36 | #endif 37 | 38 | #ifndef CONFIG_START_NETWORK 39 | # define CONFIG_START_NETWORK 1 40 | #endif 41 | 42 | #ifndef CONFIG_THRD_IDLE_STACK_SIZE 43 | # if defined(ARCH_ARM) 44 | # define CONFIG_THRD_IDLE_STACK_SIZE 1024 45 | # endif 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /examples/ftp_server/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | from ftp_server import FtpServer 33 | 34 | FtpServer('192.168.0.5', 21, 13333).main() 35 | -------------------------------------------------------------------------------- /examples/hello_world/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = hello_world 33 | BOARD ?= linux 34 | 35 | PUMBAA_ROOT ?= ../.. 36 | include $(PUMBAA_ROOT)/make/app.mk 37 | -------------------------------------------------------------------------------- /examples/hello_world/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | print('Hello world!') 33 | -------------------------------------------------------------------------------- /examples/http_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = http_server 33 | BOARD ?= linux 34 | 35 | TIMEOUT ?= 20 36 | 37 | PUMBAA_ROOT ?= ../.. 38 | include $(PUMBAA_ROOT)/make/app.mk 39 | -------------------------------------------------------------------------------- /examples/http_server/websocket_client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import print_function 4 | 5 | import sys 6 | import websocket 7 | from websocket import create_connection 8 | 9 | websocket.enableTrace(True) 10 | ws = create_connection("ws://{}/websocket/echo".format(sys.argv[1])) 11 | 12 | message = "Hello, World" 13 | 14 | print("Sending '{}'.".format(message)) 15 | ws.send(message) 16 | print("Received '{}'".format(ws.recv())) 17 | 18 | for i in range(10): 19 | print("Sending '{}'.".format(i)) 20 | ws.send(str(i)) 21 | print("Received '{}'".format(ws.recv())) 22 | 23 | ws.close() 24 | -------------------------------------------------------------------------------- /examples/https_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = https_server 33 | BOARD ?= linux 34 | 35 | TIMEOUT ?= 20 36 | 37 | PUMBAA_ROOT ?= ../.. 38 | include $(PUMBAA_ROOT)/make/app.mk 39 | -------------------------------------------------------------------------------- /examples/https_server/README.rst: -------------------------------------------------------------------------------- 1 | Test with webbrowser 2 | ==================== 3 | 4 | Enter ``https://192.168.0.7/index.html`` into the webbrowser. The 5 | fetched webpage should say ``Hello from Pumbaa!``. 6 | 7 | Test with curl 8 | ============== 9 | 10 | Verification of the certificate is turned off because I don't have a 11 | valid certificate in the test. 12 | 13 | HTTPS GET 14 | -------- 15 | 16 | .. code-block:: text 17 | 18 | > curl --insecure https://192.168.0.7/index.html 19 | 20 | Hello from Pumbaa! 21 | 22 | > 23 | 24 | HTTPS POST 25 | --------- 26 | 27 | .. code-block:: text 28 | 29 | > curl --insecure --data "My post data." https://192.168.0.7/index.html 30 | 31 | Hello from Pumbaa! 32 | Post data: "My post data." 33 | 34 | > 35 | -------------------------------------------------------------------------------- /examples/interactive/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = interactive 33 | BOARD ?= linux 34 | 35 | CDEFS += CONFIG_START_SHELL=0 36 | 37 | PUMBAA_ROOT ?= ../.. 38 | include $(PUMBAA_ROOT)/make/app.mk 39 | -------------------------------------------------------------------------------- /examples/interactive/README.rst: -------------------------------------------------------------------------------- 1 | Interactive Interpreter 2 | ======================= 3 | 4 | The Python interactive interpreter example. 5 | 6 | Build the application and upload it to the board. 7 | 8 | .. code-block:: text 9 | 10 | make -s BOARD=arduino_due upload 11 | make -s BOARD=arduino_due console 12 | 13 | Execute Python code in the interpreter. 14 | 15 | .. code-block:: python 16 | 17 | MicroPython v1.8.3-88-gf98bb2d on 2016-09-17; Arduino Due with SAM3X8E 18 | Type "help()" for more information. 19 | >>> 1+2 20 | 3 21 | >>> for i in range(10): 22 | ... print(i) 23 | ... 24 | 0 25 | 1 26 | 2 27 | 3 28 | 4 29 | 5 30 | 6 31 | 7 32 | 8 33 | 9 34 | >>> 35 | -------------------------------------------------------------------------------- /examples/interactive/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | -------------------------------------------------------------------------------- /examples/interactive_full/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = interactive_full 33 | BOARD ?= linux 34 | 35 | MAIN_PY = 36 | 37 | CDEFS += CONFIG_START_SHELL=0 38 | 39 | PUMBAA_ROOT ?= ../.. 40 | include $(PUMBAA_ROOT)/make/app.mk 41 | -------------------------------------------------------------------------------- /examples/interactive_full/README.rst: -------------------------------------------------------------------------------- 1 | Interactive Interpreter with Network enabled 2 | ============================================ 3 | 4 | The Python interactive interpreter example. 5 | 6 | Build the application and upload it to the board. 7 | 8 | .. code-block:: text 9 | 10 | make -s BOARD=esp12e upload 11 | make -s BOARD=esp12e console 12 | 13 | Execute Python code in the interpreter. The example below creates TCP 14 | sockets on an ESP12-E and sends data to and receives data from a PC. 15 | 16 | .. code-block:: python 17 | 18 | MicroPython v1.8.3-88-gf98bb2d on 2016-09-17; Arduino Due with SAM3X8E 19 | Type "help()" for more information. 20 | >>> import socket 21 | >>> 22 | >>> listener = socket.socket() 23 | >>> listener.bind(('192.168.1.103', 8000)) 24 | >>> listener.listen(5) 25 | >>> client, address = listener.accept() 26 | >>> client.recv(5) 27 | b'12345' 28 | >>> client.send('erik') 29 | 4 30 | >>> client.close() 31 | >>> 32 | >>> server = socket.socket() 33 | >>> server.connect(('192.168.1.100', 8000)) 34 | >>> server.send('12345') 35 | 5 36 | >>> server.recv(4) 37 | b'erik' 38 | >>> server.close() 39 | -------------------------------------------------------------------------------- /examples/interactive_full/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #ifndef CONFIG_ASSERT 35 | # define CONFIG_ASSERT 0 36 | #endif 37 | 38 | #ifndef CONFIG_START_NETWORK 39 | # define CONFIG_START_NETWORK 1 40 | #endif 41 | 42 | #ifndef CONFIG_THRD_IDLE_STACK_SIZE 43 | # if defined(ARCH_ARM) 44 | # define CONFIG_THRD_IDLE_STACK_SIZE 1024 45 | # endif 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /examples/minimal-configuration/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = minimal_configuration 33 | BOARD = arduino_due 34 | 35 | CDEFS += \ 36 | CONFIG_MINIMAL_SYSTEM=1 37 | 38 | PUMBAA_ROOT ?= ../.. 39 | include $(PUMBAA_ROOT)/make/app.mk 40 | -------------------------------------------------------------------------------- /examples/minimal-configuration/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | -------------------------------------------------------------------------------- /examples/music_player/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = music_player 33 | BOARD ?= arduino_due 34 | VERSION = 1.0.0 35 | 36 | PYSRC += music_player.py 37 | 38 | PUMBAA_ROOT ?= ../.. 39 | include $(PUMBAA_ROOT)/make/app.mk 40 | -------------------------------------------------------------------------------- /examples/music_player/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | from music_player import MusicPlayer 33 | 34 | music_player = MusicPlayer() 35 | music_player.start() 36 | -------------------------------------------------------------------------------- /examples/select/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = select 33 | BOARD ?= linux 34 | 35 | PUMBAA_ROOT ?= ../.. 36 | include $(PUMBAA_ROOT)/make/app.mk 37 | -------------------------------------------------------------------------------- /examples/select/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #ifndef CONFIG_ASSERT 35 | # define CONFIG_ASSERT 0 36 | #endif 37 | 38 | #ifndef CONFIG_START_NETWORK 39 | # define CONFIG_START_NETWORK 1 40 | #endif 41 | 42 | #ifndef CONFIG_THRD_IDLE_STACK_SIZE 43 | # if defined(ARCH_ARM) 44 | # define CONFIG_THRD_IDLE_STACK_SIZE 1024 45 | # endif 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /examples/ssl_client/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2014-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Simba project. 29 | # 30 | 31 | NAME = ssl_client 32 | BOARD ?= nano32 33 | 34 | TIMEOUT ?= 20 35 | 36 | SSID = Qvist2 37 | PASSWORD = maxierik 38 | 39 | CDEFS += \ 40 | CONFIG_START_NETWORK=1 \ 41 | CONFIG_START_NETWORK_INTERFACE_WIFI_SSID=$(SSID) \ 42 | CONFIG_START_NETWORK_INTERFACE_WIFI_PASSWORD=$(PASSWORD) 43 | 44 | PUMBAA_ROOT ?= ../.. 45 | include $(PUMBAA_ROOT)/make/app.mk 46 | -------------------------------------------------------------------------------- /examples/ssl_client/client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import socket 5 | import ssl 6 | import pprint 7 | 8 | server_sock = socket.socket() 9 | server_sock.connect((sys.argv[1], 10023)) 10 | 11 | # Require a certificate from the server. We used a self-signed 12 | # certificate so here ca_certs must be the server certificate itself. 13 | context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) 14 | context.verify_mode = ssl.CERT_REQUIRED 15 | context.load_verify_locations("server.crt") 16 | 17 | ssl_server_sock = context.wrap_socket(server_sock) 18 | 19 | print(repr(ssl_server_sock.getpeername())) 20 | print(ssl_server_sock.cipher()) 21 | print(pprint.pformat(ssl_server_sock.getpeercert())) 22 | 23 | print('write: Hello!') 24 | ssl_server_sock.send(b"Hello!") 25 | print('read:', ssl_server_sock.recv(8)) 26 | -------------------------------------------------------------------------------- /examples/ssl_client/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDCjCCAfICCQCoXfSQydXTczANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQGEwJT 3 | RTETMBEGA1UECAwKU29tZS1TdGF0ZTEOMAwGA1UECgwFU2ltYmExEzARBgNVBAMM 4 | CmZvb2Jhci5vcmcwHhcNMTcwMTA3MTgxOTQ3WhcNMTgwMTA3MTgxOTQ3WjBHMQsw 5 | CQYDVQQGEwJTRTETMBEGA1UECAwKU29tZS1TdGF0ZTEOMAwGA1UECgwFU2ltYmEx 6 | EzARBgNVBAMMCmZvb2Jhci5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK 7 | AoIBAQDugoc9amynDB/ODJzh2aqB6cnubSJEPlgB87jNG0akcbmUFt6BhPhMPSoP 8 | esHWl5OWscoga0cKrPURmMVVhfaeZLQGmrv5N4/liVlwae1n0gUEruX4d6MqSSDW 9 | 3C/WKjCn647udZwyzCvyrvPOq0qAzaxR4EFRdwjSEPO5sDw2zxeTjGW2WxaH9PEu 10 | C8vaNqTsLYl3YBkR3zVCbuQXTQhStsv3gT4Yhz2wJpY0yyWyDiaBkGKpdxJQiNAd 11 | x5JKSqtRshlYZM3+cdKLywNoYUnezp6Wm4mzz09TCFv+esJ0h7/6pMdVjhxLsAg5 12 | ZbZyrtNIapN07AjIJS4qjkJ/HUC3AgMBAAEwDQYJKoZIhvcNAQELBQADggEBAGHS 13 | U5AvDESzTNoak5HHx166bp5+bvECvJg45GMDGhqKeFoOlR34u2b+wyTm/piz3nYJ 14 | 12kn+BbG/PwGfndL0kZYRz46fY8Rf+MxCFfcglweDJhA6ULNpera11OC35Q/lKn5 15 | M6w6eQkZMB4VqwigvDGHGpXRTIhJHHoR2VFBFGoPTLrXilChUpiXi9DmuYXJ/19x 16 | sxOVwvvO/m/6g68G+uZYUoCsQsKllM2fgdNLTzbYvnFtsq5QnZS8m7CoZgEy2c3m 17 | VrrPsfwmyhwejDawjz2epSLNXaaDeSz4g1cQes+oehaA1IwFfKhb9tdiWUm48VuU 18 | oaFZ8e1HofYUy+65pws= 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /examples/ssl_client/server.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICjDCCAXQCAQAwRzELMAkGA1UEBhMCU0UxEzARBgNVBAgMClNvbWUtU3RhdGUx 3 | DjAMBgNVBAoMBVNpbWJhMRMwEQYDVQQDDApmb29iYXIub3JnMIIBIjANBgkqhkiG 4 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7oKHPWpspwwfzgyc4dmqgenJ7m0iRD5YAfO4 5 | zRtGpHG5lBbegYT4TD0qD3rB1peTlrHKIGtHCqz1EZjFVYX2nmS0Bpq7+TeP5YlZ 6 | cGntZ9IFBK7l+HejKkkg1twv1iowp+uO7nWcMswr8q7zzqtKgM2sUeBBUXcI0hDz 7 | ubA8Ns8Xk4xltlsWh/TxLgvL2jak7C2Jd2AZEd81Qm7kF00IUrbL94E+GIc9sCaW 8 | NMslsg4mgZBiqXcSUIjQHceSSkqrUbIZWGTN/nHSi8sDaGFJ3s6elpuJs89PUwhb 9 | /nrCdIe/+qTHVY4cS7AIOWW2cq7TSGqTdOwIyCUuKo5Cfx1AtwIDAQABoAAwDQYJ 10 | KoZIhvcNAQELBQADggEBAOVGg8svi4jrBunANl3twRJHg24+6EoiJpYqXwMfozn9 11 | bRSRajhGo8eJuy7fRp/PgAAvsZ20BlKj8yMMxlq6GwJcmOsIhlk7Q1sh083JAe/m 12 | MFexQG1fzq1bO7kpXyGnff+kUf+eVPn0qSZ2nSle0V6VOUextF5u6ui4QptR8vUf 13 | WMpd5p7Qc3PkJ14NavcbzOrgbtmaCI/T8Y+J0/pQd7woAOPWzqz0mkq41guu6SRi 14 | Hfm9X5X4qDh4YTVpFEjjnsR27Qe1hIKk62czrgiGIfahNL3Lvze8OpLKmxndAwSI 15 | rjvo2CVLBmCcNMh4k/Li/bCRv1j/ud3CX0Ggnw/Fiu0= 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /examples/ssl_client/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA7oKHPWpspwwfzgyc4dmqgenJ7m0iRD5YAfO4zRtGpHG5lBbe 3 | gYT4TD0qD3rB1peTlrHKIGtHCqz1EZjFVYX2nmS0Bpq7+TeP5YlZcGntZ9IFBK7l 4 | +HejKkkg1twv1iowp+uO7nWcMswr8q7zzqtKgM2sUeBBUXcI0hDzubA8Ns8Xk4xl 5 | tlsWh/TxLgvL2jak7C2Jd2AZEd81Qm7kF00IUrbL94E+GIc9sCaWNMslsg4mgZBi 6 | qXcSUIjQHceSSkqrUbIZWGTN/nHSi8sDaGFJ3s6elpuJs89PUwhb/nrCdIe/+qTH 7 | VY4cS7AIOWW2cq7TSGqTdOwIyCUuKo5Cfx1AtwIDAQABAoIBAQDtIH7es6Fkj2xL 8 | ikSrUqHv2YT29C++U5FiF3LjELwyIBMWRYpgkNffzGu1yiFPfZGxn/9KLf4KghyA 9 | qzd+KNshbRODAXHje7cnyV9PoTD0KFzu5Agl+KQTFXN9ypoQvg9z04FeWTW7VzxW 10 | YlRpY+mFl3Y8TM4D9WmimFIIikvDXERHtBLJRr8dde5u/6xKju1Q8qs7aSBOggws 11 | ryv/ZI/WWR7EjFy2XegU7fvByHS5MlbhaplvKLKkHSihRdXOCD66Uo+/TYiOkb9A 12 | ZVUZ0IjKS6uN3zFsaN2B3ZQQb9dWL7DZsMPXeL1u1+0WgtnVcbPyRW2fEeZJAy8M 13 | ILljkRPxAoGBAPcbhWHkTCT1HF/UHGveqqq3gLYLDDMhKTHUAxaLAyBBisRWem3L 14 | BRao478pSIOa2LthJJ9/rkWd2XWCZlvjF9PYbbO/c4PpWbvE1WfO0LX80G2YRskR 15 | kOBf3sCm25u2i6fi7E6pTf6INPRo01kxNbZG++W40lyhVfVGE7kSqDjpAoGBAPcX 16 | zTO9pzOYYbeAfFdjl8vUI+yQeAu9CSfWlqxVjU+glGIBKAAspuP4JWXFCxidBneK 17 | CqaKpxP5ZT0jUgDO/HIuvcY5ISkYJ1B/RON50/UH/PtaYEZlrHjxOacrHVrPClEc 18 | wU85pt/9cYe/xY2x5AHeSEP5BlkwEndir5x7YaifAoGBAPQMtEEoTqO5iRqDzMYk 19 | lf4hWfdxFc1xlNPnhl0/UgkLclfS6PuCpTXp+3SS+1EvH5qAqMD2Q1HyQhEyhpF9 20 | ycyqVj5OeXHwh3VRQ0tREQSL+fYjjNWMib9wL/mpUf+J3IglMCnIQIWAVHyHAyV1 21 | 2ox5stMBJJHjrZeebGA+svHxAoGBAPMhYnK0/J7SI+SR8sdyYdzYQvj1NoomWanv 22 | hpbQH5noYdkFVjzFsvnCI9o9xqtTZxecpto0uC35SlqcNIZDJTedMnKnqC9tatHU 23 | SQ6jw6HpWE5jITRjuw/OHHKXA+1kp7wkVToFemQQV/PBCTxhe/8yn1zy3gJIQQNk 24 | AXQyG2f1AoGAPzB+wQeKkL2CDH9uma8s17fH8lL5zAPOsNhlakTiCNiEj9qkOolT 25 | GkSL1HnwtCV+btGymVWPMgAwabRD4YYSDkcOqkaguerUFVc8W2rIXSzh+PaSXp9Q 26 | QSQRmqHx9I/kb1lHWPbm9z2URpwoqqNSB/475G2+XUTWxVNsTf/aA1w= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /examples/ssl_client/server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import socket 4 | import ssl 5 | 6 | 7 | def recvall(sock, length): 8 | buf = b'' 9 | while len(buf) < length: 10 | byte = sock.recv() 11 | if not byte: 12 | break 13 | buf += byte 14 | return buf 15 | 16 | 17 | context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) 18 | context.load_cert_chain(certfile="server.crt", 19 | keyfile="server.key") 20 | 21 | listener_sock = socket.socket() 22 | listener_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 23 | listener_sock.bind(('', 10023)) 24 | listener_sock.listen(5) 25 | 26 | while True: 27 | client_sock, fromaddr = listener_sock.accept() 28 | ssl_client_sock = context.wrap_socket(client_sock, server_side=True) 29 | try: 30 | print(recvall(ssl_client_sock, 6)) 31 | print('write: Goodbye!') 32 | ssl_client_sock.send(b'Goodbye!') 33 | finally: 34 | ssl_client_sock.shutdown(socket.SHUT_RDWR) 35 | ssl_client_sock.close() 36 | -------------------------------------------------------------------------------- /examples/ssl_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2014-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Simba project. 29 | # 30 | 31 | NAME = ssl_server 32 | BOARD ?= nano32 33 | 34 | TIMEOUT ?= 20 35 | 36 | SSID = Qvist2 37 | PASSWORD = maxierik 38 | 39 | CDEFS += \ 40 | CONFIG_START_NETWORK=1 \ 41 | CONFIG_START_NETWORK_INTERFACE_WIFI_SSID=$(SSID) \ 42 | CONFIG_START_NETWORK_INTERFACE_WIFI_PASSWORD=$(PASSWORD) 43 | 44 | PUMBAA_ROOT ?= ../.. 45 | include $(PUMBAA_ROOT)/make/app.mk 46 | -------------------------------------------------------------------------------- /examples/ssl_server/client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import socket 5 | import ssl 6 | import pprint 7 | 8 | server_sock = socket.socket() 9 | server_sock.connect((sys.argv[1], 10023)) 10 | 11 | # Require a certificate from the server. We used a self-signed 12 | # certificate so here ca_certs must be the server certificate itself. 13 | context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) 14 | context.verify_mode = ssl.CERT_REQUIRED 15 | context.load_verify_locations("server.crt") 16 | 17 | ssl_server_sock = context.wrap_socket(server_sock) 18 | 19 | print(repr(ssl_server_sock.getpeername())) 20 | print(ssl_server_sock.cipher()) 21 | print(pprint.pformat(ssl_server_sock.getpeercert())) 22 | 23 | print('write: Hello!') 24 | ssl_server_sock.send(b"Hello!") 25 | print('read:', ssl_server_sock.recv(8)) 26 | -------------------------------------------------------------------------------- /examples/ssl_server/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBjCCAe4CCQDxnqw02a38fDANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB 3 | VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 4 | cyBQdHkgTHRkMB4XDTE2MTIxODA4Mzg1MloXDTE3MTIxODA4Mzg1MlowRTELMAkG 5 | A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 6 | IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 7 | ALYNY/GZ2QNYdVFv39vMxFkXp7AogTYfVSqFoJwPneaXAt24aiKDwHO3OO3W8nYe 8 | AwBZ9Jl1zQKA5wafc5uaRUH4Nuq1INiQZQ6gYL74KaBjNoX8TgLBOjci2Kea8HAZ 9 | Ao/KY88UE1CG7sErJjuZ5SyKYGzdFuPek+jny8OxzqpPqP7ORrDqYKbFOOpUUhHZ 10 | kPeVMhbWR2OSn052RtO63rtDJ49LltFy+8KXV6SaEu7Zuyk4WaBObSXLlMFDZKp9 11 | ZlXYOKSZ2xGcKtgnMOTous1j/XxGTd0Xlbr2TZi/cfq7xFqfWRjfWiTX9w5d/KWd 12 | h1jv9lrNsRfqK86FKFW2SOECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAD33b4qXN 13 | BA13KsOSba7zCla8Z5dKk8JOwTp0wM7xqTWzR/eN7xkaQ6NFZavsbGACtHbGs2vU 14 | DVRsTzTzn/0RVoCaEqYsELwXoaz7sUBZoc39+kwbC5BCvZlHLPRBkEy9nAehqIg6 15 | bbzbVObZ1gqI1GWXtVONv65n1W8hjhTa2L841EMCVKKeR5sg1Pts0W7F3e9K2r7j 16 | NumMWFa8RxDPvHwfE0zXzJYbXLAbDClvdjNboAq/jZu6f1O71yAJkPNCZKHJKFKO 17 | 2p4hsmEigByb2jr0BB6Bsmdcf1RyRwIemJ5fXauUsvJydYcvklo0xcpqQrTkhIzb 18 | UoNMyyG9ikCJjA== 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /examples/ssl_server/server.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICijCCAXICAQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx 3 | ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcN 4 | AQEBBQADggEPADCCAQoCggEBALYNY/GZ2QNYdVFv39vMxFkXp7AogTYfVSqFoJwP 5 | neaXAt24aiKDwHO3OO3W8nYeAwBZ9Jl1zQKA5wafc5uaRUH4Nuq1INiQZQ6gYL74 6 | KaBjNoX8TgLBOjci2Kea8HAZAo/KY88UE1CG7sErJjuZ5SyKYGzdFuPek+jny8Ox 7 | zqpPqP7ORrDqYKbFOOpUUhHZkPeVMhbWR2OSn052RtO63rtDJ49LltFy+8KXV6Sa 8 | Eu7Zuyk4WaBObSXLlMFDZKp9ZlXYOKSZ2xGcKtgnMOTous1j/XxGTd0Xlbr2TZi/ 9 | cfq7xFqfWRjfWiTX9w5d/KWdh1jv9lrNsRfqK86FKFW2SOECAwEAAaAAMA0GCSqG 10 | SIb3DQEBCwUAA4IBAQAeoj4gxKaTtGiDMdcPFkmoJLsqAmb0fk8i62/aO0ktmgJ4 11 | IvdJeJ99GLm3VfryVB46wqMF2p7Ahw+GNywOC9X12TFBZ3exATpvuNo+Ppr1xlEA 12 | e8bCtPuCsnRqTr9GubmtzqmOfYgBXSdu6aCWn/ubjyglnL0L3kvOp72IjyzfnS3D 13 | BUibfE7xokFOfUbab0pfoG7KNBhuqZ3z25UdMCkkwfzvkewwIF6jVrzk17fm4TkV 14 | a6a9Eg9hoUYgFpYggkEmWl+JBNJwFXjXZ7+Ukx5Htr4D8l2WFTir863qnIn1w781 15 | ap+BFRMrL13OPz/1aEQkvx5iAzt38IhRmQ/taYYV 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /examples/ssl_server/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEAtg1j8ZnZA1h1UW/f28zEWRensCiBNh9VKoWgnA+d5pcC3bhq 3 | IoPAc7c47dbydh4DAFn0mXXNAoDnBp9zm5pFQfg26rUg2JBlDqBgvvgpoGM2hfxO 4 | AsE6NyLYp5rwcBkCj8pjzxQTUIbuwSsmO5nlLIpgbN0W496T6OfLw7HOqk+o/s5G 5 | sOpgpsU46lRSEdmQ95UyFtZHY5KfTnZG07reu0Mnj0uW0XL7wpdXpJoS7tm7KThZ 6 | oE5tJcuUwUNkqn1mVdg4pJnbEZwq2Ccw5Oi6zWP9fEZN3ReVuvZNmL9x+rvEWp9Z 7 | GN9aJNf3Dl38pZ2HWO/2Ws2xF+orzoUoVbZI4QIDAQABAoIBAQCSDSIONK/eODw+ 8 | bjM4ogkvtIOKFqS6p95qc7PLH9g8ow/gks9LC0n9S5O3c4cm7aLYyFIsP06OYJ13 9 | ObrErbo8V4avO0qzkvwQBOg4rNywWIfoa+al3SD4FNOdevbD57yfYO47tk5cfzPR 10 | 8u0ESc2KsyTykViIzQr6geN+BwrWpB+vP2DLdoDlhVwtMnlbViRFjsFOhxpfrgA6 11 | dSWRrfD7qv6hA62BEttk+L30vN/uLLLdLPLHtqiNwp3ri7AkLf/WEpACvHwEvCdg 12 | 2dGNrQHLUpF0WPuIEV6/R0ps3wXcfLJB9ZWX68U2lGb+w1ue7o8VEiTKfGVTK6nD 13 | xSyU0FEBAoGBAO8GQoBlTZj771YIZ0PxWn62Gk+F1E5paUKLRsoaeWzLyxEawnwS 14 | crShxWUsK24N/b6JsSwRxJe7uSplKP9VBvnjxecUc+9wXpIjd6pRSjBcSqliCMDO 15 | i72SziCu7SOkUU/wfwzmlRgWveRAixOyRUTI/rn+9X69t6uojBxsoQsxAoGBAML7 16 | T7H3xVPgWFgbZuaDZiELZ3uGt6ggsEPB9OhUmuQhklwSpY6CSsHlsc/QqQLOk+33 17 | yksLn0VRUly8Qk3Yn9W1jzvRAt1N1TzU6bV30bUUFW8y/NjHr/46y6P+sqOWVsA9 18 | 73kWLKYQS3eXruWH9P6gUNrWoF09tCJsATIS+0yxAoGBAIemLM2DMFOW/s/7eudz 19 | LKFmpW3mDIPnjMYoFqeR+MFGstrlLeSN760VddoiBA+0PwIIUJUrDD/0WHR37plh 20 | XtEoc+Ldl6IWSoVzPXFaKtlhNzoDmeYaEfInQ3YG8CvfEApm+SOQJKMEHQZRntwx 21 | ut/7lZxm1ln0Py1bPRDQkWCxAoGBAK0FrdbTc7vWnQ6yYkGz4HD6Wb338gmz2DaI 22 | avev/DLsx6AEu/0WCZi+Z2duVkwzXHoTJOQrUA6G93trY7sIu+08y/nco5oWc18j 23 | 4LAzv1fclpiyukT0DmyfaA4C+irIQfsd+t+MmdpTI2TgqUbtuq4pPRa01mFnW+4f 24 | wX/Z8D5BAoGALEvKgnYKO74qcrgG58FylvaXwyv9oaDEioRZ2fLHbcTU6M2yTdrA 25 | YlbSZl9moMeV18cHr55PzL/qxFQuoSQ26kA7Fag1MYLvakyL3Y0QnhTI+/JvqFLZ 26 | CTsgcsS/vH3Kvg+o/FsQmz/T0Pk+Q0Zb94qnlK30gdY6AQFVb2A71p0= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /examples/ssl_server/server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import socket 4 | import ssl 5 | 6 | 7 | def recvall(sock, length): 8 | buf = b'' 9 | while len(buf) < length: 10 | byte = sock.recv() 11 | if not byte: 12 | break 13 | buf += byte 14 | return buf 15 | 16 | 17 | context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) 18 | context.load_cert_chain(certfile="server.crt", 19 | keyfile="server.key") 20 | 21 | listener_sock = socket.socket() 22 | listener_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 23 | listener_sock.bind(('', 10023)) 24 | listener_sock.listen(5) 25 | 26 | while True: 27 | client_sock, fromaddr = listener_sock.accept() 28 | ssl_client_sock = context.wrap_socket(client_sock, server_side=True) 29 | try: 30 | print(recvall(ssl_client_sock, 6)) 31 | print('write: Goodbye!') 32 | ssl_client_sock.send(b'Goodbye!') 33 | finally: 34 | ssl_client_sock.shutdown(socket.SHUT_RDWR) 35 | ssl_client_sock.close() 36 | -------------------------------------------------------------------------------- /examples/tcp_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = tcp_server 33 | BOARD ?= linux 34 | 35 | PUMBAA_ROOT ?= ../.. 36 | include $(PUMBAA_ROOT)/make/app.mk 37 | -------------------------------------------------------------------------------- /examples/timer/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = timer 33 | BOARD ?= linux 34 | 35 | PUMBAA_ROOT ?= ../.. 36 | include $(PUMBAA_ROOT)/make/app.mk 37 | -------------------------------------------------------------------------------- /examples/timer/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | from kernel import Timer 33 | from sync import Event 34 | 35 | EVENT = Event() 36 | 37 | TIMER = Timer(1, EVENT, 0x1, flags=Timer.PERIODIC) 38 | TIMER.start() 39 | 40 | for i in range(10): 41 | EVENT.read(0x1) 42 | print("timeout", i) 43 | 44 | TIMER.stop() 45 | -------------------------------------------------------------------------------- /examples/ws2812/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = ws2812 33 | BOARD ?= linux 34 | TIMEOUT ?= 30 35 | 36 | PUMBAA_ROOT ?= ../.. 37 | include $(PUMBAA_ROOT)/make/app.mk 38 | -------------------------------------------------------------------------------- /examples/ws2812/main.py: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | import board 32 | from drivers import Ws2812 33 | import time 34 | 35 | PIXEL_MAX = 81 36 | 37 | RED = PIXEL_MAX * b'\x00\xff\x00' 38 | GREEN = PIXEL_MAX * b'\xff\x00\x00' 39 | BLUE = PIXEL_MAX * b'\x00\x00\xff' 40 | 41 | WS2812 = Ws2812(board.PIN_GPIO18) 42 | 43 | while True: 44 | print('Red.') 45 | WS2812.write(RED) 46 | time.sleep(0.5) 47 | 48 | print('Green.') 49 | WS2812.write(GREEN) 50 | time.sleep(0.5) 51 | 52 | print('Blue.') 53 | WS2812.write(BLUE) 54 | time.sleep(0.5) 55 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"framework-pumbaa", 3 | "description":"Pumbaa OS", 4 | "url":"https://github.com/eerimoq/pumbaa", 5 | "version":"3.0.3", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/eerimoq/pumbaa.git" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Setup script for the Pumbaa development environment. Source this file 3 | # in your shell to setup the environment. 4 | # 5 | 6 | # ARM compiler fails on Cygwin if files have absolute paths. 7 | if [ "${OSTYPE}" != "cygwin" ]; then 8 | export PUMBAA_ROOT=$(readlink -f .) 9 | export SIMBA_ROOT=$(readlink -f simba) 10 | fi 11 | 12 | export PATH=${PATH}:$(readlink -f simba/bin) 13 | 14 | # ESP8266 toolchain 15 | export PATH=$PATH:$(readlink -f ../esp-open-sdk/xtensa-lx106-elf/bin) 16 | 17 | # ESP32 toolchain 18 | export PATH=$PATH:$(readlink -f ../xtensa-esp32-elf/bin) 19 | 20 | # ARM toolchain for Cygwin. 21 | export PATH=$PATH:$(readlink -f ../arm-toolchain-windows/arm-none-eabi-gcc/4.8.3-2014q1/bin) 22 | export PATH=$PATH:$(readlink -f ../arm-toolchain-windows/bossac/1.3a-arduino) 23 | 24 | # MINGW toolchain for mpy-cross for windows. 25 | export PATH=$PATH:$(readlink -f ../mingw32/bin) 26 | 27 | # OSX toolchain for mpy-cross for OSX (Darwin). 28 | export PATH=$PATH:$(readlink -f ../osxcross/target/bin) 29 | -------------------------------------------------------------------------------- /src/boards/arduino_due/gchelper.S: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .cpu cortex-m4 3 | .thumb 4 | .text 5 | .align 2 6 | 7 | @ uint gc_helper_get_regs_and_sp(r0=uint regs[10]) 8 | .global gc_helper_get_regs_and_sp 9 | .thumb 10 | .thumb_func 11 | .type gc_helper_get_regs_and_sp, %function 12 | gc_helper_get_regs_and_sp: 13 | @ store registers into given array 14 | str r4, [r0], #4 15 | str r5, [r0], #4 16 | str r6, [r0], #4 17 | str r7, [r0], #4 18 | str r8, [r0], #4 19 | str r9, [r0], #4 20 | str r10, [r0], #4 21 | str r11, [r0], #4 22 | str r12, [r0], #4 23 | str r13, [r0], #4 24 | 25 | @ return the sp 26 | mov r0, sp 27 | bx lr 28 | -------------------------------------------------------------------------------- /src/boards/arduino_due/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /src/boards/arduino_due/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "Arduino Due" 35 | #define MICROPY_HW_MCU_NAME "SAM3X8E" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/boards/esp01/board.mk: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | LINKER_SCRIPT ?= pumbaa.flash.512k.ld 33 | 34 | LIBPATH += $(PUMBAA_ROOT)/src/mcus/esp8266/ld 35 | 36 | LIB_MINIC = 37 | LIB_CIROM = 38 | SRC += $(SIMBA_ROOT)/3pp/libc/string0.c 39 | CFLAGS += -mforce-l32 40 | CXXFLAGS += -mforce-l32 41 | -------------------------------------------------------------------------------- /src/boards/esp01/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /src/boards/esp01/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "ESP-01" 35 | #define MICROPY_HW_MCU_NAME "ESP8266" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/boards/esp12e/board.mk: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | LINKER_SCRIPT ?= pumbaa.flash.4m.ld 33 | 34 | LIBPATH += $(PUMBAA_ROOT)/src/mcus/esp8266/ld 35 | 36 | LIB_MINIC = 37 | LIB_CIROM = 38 | SRC += $(SIMBA_ROOT)/3pp/libc/string0.c 39 | CFLAGS += -mforce-l32 40 | CXXFLAGS += -mforce-l32 41 | -------------------------------------------------------------------------------- /src/boards/esp12e/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /src/boards/esp12e/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "ESP-12E" 35 | #define MICROPY_HW_MCU_NAME "ESP8266" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/boards/esp32_devkitc/board.mk: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | -------------------------------------------------------------------------------- /src/boards/esp32_devkitc/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /src/boards/esp32_devkitc/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "ESP32-DevKitC" 35 | #define MICROPY_HW_MCU_NAME "ESP32" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/boards/linux/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "Linux" 35 | #define MICROPY_HW_MCU_NAME "Linux" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/boards/nano32/board.mk: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | -------------------------------------------------------------------------------- /src/boards/nano32/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /src/boards/nano32/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "Nano32" 35 | #define MICROPY_HW_MCU_NAME "ESP32" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/boards/nodemcu/board.mk: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | LINKER_SCRIPT ?= pumbaa.flash.4m.ld 33 | 34 | LIBPATH += $(PUMBAA_ROOT)/src/mcus/esp8266/ld 35 | 36 | LIB_MINIC = 37 | LIB_CIROM = 38 | SRC += $(SIMBA_ROOT)/3pp/libc/string0.c 39 | CFLAGS += -mforce-l32 40 | CXXFLAGS += -mforce-l32 41 | -------------------------------------------------------------------------------- /src/boards/nodemcu/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /src/boards/nodemcu/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "NodeMCU" 35 | #define MICROPY_HW_MCU_NAME "ESP8266" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/boards/photon/memory.h: -------------------------------------------------------------------------------- 1 | // this is needed for extmod/crypto-algorithms/sha256.c 2 | #include 3 | -------------------------------------------------------------------------------- /src/boards/photon/simba_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PUMBAA_BOARD_H__ 32 | #define __PUMBAA_BOARD_H__ 33 | 34 | #define MICROPY_HW_BOARD_NAME "Particle IO Photon" 35 | #define MICROPY_HW_MCU_NAME "STM32F205RG" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | /* Changes of the default Simba configuration. */ 35 | #include "simba_config.h" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/mcus/esp8266/gchelper.S: -------------------------------------------------------------------------------- 1 | .file "gchelper.s" 2 | .text 3 | 4 | .align 4 5 | .global gc_helper_get_regs_and_sp 6 | .type gc_helper_get_regs_and_sp, @function 7 | gc_helper_get_regs_and_sp: 8 | # store regs into given array 9 | s32i.n a8, a2, 0 10 | s32i.n a9, a2, 4 11 | s32i.n a10, a2, 8 12 | s32i.n a11, a2, 12 13 | s32i.n a12, a2, 16 14 | s32i.n a13, a2, 20 15 | s32i.n a14, a2, 24 16 | s32i.n a15, a2, 28 17 | 18 | # return the sp 19 | mov a2, a1 20 | ret.n 21 | 22 | .size gc_helper_get_regs_and_sp, .-gc_helper_get_regs_and_sp 23 | -------------------------------------------------------------------------------- /src/mcus/esp8266/ld/pumbaa.flash.1m.ld: -------------------------------------------------------------------------------- 1 | /** 2 | * Linker script for boards with 1 MB flash and 80k dram. 3 | */ 4 | MEMORY 5 | { 6 | dport0_0_seg : org = 0x3ff00000, len = 0x10 7 | dram0_0_seg : org = 0x3ffe8000, len = 0x14000 8 | iram1_0_seg : org = 0x40100000, len = 0x8000 9 | irom0_0_seg : org = 0x40201010, len = 0x7e000 10 | } 11 | 12 | INCLUDE "pumbaa.common.ld" 13 | -------------------------------------------------------------------------------- /src/mcus/esp8266/ld/pumbaa.flash.4m.ld: -------------------------------------------------------------------------------- 1 | /** 2 | * Linker script for boards with 4 MB flash and 80k dram. 3 | */ 4 | MEMORY 5 | { 6 | dport0_0_seg : org = 0x3ff00000, len = 0x10 7 | dram0_0_seg : org = 0x3ffe8000, len = 0x14000 8 | iram1_0_seg : org = 0x40100000, len = 0x8000 9 | irom0_0_seg : org = 0x40201010, len = 0x400000 10 | } 11 | 12 | INCLUDE "pumbaa.common.ld" 13 | -------------------------------------------------------------------------------- /src/mcus/esp8266/ld/pumbaa.flash.512k.ld: -------------------------------------------------------------------------------- 1 | /** 2 | * Linker script for boards with 1 MB flash and 80k dram. 3 | */ 4 | MEMORY 5 | { 6 | dport0_0_seg : org = 0x3ff00000, len = 0x10 7 | dram0_0_seg : org = 0x3ffe8000, len = 0x14000 8 | iram1_0_seg : org = 0x40100000, len = 0x8000 9 | irom0_0_seg : org = 0x40201010, len = 0x7e000 10 | } 11 | 12 | INCLUDE "pumbaa.common.ld" 13 | -------------------------------------------------------------------------------- /src/module_drivers/class_adc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_ADC_H__ 32 | #define __MODULE_DRIVERS_CLASS_ADC_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_ADC == 1 37 | 38 | struct class_adc_t { 39 | mp_obj_base_t base; 40 | struct adc_driver_t drv; 41 | vstr_t vstr; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_adc; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_drivers/class_can.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_CAN_H__ 32 | #define __MODULE_DRIVERS_CLASS_CAN_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_CAN == 1 37 | 38 | struct class_can_t { 39 | mp_obj_base_t base; 40 | struct can_driver_t drv; 41 | struct can_frame_t rxbuf[8]; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_can; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_drivers/class_dac.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_DAC_H__ 32 | #define __MODULE_DRIVERS_CLASS_DAC_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_DAC == 1 37 | 38 | struct class_dac_t { 39 | mp_obj_base_t base; 40 | struct dac_driver_t drv; 41 | }; 42 | 43 | extern const mp_obj_type_t module_drivers_class_dac; 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/module_drivers/class_ds18b20.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_DS18B20_H__ 32 | #define __MODULE_DRIVERS_CLASS_DS18B20_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_DS18B20 == 1 37 | 38 | struct class_ds18b20_t { 39 | mp_obj_base_t base; 40 | struct ds18b20_driver_t drv; 41 | mp_obj_t owi; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_ds18b20; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_drivers/class_eeprom_i2c.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_EEPROM_I2C_H__ 32 | #define __MODULE_DRIVERS_CLASS_EEPROM_I2C_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_EEPROM_I2C == 1 37 | 38 | struct class_eeprom_i2c_t { 39 | mp_obj_base_t base; 40 | struct eeprom_i2c_driver_t drv; 41 | mp_obj_t i2c; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_eeprom_i2c; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_drivers/class_esp_wifi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_ESP_WIFI_H__ 32 | #define __MODULE_DRIVERS_CLASS_ESP_WIFI_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_ESP_WIFI == 1 37 | 38 | struct class_esp_wifi_t { 39 | mp_obj_base_t base; 40 | }; 41 | 42 | extern const struct class_esp_wifi_t module_drivers_esp_wifi_obj; 43 | 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/module_drivers/class_flash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_FLASH_H__ 32 | #define __MODULE_DRIVERS_CLASS_FLASH_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_FLASH == 1 37 | 38 | struct class_flash_t { 39 | mp_obj_base_t base; 40 | struct flash_driver_t drv; 41 | }; 42 | 43 | extern const mp_obj_type_t module_drivers_class_flash; 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/module_drivers/class_i2c.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_I2C_H__ 32 | #define __MODULE_DRIVERS_CLASS_I2C_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_I2C == 1 37 | 38 | struct class_i2c_t { 39 | mp_obj_base_t base; 40 | struct i2c_driver_t drv; 41 | }; 42 | 43 | extern const mp_obj_type_t module_drivers_class_i2c; 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/module_drivers/class_i2c_soft.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_I2C_SOFT_H__ 32 | #define __MODULE_DRIVERS_CLASS_I2C_SOFT_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_I2C_SOFT == 1 37 | 38 | struct class_i2c_soft_t { 39 | mp_obj_base_t base; 40 | struct i2c_soft_driver_t drv; 41 | }; 42 | 43 | extern const mp_obj_type_t module_drivers_class_i2c_soft; 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/module_drivers/class_owi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_OWI_H__ 32 | #define __MODULE_DRIVERS_CLASS_OWI_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_OWI == 1 37 | 38 | struct class_owi_t { 39 | mp_obj_base_t base; 40 | struct owi_driver_t drv; 41 | struct owi_device_t devices[8]; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_owi; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_drivers/class_pin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_PIN_H__ 32 | #define __MODULE_DRIVERS_CLASS_PIN_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_PIN == 1 37 | 38 | struct class_pin_t { 39 | mp_obj_base_t base; 40 | struct pin_driver_t drv; 41 | }; 42 | 43 | extern const mp_obj_type_t module_drivers_class_pin; 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/module_drivers/class_sd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_SD_H__ 32 | #define __MODULE_DRIVERS_CLASS_SD_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_SD == 1 37 | 38 | struct class_sd_t { 39 | mp_obj_base_t base; 40 | struct sd_driver_t drv; 41 | struct class_spi_t *spi_p; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_sd; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_drivers/class_spi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_SPI_H__ 32 | #define __MODULE_DRIVERS_CLASS_SPI_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_SPI == 1 37 | 38 | struct class_spi_t { 39 | mp_obj_base_t base; 40 | struct spi_driver_t drv; 41 | }; 42 | 43 | extern const mp_obj_type_t module_drivers_class_spi; 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/module_drivers/class_uart.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_UART_H__ 32 | #define __MODULE_DRIVERS_CLASS_UART_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_UART == 1 37 | 38 | struct class_uart_t { 39 | mp_obj_base_t base; 40 | struct uart_driver_t drv; 41 | char rxbuf[64]; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_uart; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_drivers/class_ws2812.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_DRIVERS_CLASS_WS2812_H__ 32 | #define __MODULE_DRIVERS_CLASS_WS2812_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | #if CONFIG_PUMBAA_CLASS_WS2812 == 1 37 | 38 | struct class_ws2812_t { 39 | mp_obj_base_t base; 40 | struct ws2812_driver_t drv; 41 | struct pin_device_t *pin_devices[WS2812_PIN_DEVICES_MAX]; 42 | }; 43 | 44 | extern const mp_obj_type_t module_drivers_class_ws2812; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/module_inet/class_http_server_websocket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_INET_CLASS_HTTP_SERVER_WEBSOCKET_H__ 32 | #define __MODULE_INET_CLASS_HTTP_SERVER_WEBSOCKET_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | struct class_http_server_websocket_t { 37 | mp_obj_base_t base; 38 | struct http_websocket_server_t http_server_websocket; 39 | }; 40 | 41 | extern const mp_obj_type_t module_inet_class_http_server_websocket; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/module_kernel/class_timer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_KERNEL_CLASS_TIMER_H__ 32 | #define __MODULE_KERNEL_CLASS_TIMER_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | struct class_timer_t { 37 | mp_obj_base_t base; 38 | struct timer_t timer; 39 | struct class_event_t *event_obj_p; 40 | uint32_t mask; 41 | mp_obj_t callback; 42 | }; 43 | 44 | extern const mp_obj_type_t module_kernel_class_timer; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/module_sync/class_event.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_SYNC_CLASS_EVENT_H__ 32 | #define __MODULE_SYNC_CLASS_EVENT_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | struct class_event_t { 37 | mp_obj_base_t base; 38 | struct event_t event; 39 | }; 40 | 41 | extern const mp_obj_type_t module_sync_class_event; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/module_sync/class_queue.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MODULE_SYNC_CLASS_QUEUE_H__ 32 | #define __MODULE_SYNC_CLASS_QUEUE_H__ 33 | 34 | #include "pumbaa.h" 35 | 36 | struct class_queue_t { 37 | mp_obj_base_t base; 38 | struct queue_t queue; 39 | char buf[64]; 40 | }; 41 | 42 | extern const mp_obj_type_t module_sync_class_queue; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/port/genhdr/mpversion.h: -------------------------------------------------------------------------------- 1 | // This file was generated by py/makeversionhdr.py 2 | #define MICROPY_GIT_TAG "v1.8.3-88-gf98bb2d" 3 | #define MICROPY_GIT_HASH "f98bb2d" 4 | #define MICROPY_BUILD_DATE "2016-09-01" 5 | #define MICROPY_VERSION_MAJOR (1) 6 | #define MICROPY_VERSION_MINOR (8) 7 | #define MICROPY_VERSION_MICRO (3) 8 | #define MICROPY_VERSION_STRING "1.8.3" 9 | -------------------------------------------------------------------------------- /src/port/mpconfigport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MPCONFIGPORT_H__ 32 | #define __MPCONFIGPORT_H__ 33 | 34 | #include "simba_board.h" 35 | #include "config.h" 36 | #include "pumbaa_config_default.h" 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/port/mphalport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __PORT_MPHALPORT_H__ 32 | #define __PORT_MPHALPORT_H__ 33 | 34 | static inline mp_uint_t mp_hal_ticks_ms(void) { return 0; } 35 | 36 | void mp_hal_set_interrupt_char(char c); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/port/mpthreadport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __MPTHREADPORT_H__ 32 | #define __MPTHREADPORT_H__ 33 | 34 | #include "simba.h" 35 | 36 | typedef struct _mp_thread_mutex_t { 37 | struct sem_t sem; 38 | } mp_thread_mutex_t; 39 | 40 | /** 41 | * Initialize the thread module. 42 | */ 43 | void module_thread_init(void); 44 | 45 | void mp_thread_gc_others(void); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /tst/drivers/adc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = adc_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_ADC=1 \ 38 | CONFIG_PIN=1 \ 39 | CONFIG_PUMBAA_CLASS_ADC=1 40 | 41 | SYNC_SRC = event.c 42 | DRIVERS_SRC = adc.c pin.c 43 | 44 | PUMBAA_ROOT ?= ../.. 45 | include $(PUMBAA_ROOT)/make/app.mk 46 | -------------------------------------------------------------------------------- /tst/drivers/can/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = can_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SRC += \ 37 | $(PUMBAA_ROOT)/tst/stubs/can_stub.c 38 | 39 | SYNC_SRC = event.c 40 | 41 | PUMBAA_ROOT ?= ../.. 42 | include $(PUMBAA_ROOT)/make/app.mk 43 | -------------------------------------------------------------------------------- /tst/drivers/can/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #include "stubs.h" 35 | 36 | #define CONFIG_PUMBAA_CLASS_CAN 1 37 | 38 | #define MICROPY_PORT_BUILTIN_MODULES_EXTRA \ 39 | { MP_ROM_QSTR(MP_QSTR_can_stub), MP_ROM_PTR(&module_can_stub) }, 40 | 41 | #define MICROPY_PORT_ROOT_POINTERS_EXTRA \ 42 | CAN_STUB_ROOT_POINTERS 43 | 44 | /* Changes of the default Simba configuration. */ 45 | #include "simba_config.h" 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /tst/drivers/dac/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = dac_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_DAC=1 \ 38 | CONFIG_PUMBAA_CLASS_DAC=1 39 | 40 | SYNC_SRC = event.c 41 | DRIVERS_SRC = dac.c 42 | 43 | PUMBAA_ROOT ?= ../.. 44 | include $(PUMBAA_ROOT)/make/app.mk 45 | -------------------------------------------------------------------------------- /tst/drivers/ds18b20/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = ds18b20_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SRC += \ 37 | $(PUMBAA_ROOT)/tst/stubs/ds18b20_stub.c \ 38 | $(PUMBAA_ROOT)/tst/stubs/owi_stub.c 39 | 40 | CDEFS += \ 41 | CONFIG_PUMBAA_CLASS_DS18B20=1 \ 42 | CONFIG_PUMBAA_CLASS_OWI=1 43 | 44 | SYNC_SRC = event.c 45 | 46 | PUMBAA_ROOT ?= ../.. 47 | include $(PUMBAA_ROOT)/make/app.mk 48 | -------------------------------------------------------------------------------- /tst/drivers/ds18b20/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #include "stubs.h" 35 | 36 | #define MICROPY_PORT_BUILTIN_MODULES_EXTRA \ 37 | OWI_STUB_BUILTIN_MODULE 38 | 39 | #define MICROPY_PORT_ROOT_POINTERS_EXTRA \ 40 | OWI_STUB_ROOT_POINTERS 41 | 42 | /* Changes of the default Simba configuration. */ 43 | #include "simba_config.h" 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /tst/drivers/exti/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = exti_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_EXTI=1 \ 38 | CONFIG_PIN=1 \ 39 | CONFIG_PUMBAA_CLASS_EXTI=1 \ 40 | CONFIG_PUMBAA_CLASS_PIN=1 41 | 42 | SYNC_SRC = event.c 43 | DRIVERS_SRC = exti.c pin.c 44 | 45 | PUMBAA_ROOT ?= ../.. 46 | include $(PUMBAA_ROOT)/make/app.mk 47 | -------------------------------------------------------------------------------- /tst/drivers/flash/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = flash_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SRC += \ 37 | $(PUMBAA_ROOT)/tst/stubs/flash_stub.c 38 | SRC_IGNORE += \ 39 | $(SIMBA_ROOT)/src/drivers/flash.c 40 | 41 | CDEFS += \ 42 | CONFIG_FLASH=1 \ 43 | CONFIG_PUMBAA_CLASS_FLASH=1 44 | 45 | SYNC_SRC = event.c 46 | 47 | PUMBAA_ROOT ?= ../.. 48 | include $(PUMBAA_ROOT)/make/app.mk 49 | -------------------------------------------------------------------------------- /tst/drivers/i2c/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = i2c_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SRC += \ 37 | $(PUMBAA_ROOT)/tst/stubs/i2c_stub.c 38 | 39 | SYNC_SRC = event.c 40 | 41 | PUMBAA_ROOT ?= ../.. 42 | include $(PUMBAA_ROOT)/make/app.mk 43 | -------------------------------------------------------------------------------- /tst/drivers/i2c/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #include "stubs.h" 35 | 36 | #define CONFIG_PUMBAA_CLASS_I2C 1 37 | 38 | #define MICROPY_PORT_BUILTIN_MODULES_EXTRA \ 39 | { MP_ROM_QSTR(MP_QSTR_i2c_stub), MP_ROM_PTR(&module_i2c_stub) }, 40 | 41 | #define MICROPY_PORT_ROOT_POINTERS_EXTRA \ 42 | I2C_STUB_ROOT_POINTERS 43 | 44 | /* Changes of the default Simba configuration. */ 45 | #include "simba_config.h" 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /tst/drivers/owi/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = owi_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SRC += \ 37 | $(PUMBAA_ROOT)/tst/stubs/owi_stub.c 38 | 39 | CDEFS += \ 40 | CONFIG_PUMBAA_CLASS_OWI=1 41 | 42 | SYNC_SRC = event.c 43 | 44 | PUMBAA_ROOT ?= ../.. 45 | include $(PUMBAA_ROOT)/make/app.mk 46 | -------------------------------------------------------------------------------- /tst/drivers/owi/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #include "stubs.h" 35 | 36 | #define MICROPY_PORT_BUILTIN_MODULES_EXTRA \ 37 | OWI_STUB_BUILTIN_MODULE 38 | 39 | #define MICROPY_PORT_ROOT_POINTERS_EXTRA \ 40 | OWI_STUB_ROOT_POINTERS 41 | 42 | /* Changes of the default Simba configuration. */ 43 | #include "simba_config.h" 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /tst/drivers/pin/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = pin_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_PIN=1 \ 38 | CONFIG_PUMBAA_CLASS_PIN=1 39 | 40 | SYNC_SRC = event.c 41 | DRIVERS_SRC = pin.c 42 | 43 | PUMBAA_ROOT ?= ../.. 44 | include $(PUMBAA_ROOT)/make/app.mk 45 | -------------------------------------------------------------------------------- /tst/drivers/sd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = sd_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SRC += \ 37 | $(PUMBAA_ROOT)/tst/stubs/sd_stub.c 38 | 39 | CDEFS += \ 40 | CONFIG_PIN=1 \ 41 | CONFIG_SPI=1 \ 42 | CONFIG_PUMBAA_CLASS_SD=1 \ 43 | CONFIG_PUMBAA_CLASS_SPI=1 44 | 45 | SYNC_SRC = event.c 46 | DRIVERS_SRC = spi.c pin.c 47 | 48 | PUMBAA_ROOT ?= ../.. 49 | include $(PUMBAA_ROOT)/make/app.mk 50 | -------------------------------------------------------------------------------- /tst/drivers/spi/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = spi_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_PIN=1 \ 38 | CONFIG_SPI=1 \ 39 | CONFIG_PUMBAA_CLASS_SPI=1 40 | 41 | SYNC_SRC = event.c 42 | DRIVERS_SRC = spi.c pin.c 43 | 44 | PUMBAA_ROOT ?= ../.. 45 | include $(PUMBAA_ROOT)/make/app.mk 46 | -------------------------------------------------------------------------------- /tst/drivers/uart/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = uart_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_PIN=1 \ 38 | CONFIG_UART=1 \ 39 | CONFIG_PUMBAA_CLASS_UART=1 \ 40 | CONFIG_PUMBAA_MODULE_SELECT=1 41 | 42 | SYNC_SRC = event.c 43 | DRIVERS_SRC = pin.c 44 | 45 | PUMBAA_ROOT ?= ../.. 46 | include $(PUMBAA_ROOT)/make/app.mk 47 | -------------------------------------------------------------------------------- /tst/inet/http_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = http_server_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SRC += \ 37 | $(PUMBAA_ROOT)/tst/stubs/socket_stub.c 38 | 39 | SYNC_SRC = event.c 40 | INET_SRC = http_server.c http_websocket_server.c inet.c 41 | HASH_SRC = sha1.c 42 | ENCODE_SRC = base64.c 43 | 44 | PUMBAA_ROOT ?= ../.. 45 | include $(PUMBAA_ROOT)/make/app.mk 46 | -------------------------------------------------------------------------------- /tst/kernel/timer/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = timer_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | TIMEOUT ?= 20 37 | 38 | CDEFS += \ 39 | CONFIG_MINIMAL_SYSTEM=1 \ 40 | CONFIG_FS_CMD_THRD_LIST=1 \ 41 | CONFIG_PUMBAA_MAIN_REBOOT_AT_EXIT=0 \ 42 | CONFIG_PUMBAA_MAIN_FRIENDLY_REPL=0 43 | 44 | SYNC_SRC = event.c 45 | 46 | PUMBAA_ROOT ?= ../.. 47 | include $(PUMBAA_ROOT)/make/app.mk 48 | -------------------------------------------------------------------------------- /tst/os/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = os_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | TIMEOUT ?= 120 36 | 37 | SYNC_SRC = event.c 38 | FILESYSTEMS_SRC = fat16.c spiffs.c 39 | SPIFFS_SRC = \ 40 | 3pp/spiffs-0.3.5/src/spiffs_nucleus.c \ 41 | 3pp/spiffs-0.3.5/src/spiffs_gc.c \ 42 | 3pp/spiffs-0.3.5/src/spiffs_hydrogen.c \ 43 | 3pp/spiffs-0.3.5/src/spiffs_cache.c \ 44 | 3pp/spiffs-0.3.5/src/spiffs_check.c 45 | 46 | PUMBAA_ROOT ?= ../.. 47 | include $(PUMBAA_ROOT)/make/app.mk 48 | -------------------------------------------------------------------------------- /tst/os/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #include "stubs.h" 35 | 36 | #define CONFIG_START_FILESYSTEM 1 37 | #define CONFIG_FAT16 1 38 | #define CONFIG_SPIFFS 1 39 | #define CONFIG_THRD_ENV 1 40 | #define CONFIG_FS_CMD_THRD_LIST 1 41 | 42 | /* Changes of the default Simba configuration. */ 43 | #include "simba_config.h" 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /tst/select/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = select_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_CAN=1 \ 38 | CONFIG_UART=1 \ 39 | CONFIG_PUMBAA_CLASS_CAN=1 \ 40 | CONFIG_PUMBAA_CLASS_UART=1 \ 41 | CONFIG_PUMBAA_MODULE_SELECT=1 42 | 43 | SYNC_SRC = event.c 44 | DRIVERS_SRC = can.c 45 | 46 | PUMBAA_ROOT ?= ../.. 47 | include $(PUMBAA_ROOT)/make/app.mk 48 | -------------------------------------------------------------------------------- /tst/smoke/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = smoke_suite 33 | BOARD ?= linux 34 | 35 | MAIN_PY = 36 | PYSRC += \ 37 | $(GENDIR)/main.py \ 38 | $(NAME).py \ 39 | other.py \ 40 | $(PUMBAA_ROOT)/src/py/harness.py 41 | CDEFS += \ 42 | CONFIG_PUMBAA_MAIN_REBOOT_AT_EXIT=0 \ 43 | CONFIG_PUMBAA_MAIN_FRIENDLY_REPL=0 \ 44 | CONFIG_FS_CMD_THRD_LIST=1 45 | 46 | PUMBAA_ROOT ?= ../.. 47 | include $(PUMBAA_ROOT)/make/app.mk 48 | -------------------------------------------------------------------------------- /tst/smoke/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | /* Changes of the default Simba configuration. */ 35 | #include "simba_config.h" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /tst/smoke/other.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | return True 3 | -------------------------------------------------------------------------------- /tst/socket/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @section License 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2016-2017, Erik Moqvist 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, copy, 12 | * modify, merge, publish, distribute, sublicense, and/or sell copies 13 | * of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE. 27 | * 28 | * This file is part of the Pumbaa project. 29 | */ 30 | 31 | #ifndef __CONFIG_H__ 32 | #define __CONFIG_H__ 33 | 34 | #include "stubs.h" 35 | 36 | #define MICROPY_PORT_BUILTIN_MODULES_EXTRA \ 37 | SOCKET_STUB_BUILTIN_MODULE 38 | 39 | #define MICROPY_PORT_ROOT_POINTERS_EXTRA \ 40 | SOCKET_STUB_ROOT_POINTERS 41 | 42 | /* Changes of the default Simba configuration. */ 43 | #include "simba_config.h" 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /tst/sync/event/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = event_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SYNC_SRC = event.c 37 | 38 | PUMBAA_ROOT ?= ../.. 39 | include $(PUMBAA_ROOT)/make/app.mk 40 | -------------------------------------------------------------------------------- /tst/sync/queue/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = queue_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | SYNC_SRC = event.c 37 | 38 | PUMBAA_ROOT ?= ../.. 39 | include $(PUMBAA_ROOT)/make/app.mk 40 | -------------------------------------------------------------------------------- /tst/thread/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @section License 3 | # 4 | # The MIT License (MIT) 5 | # 6 | # Copyright (c) 2016-2017, Erik Moqvist 7 | # 8 | # Permission is hereby granted, free of charge, to any person 9 | # obtaining a copy of this software and associated documentation 10 | # files (the "Software"), to deal in the Software without 11 | # restriction, including without limitation the rights to use, copy, 12 | # modify, merge, publish, distribute, sublicense, and/or sell copies 13 | # of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be 17 | # included in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # This file is part of the Pumbaa project. 29 | # 30 | 31 | 32 | NAME = thread_suite 33 | TYPE = suite 34 | BOARD ?= linux 35 | 36 | CDEFS += \ 37 | CONFIG_THRD_STACK_HEAP=1 38 | 39 | SYNC_SRC = event.c 40 | ALLOC_SRC = heap.c 41 | 42 | PUMBAA_ROOT ?= ../.. 43 | include $(PUMBAA_ROOT)/make/app.mk 44 | --------------------------------------------------------------------------------