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