From ad856e42db040b005b953dd274bc261ae7f3f317 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Tue, 31 Jan 2023 13:46:15 +0200 Subject: [PATCH] Initial commit --- .github/workflows/examples.yml | 34 +++ .gitignore | 2 + README.md | 69 ++++- boards/cubecell_board.json | 22 ++ boards/cubecell_board_plus.json | 22 ++ boards/cubecell_board_pro.json | 27 ++ boards/cubecell_board_v2.json | 22 ++ boards/cubecell_capsule.json | 22 ++ boards/cubecell_capsule_solar_sensor.json | 22 ++ boards/cubecell_gps.json | 22 ++ boards/cubecell_module.json | 27 ++ boards/cubecell_module_plus.json | 27 ++ boards/cubecell_module_v2.json | 27 ++ boards/cubecell_node.json | 27 ++ builder/frameworks/arduino.py | 238 ++++++++++++++++++ builder/main.py | 153 +++++++++++ examples/LoRa/LoRaBasic/PingPong/.gitignore | 1 + examples/LoRa/LoRaBasic/PingPong/README.md | 27 ++ .../LoRa/LoRaBasic/PingPong/include/README | 39 +++ examples/LoRa/LoRaBasic/PingPong/lib/README | 46 ++++ .../LoRa/LoRaBasic/PingPong/platformio.ini | 38 +++ .../LoRa/LoRaBasic/PingPong/src/PingPong.ino | 159 ++++++++++++ examples/LoRa/LoRaBasic/PingPong/test/README | 11 + examples/LoRa/LoRaWAN/LoRaWAN/.gitignore | 1 + examples/LoRa/LoRaWAN/LoRaWAN/README.md | 27 ++ examples/LoRa/LoRaWAN/LoRaWAN/include/README | 39 +++ examples/LoRa/LoRaWAN/LoRaWAN/lib/README | 46 ++++ examples/LoRa/LoRaWAN/LoRaWAN/platformio.ini | 66 +++++ examples/LoRa/LoRaWAN/LoRaWAN/src/LoRaWan.ino | 144 +++++++++++ examples/LoRa/LoRaWAN/LoRaWAN/test/README | 11 + .../LoRa/LoRaWAN/LoRaWAN_Interrupt/.gitignore | 1 + .../LoRa/LoRaWAN/LoRaWAN_Interrupt/README.md | 27 ++ .../LoRaWAN/LoRaWAN_Interrupt/include/README | 39 +++ .../LoRa/LoRaWAN/LoRaWAN_Interrupt/lib/README | 46 ++++ .../LoRaWAN/LoRaWAN_Interrupt/platformio.ini | 36 +++ .../src/LoRaWAN_Interrupt.ino | 175 +++++++++++++ .../LoRaWAN/LoRaWAN_Interrupt/test/README | 11 + examples/arduino-adc/.gitignore | 1 + examples/arduino-adc/README.md | 27 ++ examples/arduino-adc/include/README | 39 +++ examples/arduino-adc/lib/README | 46 ++++ examples/arduino-adc/platformio.ini | 43 ++++ examples/arduino-adc/src/ADC.ino | 20 ++ examples/arduino-adc/test/README | 11 + examples/arduino-blink/.gitignore | 1 + examples/arduino-blink/README.md | 27 ++ examples/arduino-blink/include/README | 39 +++ examples/arduino-blink/lib/README | 46 ++++ examples/arduino-blink/platformio.ini | 33 +++ examples/arduino-blink/src/Blink.cpp | 25 ++ examples/arduino-blink/test/README | 11 + examples/arduino-lowpower/.gitignore | 1 + examples/arduino-lowpower/README.md | 27 ++ examples/arduino-lowpower/include/README | 39 +++ examples/arduino-lowpower/lib/README | 46 ++++ examples/arduino-lowpower/platformio.ini | 34 +++ .../src/LowPower_WakeUpByTimer.ino | 41 +++ examples/arduino-lowpower/test/README | 11 + examples/arduino-rgb/.gitignore | 1 + examples/arduino-rgb/README.md | 27 ++ examples/arduino-rgb/include/README | 39 +++ examples/arduino-rgb/lib/README | 46 ++++ examples/arduino-rgb/platformio.ini | 28 +++ examples/arduino-rgb/src/RGB.ino | 37 +++ examples/arduino-rgb/test/README | 11 + platform.json | 61 +++++ 66 files changed, 2569 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/examples.yml create mode 100644 .gitignore create mode 100644 boards/cubecell_board.json create mode 100644 boards/cubecell_board_plus.json create mode 100644 boards/cubecell_board_pro.json create mode 100644 boards/cubecell_board_v2.json create mode 100644 boards/cubecell_capsule.json create mode 100644 boards/cubecell_capsule_solar_sensor.json create mode 100644 boards/cubecell_gps.json create mode 100644 boards/cubecell_module.json create mode 100644 boards/cubecell_module_plus.json create mode 100644 boards/cubecell_module_v2.json create mode 100644 boards/cubecell_node.json create mode 100644 builder/frameworks/arduino.py create mode 100644 builder/main.py create mode 100644 examples/LoRa/LoRaBasic/PingPong/.gitignore create mode 100644 examples/LoRa/LoRaBasic/PingPong/README.md create mode 100644 examples/LoRa/LoRaBasic/PingPong/include/README create mode 100644 examples/LoRa/LoRaBasic/PingPong/lib/README create mode 100644 examples/LoRa/LoRaBasic/PingPong/platformio.ini create mode 100644 examples/LoRa/LoRaBasic/PingPong/src/PingPong.ino create mode 100644 examples/LoRa/LoRaBasic/PingPong/test/README create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN/.gitignore create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN/README.md create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN/include/README create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN/lib/README create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN/platformio.ini create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN/src/LoRaWan.ino create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN/test/README create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/.gitignore create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/README.md create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/include/README create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/lib/README create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/platformio.ini create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/src/LoRaWAN_Interrupt.ino create mode 100644 examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/test/README create mode 100644 examples/arduino-adc/.gitignore create mode 100644 examples/arduino-adc/README.md create mode 100644 examples/arduino-adc/include/README create mode 100644 examples/arduino-adc/lib/README create mode 100644 examples/arduino-adc/platformio.ini create mode 100644 examples/arduino-adc/src/ADC.ino create mode 100644 examples/arduino-adc/test/README create mode 100644 examples/arduino-blink/.gitignore create mode 100644 examples/arduino-blink/README.md create mode 100644 examples/arduino-blink/include/README create mode 100644 examples/arduino-blink/lib/README create mode 100644 examples/arduino-blink/platformio.ini create mode 100644 examples/arduino-blink/src/Blink.cpp create mode 100644 examples/arduino-blink/test/README create mode 100644 examples/arduino-lowpower/.gitignore create mode 100644 examples/arduino-lowpower/README.md create mode 100644 examples/arduino-lowpower/include/README create mode 100644 examples/arduino-lowpower/lib/README create mode 100644 examples/arduino-lowpower/platformio.ini create mode 100644 examples/arduino-lowpower/src/LowPower_WakeUpByTimer.ino create mode 100644 examples/arduino-lowpower/test/README create mode 100644 examples/arduino-rgb/.gitignore create mode 100644 examples/arduino-rgb/README.md create mode 100644 examples/arduino-rgb/include/README create mode 100644 examples/arduino-rgb/lib/README create mode 100644 examples/arduino-rgb/platformio.ini create mode 100644 examples/arduino-rgb/src/RGB.ino create mode 100644 examples/arduino-rgb/test/README create mode 100644 platform.json diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 0000000..316be1f --- /dev/null +++ b/.github/workflows/examples.yml @@ -0,0 +1,34 @@ +name: Examples + +on: [push, pull_request] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + example: + - "examples/arduino-adc" + - "examples/arduino-blink" + - "examples/arduino-lowpower" + - "examples/arduino-rgb" + - "examples/LoRa/LoRaBasic/PingPong" + - "examples/LoRa/LoRaWAN/LoRaWAN" + - "examples/LoRa/LoRaWAN/LoRaWAN_Interrupt" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + with: + submodules: "recursive" + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.9" + - name: Install dependencies + run: | + pip install -U https://github.com/platformio/platformio/archive/develop.zip + pio pkg install --global --platform symlink://. + - name: Build examples + run: | + pio run -d ${{ matrix.example }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e23d32f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +.pio diff --git a/README.md b/README.md index 20f2bed..d12da23 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,67 @@ -# heltec-cubecell -Heltec Cubecell: development platform for PlatformIO +# Heltec CubeCell: development platform for [PlatformIO](https://platformio.org) + +[![Build Status](https://github.com/HelTecAutomation/heltec-cubecell/workflows/Examples/badge.svg)](https://github.com/HelTecAutomation/heltec-cubecell/actions) + +Heltec CubeCell is an easy-to-use LoRa Node series brand based on a highly integrated and ultra low power SoC and the LoRa SX1262 transceiver. + +* [Home](https://registry.platformio.org/platforms/heltecautomation/heltec-cubecell) (home page in the PlatformIO Registry) +* [Documentation](https://docs.platformio.org/page/platforms/heltec-cubecell.html) (advanced usage, packages, boards, frameworks, etc.) + +# Usage + +1. [Install PlatformIO](https://platformio.org) +2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: + +## Stable version + +```ini +[env:stable] +platform = heltec-cubecell +board = ... +... +``` + +## Development version + +```ini +[env:development] +platform = https://github.com/HelTecAutomation/heltec-cubecell.git +board = ... +... +``` + +# Configuration + +## LoRaWAN + +LoRaWAN protocol can be configured in https://docs.platformio.org/en/latest/projectconf/index.html using the following syntax +``board_build.arduino.lorawan.*`` where ``*`` is an option from the following list: + +| Option | Description | Possible values | Default | +| ----------- | ----------- | --------------- | ------- | +| ``region`` | Region definition | ``AS923_AS1``, ``AS923_AS2``, ``AU915``, ``CN470``, ``CN779``, ``EU433``, ``EU868``, ``KR920``, ``IN865``, ``US915``, ``US915_HYBRID`` | ``US915`` | +| ``class`` | Device class | ``CLASS_A``, ``CLASS_C`` | ``CLASS_A`` | +| ``netmode`` | Activation method | ``OTAA``, ``ABP`` | ``OTAA`` | +| ``adr`` | Adaptive Data Rate | ``ON``, ``OFF`` | ``ON`` | +| ``uplinkmode`` | Uplink confirmed/unconfirmed messages | ``CONFIRMED``, ``UNCONFIRMED`` | ``CONFIRMED`` | +| ``net_reserve`` | Don't rejoin after reset | ``ON``, ``OFF`` | ``OFF`` | +| ``at_support`` | AT commands support | ``ON``, ``OFF`` | ``ON`` | +| ``rgb`` | RGB light for LoRaWAN status | ``ACTIVE``, ``DEACTIVE`` | ``ACTIVE`` | +| ``preamble_length`` | Preamble length | ``8``, ``16`` (For M00 and M00L) | ``8`` | +| ``debug_level`` | Print LoRaWAN relevant messages print to serial port | ``NONE``, ``FREQ`` (Sending/receiving frequency), ``FREQ_AND_DIO`` (Sending/receiving frequency and DIO pin interrupt information) | ``NONE`` | + + +**Example** + +```ini +[env:cubecell_board] +platform = heltec-cubecell +framework = arduino +board = cubecell_board +board_build.arduino.lorawan.region = EU433 +board_build.arduino.lorawan.adr = OFF +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO +``` + +More information about LoRaWAN configuration can be found in +[the official CubeCell documentation](https://heltec-automation-docs.readthedocs.io/en/latest/cubecell/index.html). diff --git a/boards/cubecell_board.json b/boards/cubecell_board.json new file mode 100644 index 0000000..6e56cb7 --- /dev/null +++ b/boards/cubecell_board.json @@ -0,0 +1,22 @@ +{ + "build": { + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_Board", + "f_cpu": "48000000L", + "mcu": "asr6501", + "variant": "CubeCell-Board" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Board (HTCC-AB01)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-ab01/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_board_plus.json b/boards/cubecell_board_plus.json new file mode 100644 index 0000000..b377b92 --- /dev/null +++ b/boards/cubecell_board_plus.json @@ -0,0 +1,22 @@ +{ + "build": { + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_BoardPlus", + "f_cpu": "48000000L", + "mcu": "asr6502", + "variant": "CubeCell-BoardPlus" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Board Plus (HTCC-AB02)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-ab02/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_board_pro.json b/boards/cubecell_board_pro.json new file mode 100644 index 0000000..f2d01b8 --- /dev/null +++ b/boards/cubecell_board_pro.json @@ -0,0 +1,27 @@ +{ + "build": { + "arduino": { + "lorawan": { + "class": "CLASS_B" + } + }, + "core": "asr6601", + "cpu": "cortex-m4", + "extra_flags": "-DCubeCell_BoardPRO", + "f_cpu": "48000000L", + "mcu": "asr6601", + "variant": "CubeCell-Board-PRO" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Board PRO (HTCC-AB03)", + "upload": { + "maximum_ram_size": 229376, + "maximum_size": 229376, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/proudct_center", + "vendor": "Heltec" +} diff --git a/boards/cubecell_board_v2.json b/boards/cubecell_board_v2.json new file mode 100644 index 0000000..cb77e7a --- /dev/null +++ b/boards/cubecell_board_v2.json @@ -0,0 +1,22 @@ +{ + "build": { + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_Board_V2", + "f_cpu": "48000000L", + "mcu": "asr6501", + "variant": "CubeCell-Board-V2" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Board-V2 (HTCC-AB01-V2)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-ab01-v2/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_capsule.json b/boards/cubecell_capsule.json new file mode 100644 index 0000000..9eb6de5 --- /dev/null +++ b/boards/cubecell_capsule.json @@ -0,0 +1,22 @@ +{ + "build": { + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_Capsule", + "f_cpu": "48000000L", + "mcu": "asr6501", + "variant": "CubeCell-Capsule" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Capsule (HTCC-AC01)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/product/htcc-ac01/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_capsule_solar_sensor.json b/boards/cubecell_capsule_solar_sensor.json new file mode 100644 index 0000000..5d9bcc1 --- /dev/null +++ b/boards/cubecell_capsule_solar_sensor.json @@ -0,0 +1,22 @@ +{ + "build": { + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_Capsule", + "f_cpu": "48000000L", + "mcu": "asr6051", + "variant": "CubeCell-Capsule" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell Capsule Solar Sensor (HTCC-AC02)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-ac02/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_gps.json b/boards/cubecell_gps.json new file mode 100644 index 0000000..53428fe --- /dev/null +++ b/boards/cubecell_gps.json @@ -0,0 +1,22 @@ +{ + "build": { + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_GPS", + "f_cpu": "48000000L", + "mcu": "asr6502", + "variant": "CubeCell-GPS" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-GPS (HTCC-AB02S)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-ab02s/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_module.json b/boards/cubecell_module.json new file mode 100644 index 0000000..fe28a7c --- /dev/null +++ b/boards/cubecell_module.json @@ -0,0 +1,27 @@ +{ + "build": { + "arduino": { + "lorawan": { + "rgb": "DEACTIVE" + } + }, + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_Module", + "f_cpu": "48000000L", + "mcu": "asr6501", + "variant": "CubeCell-Module" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Module (HTCC-AM01)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-am01/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_module_plus.json b/boards/cubecell_module_plus.json new file mode 100644 index 0000000..5d8c313 --- /dev/null +++ b/boards/cubecell_module_plus.json @@ -0,0 +1,27 @@ +{ + "build": { + "arduino": { + "lorawan": { + "rgb": "DEACTIVE" + } + }, + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_ModulePlus", + "f_cpu": "48000000L", + "mcu": "asr6502", + "variant": "CubeCell-ModulePlus" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Module Plus (HTCC-AM02)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-am02/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_module_v2.json b/boards/cubecell_module_v2.json new file mode 100644 index 0000000..ace7aae --- /dev/null +++ b/boards/cubecell_module_v2.json @@ -0,0 +1,27 @@ +{ + "build": { + "arduino": { + "lorawan": { + "rgb": "DEACTIVE" + } + }, + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_Module_V2", + "f_cpu": "48000000L", + "mcu": "asr6501", + "variant": "CubeCell-Module-V2" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-Module-V2(HTCC-AM01-V2)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-am01-v2/", + "vendor": "Heltec" +} diff --git a/boards/cubecell_node.json b/boards/cubecell_node.json new file mode 100644 index 0000000..a9d6a2e --- /dev/null +++ b/boards/cubecell_node.json @@ -0,0 +1,27 @@ +{ + "build": { + "arduino": { + "lorawan": { + "rgb": "DEACTIVE" + } + }, + "core": "asr650x", + "cpu": "cortex-m0plus", + "extra_flags": "-DCubeCell_HalfAA", + "f_cpu": "48000000L", + "mcu": "asr6502", + "variant": "CubeCell-HalfAA" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec CubeCell-1/2AA Node (HTCC-AB02A)", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "serial", + "require_upload_port": true + }, + "url": "https://heltec.org/project/htcc-ab02a/", + "vendor": "Heltec" +} diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py new file mode 100644 index 0000000..027b6b1 --- /dev/null +++ b/builder/frameworks/arduino.py @@ -0,0 +1,238 @@ +# Copyright 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Arduino + +Arduino Wiring-based Framework allows writing cross-platform software to +control devices attached to a wide range of Arduino boards to create all +kinds of creative coding, interactive objects, spaces or physical experiences. + +http://arduino.cc/en/Reference/HomePage +""" + +import os + +from SCons.Script import DefaultEnvironment + + +env = DefaultEnvironment() +platform = env.PioPlatform() +board = env.BoardConfig() +core = board.get("build.core") +mcu = board.get("build.mcu", "") +is_asr6601 = mcu.startswith("asr6601") +arch = "asr6601" if is_asr6601 else "asr650x" + +FRAMEWORK_DIR = platform.get_package_dir("framework-arduinocubecell") +CORE_DIR = os.path.join(FRAMEWORK_DIR, "cores", core) +assert os.path.isdir(FRAMEWORK_DIR) + +machine_flags = [ + "-mcpu=%s" % board.get("build.cpu"), + "-mthumb", + "-mthumb-interwork", + "-mapcs-frame", +] + +env.Append( + ASFLAGS=machine_flags, + ASPPFLAGS=[ + "-x", "assembler-with-cpp", + ], + + CPPDEFINES=[ + ("ARDUINO", 10815), + "ARDUINO_ARCH_%s" % arch.upper(), + "__%s__" % mcu.upper(), + "__%s__" % arch, + ("CONFIG_MANUFACTURER", '\\"ASR\\"'), + ("CONFIG_DEVICE_MODEL", '\\"%s\\"' % mcu), + ("CONFIG_VERSION", '\\"v4.0\\"'), + ("CY_CORE_ID", 0), + "CONFIG_LORA_USE_TCXO", + ("F_CPU", "$BOARD_F_CPU"), + "SOFT_SE", + ], + CCFLAGS=machine_flags + [ + "-w", + "-Wall", + "-Os", + "-ffunction-sections", + "-fdata-sections", + "-ffat-lto-objects", + "-fno-common", + "-fno-builtin-printf", + "-fno-builtin-fflush", + "-fno-builtin-sprintf", + "-fno-builtin-snprintf", + "-Wno-strict-aliasing", + ], + CXXFLAGS=[ + "-fno-exceptions", + "-fno-rtti", + ], + LINKFLAGS=machine_flags + [ + "-Os", + "-Wl,--gc-sections", + "-Wl,--wrap=printf", + "-Wl,--wrap=fflush", + "-Wl,--wrap=sprintf", + "-Wl,--wrap=snprintf", + "-specs=nano.specs", + "-specs=nosys.specs", + "-ffat-lto-objects", + ], + LIBS=["stdc++", "m"], + LIBSOURCE_DIRS=[os.path.join(FRAMEWORK_DIR, "libraries")], +) + +env.Prepend( + _LIBFLAGS='"%s" ' + % ( + os.path.join(CORE_DIR, "asr6601.a") + if is_asr6601 + else os.path.join(CORE_DIR, "projects", "CubeCellLib.a") + ), +) + +if is_asr6601: + env.Append( + CPPPATH=[ + CORE_DIR, + os.path.join(CORE_DIR, "drivers", "peripheral", "inc"), + os.path.join(CORE_DIR, "drivers", "crypto", "inc"), + os.path.join(CORE_DIR, "platform", "CMSIS"), + os.path.join(CORE_DIR, "platform", "system"), + os.path.join(CORE_DIR, "lora", "driver"), + os.path.join(CORE_DIR, "lora", "radio"), + os.path.join(CORE_DIR, "lora"), + os.path.join(CORE_DIR, "lora", "radio", "sx126x"), + os.path.join(CORE_DIR, "lora", "system"), + os.path.join(CORE_DIR, "lora", "system", "crypto"), + os.path.join(CORE_DIR, "base"), + os.path.join(CORE_DIR, "peripheral"), + ], + ) +else: + env.Append( + CPPPATH=[ + CORE_DIR, + os.path.join(CORE_DIR, "board"), + os.path.join(CORE_DIR, "board", "src"), + os.path.join(CORE_DIR, "board", "inc"), + os.path.join(CORE_DIR, "device", "sx126x"), + os.path.join(CORE_DIR, "lora"), + os.path.join(CORE_DIR, "lora", "system"), + os.path.join(CORE_DIR, "lora", "system", "crypto"), + os.path.join(CORE_DIR, "port"), + os.path.join(CORE_DIR, "port", "include"), + os.path.join(CORE_DIR, "projects"), + os.path.join(CORE_DIR, "projects", "PSoC4"), + os.path.join(CORE_DIR, "cores"), + os.path.join(CORE_DIR, "Serial"), + os.path.join(CORE_DIR, "Wire"), + os.path.join(CORE_DIR, "SPI"), + ], + ) + + +if not board.get("build.ldscript", ""): + env.Append( + LIBPATH=[ + CORE_DIR if is_asr6601 else os.path.join(CORE_DIR, "projects", "PSoC4"), + ] + ) + env.Replace( + LDSCRIPT_PATH=board.get( + "build.arduino.ldscript", "gcc.ld" if is_asr6601 else "cm0plusgcc.ld" + ) + ) + +# +# Configure LoRaWAN +# + +lorawan_config = board.get("build.arduino.lorawan", {}) +region = lorawan_config.get("region", "US915") +debug_level = lorawan_config.get("debug_level", "NONE") + +env.Append( + CPPDEFINES=[ + "REGION_%s" % region, + ("ACTIVE_REGION", "LORAMAC_REGION_%s" % region), + ("LORAWAN_CLASS", lorawan_config.get("class", "CLASS_A")), + ( + "LORAWAN_NETMODE", + "true" if lorawan_config.get("netmode", "OTAA") == "OTAA" else "false", + ), + ("LORAWAN_ADR", "true" if lorawan_config.get("adr", "ON") == "ON" else "false"), + ( + "LORAWAN_UPLINKMODE", + "true" + if lorawan_config.get("uplinkmode", "CONFIRMED") == "CONFIRMED" + else "false", + ), + ( + "LORAWAN_NET_RESERVE", + "true" if lorawan_config.get("net_reserve", "OFF") == "ON" else "false", + ), + ("AT_SUPPORT", 1 if lorawan_config.get("at_support", "ON") == "ON" else 0), + ( + "LORAWAN_DEVEUI_AUTO", + 0 if lorawan_config.get("deveui", "CUSTOM") == "CUSTOM" else 1, + ), + ("LoraWan_RGB", 1 if lorawan_config.get("rgb", "ACTIVE") == "ACTIVE" else 0), + ("LORAWAN_PREAMBLE_LENGTH", lorawan_config.get("preamble_length", 8)), + ( + "LoRaWAN_DEBUG_LEVEL", + 2 if debug_level == "FREQ_AND_DIO" else (1 if debug_level == "FREQ" else 0), + ), + ] +) + +# +# Target: Build Core Library +# + +libs = [] + +if "build.variant" in board: + variants_dir = ( + os.path.join("$PROJECT_DIR", board.get("build.variants_dir")) + if board.get("build.variants_dir", "") + else os.path.join(FRAMEWORK_DIR, "variants") + ) + env.Append(CPPPATH=[os.path.join(variants_dir, board.get("build.variant"))]) + libs.append( + env.BuildLibrary( + os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"), + os.path.join(variants_dir, board.get("build.variant")), + ) + ) + +libs.append( + env.BuildLibrary( + os.path.join("$BUILD_DIR", "FrameworkArduino"), + CORE_DIR, + # Only applicable to ASR6501 + src_filter=[ + "+<*>", + "-", + "-", + ], + ) +) + +env.Prepend(LIBS=libs) diff --git a/builder/main.py b/builder/main.py new file mode 100644 index 0000000..9683030 --- /dev/null +++ b/builder/main.py @@ -0,0 +1,153 @@ +# Copyright 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from os.path import join + +from SCons.Script import ( + AlwaysBuild, + Builder, + COMMAND_LINE_TARGETS, + Default, + DefaultEnvironment, +) + + +env = DefaultEnvironment() +platform = env.PioPlatform() + + +env.Replace( + AR="arm-none-eabi-ar", + AS="arm-none-eabi-as", + CC="arm-none-eabi-gcc", + GDB="arm-none-eabi-gdb", + CXX="arm-none-eabi-g++", + OBJCOPY="arm-none-eabi-objcopy", + RANLIB="arm-none-eabi-gcc-ranlib", + SIZETOOL="arm-none-eabi-size", + ARFLAGS=["rcs"], + SIZEPROGREGEXP=r"^(?:\.text|\.data|\.rodata|\.text.align|\.ARM.exidx|\.cybootloader)\s+(\d+).*", + SIZEDATAREGEXP=r"^(?:\.data|\.bss|\.noinit)\s+(\d+).*", + SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", + SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES", + PROGSUFFIX=".elf", +) + +env.Append( + BUILDERS=dict( + ElfToHex=Builder( + action=env.VerboseAction( + " ".join(["$OBJCOPY", "-O", "ihex", "$SOURCES", "$TARGET"]), + "Building $TARGET", + ), + suffix=".hex", + ), + ElfToBin=Builder( + action=env.VerboseAction( + " ".join(["$OBJCOPY", "-O", "binary", "$SOURCES", "$TARGET"]), + "Building $TARGET", + ), + suffix=".bin", + ), + GenerateCyacd=Builder( + action=env.VerboseAction( + " ".join( + [ + '"%s"' + % join( + platform.get_package_dir("tool-cubecellelftool") or "", + "CubeCellelftool", + ), + "$OBJCOPY", + "${SOURCES[0]}", + "${SOURCES[1]}", + "$TARGET", + ] + ), + "Building $TARGET", + ), + suffix=".cyacd", + ), + ) +) + +# Allow user to override via pre:script +if env.get("PROGNAME", "program") == "program": + env.Replace(PROGNAME="firmware") + +# +# Target: Build executable and linkable firmware +# + +target_elf = None +is_asr6601 = env.BoardConfig().get("build.mcu", "").startswith("asr6601") +if "nobuild" in COMMAND_LINE_TARGETS: + target_elf = join("$BUILD_DIR", "${PROGNAME}.elf") + target_hex = join("$BUILD_DIR", "${PROGNAME}.hex") + target_firm = join( + "$BUILD_DIR", "${PROGNAME}" + (".bin" if is_asr6601 else ".cyacd") + ) +else: + target_elf = env.BuildProgram() + target_hex = env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf) + target_firm = ( + env.ElfToBin(join("$BUILD_DIR", "${PROGNAME}"), target_elf) + if is_asr6601 + else env.GenerateCyacd( + join("$BUILD_DIR", "${PROGNAME}"), [target_elf, target_hex] + ) + ) + env.Depends(target_firm, "checkprogsize") + +AlwaysBuild(env.Alias("nobuild", target_firm)) +target_buildprog = env.Alias("buildprog", target_firm, target_firm) + +# +# Target: Print binary size +# + +target_size = env.Alias( + "size", target_elf, env.VerboseAction("$SIZEPRINTCMD", "Calculating size $SOURCE") +) +AlwaysBuild(target_size) + +# +# Target: Upload by default .hex file +# + +upload_protocol = env.subst("$UPLOAD_PROTOCOL") + +if upload_protocol == "serial": + env.Replace( + UPLOADER="flash6601" if is_asr6601 else "CubeCellflash", + UPLOADERFLAGS=["-p", '"$UPLOAD_PORT"', "flash"] + if is_asr6601 + else ["-serial", '"$UPLOAD_PORT"'], + UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES", + ) + upload_actions = [ + env.VerboseAction(env.AutodetectUploadPort, "Looking for upload port..."), + env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE"), + ] + +elif upload_protocol == "custom": + upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] + +AlwaysBuild(env.Alias("upload", target_firm, upload_actions)) + +# +# Target: Define targets +# + +Default([target_buildprog, target_size]) diff --git a/examples/LoRa/LoRaBasic/PingPong/.gitignore b/examples/LoRa/LoRaBasic/PingPong/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/examples/LoRa/LoRaBasic/PingPong/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/LoRa/LoRaBasic/PingPong/README.md b/examples/LoRa/LoRaBasic/PingPong/README.md new file mode 100644 index 0000000..941f0c2 --- /dev/null +++ b/examples/LoRa/LoRaBasic/PingPong/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/HelTecAutomation/heltec-cubecell/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd heltec-cubecell/examples/LoRa/LoRaBasic/PingPong + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e cubecell_capsule + +# Upload firmware for the specific environment +$ pio run -e cubecell_capsule --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/LoRa/LoRaBasic/PingPong/include/README b/examples/LoRa/LoRaBasic/PingPong/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/LoRa/LoRaBasic/PingPong/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/LoRa/LoRaBasic/PingPong/lib/README b/examples/LoRa/LoRaBasic/PingPong/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/LoRa/LoRaBasic/PingPong/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/LoRa/LoRaBasic/PingPong/platformio.ini b/examples/LoRa/LoRaBasic/PingPong/platformio.ini new file mode 100644 index 0000000..4662e6a --- /dev/null +++ b/examples/LoRa/LoRaBasic/PingPong/platformio.ini @@ -0,0 +1,38 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:cubecell_board] +platform = heltec-cubecell +framework = arduino +board = cubecell_board +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU868 +board_build.arduino.lorawan.adr = ON +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO + + +[env:cubecell_capsule] +platform = heltec-cubecell +framework = arduino +board = cubecell_capsule +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU868 +board_build.arduino.lorawan.adr = ON +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO + +[env:cubecell_gps] +platform = heltec-cubecell +framework = arduino +board = cubecell_gps +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU868 +board_build.arduino.lorawan.adr = ON +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO + diff --git a/examples/LoRa/LoRaBasic/PingPong/src/PingPong.ino b/examples/LoRa/LoRaBasic/PingPong/src/PingPong.ino new file mode 100644 index 0000000..508435c --- /dev/null +++ b/examples/LoRa/LoRaBasic/PingPong/src/PingPong.ino @@ -0,0 +1,159 @@ +/* Heltec Automation Ping Pong communication test example + * + * Function: + * 1. Ping Pong communication in two CubeCell device. + * + * Description: + * 1. Only hardware layer communicate, no LoRaWAN protocol support; + * 2. Download the same code into two CubeCell devices, then they will begin Ping Pong test each other; + * 3. This example is for CubeCell hardware basic test. + * + * HelTec AutoMation, Chengdu, China + * 成都惠利特自动化科技有限公司 + * www.heltec.org + * + * this project also realess in GitHub: + * https://github.com/HelTecAutomation/ASR650x-Arduino + * */ + +#include "LoRaWan_APP.h" +#include "Arduino.h" + +/* + * set LoraWan_RGB to 1,the RGB active in loraWan + * RGB red means sending; + * RGB green means received done; + */ +#ifndef LoraWan_RGB +#define LoraWan_RGB 0 +#endif + +#define RF_FREQUENCY 868000000 // Hz + +#define TX_OUTPUT_POWER 5 // dBm + +#define LORA_BANDWIDTH 0 // [0: 125 kHz, + // 1: 250 kHz, + // 2: 500 kHz, + // 3: Reserved] +#define LORA_SPREADING_FACTOR 7 // [SF7..SF12] +#define LORA_CODINGRATE 1 // [1: 4/5, + // 2: 4/6, + // 3: 4/7, + // 4: 4/8] +#define LORA_PREAMBLE_LENGTH 8 // Same for Tx and Rx +#define LORA_SYMBOL_TIMEOUT 0 // Symbols +#define LORA_FIX_LENGTH_PAYLOAD_ON false +#define LORA_IQ_INVERSION_ON false + + +#define RX_TIMEOUT_VALUE 1000 +#define BUFFER_SIZE 30 // Define the payload size here + +char txpacket[BUFFER_SIZE]; +char rxpacket[BUFFER_SIZE]; + +static RadioEvents_t RadioEvents; +void OnTxDone( void ); +void OnTxTimeout( void ); +void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ); + +typedef enum +{ + LOWPOWER, + RX, + TX +}States_t; + +int16_t txNumber; +States_t state; +bool sleepMode = false; +int16_t Rssi,rxSize; + + +void setup() { + boardInitMcu( ); + Serial.begin(115200); + + txNumber=0; + Rssi=0; + + RadioEvents.TxDone = OnTxDone; + RadioEvents.TxTimeout = OnTxTimeout; + RadioEvents.RxDone = OnRxDone; + + Radio.Init( &RadioEvents ); + Radio.SetChannel( RF_FREQUENCY ); + Radio.SetTxConfig( MODEM_LORA, TX_OUTPUT_POWER, 0, LORA_BANDWIDTH, + LORA_SPREADING_FACTOR, LORA_CODINGRATE, + LORA_PREAMBLE_LENGTH, LORA_FIX_LENGTH_PAYLOAD_ON, + true, 0, 0, LORA_IQ_INVERSION_ON, 3000 ); + + Radio.SetRxConfig( MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR, + LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH, + LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON, + 0, true, 0, 0, LORA_IQ_INVERSION_ON, true ); + state=TX; +} + + + +void loop() +{ + switch(state) + { + case TX: + delay(1000); + txNumber++; + sprintf(txpacket,"%s","hello"); + sprintf(txpacket+strlen(txpacket),"%d",txNumber); + sprintf(txpacket+strlen(txpacket),"%s"," Rssi : "); + sprintf(txpacket+strlen(txpacket),"%d",Rssi); + turnOnRGB(COLOR_SEND,0); + + Serial.printf("\r\nsending packet \"%s\" , length %d\r\n",txpacket, strlen(txpacket)); + + Radio.Send( (uint8_t *)txpacket, strlen(txpacket) ); + state=LOWPOWER; + break; + case RX: + Serial.println("into RX mode"); + Radio.Rx( 0 ); + state=LOWPOWER; + break; + case LOWPOWER: + lowPowerHandler(); + break; + default: + break; + } + Radio.IrqProcess( ); +} + +void OnTxDone( void ) +{ + Serial.print("TX done......"); + turnOnRGB(0,0); + state=RX; +} + +void OnTxTimeout( void ) +{ + Radio.Sleep( ); + Serial.print("TX Timeout......"); + state=TX; +} +void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ) +{ + Rssi=rssi; + rxSize=size; + memcpy(rxpacket, payload, size ); + rxpacket[size]='\0'; + turnOnRGB(COLOR_RECEIVED,0); + Radio.Sleep( ); + + Serial.printf("\r\nreceived packet \"%s\" with Rssi %d , length %d\r\n",rxpacket,Rssi,rxSize); + Serial.println("wait to send next packet"); + + state=TX; +} \ No newline at end of file diff --git a/examples/LoRa/LoRaBasic/PingPong/test/README b/examples/LoRa/LoRaBasic/PingPong/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/LoRa/LoRaBasic/PingPong/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/LoRa/LoRaWAN/LoRaWAN/.gitignore b/examples/LoRa/LoRaWAN/LoRaWAN/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/LoRa/LoRaWAN/LoRaWAN/README.md b/examples/LoRa/LoRaWAN/LoRaWAN/README.md new file mode 100644 index 0000000..cd1611d --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/HelTecAutomation/heltec-cubecell/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd heltec-cubecell/examples/LoRa/LoRaWAN/LoRaWAN + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e cubecell_capsule + +# Upload firmware for the specific environment +$ pio run -e cubecell_capsule --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/LoRa/LoRaWAN/LoRaWAN/include/README b/examples/LoRa/LoRaWAN/LoRaWAN/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/LoRa/LoRaWAN/LoRaWAN/lib/README b/examples/LoRa/LoRaWAN/LoRaWAN/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/LoRa/LoRaWAN/LoRaWAN/platformio.ini b/examples/LoRa/LoRaWAN/LoRaWAN/platformio.ini new file mode 100644 index 0000000..ec69454 --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN/platformio.ini @@ -0,0 +1,66 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:cubecell_board] +platform = heltec-cubecell +framework = arduino +board = cubecell_board +monitor_speed = 115200 +board_build.arduino.lorawan.region = US915 +board_build.arduino.lorawan.uplinkmode = UNCONFIRMED + +[env:cubecell_board_plus] +platform = heltec-cubecell +framework = arduino +board = cubecell_board_plus +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU433 +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO + +[env:cubecell_capsule] +platform = heltec-cubecell +framework = arduino +board = cubecell_capsule +monitor_speed = 115200 +board_build.arduino.lorawan.region = CN470 +board_build.arduino.lorawan.at_support = OFF + +[env:cubecell_gps] +platform = heltec-cubecell +framework = arduino +board = cubecell_gps +monitor_speed = 115200 +board_build.arduino.lorawan.region = CN779 +board_build.arduino.lorawan.net_reserve = ON + +[env:cubecell_module] +platform = heltec-cubecell +framework = arduino +board = cubecell_module +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU868 +board_build.arduino.lorawan.rgb = DEACTIVE + +[env:cubecell_module_plus] +platform = heltec-cubecell +framework = arduino +board = cubecell_module_plus +monitor_speed = 115200 +board_build.arduino.lorawan.region = KR920 +board_build.arduino.lorawan.adr = OFF +board_build.arduino.lorawan.rgb = DEACTIVE + +[env:cubecell_node] +platform = heltec-cubecell +framework = arduino +board = cubecell_node +monitor_speed = 115200 +board_build.arduino.lorawan.region = IN865 +board_build.arduino.lorawan.class = CLASS_C +board_build.arduino.lorawan.rgb = DEACTIVE diff --git a/examples/LoRa/LoRaWAN/LoRaWAN/src/LoRaWan.ino b/examples/LoRa/LoRaWAN/LoRaWAN/src/LoRaWan.ino new file mode 100644 index 0000000..fd68717 --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN/src/LoRaWan.ino @@ -0,0 +1,144 @@ +#include "LoRaWan_APP.h" +#include "Arduino.h" + +/* + * set LoraWan_RGB to Active,the RGB active in loraWan + * RGB red means sending; + * RGB purple means joined done; + * RGB blue means RxWindow1; + * RGB yellow means RxWindow2; + * RGB green means received done; + */ + +/* OTAA para*/ +uint8_t devEui[] = { 0x22, 0x32, 0x33, 0x00, 0x00, 0x88, 0x88, 0x02 }; +uint8_t appEui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +uint8_t appKey[] = { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x66, 0x01 }; + +/* ABP para*/ +uint8_t nwkSKey[] = { 0x15, 0xb1, 0xd0, 0xef, 0xa4, 0x63, 0xdf, 0xbe, 0x3d, 0x11, 0x18, 0x1e, 0x1e, 0xc7, 0xda,0x85 }; +uint8_t appSKey[] = { 0xd7, 0x2c, 0x78, 0x75, 0x8c, 0xdc, 0xca, 0xbf, 0x55, 0xee, 0x4a, 0x77, 0x8d, 0x16, 0xef,0x67 }; +uint32_t devAddr = ( uint32_t )0x007e6ae1; + +/*LoraWan channelsmask, default channels 0-7*/ +uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 }; + +/*LoraWan region, select in arduino IDE tools*/ +LoRaMacRegion_t loraWanRegion = ACTIVE_REGION; + +/*LoraWan Class, Class A and Class C are supported*/ +DeviceClass_t loraWanClass = LORAWAN_CLASS; + +/*the application data transmission duty cycle. value in [ms].*/ +uint32_t appTxDutyCycle = 15000; + +/*OTAA or ABP*/ +bool overTheAirActivation = LORAWAN_NETMODE; + +/*ADR enable*/ +bool loraWanAdr = LORAWAN_ADR; + +/* set LORAWAN_Net_Reserve ON, the node could save the network info to flash, when node reset not need to join again */ +bool keepNet = LORAWAN_NET_RESERVE; + +/* Indicates if the node is sending confirmed or unconfirmed messages */ +bool isTxConfirmed = LORAWAN_UPLINKMODE; + +/* Application port */ +uint8_t appPort = 2; +/*! +* Number of trials to transmit the frame, if the LoRaMAC layer did not +* receive an acknowledgment. The MAC performs a datarate adaptation, +* according to the LoRaWAN Specification V1.0.2, chapter 18.4, according +* to the following table: +* +* Transmission nb | Data Rate +* ----------------|----------- +* 1 (first) | DR +* 2 | DR +* 3 | max(DR-1,0) +* 4 | max(DR-1,0) +* 5 | max(DR-2,0) +* 6 | max(DR-2,0) +* 7 | max(DR-3,0) +* 8 | max(DR-3,0) +* +* Note, that if NbTrials is set to 1 or 2, the MAC will not decrease +* the datarate, in case the LoRaMAC layer did not receive an acknowledgment +*/ +uint8_t confirmedNbTrials = 4; + +/* Prepares the payload of the frame */ +static void prepareTxFrame( uint8_t port ) +{ + /*appData size is LORAWAN_APP_DATA_MAX_SIZE which is defined in "commissioning.h". + *appDataSize max value is LORAWAN_APP_DATA_MAX_SIZE. + *if enabled AT, don't modify LORAWAN_APP_DATA_MAX_SIZE, it may cause system hanging or failure. + *if disabled AT, LORAWAN_APP_DATA_MAX_SIZE can be modified, the max value is reference to lorawan region and SF. + *for example, if use REGION_CN470, + *the max value for different DR can be found in MaxPayloadOfDatarateCN470 refer to DataratesCN470 and BandwidthsCN470 in "RegionCN470.h". + */ + appDataSize = 4; + appData[0] = 0x00; + appData[1] = 0x01; + appData[2] = 0x02; + appData[3] = 0x03; +} + + +void setup() { + boardInitMcu(); + Serial.begin(115200); +#if(AT_SUPPORT) + enableAt(); +#endif + deviceState = DEVICE_STATE_INIT; + LoRaWAN.ifskipjoin(); +} + +void loop() +{ + switch( deviceState ) + { + case DEVICE_STATE_INIT: + { +#if(AT_SUPPORT) + getDevParam(); +#endif + printDevParam(); + LoRaWAN.init(loraWanClass,loraWanRegion); + deviceState = DEVICE_STATE_JOIN; + break; + } + case DEVICE_STATE_JOIN: + { + LoRaWAN.join(); + break; + } + case DEVICE_STATE_SEND: + { + prepareTxFrame( appPort ); + LoRaWAN.send(); + deviceState = DEVICE_STATE_CYCLE; + break; + } + case DEVICE_STATE_CYCLE: + { + // Schedule next packet transmission + txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND ); + LoRaWAN.cycle(txDutyCycleTime); + deviceState = DEVICE_STATE_SLEEP; + break; + } + case DEVICE_STATE_SLEEP: + { + LoRaWAN.sleep(); + break; + } + default: + { + deviceState = DEVICE_STATE_INIT; + break; + } + } +} diff --git a/examples/LoRa/LoRaWAN/LoRaWAN/test/README b/examples/LoRa/LoRaWAN/LoRaWAN/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/.gitignore b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/README.md b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/README.md new file mode 100644 index 0000000..cd49b2e --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/HelTecAutomation/heltec-cubecell/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd heltec-cubecell/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e cubecell_capsule + +# Upload firmware for the specific environment +$ pio run -e cubecell_capsule --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/include/README b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/lib/README b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/platformio.ini b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/platformio.ini new file mode 100644 index 0000000..1ba994b --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/platformio.ini @@ -0,0 +1,36 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:cubecell_board] +platform = heltec-cubecell +board = cubecell_board +framework = arduino +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU868 +board_build.arduino.lorawan.adr = ON +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO + +[env:cubecell_board_plus] +platform = heltec-cubecell +framework = arduino +board = cubecell_board_plus +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU868 +board_build.arduino.lorawan.adr = ON +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO + +[env:cubecell_gps] +platform = heltec-cubecell +framework = arduino +board = cubecell_gps +monitor_speed = 115200 +board_build.arduino.lorawan.region = EU868 +board_build.arduino.lorawan.adr = ON +board_build.arduino.lorawan.debug_level = FREQ_AND_DIO diff --git a/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/src/LoRaWAN_Interrupt.ino b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/src/LoRaWAN_Interrupt.ino new file mode 100644 index 0000000..c083610 --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/src/LoRaWAN_Interrupt.ino @@ -0,0 +1,175 @@ +#include "LoRaWan_APP.h" +#include "Arduino.h" + +/* OTAA para*/ +uint8_t devEui[] = { 0x22, 0x32, 0x33, 0x00, 0x00, 0x88, 0x88, 0x02 }; +uint8_t appEui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +uint8_t appKey[] = { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x66, 0x01 }; + +/* ABP para*/ +uint8_t nwkSKey[] = { 0x15, 0xb1, 0xd0, 0xef, 0xa4, 0x63, 0xdf, 0xbe, 0x3d, 0x11, 0x18, 0x1e, 0x1e, 0xc7, 0xda,0x85 }; +uint8_t appSKey[] = { 0xd7, 0x2c, 0x78, 0x75, 0x8c, 0xdc, 0xca, 0xbf, 0x55, 0xee, 0x4a, 0x77, 0x8d, 0x16, 0xef,0x67 }; +uint32_t devAddr = ( uint32_t )0x007e6ae1; + +/*LoraWan channelsmask, default channels 0-7*/ +uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 }; + +// The interrupt pin is attached to USER_KEY +#define INT_PIN USER_KEY + +/* Application port */ +#define DEVPORT 2 +#define APPPORT 1 + +bool accelWoke = false; + +/*LoraWan region, select in arduino IDE tools*/ +LoRaMacRegion_t loraWanRegion = ACTIVE_REGION; + +/*LoraWan Class, Class A and Class C are supported*/ +DeviceClass_t loraWanClass = LORAWAN_CLASS; + +/*the application data transmission duty cycle. value in [ms].*/ +/*For this example, this is the frequency of the device status packets */ +uint32_t appTxDutyCycle = (24 * 60 * 60 * 1000); // 24h; + +/*OTAA or ABP*/ +bool overTheAirActivation = LORAWAN_NETMODE; + +/*ADR enable*/ +bool loraWanAdr = LORAWAN_ADR; + +/* set LORAWAN_Net_Reserve ON, the node could save the network info to flash, when node reset not need to join again */ +bool keepNet = LORAWAN_NET_RESERVE; + +/* Indicates if the node is sending confirmed or unconfirmed messages */ +bool isTxConfirmed = LORAWAN_UPLINKMODE; + +/* Application port */ +uint8_t appPort = DEVPORT; +/*! +* Number of trials to transmit the frame, if the LoRaMAC layer did not +* receive an acknowledgment. The MAC performs a datarate adaptation, +* according to the LoRaWAN Specification V1.0.2, chapter 18.4, according +* to the following table: +* +* Transmission nb | Data Rate +* ----------------|----------- +* 1 (first) | DR +* 2 | DR +* 3 | max(DR-1,0) +* 4 | max(DR-1,0) +* 5 | max(DR-2,0) +* 6 | max(DR-2,0) +* 7 | max(DR-3,0) +* 8 | max(DR-3,0) +* +* Note, that if NbTrials is set to 1 or 2, the MAC will not decrease +* the datarate, in case the LoRaMAC layer did not receive an acknowledgment +*/ +uint8_t confirmedNbTrials = 4; + + +/* Prepares the payload of the frame */ +static bool prepareTxFrame( uint8_t port ) +{ + int head; + appPort = port; + switch (port) { + case APPPORT: // woke up from interrupt + Serial.println("Sending data packet"); + appDataSize = 1;//AppDataSize max value is 64 + appData[0] = 0xFF; // set to something useful + break; + case DEVPORT: // daily wake up + Serial.println("Sending dev status packet"); + appDataSize = 1;//AppDataSize max value is 64 + appData[0] = 0xA0; // set to something else useful + break; + } + return true; +} + +void accelWakeup() +{ + delay(10); + if(digitalRead(INT_PIN)==HIGH) + { + accelWoke = true; + } +} + +void setup() { + boardInitMcu(); + Serial.begin(115200); +#if(AT_SUPPORT) + enableAt(); +#endif + deviceState = DEVICE_STATE_INIT; + LoRaWAN.ifskipjoin(); + + accelWoke = false; + pinMode(INT_PIN,INPUT); + attachInterrupt(INT_PIN, accelWakeup, RISING); + Serial.println("Interrupts attached"); +} + +void loop() +{ + if (accelWoke) { + uint32_t now = TimerGetCurrentTime(); + Serial.print(now); Serial.println("accel woke"); + } + + switch( deviceState ) + { + case DEVICE_STATE_INIT: + { +#if(AT_SUPPORT) + getDevParam(); +#endif + printDevParam(); + LoRaWAN.init(loraWanClass,loraWanRegion); + deviceState = DEVICE_STATE_JOIN; + break; + } + case DEVICE_STATE_JOIN: + { + LoRaWAN.join(); + break; + } + case DEVICE_STATE_SEND: + { + prepareTxFrame( DEVPORT ); + LoRaWAN.send(); + deviceState = DEVICE_STATE_CYCLE; + break; + } + case DEVICE_STATE_CYCLE: + { + // Schedule next packet transmission + txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND ); + LoRaWAN.cycle(txDutyCycleTime); + deviceState = DEVICE_STATE_SLEEP; + break; + } + case DEVICE_STATE_SLEEP: + { + if (accelWoke) { + if (IsLoRaMacNetworkJoined) { + if(prepareTxFrame(APPPORT)) { + LoRaWAN.send(); + } + } + accelWoke = false; + } + LoRaWAN.sleep(); + break; + } + default: + { + deviceState = DEVICE_STATE_INIT; + break; + } + } +} \ No newline at end of file diff --git a/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/test/README b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/LoRa/LoRaWAN/LoRaWAN_Interrupt/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/arduino-adc/.gitignore b/examples/arduino-adc/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/examples/arduino-adc/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/arduino-adc/README.md b/examples/arduino-adc/README.md new file mode 100644 index 0000000..5f8fd63 --- /dev/null +++ b/examples/arduino-adc/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/HelTecAutomation/heltec-cubecell/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd heltec-cubecell/examples/arduino-adc + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e cubecell_capsule + +# Upload firmware for the specific environment +$ pio run -e cubecell_capsule --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/arduino-adc/include/README b/examples/arduino-adc/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/arduino-adc/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/arduino-adc/lib/README b/examples/arduino-adc/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/arduino-adc/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/arduino-adc/platformio.ini b/examples/arduino-adc/platformio.ini new file mode 100644 index 0000000..9b28a2c --- /dev/null +++ b/examples/arduino-adc/platformio.ini @@ -0,0 +1,43 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:cubecell_board] +platform = heltec-cubecell +framework = arduino +board = cubecell_board + +[env:cubecell_board_plus] +platform = heltec-cubecell +framework = arduino +board = cubecell_board_plus + +[env:cubecell_capsule] +platform = heltec-cubecell +framework = arduino +board = cubecell_capsule + +[env:cubecell_gps] +platform = heltec-cubecell +framework = arduino +board = cubecell_gps + +[env:cubecell_module] +platform = heltec-cubecell +framework = arduino +board = cubecell_module + +[env:cubecell_module_plus] +platform = heltec-cubecell +framework = arduino +board = cubecell_module_plus + +[env:cubecell_node] +platform = heltec-cubecell +framework = arduino +board = cubecell_node diff --git a/examples/arduino-adc/src/ADC.ino b/examples/arduino-adc/src/ADC.ino new file mode 100644 index 0000000..2cddb71 --- /dev/null +++ b/examples/arduino-adc/src/ADC.ino @@ -0,0 +1,20 @@ +#include "Arduino.h" + + +void setup() { + // put your setup code here, to run once: + Serial.begin(115200); +} + +uint16_t voltage; + +void loop() { + // put your main code here, to run repeatedly: + + //ADC == ADC1 + voltage=analogRead(ADC);//return the voltage in mV, max value can be read is 2400mV + Serial.print(millis()); + Serial.print(" "); + Serial.println(voltage); + delay(1000); +} diff --git a/examples/arduino-adc/test/README b/examples/arduino-adc/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/arduino-adc/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/arduino-blink/.gitignore b/examples/arduino-blink/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/examples/arduino-blink/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/arduino-blink/README.md b/examples/arduino-blink/README.md new file mode 100644 index 0000000..d0ee403 --- /dev/null +++ b/examples/arduino-blink/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/HelTecAutomation/heltec-cubecell/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd heltec-cubecell/examples/arduino-blink + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e cubecell_capsule + +# Upload firmware for the specific environment +$ pio run -e cubecell_capsule --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/arduino-blink/include/README b/examples/arduino-blink/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/arduino-blink/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/arduino-blink/lib/README b/examples/arduino-blink/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/arduino-blink/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini new file mode 100644 index 0000000..4c7608b --- /dev/null +++ b/examples/arduino-blink/platformio.ini @@ -0,0 +1,33 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:cubecell_board] +platform = heltec-cubecell +framework = arduino +board = cubecell_board + +[env:cubecell_board_plus] +platform = heltec-cubecell +framework = arduino +board = cubecell_board_plus + +[env:cubecell_capsule] +platform = heltec-cubecell +framework = arduino +board = cubecell_capsule + +[env:cubecell_gps] +platform = heltec-cubecell +framework = arduino +board = cubecell_gps + +[env:cubecell_board_pro] +platform = heltec-cubecell +framework = arduino +board = cubecell_board_pro diff --git a/examples/arduino-blink/src/Blink.cpp b/examples/arduino-blink/src/Blink.cpp new file mode 100644 index 0000000..aa6d0f2 --- /dev/null +++ b/examples/arduino-blink/src/Blink.cpp @@ -0,0 +1,25 @@ +/* + * Blink + * Turns on an LED on for one second, + * then off for one second, repeatedly. + */ + +#include + +void setup() +{ + // initialize LED digital pin as an output. + pinMode(RGB, OUTPUT); +} + +void loop() +{ + // turn the LED on (HIGH is the voltage level) + digitalWrite(RGB, HIGH); + // wait for a second + delay(1000); + // turn the LED off by making the voltage LOW + digitalWrite(RGB, LOW); + // wait for a second + delay(1000); +} \ No newline at end of file diff --git a/examples/arduino-blink/test/README b/examples/arduino-blink/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/arduino-blink/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/arduino-lowpower/.gitignore b/examples/arduino-lowpower/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/examples/arduino-lowpower/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/arduino-lowpower/README.md b/examples/arduino-lowpower/README.md new file mode 100644 index 0000000..6619b51 --- /dev/null +++ b/examples/arduino-lowpower/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/HelTecAutomation/heltec-cubecell/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd heltec-cubecell/examples/arduino-lowpower + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e cubecell_capsule + +# Upload firmware for the specific environment +$ pio run -e cubecell_capsule --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/arduino-lowpower/include/README b/examples/arduino-lowpower/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/arduino-lowpower/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/arduino-lowpower/lib/README b/examples/arduino-lowpower/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/arduino-lowpower/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/arduino-lowpower/platformio.ini b/examples/arduino-lowpower/platformio.ini new file mode 100644 index 0000000..1b2f059 --- /dev/null +++ b/examples/arduino-lowpower/platformio.ini @@ -0,0 +1,34 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env] +platform = heltec-cubecell +framework = arduino +lib_ldf_mode = deep + +[env:cubecell_board] +board = cubecell_board + +[env:cubecell_board_plus] +board = cubecell_board_plus + +[env:cubecell_capsule] +board = cubecell_capsule + +[env:cubecell_gps] +board = cubecell_gps + +[env:cubecell_module] +board = cubecell_module + +[env:cubecell_module_plus] +board = cubecell_module_plus + +[env:cubecell_node] +board = cubecell_node diff --git a/examples/arduino-lowpower/src/LowPower_WakeUpByTimer.ino b/examples/arduino-lowpower/src/LowPower_WakeUpByTimer.ino new file mode 100644 index 0000000..f7f0f08 --- /dev/null +++ b/examples/arduino-lowpower/src/LowPower_WakeUpByTimer.ino @@ -0,0 +1,41 @@ +#include "Arduino.h" +#include "LoRa_APP.h" + +#define timetillsleep 5000 +#define timetillwakeup 5000 +static TimerEvent_t sleep; +static TimerEvent_t wakeUp; +uint8_t lowpower=1; + +void onSleep() +{ + Serial.printf("Going into lowpower mode, %d ms later wake up.\r\n",timetillwakeup); + lowpower=1; + //timetillwakeup ms later wake up; + TimerSetValue( &wakeUp, timetillwakeup ); + TimerStart( &wakeUp ); +} +void onWakeUp() +{ + Serial.printf("Woke up, %d ms later into lowpower mode.\r\n",timetillsleep); + lowpower=0; + //timetillsleep ms later into lowpower mode; + TimerSetValue( &sleep, timetillsleep ); + TimerStart( &sleep ); +} + +void setup() { + // put your setup code here, to run once: + Serial.begin(115200); + Radio.Sleep( ); + TimerInit( &sleep, onSleep ); + TimerInit( &wakeUp, onWakeUp ); + onSleep(); +} + +void loop() { + if(lowpower){ + lowPowerHandler(); + } + // put your main code here, to run repeatedly: +} diff --git a/examples/arduino-lowpower/test/README b/examples/arduino-lowpower/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/arduino-lowpower/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/arduino-rgb/.gitignore b/examples/arduino-rgb/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/examples/arduino-rgb/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/arduino-rgb/README.md b/examples/arduino-rgb/README.md new file mode 100644 index 0000000..7033235 --- /dev/null +++ b/examples/arduino-rgb/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/HelTecAutomation/heltec-cubecell/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd heltec-cubecell/examples/arduino-rgb + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e cubecell_capsule + +# Upload firmware for the specific environment +$ pio run -e cubecell_capsule --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/arduino-rgb/include/README b/examples/arduino-rgb/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/arduino-rgb/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/arduino-rgb/lib/README b/examples/arduino-rgb/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/arduino-rgb/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/arduino-rgb/platformio.ini b/examples/arduino-rgb/platformio.ini new file mode 100644 index 0000000..9a4c6a4 --- /dev/null +++ b/examples/arduino-rgb/platformio.ini @@ -0,0 +1,28 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:cubecell_board] +platform = heltec-cubecell +framework = arduino +board = cubecell_board + +[env:cubecell_board_plus] +platform = heltec-cubecell +framework = arduino +board = cubecell_board_plus + +[env:cubecell_capsule] +platform = heltec-cubecell +framework = arduino +board = cubecell_capsule + +[env:cubecell_gps] +platform = heltec-cubecell +framework = arduino +board = cubecell_gps diff --git a/examples/arduino-rgb/src/RGB.ino b/examples/arduino-rgb/src/RGB.ino new file mode 100644 index 0000000..4f4d88f --- /dev/null +++ b/examples/arduino-rgb/src/RGB.ino @@ -0,0 +1,37 @@ +#include "CubeCell_NeoPixel.h" +CubeCell_NeoPixel pixels(1, RGB, NEO_GRB + NEO_KHZ800); + +void setup() { + // put your setup code here, to run once: + pinMode(Vext,OUTPUT); + digitalWrite(Vext,LOW); //SET POWER + pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) + pixels.clear(); // Set all pixel colors to 'off' +} +uint8_t i=0; + +void loop() { + // put your main code here, to run repeatedly: + + pixels.setPixelColor(0, pixels.Color(i, 0, 0)); + + pixels.show(); // Send the updated pixel colors to the hardware. + + delay(200); // Pause before next pass through loop + + pixels.setPixelColor(0, pixels.Color(0, i, 0)); + + pixels.show(); // Send the updated pixel colors to the hardware. + + + delay(200); // Pause before next pass through loop + + pixels.setPixelColor(0, pixels.Color(0, 0, i)); + + pixels.show(); // Send the updated pixel colors to the hardware. + + delay(200); // Pause before next pass through loop + + i+=10; + +} diff --git a/examples/arduino-rgb/test/README b/examples/arduino-rgb/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/arduino-rgb/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/platform.json b/platform.json new file mode 100644 index 0000000..35d94e4 --- /dev/null +++ b/platform.json @@ -0,0 +1,61 @@ +{ + "name": "heltec-cubecell", + "title": "Heltec CubeCell", + "description": "Heltec CubeCell is an easy-to-use LoRa Node series brand based on a highly integrated and ultra low power SoC and the LoRa SX1262 transceiver.", + "homepage": "https://heltec.org/", + "keywords": [ + "dev-platform", + "ARM", + "PSoC", + "Semtech", + "SX1262", + "Heltec", + "CubeCell", + "LoRa", + "ASR Microelectronics" + ], + "license": "Apache-2.0", + "engines": { + "platformio": "^6" + }, + "repository": { + "type": "git", + "url": "https://github.com/HelTecAutomation/heltec-cubecell.git" + }, + "version": "1.0.0", + "frameworks": { + "arduino": { + "package": "framework-arduinocubecell", + "script": "builder/frameworks/arduino.py" + } + }, + "packages": { + "toolchain-gccarmnoneeabi": { + "type": "toolchain", + "owner": "platformio", + "version": "~1.90201.0" + }, + "framework-arduinocubecell": { + "type": "framework", + "owner": "heltecautomation", + "version": "~1.5.0", + "optional": true + }, + "tool-cubecellelftool": { + "owner": "heltecautomation", + "version": "~0.0.1" + }, + "tool-cubecellflash": { + "type": "uploader", + "optional": true, + "owner": "heltecautomation", + "version": "~0.0.1" + }, + "tool-cubecellflash6601": { + "type": "uploader", + "optional": true, + "owner": "heltecautomation", + "version": "~0.0.1" + } + } +}