├── .gitattributes
├── .gitignore
├── Code
└── v1
│ ├── .link_script.sct
│ ├── .mbed
│ ├── .travis.yml
│ ├── .vscode
│ ├── c_cpp_properties.json
│ ├── configurationCache.log
│ ├── dryrun.log
│ ├── launch.json
│ ├── settings.json
│ ├── targets.log
│ └── tasks.json
│ ├── CMakeLists.txt
│ ├── CONTRIBUTING.md
│ ├── Communication
│ ├── LoRa.cpp
│ └── LoRa.hpp
│ ├── GettingStarted.html
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── SensorFusion.cpp
│ ├── SensorFusion.hpp
│ ├── Sensors
│ ├── BME688.cpp
│ ├── BME688.hpp
│ ├── BME688_defs.h
│ ├── bme68x.c
│ ├── bme68x.h
│ ├── bme68x_defs.h
│ ├── bsec_datatypes.h
│ ├── bsec_interface.h
│ └── libalgobsec.a
│ ├── SerialStream.lib
│ ├── __pycache__
│ └── mbed_settings.cpython-37.pyc
│ ├── custom_targets.json
│ ├── lora_radio_helper.h
│ ├── main.cpp
│ ├── mbed-os.lib
│ ├── mbed_app.json
│ ├── mbed_config.h
│ ├── mbed_settings.py
│ ├── mbedtls_lora_config.h
│ ├── resources
│ └── official_armmbed_example_badge.png
│ ├── stm32customtargets.lib
│ ├── stm32customtargets
│ ├── .gitignore
│ ├── .mbedignore
│ ├── CMakeLists.txt
│ ├── LICENSE-apache-2.0.txt
│ ├── README.md
│ ├── TARGET_STM32F0
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32F1
│ │ ├── CMakeLists.txt
│ │ └── TARGET_BLUEPILL_F103C8
│ │ │ ├── CMakeLists.txt
│ │ │ ├── PeripheralPins.c
│ │ │ └── PinNames.h
│ ├── TARGET_STM32F2
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32F3
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32F4
│ │ ├── CMakeLists.txt
│ │ └── TARGET_CORE2
│ │ │ ├── CMakeLists.txt
│ │ │ ├── PeripheralPinMaps.h
│ │ │ ├── PeripheralPins.c
│ │ │ ├── PinNames.h
│ │ │ └── system_clock.c
│ ├── TARGET_STM32F7
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32G0
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32G4
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32H7
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32L0
│ │ ├── CMakeLists.txt
│ │ ├── TARGET_GNAT
│ │ │ ├── CMakeLists.txt
│ │ │ └── PinNames.h
│ │ ├── TARGET_GRASSHOPPER
│ │ │ ├── CMakeLists.txt
│ │ │ └── PinNames.h
│ │ └── TARGET_MTB_MURATA_ABZ
│ │ │ ├── CMakeLists.txt
│ │ │ ├── PeripheralPins.c
│ │ │ ├── PinNames.h
│ │ │ └── system_clock.c
│ ├── TARGET_STM32L1
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32L4
│ │ ├── CMakeLists.txt
│ │ └── TARGET_STWIN
│ │ │ ├── CMakeLists.txt
│ │ │ ├── PeripheralPins.c
│ │ │ └── PinNames.h
│ ├── TARGET_STM32L5
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32U5
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32WB
│ │ └── CMakeLists.txt
│ ├── TARGET_STM32WL
│ │ ├── CMakeLists.txt
│ │ ├── TARGET_LORA_E5
│ │ │ ├── CMakeLists.txt
│ │ │ ├── LORA_E5_radio_driver.cpp
│ │ │ ├── PeripheralPins.c
│ │ │ └── PinNames.h
│ │ ├── TARGET_LORA_E5_BREAKOUT
│ │ │ └── CMakeLists.txt
│ │ ├── TARGET_LORA_E5_DEV_BOARD
│ │ │ └── CMakeLists.txt
│ │ ├── TARGET_LORA_E5_MINI
│ │ │ └── CMakeLists.txt
│ │ ├── TARGET_LORA_E5_TINY
│ │ │ └── CMakeLists.txt
│ │ ├── TARGET_RAK3172
│ │ │ ├── CMakeLists.txt
│ │ │ ├── PeripheralPins.c
│ │ │ ├── PinNames.h
│ │ │ └── RAK3172_radio_driver.cpp
│ │ └── TARGET_RAK3172_BREAKOUT
│ │ │ └── CMakeLists.txt
│ ├── aci_build.py
│ ├── aci_pinvalidate.py
│ ├── custom_targets.json
│ └── mbed_app_template.json
│ ├── trace_helper.cpp
│ └── trace_helper.h
├── Images
├── boards.jpg
├── iotcentral.png
├── kivyprototype.png
└── ttndata.PNG
├── PCB
├── 101-3
│ ├── Gerbers
│ │ ├── main-B_Cu.gbr
│ │ ├── main-B_Mask.gbr
│ │ ├── main-B_Paste.gbr
│ │ ├── main-B_SilkS.gbr
│ │ ├── main-Edge_Cuts.gbr
│ │ ├── main-F_Cu.gbr
│ │ ├── main-F_Mask.gbr
│ │ ├── main-F_Paste.gbr
│ │ ├── main-F_SilkS.gbr
│ │ ├── main-GND.gbr
│ │ ├── main-PWR.gbr
│ │ ├── main-drl_map.ps
│ │ ├── main-job.gbrjob
│ │ └── main.drl
│ ├── Schematic.pdf
│ ├── Sensor.dcm
│ ├── fp-info-cache
│ ├── fp-lib-table
│ ├── main-cache.lib
│ ├── main-rescue.dcm
│ ├── main-rescue.lib
│ ├── main.kicad_pcb
│ ├── main.kicad_pcb-bak
│ ├── main.net
│ ├── main.pro
│ ├── main.sch
│ ├── main.sch-bak
│ ├── report.txt
│ └── sym-lib-table
└── 101-5
│ ├── Schematic.pdf
│ ├── Sensor.dcm
│ ├── fp-info-cache
│ ├── fp-lib-table
│ ├── main-cache.lib
│ ├── main-rescue.dcm
│ ├── main-rescue.lib
│ ├── main.csv
│ ├── main.kicad_pcb
│ ├── main.kicad_pcb-bak
│ ├── main.net
│ ├── main.pro
│ ├── main.sch
│ ├── main.sch-bak
│ ├── main.xml
│ ├── report.txt
│ └── sym-lib-table
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /Code/v1/BUILD
2 | /Code/v1/mbed-os
--------------------------------------------------------------------------------
/Code/v1/.link_script.sct:
--------------------------------------------------------------------------------
1 | #! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 -I./mbed-os/targets/TARGET_STM/TARGET_STM32WL/TARGET_STM32WL55xC/TOOLCHAIN_ARM
2 | ; Scatter-Loading Description File
3 | ;
4 | ; SPDX-License-Identifier: BSD-3-Clause
5 | ;******************************************************************************
6 | ;* @attention
7 | ;*
8 | ;* Copyright (c) 2016-2020 STMicroelectronics.
9 | ;* All rights reserved.
10 | ;*
11 | ;* This software component is licensed by ST under BSD 3-Clause license,
12 | ;* the "License"; You may not use this file except in compliance with the
13 | ;* License. You may obtain a copy of the License at:
14 | ;* opensource.org/licenses/BSD-3-Clause
15 | ;*
16 | ;******************************************************************************
17 |
18 | #include "../cmsis_nvic.h"
19 |
20 | #if !defined(MBED_APP_START)
21 | #define MBED_APP_START MBED_ROM_START
22 | #endif
23 |
24 | #if !defined(MBED_APP_SIZE)
25 | #define MBED_APP_SIZE MBED_ROM_SIZE
26 | #endif
27 |
28 | #if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
29 | /* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
30 | #if defined(MBED_BOOT_STACK_SIZE)
31 | #define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
32 | #else
33 | #define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
34 | #endif
35 | #endif
36 |
37 | /* Round up VECTORS_SIZE to 8 bytes */
38 | #define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
39 |
40 | LR_IROM1 MBED_APP_START MBED_APP_SIZE {
41 |
42 | ER_IROM1 MBED_APP_START MBED_APP_SIZE {
43 | *.o (RESET, +First)
44 | *(InRoot$$Sections)
45 | .ANY (+RO)
46 | }
47 |
48 | RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
49 | .ANY (+RW +ZI)
50 | }
51 |
52 | ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
53 | }
54 |
55 | ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; Stack region growing down
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Code/v1/.mbed:
--------------------------------------------------------------------------------
1 | ROOT=.
2 | TOOLCHAIN=GCC_ARM
3 | TARGET=AERQ
4 | TARGET_CODE=custom-353
5 | TARGET_SERIAL=51ff6d064888524941542487
6 |
--------------------------------------------------------------------------------
/Code/v1/.travis.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013-2020 Arm Limited. All rights reserved.
2 | #
3 | # SPDX-License-Identifier: Apache-2.0
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the License); you may
6 | # not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT
13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | language: sh
18 | os: linux
19 | dist: xenial
20 |
21 | env:
22 | global:
23 | - PROFILE=develop
24 |
25 | cache:
26 | pip: true
27 | ccache: true
28 | # It looks like ccache for arm-none-eabi is not yet supported by Travis.
29 | # Therefore manually adding ccache directory to cache
30 | directories:
31 | - ${HOME}/.ccache
32 |
33 | addons:
34 | apt:
35 | sources:
36 | - sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main'
37 | key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
38 | - sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial-rc main'
39 | packages:
40 | - cmake
41 | - ninja-build
42 |
43 | matrix:
44 | include:
45 |
46 | - &cmake-build-test
47 | stage: "CMake"
48 | name: "CMake blinky example - develop (K64F)"
49 | env: NAME=cmake_test TARGET_NAME=K64F PROFILE=develop CACHE_NAME=develop-K64F
50 | language: python
51 | python: 3.8
52 | install:
53 | # Setup ccache
54 | - ccache -o compiler_check=content
55 | - ccache -M 1G
56 | - pushd /usr/lib/ccache
57 | - sudo ln -s ../../bin/ccache arm-none-eabi-gcc
58 | - sudo ln -s ../../bin/ccache arm-none-eabi-g++
59 | - export PATH="/usr/lib/ccache:$PATH"
60 | - popd
61 | # Install arm-none-eabi-gcc
62 | - pushd /home/travis/build && mkdir arm-gcc && cd arm-gcc
63 | - curl -L0 "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2?revision=05382cca-1721-44e1-ae19-1e7c3dc96118&la=en&hash=D7C9D18FCA2DD9F894FD9F3C3DC9228498FA281A" --output gcc-arm-none-eabi-9-2020-q2-update.tar.bz2
64 | - tar xf gcc-arm-none-eabi-9-2020-q2-update.tar.bz2
65 | - export PATH="$PATH:${PWD}/gcc-arm-none-eabi-9-2020-q2-update/bin"
66 | - popd
67 | - arm-none-eabi-gcc --version
68 | # Hide Travis-preinstalled CMake
69 | # The Travis-preinstalled CMake is unfortunately not installed via apt, so we
70 | # can't replace it with an apt-supplied version very easily. Additionally, we
71 | # can't permit the Travis-preinstalled copy to survive, as the Travis default
72 | # path lists the Travis CMake install location ahead of any place where apt
73 | # would install CMake to. Instead of apt removing or upgrading to a new CMake
74 | # version, we must instead delete the Travis copy of CMake.
75 | - sudo rm -rf /usr/local/cmake*
76 | - pip install --upgrade mbed-tools
77 | - pip install prettytable==0.7.2
78 | - pip install future==0.16.0
79 | - pip install "Jinja2>=2.10.1,<2.11"
80 | - pip install "intelhex>=1.3,<=2.2.1"
81 | # Fetch mbed-os: We use manual clone, with depth=1 and --single-branch to save time.
82 | - >-
83 | git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git;
84 | - >-
85 | script:
86 | - echo mbedtools compile -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE}
87 | - mbedtools compile -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE}
88 | - ccache -s
89 |
90 | - <<: *cmake-build-test
91 | name: "CMake blinky example - release (K64F)"
92 | env: NAME=cmake_test TARGET_NAME=K64F PROFILE=release CACHE_NAME=release-K64F
93 |
94 | - <<: *cmake-build-test
95 | name: "CMake blinky example - debug (K64F)"
96 | env: NAME=cmake_test TARGET_NAME=K64F PROFILE=debug CACHE_NAME=debug-K64F
97 |
98 | - <<: *cmake-build-test
99 | name: "CMake blinky example - develop (DISCO_L475VG_IOT01A)"
100 | env: NAME=cmake_test TARGET_NAME=DISCO_L475VG_IOT01A PROFILE=develop CACHE_NAME=develop-DISCO_L475VG_IOT01A
101 |
102 | - <<: *cmake-build-test
103 | name: "CMake blinky example - release (DISCO_L475VG_IOT01A)"
104 | env: NAME=cmake_test TARGET_NAME=DISCO_L475VG_IOT01A PROFILE=release CACHE_NAME=release-DISCO_L475VG_IOT01A
105 |
106 | - <<: *cmake-build-test
107 | name: "CMake blinky example - debug (DISCO_L475VG_IOT01A)"
108 | env: NAME=cmake_test TARGET_NAME=DISCO_L475VG_IOT01A PROFILE=debug CACHE_NAME=debug-DISCO_L475VG_IOT01A
109 |
110 | - <<: *cmake-build-test
111 | name: "CMake blinky example - develop (NRF52840_DK)"
112 | env: NAME=cmake_test TARGET_NAME=NRF52840_DK PROFILE=develop CACHE_NAME=develop-NRF52840_DK
113 |
114 | - <<: *cmake-build-test
115 | name: "CMake blinky example - release (NRF52840_DK)"
116 | env: NAME=cmake_test TARGET_NAME=NRF52840_DK PROFILE=release CACHE_NAME=release-NRF52840_DK
117 |
118 | - <<: *cmake-build-test
119 | name: "CMake blinky example - debug (NRF52840_DK)"
120 | env: NAME=cmake_test TARGET_NAME=NRF52840_DK PROFILE=debug CACHE_NAME=debug-NRF52840_DK
121 |
--------------------------------------------------------------------------------
/Code/v1/.vscode/configurationCache.log:
--------------------------------------------------------------------------------
1 | {"buildTargets":[],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}}
--------------------------------------------------------------------------------
/Code/v1/.vscode/dryrun.log:
--------------------------------------------------------------------------------
1 | make.exe --dry-run --always-make --keep-going --print-directory
2 | 'make.exe' is not recognized as an internal or external command,
3 | operable program or batch file.
4 |
5 |
--------------------------------------------------------------------------------
/Code/v1/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "cwd": "${workspaceRoot}",
6 | "executable": "./bin/executable.elf",
7 | "name": "Debug Microcontroller",
8 | "request": "launch",
9 | "type": "cortex-debug",
10 | "showDevDebugOutput": false,
11 | "servertype": "stlink"
12 | },
13 | {
14 | "name": "C++ Launch",
15 | "type": "cppdbg",
16 | "request": "launch",
17 | "program": "${workspaceRoot}/BUILD/${workspaceRootFolderName}.elf",
18 | "args": [],
19 | "stopAtEntry": true,
20 | "cwd": "${workspaceRoot}",
21 | "environment": [],
22 | "externalConsole": false,
23 | "debugServerArgs": "",
24 | "serverLaunchTimeout": 20000,
25 | "filterStderr": true,
26 | "filterStdout": false,
27 | "serverStarted": "GDB\\ server\\ started",
28 | "preLaunchTask": "make",
29 | "setupCommands": [
30 | { "text": "-target-select remote localhost:3333", "description": "connect to target", "ignoreFailures": false },
31 | { "text": "-file-exec-and-symbols ${workspaceRoot}/BUILD/${workspaceRootFolderName}.elf", "description": "load file", "ignoreFailures": false},
32 | { "text": "-interpreter-exec console \"monitor endian little\"", "ignoreFailures": false },
33 | { "text": "-interpreter-exec console \"monitor reset\"", "ignoreFailures": false },
34 | { "text": "-interpreter-exec console \"monitor halt\"", "ignoreFailures": false },
35 | { "text": "-interpreter-exec console \"monitor arm semihosting enable\"", "ignoreFailures": false },
36 | { "text": "-target-download", "description": "flash target", "ignoreFailures": false }
37 | ],
38 | "logging": {
39 | "moduleLoad": true,
40 | "trace": true,
41 | "engineLogging": true,
42 | "programOutput": true,
43 | "exceptions": true
44 | },
45 | "linux": {
46 | "MIMode": "gdb",
47 | "MIDebuggerPath": "arm-none-eabi-gdb",
48 | "debugServerPath": "pyocd-gdbserver"
49 | },
50 | "osx": {
51 | "MIMode": "gdb",
52 | "MIDebuggerPath": "arm-none-eabi-gdb",
53 | "debugServerPath": "pyocd-gdbserver"
54 | },
55 | "windows": {
56 | "preLaunchTask": "make.exe",
57 | "MIMode": "gdb",
58 | "MIDebuggerPath": "arm-none-eabi-gdb.exe",
59 | "debugServerPath": "pyocd-gdbserver.exe",
60 | "setupCommands": [
61 | { "text": "-environment-cd ${workspaceRoot}\\BUILD" },
62 | { "text": "-target-select remote localhost:3333", "description": "connect to target", "ignoreFailures": false },
63 | { "text": "-file-exec-and-symbols ${workspaceRootFolderName}.elf", "description": "load file", "ignoreFailures": false},
64 | { "text": "-interpreter-exec console \"monitor endian little\"", "ignoreFailures": false },
65 | { "text": "-interpreter-exec console \"monitor reset\"", "ignoreFailures": false },
66 | { "text": "-interpreter-exec console \"monitor halt\"", "ignoreFailures": false },
67 | { "text": "-interpreter-exec console \"monitor arm semihosting enable\"", "ignoreFailures": false },
68 | { "text": "-target-download", "description": "flash target", "ignoreFailures": false }
69 | ]
70 | }
71 | }
72 | ]
73 | }
--------------------------------------------------------------------------------
/Code/v1/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "C_Cpp.addWorkspaceRootToIncludePath": false,
4 | "C_Cpp.intelliSenseEngine": "Tag Parser"
5 | }
--------------------------------------------------------------------------------
/Code/v1/.vscode/targets.log:
--------------------------------------------------------------------------------
1 | make.exe all --print-data-base --no-builtin-variables --no-builtin-rules --question
2 | 'make.exe' is not recognized as an internal or external command,
3 | operable program or batch file.
4 |
5 |
--------------------------------------------------------------------------------
/Code/v1/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "0.1.0",
5 | "name": "make",
6 | "isShellCommand": true,
7 | "showOutput": "always",
8 | "problemMatcher": {
9 | "owner": "cpp",
10 | "fileLocation": ["relative", "${workspaceRoot}/mbed-os"],
11 | "pattern": {
12 | "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
13 | "file": 1,
14 | "line": 2,
15 | "column": 3,
16 | "severity": 4,
17 | "message": 5
18 | }
19 | },
20 | "args": ["-j"],
21 | "linux": {
22 | "command": "make"
23 | },
24 | "osx": {
25 | "command": "make"
26 | },
27 | "windows": {
28 | "command": "make.exe"
29 | }
30 | }
--------------------------------------------------------------------------------
/Code/v1/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
5 |
6 | set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
7 | set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
8 | set(APP_TARGET mbed-os-example-blinky)
9 |
10 | include(${MBED_PATH}/tools/cmake/app.cmake)
11 |
12 | add_subdirectory(${MBED_PATH})
13 |
14 | add_executable(${APP_TARGET})
15 |
16 | mbed_configure_app_target(${APP_TARGET})
17 |
18 | project(${APP_TARGET})
19 |
20 | target_sources(${APP_TARGET}
21 | PRIVATE
22 | main.cpp
23 | )
24 |
25 | target_link_libraries(${APP_TARGET}
26 | PRIVATE
27 | mbed-os
28 | )
29 |
30 | mbed_set_post_build(${APP_TARGET})
31 |
32 | option(VERBOSE_BUILD "Have a verbose build process")
33 | if(VERBOSE_BUILD)
34 | set(CMAKE_VERBOSE_MAKEFILE ON)
35 | endif()
36 |
--------------------------------------------------------------------------------
/Code/v1/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Mbed OS
2 |
3 | Mbed OS is an open-source, device software platform for the Internet of Things. Contributions are an important part of the platform, and our goal is to make it as simple as possible to become a contributor.
4 |
5 | To encourage productive collaboration, as well as robust, consistent and maintainable code, we have a set of guidelines for [contributing to Mbed OS](https://os.mbed.com/docs/mbed-os/latest/contributing/index.html).
6 |
--------------------------------------------------------------------------------
/Code/v1/Communication/LoRa.cpp:
--------------------------------------------------------------------------------
1 | #include "LoRa.hpp"
2 |
3 |
4 |
5 |
6 |
7 |
8 | static EventQueue LoRaQueue(MAX_NUMBER_OF_EVENTS *EVENTS_EVENT_SIZE);
9 | using namespace events;
10 | static STM32WL_LoRaRadio radioLoRa;
11 |
12 |
13 |
14 | LoRa::LoRa() : _lorawan(radioLoRa), LoRaInternalThread(osPriorityNormal,OS_STACK_SIZE,nullptr,"LoRaThread")
15 | {
16 | }
17 |
18 | void LoRa::start()
19 | {
20 | LoRaInternalThread.start(callback(this,&LoRa::_internalThread));
21 | }
22 |
23 | void LoRa::loraHandler(lorawan_event_t event)
24 | {
25 | switch (event) {
26 | case CONNECTED:
27 | printf("Connected to TTN\n\r");
28 | break;
29 | case DISCONNECTED:
30 | LoRaQueue.break_dispatch();
31 | printf("\r\n Disconnected Successfully \r\n");
32 | break;
33 | case TX_DONE:
34 | printf("\r\n Message Sent to Network Server \r\n");
35 | break;
36 | case TX_TIMEOUT:
37 | case TX_ERROR:
38 | case TX_CRYPTO_ERROR:
39 | case TX_SCHEDULING_ERROR:
40 | printf("\r\n Transmission Error - EventCode = %d \r\n", event);
41 | break;
42 | case RX_DONE:
43 | printf("\r\n Received message from Network Server \r\n");
44 | this->receiveMessage();
45 | break;
46 | case RX_TIMEOUT:
47 | case RX_ERROR:
48 | printf("\r\n Error in reception - Code = %d \r\n", event);
49 | break;
50 | case JOIN_FAILURE:
51 | printf("\r\n OTAA Failed - Check Keys \r\n");
52 | break;
53 | case UPLINK_REQUIRED:
54 | printf("\r\n Uplink required by NS \r\n");
55 | if (MBED_CONF_LORA_DUTY_CYCLE_ON) {
56 | this->sendMessage();
57 | }
58 | break;
59 | default:
60 | MBED_ASSERT("Unknown Event");
61 | }
62 | }
63 |
64 |
65 | void LoRa::_internalThread()
66 | {
67 | setup_trace();
68 |
69 | ThisThread::sleep_for(1000ms);
70 | if (_lorawan.initialize(&LoRaQueue) != LORAWAN_STATUS_OK) {
71 | printf("\r\n LoRa initialization failed! \r\n");
72 | }
73 |
74 | // prepare application callbacks
75 | callbacks.events = mbed::callback(this,&LoRa::loraHandler);
76 | _lorawan.add_app_callbacks(&callbacks);
77 |
78 | // Set number of retries in case of CONFIRMED messages
79 | if (_lorawan.set_confirmed_msg_retries(CONFIRMED_MSG_RETRY_COUNTER)
80 | != LORAWAN_STATUS_OK) {
81 | printf("\r\n set_confirmed_msg_retries failed! \r\n\r\n");
82 | }
83 | printf("\r\n CONFIRMED message retries : %d \r\n",
84 | CONFIRMED_MSG_RETRY_COUNTER);
85 |
86 | // Enable adaptive data rate
87 | if (_lorawan.enable_adaptive_datarate() != LORAWAN_STATUS_OK) {
88 | printf("\r\n enable_adaptive_datarate failed! \r\n");
89 | }
90 |
91 | printf("\r\n Adaptive data rate (ADR) - Enabled \r\n");
92 | retcode = _lorawan.connect();
93 |
94 | if (retcode == LORAWAN_STATUS_OK ||
95 | retcode == LORAWAN_STATUS_CONNECT_IN_PROGRESS) {
96 | } else {
97 | printf("\r\n Connection error, code = %d \r\n", retcode);
98 | }
99 |
100 | printf("\r\n Connection - In Progress ...\r\n");
101 |
102 | LoRaQueue.dispatch_forever();
103 | }
104 |
105 |
106 | void LoRa::sendMessage()
107 | {
108 |
109 | printf("send something!\n\r");
110 | printf("Temperature:%2.1f *C\n\r",data.temperature);
111 | printf("Humidity:%2.1f\n\r",data.humidity);
112 | printf("CO2:%2.1f\n\r",data.CO2);
113 | printf("CO2 Accuracy:%d\n\r",data.CO2Accuracy);
114 | printf("IAQ:%2.1f\n\r",data.IAQ);
115 | printf("IAQ Accuracy:%d",data.IAQAccuracy);
116 | uint16_t packet_len;
117 | int16_t retcode;
118 | int32_t sensor_value=0;
119 | uint8_t tx_buffer[30];
120 |
121 | packet_len = sprintf((char *) tx_buffer, "%2.2f %2.2f %d %2.2f %2.2f",
122 | data.temperature,data.humidity,data.IAQAccuracy,data.IAQ,data.CO2);
123 |
124 |
125 | retcode = _lorawan.send(MBED_CONF_LORA_APP_PORT, tx_buffer, packet_len,
126 | MSG_UNCONFIRMED_FLAG);
127 |
128 | if (retcode < 0) {
129 | retcode == LORAWAN_STATUS_WOULD_BLOCK ? printf("send - WOULD BLOCK\r\n")
130 | : printf("\r\n send() - Error code %d \r\n", retcode);
131 |
132 | if (retcode == LORAWAN_STATUS_WOULD_BLOCK) {
133 | //retry in 3 seconds
134 | if (MBED_CONF_LORA_DUTY_CYCLE_ON) {
135 | LoRaQueue.call_in(3000ms, callback(this,&LoRa::sendMessage));
136 | }
137 | }
138 | return;
139 | }
140 |
141 | printf("\r\n %d bytes scheduled for transmission \r\n", retcode);
142 | memset(tx_buffer, 0, sizeof(tx_buffer));
143 | }
144 |
145 | void LoRa::receiveMessage()
146 | {
147 | printf("Decode etc\n\r");
148 | }
149 |
150 | void LoRa::sendGarbage()
151 | {
152 | data.temperature = 1;
153 | data.humidity = 1;
154 | data.CO2 = 1;
155 | data.CO2Accuracy = 1;
156 | data.IAQ = 1;
157 | data.IAQAccuracy = 4;
158 | printf("send something!\n\r");
159 | printf("Temperature:%2.1f *C\n\r",data.temperature);
160 | printf("Humidity:%2.1f\n\r",data.humidity);
161 | printf("CO2:%2.1f\n\r",data.CO2);
162 | printf("CO2 Accuracy:%d\n\r",data.CO2Accuracy);
163 | printf("IAQ:%2.1f\n\r",data.IAQ);
164 | printf("IAQ Accuracy:%d",data.IAQAccuracy);
165 | uint16_t packet_len;
166 | int16_t retcode;
167 | int32_t sensor_value=0;
168 | uint8_t tx_buffer[30];
169 |
170 | packet_len = sprintf((char *) tx_buffer, "%2.2f %2.2f %d %2.2f %2.2f",
171 | data.temperature,data.humidity,data.IAQAccuracy,data.IAQ,data.CO2);
172 |
173 |
174 | retcode = _lorawan.send(MBED_CONF_LORA_APP_PORT, tx_buffer, packet_len,
175 | MSG_UNCONFIRMED_FLAG);
176 |
177 | if (retcode < 0) {
178 | retcode == LORAWAN_STATUS_WOULD_BLOCK ? printf("send - WOULD BLOCK\r\n")
179 | : printf("\r\n send() - Error code %d \r\n", retcode);
180 |
181 | if (retcode == LORAWAN_STATUS_WOULD_BLOCK) {
182 | //retry in 3 seconds
183 | if (MBED_CONF_LORA_DUTY_CYCLE_ON) {
184 | LoRaQueue.call_in(3000ms, callback(this,&LoRa::sendMessage));
185 | }
186 | }
187 | return;
188 | }
189 |
190 | printf("\r\n %d bytes scheduled for transmission \r\n", retcode);
191 | memset(tx_buffer, 0, sizeof(tx_buffer));
192 | }
193 |
194 | void LoRa::updateData(dataContainer newestData)
195 | {
196 | data = newestData;
197 | }
198 |
199 | void LoRa::sendData(dataContainer newestData)
200 | {
201 | LoRaQueue.call(callback(this,&LoRa::updateData),newestData);
202 | LoRaQueue.call(callback(this,&LoRa::sendMessage));
203 | }
204 |
205 |
206 |
207 |
--------------------------------------------------------------------------------
/Code/v1/Communication/LoRa.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __LORA__H
2 | #define __LORA__H
3 |
4 | #include "BME688.hpp"
5 | #include "mbed.h"
6 | #include "lorawan/LoRaWANInterface.h"
7 | #include "lorawan/system/lorawan_data_structures.h"
8 | #include "events/EventQueue.h"
9 | #include "trace_helper.h"
10 | #include "lorawan/LoRaRadio.h"
11 | #include "STM32WL_LoRaRadio.h"
12 | #define MAX_NUMBER_OF_EVENTS 10
13 | #define CONFIRMED_MSG_RETRY_COUNTER 3
14 |
15 |
16 |
17 | class LoRa{
18 |
19 | public:
20 | LoRa();
21 | void start();
22 | void sendData(dataContainer newestData);
23 | void updateData(dataContainer newestData);
24 | void sendGarbage();
25 | private:
26 | dataContainer data;
27 | void sendMessage();
28 | void receiveMessage();
29 | void loraHandler(lorawan_event_t event);
30 | void _internalThread();
31 | LoRaWANInterface _lorawan;
32 | lorawan_app_callbacks_t callbacks;
33 | Thread LoRaInternalThread;
34 | lorawan_status_t retcode;
35 | };
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | #endif
--------------------------------------------------------------------------------
/Code/v1/GettingStarted.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
10 | Page Redirection
11 |
12 |
13 | If you are not redirected automatically, please follow the
14 | link to the online exporter documentation
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Code/v1/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction, and
10 | distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright
13 | owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all other entities
16 | that control, are controlled by, or are under common control with that entity.
17 | For the purposes of this definition, "control" means (i) the power, direct or
18 | indirect, to cause the direction or management of such entity, whether by
19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20 | outstanding shares, or (iii) beneficial ownership of such entity.
21 |
22 | "You" (or "Your") shall mean an individual or Legal Entity exercising
23 | permissions granted by this License.
24 |
25 | "Source" form shall mean the preferred form for making modifications, including
26 | but not limited to software source code, documentation source, and configuration
27 | files.
28 |
29 | "Object" form shall mean any form resulting from mechanical transformation or
30 | translation of a Source form, including but not limited to compiled object code,
31 | generated documentation, and conversions to other media types.
32 |
33 | "Work" shall mean the work of authorship, whether in Source or Object form, made
34 | available under the License, as indicated by a copyright notice that is included
35 | in or attached to the work (an example is provided in the Appendix below).
36 |
37 | "Derivative Works" shall mean any work, whether in Source or Object form, that
38 | is based on (or derived from) the Work and for which the editorial revisions,
39 | annotations, elaborations, or other modifications represent, as a whole, an
40 | original work of authorship. For the purposes of this License, Derivative Works
41 | shall not include works that remain separable from, or merely link (or bind by
42 | name) to the interfaces of, the Work and Derivative Works thereof.
43 |
44 | "Contribution" shall mean any work of authorship, including the original version
45 | of the Work and any modifications or additions to that Work or Derivative Works
46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work
47 | by the copyright owner or by an individual or Legal Entity authorized to submit
48 | on behalf of the copyright owner. For the purposes of this definition,
49 | "submitted" means any form of electronic, verbal, or written communication sent
50 | to the Licensor or its representatives, including but not limited to
51 | communication on electronic mailing lists, source code control systems, and
52 | issue tracking systems that are managed by, or on behalf of, the Licensor for
53 | the purpose of discussing and improving the Work, but excluding communication
54 | that is conspicuously marked or otherwise designated in writing by the copyright
55 | owner as "Not a Contribution."
56 |
57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58 | of whom a Contribution has been received by Licensor and subsequently
59 | incorporated within the Work.
60 |
61 | 2. Grant of Copyright License.
62 |
63 | Subject to the terms and conditions of this License, each Contributor hereby
64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
65 | irrevocable copyright license to reproduce, prepare Derivative Works of,
66 | publicly display, publicly perform, sublicense, and distribute the Work and such
67 | Derivative Works in Source or Object form.
68 |
69 | 3. Grant of Patent License.
70 |
71 | Subject to the terms and conditions of this License, each Contributor hereby
72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
73 | irrevocable (except as stated in this section) patent license to make, have
74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where
75 | such license applies only to those patent claims licensable by such Contributor
76 | that are necessarily infringed by their Contribution(s) alone or by combination
77 | of their Contribution(s) with the Work to which such Contribution(s) was
78 | submitted. If You institute patent litigation against any entity (including a
79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
80 | Contribution incorporated within the Work constitutes direct or contributory
81 | patent infringement, then any patent licenses granted to You under this License
82 | for that Work shall terminate as of the date such litigation is filed.
83 |
84 | 4. Redistribution.
85 |
86 | You may reproduce and distribute copies of the Work or Derivative Works thereof
87 | in any medium, with or without modifications, and in Source or Object form,
88 | provided that You meet the following conditions:
89 |
90 | You must give any other recipients of the Work or Derivative Works a copy of
91 | this License; and
92 | You must cause any modified files to carry prominent notices stating that You
93 | changed the files; and
94 | You must retain, in the Source form of any Derivative Works that You distribute,
95 | all copyright, patent, trademark, and attribution notices from the Source form
96 | of the Work, excluding those notices that do not pertain to any part of the
97 | Derivative Works; and
98 | If the Work includes a "NOTICE" text file as part of its distribution, then any
99 | Derivative Works that You distribute must include a readable copy of the
100 | attribution notices contained within such NOTICE file, excluding those notices
101 | that do not pertain to any part of the Derivative Works, in at least one of the
102 | following places: within a NOTICE text file distributed as part of the
103 | Derivative Works; within the Source form or documentation, if provided along
104 | with the Derivative Works; or, within a display generated by the Derivative
105 | Works, if and wherever such third-party notices normally appear. The contents of
106 | the NOTICE file are for informational purposes only and do not modify the
107 | License. You may add Your own attribution notices within Derivative Works that
108 | You distribute, alongside or as an addendum to the NOTICE text from the Work,
109 | provided that such additional attribution notices cannot be construed as
110 | modifying the License.
111 | You may add Your own copyright statement to Your modifications and may provide
112 | additional or different license terms and conditions for use, reproduction, or
113 | distribution of Your modifications, or for any such Derivative Works as a whole,
114 | provided Your use, reproduction, and distribution of the Work otherwise complies
115 | with the conditions stated in this License.
116 |
117 | 5. Submission of Contributions.
118 |
119 | Unless You explicitly state otherwise, any Contribution intentionally submitted
120 | for inclusion in the Work by You to the Licensor shall be under the terms and
121 | conditions of this License, without any additional terms or conditions.
122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of
123 | any separate license agreement you may have executed with Licensor regarding
124 | such Contributions.
125 |
126 | 6. Trademarks.
127 |
128 | This License does not grant permission to use the trade names, trademarks,
129 | service marks, or product names of the Licensor, except as required for
130 | reasonable and customary use in describing the origin of the Work and
131 | reproducing the content of the NOTICE file.
132 |
133 | 7. Disclaimer of Warranty.
134 |
135 | Unless required by applicable law or agreed to in writing, Licensor provides the
136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
138 | including, without limitation, any warranties or conditions of TITLE,
139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
140 | solely responsible for determining the appropriateness of using or
141 | redistributing the Work and assume any risks associated with Your exercise of
142 | permissions under this License.
143 |
144 | 8. Limitation of Liability.
145 |
146 | In no event and under no legal theory, whether in tort (including negligence),
147 | contract, or otherwise, unless required by applicable law (such as deliberate
148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be
149 | liable to You for damages, including any direct, indirect, special, incidental,
150 | or consequential damages of any character arising as a result of this License or
151 | out of the use or inability to use the Work (including but not limited to
152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or
153 | any and all other commercial damages or losses), even if such Contributor has
154 | been advised of the possibility of such damages.
155 |
156 | 9. Accepting Warranty or Additional Liability.
157 |
158 | While redistributing the Work or Derivative Works thereof, You may choose to
159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or
160 | other liability obligations and/or rights consistent with this License. However,
161 | in accepting such obligations, You may act only on Your own behalf and on Your
162 | sole responsibility, not on behalf of any other Contributor, and only if You
163 | agree to indemnify, defend, and hold each Contributor harmless for any liability
164 | incurred by, or claims asserted against, such Contributor by reason of your
165 | accepting any such warranty or additional liability.
166 |
--------------------------------------------------------------------------------
/Code/v1/README.md:
--------------------------------------------------------------------------------
1 | 
2 | # Blinky Mbed OS example
3 |
4 | The example project is part of the [Arm Mbed OS Official Examples](https://os.mbed.com/code/) and is the [getting started example for Mbed OS](https://os.mbed.com/docs/mbed-os/latest/quick-start/index.html). It contains an application that repeatedly blinks an LED on supported [Mbed boards](https://os.mbed.com/platforms/).
5 |
6 | You can build the project with all supported [Mbed OS build tools](https://os.mbed.com/docs/mbed-os/latest/tools/index.html). However, this example project specifically refers to the command-line interface tool [Arm Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
7 | (Note: To see a rendered example you can import into the Arm Online Compiler, please see our [import quick start](https://os.mbed.com/docs/mbed-os/latest/quick-start/online-with-the-online-compiler.html#importing-the-code).)
8 |
9 | ## Mbed OS build tools
10 |
11 | ### Mbed CLI 2
12 | Starting with version 6.5, Mbed OS uses Mbed CLI 2. It uses Ninja as a build system, and CMake to generate the build environment and manage the build process in a compiler-independent manner. If you are working with Mbed OS version prior to 6.5 then check the section [Mbed CLI 1](#mbed-cli-1).
13 | 1. [Install Mbed CLI 2](https://os.mbed.com/docs/mbed-os/latest/build-tools/install-or-upgrade.html).
14 | 1. From the command-line, import the example: `mbed-tools import mbed-os-example-blinky`
15 | 1. Change the current directory to where the project was imported.
16 |
17 | ### Mbed CLI 1
18 | 1. [Install Mbed CLI 1](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
19 | 1. From the command-line, import the example: `mbed import mbed-os-example-blinky`
20 | 1. Change the current directory to where the project was imported.
21 |
22 | ## Application functionality
23 |
24 | The `main()` function is the single thread in the application. It toggles the state of a digital output connected to an LED on the board.
25 |
26 | **Note**: This example requires a target with RTOS support, i.e. one with `rtos` declared in `supported_application_profiles` in `targets/targets.json` in [mbed-os](https://github.com/ARMmbed/mbed-os). For non-RTOS targets (usually with small memory sizes), please use [mbed-os-example-blinky-baremetal](https://github.com/ARMmbed/mbed-os-example-blinky-baremetal) instead.
27 |
28 | ## Building and running
29 |
30 | 1. Connect a USB cable between the USB port on the board and the host computer.
31 | 1. Run the following command to build the example project and program the microcontroller flash memory:
32 |
33 | * Mbed CLI 2
34 |
35 | ```bash
36 | $ mbed-tools compile -m -t --flash
37 | ```
38 |
39 | * Mbed CLI 1
40 |
41 | ```bash
42 | $ mbed compile -m -t --flash
43 | ```
44 |
45 | Your PC may take a few minutes to compile your code.
46 |
47 | The binary is located at:
48 | * **Mbed CLI 2** - `./cmake_build/mbed-os-example-blinky.bin`
49 | * **Mbed CLI 1** - `./BUILD///mbed-os-example-blinky.bin`
50 |
51 | Alternatively, you can manually copy the binary to the board, which you mount on the host computer over USB.
52 |
53 | ## Expected output
54 | The LED on your target turns on and off every 500 milliseconds.
55 |
56 |
57 | ## Troubleshooting
58 | If you have problems, you can review the [documentation](https://os.mbed.com/docs/latest/tutorials/debugging.html) for suggestions on what could be wrong and how to fix it.
59 |
60 | ## Related Links
61 |
62 | * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html).
63 | * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html).
64 | * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html).
65 | * [Mbed OS bare metal](https://os.mbed.com/docs/mbed-os/latest/reference/mbed-os-bare-metal.html).
66 | * [Mbed boards](https://os.mbed.com/platforms/).
67 |
68 | ### License and contributions
69 |
70 | The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more info.
71 |
72 | This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.
73 |
--------------------------------------------------------------------------------
/Code/v1/SensorFusion.cpp:
--------------------------------------------------------------------------------
1 | #include "SensorFusion.hpp"
2 |
3 | static EventQueue fusionQueue(5 *EVENTS_EVENT_SIZE);
4 | SensorFusion::SensorFusion() : _iaqSensor(), _lora(),_fusionThread(osPriorityAboveNormal,OS_STACK_SIZE,nullptr,"SensorThread")
5 | {
6 |
7 | }
8 |
9 |
10 |
11 |
12 | void SensorFusion::start()
13 | {
14 | _lora.start();
15 | _iaqSensor.initialise();
16 | _iaqSensor.doMeasurements();
17 | _fusionThread.start(callback(this,&SensorFusion::_fusionThreadWorker));
18 | fusionQueue.call_every(15s,callback(this,&SensorFusion::checkDataAndPost));
19 | }
20 |
21 |
22 | void SensorFusion::checkDataAndPost()
23 | {
24 | printf("Test\n\r");
25 | if(_iaqSensor.isNewDataAvailable())
26 | {
27 | _lora.sendData(_iaqSensor.returnLatest());
28 | }
29 | else
30 | {
31 | //Replace with Error
32 | _lora.sendGarbage();
33 | }
34 | }
35 |
36 |
37 | void SensorFusion::_fusionThreadWorker()
38 | {
39 | fusionQueue.dispatch_forever();
40 | }
--------------------------------------------------------------------------------
/Code/v1/SensorFusion.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __SENSOR__FUSION__H
2 | #define __SENSOR__FUSION__H
3 | #include "LoRa.hpp"
4 | #include "BME688.hpp"
5 |
6 |
7 |
8 |
9 |
10 | class SensorFusion{
11 |
12 | public:
13 | SensorFusion();
14 | void checkDataAndPost();
15 | void start();
16 | private:
17 | BME688 _iaqSensor;
18 | LoRa _lora;
19 | Thread _fusionThread;
20 | void _fusionThreadWorker();
21 |
22 |
23 |
24 | };
25 |
26 |
27 |
28 |
29 | #endif
--------------------------------------------------------------------------------
/Code/v1/Sensors/BME688.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __BME688__H
2 | #define __BME688__H
3 |
4 | #include "mbed.h"
5 | #include "bme68x_defs.h"
6 | #include "bsec_interface.h"
7 | #include "bsec_datatypes.h"
8 | #include "bme68x.h"
9 |
10 | #define BME688_CHIP_ID_LOCATION 0xD0
11 | #define BME688_ADDRESS 0x76 << 1
12 |
13 |
14 |
15 |
16 | // int8_t readRegister(uint8_t reg_addr, uint8_t *reg_data, uint32_t length, void *intf_ptr);
17 | // int8_t writeRegister(uint8_t reg_addr,const uint8_t *reg_data, uint32_t length,void *intf_ptr);
18 | // void delay(uint32_t period, void *intf_ptr);
19 |
20 | struct dataContainer
21 | {
22 | float temperature;
23 | float humidity;
24 | float CO2;
25 | uint8_t CO2Accuracy;
26 | float IAQ;
27 | uint8_t IAQAccuracy;
28 | };
29 |
30 |
31 |
32 |
33 | class BME688{
34 |
35 | public:
36 | BME688();
37 | void start();
38 | void doMeasurements();
39 | dataContainer returnLatest();
40 | void dumpData();
41 | uint8_t isNewDataAvailable();
42 | void initialise();
43 | private:
44 | typedef enum{SENSOR_STRUCTURE_FAIL, SENSOR_CONFIG_FAIL,
45 | SENSOR_HEATER_FAIL, SENSOR_OPERATION_SEQ_FAIL,
46 | SENSOR_BSEC_FAIL,SENSOR_BSEC_SUBSCRIPTION_FAIL}sensorFailure;
47 |
48 | uint8_t newDataAvailable = 0 ;
49 |
50 | void run();
51 | void _internalThreadFunction();
52 | dataContainer _dataHolder;
53 | uint8_t _initialiseSensorStructure();
54 | uint8_t _initialiseSensorFilterSettings();
55 | uint8_t _initialiseSensorHeaterSettings();
56 | uint8_t _setSequentialMode();
57 | uint8_t _startBsec();
58 | uint8_t _doBsecSettings();
59 | void _processData();
60 | void _bsecProcessing();
61 |
62 |
63 | Thread internalSensorThread;
64 | //BSEC
65 | bme68x_data sensorData[3];
66 | bme68x_dev sensorStructure;
67 | bme68x_conf sensorConfig;
68 | bme68x_heatr_conf sensorHeaterConfig;
69 | uint8_t dataFields;
70 | bsec_sensor_configuration_t requestedVirtualSensors[4];
71 | uint8_t numberRequiredSensorSettings;
72 | uint8_t requestedVirtualSensorsNumber = 4;
73 | int64_t currentTimeInNs;
74 | bsec_output_t outputs[BSEC_NUMBER_OUTPUTS];
75 | const float temperatureOffset = 7.0f;
76 | bool _newDataAvailable;
77 | uint16_t _tempProfile[1];
78 | uint16_t _durProfile[1];
79 |
80 | //BME68X General API
81 | uint8_t statusGetData;
82 | };
83 |
84 |
85 | #endif
--------------------------------------------------------------------------------
/Code/v1/Sensors/libalgobsec.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/Code/v1/Sensors/libalgobsec.a
--------------------------------------------------------------------------------
/Code/v1/SerialStream.lib:
--------------------------------------------------------------------------------
1 | https://os.mbed.com/users/MultipleMonomials/code/SerialStream/#3736580f2dbeb8adf0607fcfd0f434b4faa08a03
--------------------------------------------------------------------------------
/Code/v1/__pycache__/mbed_settings.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/Code/v1/__pycache__/mbed_settings.cpython-37.pyc
--------------------------------------------------------------------------------
/Code/v1/custom_targets.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "BLUEPILL_F103C8": {
4 | "inherits": [
5 | "MCU_STM32F103x8"
6 | ],
7 | "overrides": {
8 | "clock_source": "USE_PLL_HSE_XTAL"
9 | },
10 | "device_has_add": [
11 | "USBDEVICE"
12 | ],
13 | "device_name": "STM32F103C8"
14 | },
15 | "MTB_MURATA_ABZ": {
16 | "inherits": [
17 | "MCU_STM32L082xZ"
18 | ],
19 | "detect_code": ["0456"],
20 | "device_name": "STM32L082CZYx"
21 | },
22 | "GRASSHOPPER": {
23 | "inherits": [
24 | "MTB_MURATA_ABZ"
25 | ]
26 | },
27 | "GNAT": {
28 | "inherits": [
29 | "MTB_MURATA_ABZ"
30 | ]
31 | },
32 | "STWIN": {
33 | "inherits": [
34 | "MCU_STM32L4R9xI"
35 | ],
36 | "device_name": "STM32L4R9ZITx",
37 | "supported_form_factors": [
38 | "STMOD"
39 | ],
40 | "components_add": [
41 | "BlueNRG_MS"
42 | ],
43 | "extra_labels_add": [
44 | "CORDIO"
45 | ],
46 | "features": [
47 | "BLE"
48 | ]
49 | },
50 | "LORA_E5": {
51 | "inherits": [
52 | "MCU_STM32WLE5xC"
53 | ],
54 | "device_name": "STM32WLE5JCIx"
55 | },
56 | "LORA_E5_BREAKOUT": {
57 | "inherits": ["LORA_E5"],
58 | "overrides":{
59 | "lse_available" : 0
60 | },
61 | "macros_add": [
62 | "LED1=PB_5",
63 | "LED2=PB_10",
64 | "BUTTON1=PB_13"
65 | ]
66 |
67 | },
68 | "LORA_E5_MINI": {
69 | "inherits": [
70 | "LORA_E5"
71 | ],
72 | "macros_add": [
73 | "LED1=PB_5",
74 | "BUTTON1=PB_13"
75 | ]
76 | },
77 | "LORA_E5_DEV_BOARD": {
78 | "inherits": [
79 | "LORA_E5"
80 | ],
81 | "macros_add": [
82 | "LED1=PB_5",
83 | "EN_3V3=PA_9",
84 | "EN_5V=PB_10",
85 | "BUTTON1=PB_13",
86 | "BUTTON2=PA_0",
87 | "RS485_REDE=PB_4"
88 | ]
89 | },
90 | "LORA_E5_TINY": {
91 | "inherits": [
92 | "LORA_E5"
93 | ],
94 | "macros_add": [
95 | "LED1=PA_9",
96 | "LED2=PB_13",
97 | "BUTTON1=PB_4"
98 | ]
99 | },
100 | "RAK3172": {
101 | "inherits": [
102 | "MCU_STM32WLE5xC"
103 | ],
104 | "device_name": "STM32WLE5CCUx"
105 | },
106 | "RAK3172_BREAKOUT": {
107 | "inherits": [
108 | "RAK3172"
109 | ],
110 | "macros_add": [
111 | "LED1=PA_9",
112 | "LED2=PA_10"
113 | ]
114 | },
115 | "CORE2":
116 | {
117 | "inherits": ["MCU_STM32F4"],
118 | "extra_labels_add": ["STM32F407xG"],
119 | "macros_add": [
120 | "STM32F407xx",
121 | "ENCODER_1=TIM2",
122 | "ENCODER_2=TIM8",
123 | "ENCODER_3=TIM3",
124 | "ENCODER_4=TIM4",
125 | "UPPER_RESISTOR=5.6e4",
126 | "LOWER_RESISTOR=1.0e4",
127 | "VIN_MEAS_CORRECTION=0.986"
128 | ],
129 | "overrides": {
130 | "lse_available": 0,
131 | "clock_source": "USE_PLL_HSE_XTAL"
132 | },
133 | "device_has_add": ["TRNG", "CAN"],
134 | "device_has_remove": ["LPTICKER"],
135 | "device_name": "STM32F407ZG"
136 | },
137 | "AERQ": {
138 | "inherits": ["LORA_E5"],
139 | "overrides":{
140 | "lse_available" : 0
141 | },
142 | "device_has_add": ["STORAGE","FLASH","FLASHIAP"],
143 | "macros_add": [
144 | "ALERT_LED=PB_0",
145 | "HEARTBEAT_LED=PA_10",
146 | "AERQ_SCL=PB_15",
147 | "AERQ_SDA=PA_15",
148 | "FACTORY=PA_0"
149 | ]
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/Code/v1/lora_radio_helper.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017, Arm Limited and affiliates.
3 | * SPDX-License-Identifier: Apache-2.0
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #ifndef APP_LORA_RADIO_HELPER_H_
19 | #define APP_LORA_RADIO_HELPER_H_
20 |
21 | #include "lorawan/LoRaRadio.h"
22 |
23 | #if COMPONENT_SX1272
24 | #include "SX1272_LoRaRadio.h"
25 | SX1272_LoRaRadio radio(MBED_CONF_SX1272_LORA_DRIVER_SPI_MOSI,
26 | MBED_CONF_SX1272_LORA_DRIVER_SPI_MISO,
27 | MBED_CONF_SX1272_LORA_DRIVER_SPI_SCLK,
28 | MBED_CONF_SX1272_LORA_DRIVER_SPI_CS,
29 | MBED_CONF_SX1272_LORA_DRIVER_RESET,
30 | MBED_CONF_SX1272_LORA_DRIVER_DIO0,
31 | MBED_CONF_SX1272_LORA_DRIVER_DIO1,
32 | MBED_CONF_SX1272_LORA_DRIVER_DIO2,
33 | MBED_CONF_SX1272_LORA_DRIVER_DIO3,
34 | MBED_CONF_SX1272_LORA_DRIVER_DIO4,
35 | MBED_CONF_SX1272_LORA_DRIVER_DIO5,
36 | MBED_CONF_SX1272_LORA_DRIVER_RF_SWITCH_CTL1,
37 | MBED_CONF_SX1272_LORA_DRIVER_RF_SWITCH_CTL2,
38 | MBED_CONF_SX1272_LORA_DRIVER_TXCTL,
39 | MBED_CONF_SX1272_LORA_DRIVER_RXCTL,
40 | MBED_CONF_SX1272_LORA_DRIVER_ANT_SWITCH,
41 | MBED_CONF_SX1272_LORA_DRIVER_PWR_AMP_CTL,
42 | MBED_CONF_SX1272_LORA_DRIVER_TCXO);
43 |
44 | #elif COMPONENT_SX1276
45 | #include "SX1276_LoRaRadio.h"
46 | SX1276_LoRaRadio radio(MBED_CONF_SX1276_LORA_DRIVER_SPI_MOSI,
47 | MBED_CONF_SX1276_LORA_DRIVER_SPI_MISO,
48 | MBED_CONF_SX1276_LORA_DRIVER_SPI_SCLK,
49 | MBED_CONF_SX1276_LORA_DRIVER_SPI_CS,
50 | MBED_CONF_SX1276_LORA_DRIVER_RESET,
51 | MBED_CONF_SX1276_LORA_DRIVER_DIO0,
52 | MBED_CONF_SX1276_LORA_DRIVER_DIO1,
53 | MBED_CONF_SX1276_LORA_DRIVER_DIO2,
54 | MBED_CONF_SX1276_LORA_DRIVER_DIO3,
55 | MBED_CONF_SX1276_LORA_DRIVER_DIO4,
56 | MBED_CONF_SX1276_LORA_DRIVER_DIO5,
57 | MBED_CONF_SX1276_LORA_DRIVER_RF_SWITCH_CTL1,
58 | MBED_CONF_SX1276_LORA_DRIVER_RF_SWITCH_CTL2,
59 | MBED_CONF_SX1276_LORA_DRIVER_TXCTL,
60 | MBED_CONF_SX1276_LORA_DRIVER_RXCTL,
61 | MBED_CONF_SX1276_LORA_DRIVER_ANT_SWITCH,
62 | MBED_CONF_SX1276_LORA_DRIVER_PWR_AMP_CTL,
63 | MBED_CONF_SX1276_LORA_DRIVER_TCXO);
64 |
65 | #elif COMPONENT_SX126X
66 | #include "SX126X_LoRaRadio.h"
67 | SX126X_LoRaRadio radio(MBED_CONF_SX126X_LORA_DRIVER_SPI_MOSI,
68 | MBED_CONF_SX126X_LORA_DRIVER_SPI_MISO,
69 | MBED_CONF_SX126X_LORA_DRIVER_SPI_SCLK,
70 | MBED_CONF_SX126X_LORA_DRIVER_SPI_CS,
71 | MBED_CONF_SX126X_LORA_DRIVER_RESET,
72 | MBED_CONF_SX126X_LORA_DRIVER_DIO1,
73 | MBED_CONF_SX126X_LORA_DRIVER_BUSY,
74 | MBED_CONF_SX126X_LORA_DRIVER_FREQ_SELECT,
75 | MBED_CONF_SX126X_LORA_DRIVER_DEVICE_SELECT,
76 | MBED_CONF_SX126X_LORA_DRIVER_CRYSTAL_SELECT,
77 | MBED_CONF_SX126X_LORA_DRIVER_ANT_SWITCH);
78 |
79 | #elif (TARGET_STM32WL)
80 | #include "STM32WL_LoRaRadio.h"
81 | STM32WL_LoRaRadio radio;
82 | #else
83 | #error "Unknown LoRa radio specified (SX126X, SX1272, SX1276, STM32WL are valid)"
84 | #endif
85 |
86 | #endif /* APP_LORA_RADIO_HELPER_H_ */
87 |
--------------------------------------------------------------------------------
/Code/v1/main.cpp:
--------------------------------------------------------------------------------
1 | #include "mbed.h"
2 | #include "SensorFusion.hpp"
3 | #include
4 |
5 |
6 |
7 |
8 | static EventQueue mainThread(5 *EVENTS_EVENT_SIZE);
9 |
10 |
11 | DigitalOut hb(HEARTBEAT_LED);
12 | SensorFusion sensorManagement;
13 |
14 |
15 | void doHb();
16 |
17 |
18 |
19 | int main()
20 | {
21 | sensorManagement.start();
22 | mainThread.dispatch_forever();
23 | }
24 |
25 | void doHb()
26 | {
27 | hb = !hb;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/Code/v1/mbed-os.lib:
--------------------------------------------------------------------------------
1 | https://github.com/ARMmbed/mbed-os/#4cfbea43cabe86bc3ed7a5287cd464be7a218938
--------------------------------------------------------------------------------
/Code/v1/mbed_settings.py:
--------------------------------------------------------------------------------
1 | """
2 | mbed SDK
3 | Copyright (c) 2016 ARM Limited
4 |
5 | Licensed under the Apache License, Version 2.0 (the "License");
6 | you may not use this file except in compliance with the License.
7 | You may obtain a copy of the License at
8 |
9 | http://www.apache.org/licenses/LICENSE-2.0
10 |
11 | Unless required by applicable law or agreed to in writing, software
12 | distributed under the License is distributed on an "AS IS" BASIS,
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | See the License for the specific language governing permissions and
15 | limitations under the License.
16 | """
17 |
18 | from os.path import join, abspath, dirname
19 |
20 | #ROOT = abspath(join(dirname(__file__), "."))
21 |
22 | ##############################################################################
23 | # Build System Settings
24 | ##############################################################################
25 | #BUILD_DIR = abspath(join(ROOT, "build"))
26 |
27 | # ARM
28 | #ARM_PATH = "C:/Program Files/ARM"
29 |
30 | # GCC ARM
31 | #GCC_ARM_PATH = ""
32 |
33 | # IAR
34 | #IAR_PATH = "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.0/arm"
35 |
36 | # Goanna static analyser. Please overload it in private_settings.py
37 | #GOANNA_PATH = "c:/Program Files (x86)/RedLizards/Goanna Central 3.2.3/bin"
38 |
39 | #BUILD_OPTIONS = []
40 |
41 | # mbed.org username
42 | #MBED_ORG_USER = ""
43 |
44 | # Print compiler warnings and errors as link format
45 | #PRINT_COMPILER_OUTPUT_AS_LINK = False
46 |
--------------------------------------------------------------------------------
/Code/v1/mbedtls_lora_config.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017, Arm Limited and affiliates.
3 | * SPDX-License-Identifier: Apache-2.0
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #ifndef MBEDTLS_LORA_CONFIG_H
19 | #define MBEDTLS_LORA_CONFIG_H
20 |
21 | /*
22 | * Configure mbedtls for LoRa stack.
23 | *
24 | * These settings are just a customization of the main mbedtls config
25 | * mbed-os/features/mbedtls/inc/mbedtls/config.h
26 | */
27 |
28 | // Ensure LoRa required ciphers are enabled
29 | #define MBEDTLS_CIPHER_C
30 | #define MBEDTLS_AES_C
31 | #define MBEDTLS_CMAC_C
32 |
33 | // Reduce ROM usage by optimizing some mbedtls features.
34 | // These are only reference configurations for this LoRa example application.
35 | // Other LoRa applications might need different configurations.
36 | #define MBEDTLS_AES_FEWER_TABLES
37 |
38 | #undef MBEDTLS_GCM_C
39 | #undef MBEDTLS_CHACHA20_C
40 | #undef MBEDTLS_CHACHAPOLY_C
41 | #undef MBEDTLS_POLY1305_C
42 |
43 | #endif /* MBEDTLS_LORA_CONFIG_H */
44 |
--------------------------------------------------------------------------------
/Code/v1/resources/official_armmbed_example_badge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/Code/v1/resources/official_armmbed_example_badge.png
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets.lib:
--------------------------------------------------------------------------------
1 | https://github.com/ARMmbed/stm32customtargets#66bcf07e7ccd5a307ead1c096aaca2edb1ded064
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/.gitignore:
--------------------------------------------------------------------------------
1 | BUILD
2 | cmake_build
3 | main.cpp
4 | mbed_app.json
5 | mbed-os.lib
6 | mbed-os
7 | .mbed
8 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/.mbedignore:
--------------------------------------------------------------------------------
1 | cmake_build/*
2 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_subdirectory(TARGET_STM32F0)
5 | add_subdirectory(TARGET_STM32F1)
6 | add_subdirectory(TARGET_STM32F2)
7 | add_subdirectory(TARGET_STM32F3)
8 | add_subdirectory(TARGET_STM32F4)
9 | add_subdirectory(TARGET_STM32F7)
10 | add_subdirectory(TARGET_STM32G0)
11 | add_subdirectory(TARGET_STM32G4)
12 | add_subdirectory(TARGET_STM32H7)
13 | add_subdirectory(TARGET_STM32L0)
14 | add_subdirectory(TARGET_STM32L1)
15 | add_subdirectory(TARGET_STM32L4)
16 | add_subdirectory(TARGET_STM32L5)
17 | add_subdirectory(TARGET_STM32U5)
18 | add_subdirectory(TARGET_STM32WB)
19 | add_subdirectory(TARGET_STM32WL)
20 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/LICENSE-apache-2.0.txt:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction, and
10 | distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright
13 | owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all other entities
16 | that control, are controlled by, or are under common control with that entity.
17 | For the purposes of this definition, "control" means (i) the power, direct or
18 | indirect, to cause the direction or management of such entity, whether by
19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20 | outstanding shares, or (iii) beneficial ownership of such entity.
21 |
22 | "You" (or "Your") shall mean an individual or Legal Entity exercising
23 | permissions granted by this License.
24 |
25 | "Source" form shall mean the preferred form for making modifications, including
26 | but not limited to software source code, documentation source, and configuration
27 | files.
28 |
29 | "Object" form shall mean any form resulting from mechanical transformation or
30 | translation of a Source form, including but not limited to compiled object code,
31 | generated documentation, and conversions to other media types.
32 |
33 | "Work" shall mean the work of authorship, whether in Source or Object form, made
34 | available under the License, as indicated by a copyright notice that is included
35 | in or attached to the work (an example is provided in the Appendix below).
36 |
37 | "Derivative Works" shall mean any work, whether in Source or Object form, that
38 | is based on (or derived from) the Work and for which the editorial revisions,
39 | annotations, elaborations, or other modifications represent, as a whole, an
40 | original work of authorship. For the purposes of this License, Derivative Works
41 | shall not include works that remain separable from, or merely link (or bind by
42 | name) to the interfaces of, the Work and Derivative Works thereof.
43 |
44 | "Contribution" shall mean any work of authorship, including the original version
45 | of the Work and any modifications or additions to that Work or Derivative Works
46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work
47 | by the copyright owner or by an individual or Legal Entity authorized to submit
48 | on behalf of the copyright owner. For the purposes of this definition,
49 | "submitted" means any form of electronic, verbal, or written communication sent
50 | to the Licensor or its representatives, including but not limited to
51 | communication on electronic mailing lists, source code control systems, and
52 | issue tracking systems that are managed by, or on behalf of, the Licensor for
53 | the purpose of discussing and improving the Work, but excluding communication
54 | that is conspicuously marked or otherwise designated in writing by the copyright
55 | owner as "Not a Contribution."
56 |
57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58 | of whom a Contribution has been received by Licensor and subsequently
59 | incorporated within the Work.
60 |
61 | 2. Grant of Copyright License.
62 |
63 | Subject to the terms and conditions of this License, each Contributor hereby
64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
65 | irrevocable copyright license to reproduce, prepare Derivative Works of,
66 | publicly display, publicly perform, sublicense, and distribute the Work and such
67 | Derivative Works in Source or Object form.
68 |
69 | 3. Grant of Patent License.
70 |
71 | Subject to the terms and conditions of this License, each Contributor hereby
72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
73 | irrevocable (except as stated in this section) patent license to make, have
74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where
75 | such license applies only to those patent claims licensable by such Contributor
76 | that are necessarily infringed by their Contribution(s) alone or by combination
77 | of their Contribution(s) with the Work to which such Contribution(s) was
78 | submitted. If You institute patent litigation against any entity (including a
79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
80 | Contribution incorporated within the Work constitutes direct or contributory
81 | patent infringement, then any patent licenses granted to You under this License
82 | for that Work shall terminate as of the date such litigation is filed.
83 |
84 | 4. Redistribution.
85 |
86 | You may reproduce and distribute copies of the Work or Derivative Works thereof
87 | in any medium, with or without modifications, and in Source or Object form,
88 | provided that You meet the following conditions:
89 |
90 | You must give any other recipients of the Work or Derivative Works a copy of
91 | this License; and
92 | You must cause any modified files to carry prominent notices stating that You
93 | changed the files; and
94 | You must retain, in the Source form of any Derivative Works that You distribute,
95 | all copyright, patent, trademark, and attribution notices from the Source form
96 | of the Work, excluding those notices that do not pertain to any part of the
97 | Derivative Works; and
98 | If the Work includes a "NOTICE" text file as part of its distribution, then any
99 | Derivative Works that You distribute must include a readable copy of the
100 | attribution notices contained within such NOTICE file, excluding those notices
101 | that do not pertain to any part of the Derivative Works, in at least one of the
102 | following places: within a NOTICE text file distributed as part of the
103 | Derivative Works; within the Source form or documentation, if provided along
104 | with the Derivative Works; or, within a display generated by the Derivative
105 | Works, if and wherever such third-party notices normally appear. The contents of
106 | the NOTICE file are for informational purposes only and do not modify the
107 | License. You may add Your own attribution notices within Derivative Works that
108 | You distribute, alongside or as an addendum to the NOTICE text from the Work,
109 | provided that such additional attribution notices cannot be construed as
110 | modifying the License.
111 | You may add Your own copyright statement to Your modifications and may provide
112 | additional or different license terms and conditions for use, reproduction, or
113 | distribution of Your modifications, or for any such Derivative Works as a whole,
114 | provided Your use, reproduction, and distribution of the Work otherwise complies
115 | with the conditions stated in this License.
116 |
117 | 5. Submission of Contributions.
118 |
119 | Unless You explicitly state otherwise, any Contribution intentionally submitted
120 | for inclusion in the Work by You to the Licensor shall be under the terms and
121 | conditions of this License, without any additional terms or conditions.
122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of
123 | any separate license agreement you may have executed with Licensor regarding
124 | such Contributions.
125 |
126 | 6. Trademarks.
127 |
128 | This License does not grant permission to use the trade names, trademarks,
129 | service marks, or product names of the Licensor, except as required for
130 | reasonable and customary use in describing the origin of the Work and
131 | reproducing the content of the NOTICE file.
132 |
133 | 7. Disclaimer of Warranty.
134 |
135 | Unless required by applicable law or agreed to in writing, Licensor provides the
136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
138 | including, without limitation, any warranties or conditions of TITLE,
139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
140 | solely responsible for determining the appropriateness of using or
141 | redistributing the Work and assume any risks associated with Your exercise of
142 | permissions under this License.
143 |
144 | 8. Limitation of Liability.
145 |
146 | In no event and under no legal theory, whether in tort (including negligence),
147 | contract, or otherwise, unless required by applicable law (such as deliberate
148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be
149 | liable to You for damages, including any direct, indirect, special, incidental,
150 | or consequential damages of any character arising as a result of this License or
151 | out of the use or inability to use the Work (including but not limited to
152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or
153 | any and all other commercial damages or losses), even if such Contributor has
154 | been advised of the possibility of such damages.
155 |
156 | 9. Accepting Warranty or Additional Liability.
157 |
158 | While redistributing the Work or Derivative Works thereof, You may choose to
159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or
160 | other liability obligations and/or rights consistent with this License. However,
161 | in accepting such obligations, You may act only on Your own behalf and on Your
162 | sole responsibility, not on behalf of any other Contributor, and only if You
163 | agree to indemnify, defend, and hold each Contributor harmless for any liability
164 | incurred by, or claims asserted against, such Contributor by reason of your
165 | accepting any such warranty or additional liability.
166 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F0/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F1/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_subdirectory(TARGET_BLUEPILL_F103C8 EXCLUDE_FROM_ALL)
5 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2021 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-bluepill-f103c8 INTERFACE)
5 |
6 | target_sources(mbed-bluepill-f103c8
7 | INTERFACE
8 | PeripheralPins.c
9 | )
10 |
11 | target_include_directories(mbed-bluepill-f103c8
12 | INTERFACE
13 | .
14 | )
15 |
16 | target_link_libraries(mbed-bluepill-f103c8 INTERFACE mbed-stm32f103x8)
17 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/PeripheralPins.c:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2020 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32F103C(8-B)Tx.xml
16 | */
17 |
18 | #include "PeripheralPins.h"
19 | #include "mbed_toolchain.h"
20 |
21 | //==============================================================================
22 | // Notes
23 | //
24 | // - The pins mentioned Px_y_ALTz are alternative possibilities which use other
25 | // HW peripheral instances. You can use them the same way as any other "normal"
26 | // pin (i.e. PwmOut pwm(PA_7_ALT0);). These pins are not displayed on the board
27 | // pinout image on mbed.org.
28 | //
29 | // - The pins which are connected to other components present on the board have
30 | // the comment "Connected to xxx". The pin function may not work properly in this
31 | // case. These pins may not be displayed on the board pinout image on mbed.org.
32 | // Please read the board reference manual and schematic for more information.
33 | //
34 | // - Warning: pins connected to the default STDIO_UART_TX and STDIO_UART_RX pins are commented
35 | // See https://os.mbed.com/teams/ST/wiki/STDIO for more information.
36 | //
37 | //==============================================================================
38 |
39 |
40 | //*** ADC ***
41 |
42 | MBED_WEAK const PinMap PinMap_ADC[] = {
43 | {PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0
44 | {PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1
45 | {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
46 | {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
47 | {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
48 | {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
49 | {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
50 | {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
51 | {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
52 | {PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
53 | {NC, NC, 0}
54 | };
55 |
56 | const PinMap PinMap_ADC_Internal[] = {
57 | {ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // ADC_IN16
58 | {ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // ADC_IN17
59 | {NC, NC, 0}
60 | };
61 |
62 | //*** I2C ***
63 |
64 | MBED_WEAK const PinMap PinMap_I2C_SDA[] = {
65 | {PB_7, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, 0)},
66 | {PB_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, 2)},
67 | {PB_11, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, 0)},
68 | {NC, NC, 0}
69 | };
70 |
71 | MBED_WEAK const PinMap PinMap_I2C_SCL[] = {
72 | {PB_6, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, 0)},
73 | {PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, 2)},
74 | {PB_10, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, 0)},
75 | {NC, NC, 0}
76 | };
77 |
78 | //*** PWM ***
79 |
80 | // TIM4 cannot be used because already used by the us_ticker
81 | // (update us_ticker_data.h file if another timer is chosen)
82 | MBED_WEAK const PinMap PinMap_PWM[] = {
83 | {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 1, 0)}, // TIM2_CH1
84 | {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 2, 0)}, // TIM2_CH2
85 | {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 3, 0)}, // TIM2_CH3
86 | {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 4, 0)}, // TIM2_CH4
87 | {PA_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 1, 0)}, // TIM3_CH1
88 | {PA_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 6, 1, 1)}, // TIM1_CH1N
89 | {PA_7_ALT0, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 2, 0)}, // TIM3_CH2
90 | {PA_8, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 1, 0)}, // TIM1_CH1
91 | {PA_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 2, 0)}, // TIM1_CH2
92 | {PA_10, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 3, 0)}, // TIM1_CH3
93 | {PA_11, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 4, 0)}, // TIM1_CH4
94 | {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 8, 1, 0)}, // TIM2_CH1
95 | {PB_0, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 6, 2, 1)}, // TIM1_CH2N
96 | {PB_0_ALT0, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 3, 0)}, // TIM3_CH3
97 | {PB_1, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 6, 3, 1)}, // TIM1_CH3N
98 | {PB_1_ALT0, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 4, 0)}, // TIM3_CH4
99 | {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 8, 2, 0)}, // TIM2_CH2
100 | {PB_4, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 7, 1, 0)}, // TIM3_CH1
101 | {PB_5, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 7, 2, 0)}, // TIM3_CH2
102 | // {PB_6, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 1, 0)}, // TIM4_CH1
103 | // {PB_7, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 2, 0)}, // TIM4_CH2
104 | // {PB_8, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 3, 0)}, // TIM4_CH3
105 | // {PB_9, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 4, 0)}, // TIM4_CH4
106 | {PB_10, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 8, 3, 0)}, // TIM2_CH3
107 | {PB_11, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 8, 4, 0)}, // TIM2_CH4
108 | {PB_13, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 1, 1)}, // TIM1_CH1N
109 | {PB_14, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 2, 1)}, // TIM1_CH2N
110 | {PB_15, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, 0, 3, 1)}, // TIM1_CH3N
111 | {NC, NC, 0}
112 | };
113 |
114 | //*** SERIAL ***
115 |
116 | MBED_WEAK const PinMap PinMap_UART_TX[] = {
117 | {PA_2, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
118 | {PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
119 | {PB_6, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 3)},
120 | {PB_10, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
121 | {NC, NC, 0}
122 | };
123 |
124 | MBED_WEAK const PinMap PinMap_UART_RX[] = {
125 | {PA_3, UART_2, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, 0)},
126 | {PA_10, UART_1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, 0)},
127 | {PB_7, UART_1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, 3)},
128 | {PB_11, UART_3, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, 0)},
129 | {NC, NC, 0}
130 | };
131 |
132 | MBED_WEAK const PinMap PinMap_UART_RTS[] = {
133 | {PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
134 | {PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
135 | {PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
136 | {PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 5)},
137 | {NC, NC, 0}
138 | };
139 |
140 | MBED_WEAK const PinMap PinMap_UART_CTS[] = {
141 | {PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
142 | {PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
143 | {PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 0)},
144 | {PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, 5)},
145 | {NC, NC, 0}
146 | };
147 |
148 | //*** SPI ***
149 |
150 | MBED_WEAK const PinMap PinMap_SPI_MOSI[] = {
151 | {PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
152 | {PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 1)},
153 | {PB_15, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
154 | {NC, NC, 0}
155 | };
156 |
157 | MBED_WEAK const PinMap PinMap_SPI_MISO[] = {
158 | {PA_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
159 | {PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 1)},
160 | {PB_14, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
161 | {NC, NC, 0}
162 | };
163 |
164 | MBED_WEAK const PinMap PinMap_SPI_SCLK[] = {
165 | {PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
166 | {PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 1)},
167 | {PB_13, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
168 | {NC, NC, 0}
169 | };
170 |
171 | MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
172 | {PA_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
173 | {PA_15, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 1)},
174 | {PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
175 | {NC, NC, 0}
176 | };
177 |
178 | //*** CAN ***
179 |
180 | MBED_WEAK const PinMap PinMap_CAN_RD[] = {
181 | {PA_11, CAN_1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)},
182 | {PB_8, CAN_1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 10)},
183 | {NC, NC, 0}
184 | };
185 |
186 | MBED_WEAK const PinMap PinMap_CAN_TD[] = {
187 | {PA_12, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
188 | {PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 10)},
189 | {NC, NC, 0}
190 | };
191 |
192 | //*** USBDEVICE ***
193 |
194 | MBED_WEAK const PinMap PinMap_USB_FS[] = {
195 | {PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_DM
196 | {PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_DP
197 | {NC, NC, 0}
198 | };
199 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/PinNames.h:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2020 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32F103C(8-B)Tx.xml
16 | */
17 |
18 | /* MBED TARGET LIST: BLUEPILL_F103C8 */
19 |
20 | #ifndef MBED_PINNAMES_H
21 | #define MBED_PINNAMES_H
22 |
23 | #include "cmsis.h"
24 | #include "PinNamesTypes.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef enum {
31 | ALT0 = 0x100,
32 | } ALTx;
33 |
34 | typedef enum {
35 | PA_0 = 0x00,
36 | PA_1 = 0x01,
37 | PA_2 = 0x02,
38 | PA_3 = 0x03,
39 | PA_4 = 0x04,
40 | PA_5 = 0x05,
41 | PA_6 = 0x06,
42 | PA_7 = 0x07,
43 | PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
44 | PA_8 = 0x08,
45 | PA_9 = 0x09,
46 | PA_10 = 0x0A,
47 | PA_11 = 0x0B,
48 | PA_12 = 0x0C,
49 | PA_13 = 0x0D,
50 | PA_14 = 0x0E,
51 | PA_15 = 0x0F,
52 | PB_0 = 0x10,
53 | PB_0_ALT0 = PB_0 | ALT0, // same pin used for alternate HW
54 | PB_1 = 0x11,
55 | PB_1_ALT0 = PB_1 | ALT0, // same pin used for alternate HW
56 | PB_2 = 0x12,
57 | PB_3 = 0x13,
58 | PB_4 = 0x14,
59 | PB_5 = 0x15,
60 | PB_6 = 0x16,
61 | PB_7 = 0x17,
62 | PB_8 = 0x18,
63 | PB_9 = 0x19,
64 | PB_10 = 0x1A,
65 | PB_11 = 0x1B,
66 | PB_12 = 0x1C,
67 | PB_13 = 0x1D,
68 | PB_14 = 0x1E,
69 | PB_15 = 0x1F,
70 | PC_13 = 0x2D,
71 | PC_14 = 0x2E,
72 | PC_15 = 0x2F,
73 | PD_0 = 0x30,
74 | PD_1 = 0x31,
75 |
76 | // ADC internal channels
77 | ADC_TEMP = 0xF0,
78 | ADC_VREF = 0xF1,
79 |
80 | // STDIO for console print
81 | #ifdef MBED_CONF_TARGET_STDIO_UART_TX
82 | CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
83 | #else
84 | CONSOLE_TX = PA_2,
85 | #endif
86 | #ifdef MBED_CONF_TARGET_STDIO_UART_RX
87 | CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
88 | #else
89 | CONSOLE_RX = PA_3,
90 | #endif
91 |
92 | //USB pins
93 | USB_DM = PA_11,
94 | USB_DP = PA_12,
95 |
96 | // Not connected
97 | NC = (int)0xFFFFFFFF
98 | } PinName;
99 |
100 |
101 | // Standardized LED and button names
102 | #define LED1 PC_13
103 |
104 |
105 | // PCB printout
106 | #define A0 PA_0,
107 | #define A1 PA_1,
108 | #define A2 PA_2,
109 | #define A3 PA_3,
110 | #define A4 PA_4,
111 | #define A5 PA_5,
112 | #define A6 PA_6,
113 | #define A7 PA_7,
114 | #define A8 PA_8,
115 | #define A9 PA_9,
116 | #define A10 PA_10,
117 | #define A11 PA_11,
118 | #define A12 PA_12,
119 | #define A15 PA_15,
120 |
121 | // #define B0 PB_0, // compilation issue with platform/cxxsupport/mstd_type_traits
122 | // #define B1 PB_1, // compilation issue with platform/cxxsupport/mstd_type_traits
123 | // #define B2 PB_2, // compilation issue with platform/cxxsupport/mstd_type_traits
124 | // #define B3 PB_3, // compilation issue with platform/cxxsupport/mstd_type_traits
125 | // #define B4 PB_4, // compilation issue with platform/cxxsupport/mstd_type_traits
126 | #define B5 PB_5,
127 | #define B6 PB_6,
128 | #define B7 PB_7,
129 | #define B8 PB_8,
130 | #define B9 PB_9,
131 | #define B10 PB_10,
132 | #define B11 PB_11,
133 | #define B12 PB_12,
134 | #define B13 PB_13,
135 | #define B14 PB_14,
136 | #define B15 PB_15,
137 |
138 | #define C13 PC_13,
139 | #define C14 PC_14,
140 | #define C15 PC_15,
141 |
142 |
143 | // Default pin alias
144 | #define I2C_SCL = B6,
145 | #define I2C_SDA = B7,
146 | #define SPI_MOSI = A7,
147 | #define SPI_MISO = A6,
148 | #define SPI_SCK = A5,
149 | #define SPI_CS = A4,
150 | #define PWM_OUT = B5,
151 |
152 |
153 | #ifdef __cplusplus
154 | }
155 | #endif
156 |
157 | #endif
158 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F2/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F3/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F4/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_subdirectory(TARGET_CORE2 EXCLUDE_FROM_ALL)
5 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F4/TARGET_CORE2/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(mbed-core2 INTERFACE)
2 |
3 | target_sources(mbed-core2
4 | INTERFACE
5 | PeripheralPins.c
6 | system_clock.c
7 | )
8 |
9 | target_include_directories(mbed-core2
10 | INTERFACE
11 | .
12 | )
13 |
14 | target_link_libraries(mbed-core2 INTERFACE mbed-stm32f407xg)
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F4/TARGET_CORE2/PeripheralPins.c:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | *******************************************************************************
3 | * Copyright (c) 2019, STMicroelectronics
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
15 | * may be used to endorse or promote products derived from this software
16 | * without specific prior written permission.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | *******************************************************************************
29 | */
30 | #include "PeripheralPins.h"
31 | #include "mbed_toolchain.h"
32 | #include "PeripheralPinMaps.h"
33 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32F7/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32G0/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32G4/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32H7/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_subdirectory(TARGET_MTB_MURATA_ABZ EXCLUDE_FROM_ALL)
5 | add_subdirectory(TARGET_GRASSHOPPER EXCLUDE_FROM_ALL)
6 | add_subdirectory(TARGET_GNAT EXCLUDE_FROM_ALL)
7 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/TARGET_GNAT/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-gnat INTERFACE)
5 |
6 | target_include_directories(mbed-gnat
7 | INTERFACE
8 | .
9 | )
10 |
11 | target_link_libraries(mbed-gnat INTERFACE
12 | mbed-stm32l082xz
13 | mbed-mtb-murata-abz
14 | )
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/TARGET_GNAT/PinNames.h:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32L082CZUx.xml
16 | */
17 |
18 | /* MBED TARGET LIST: MTB_MURATA_ABZ */
19 |
20 | #ifndef MBED_PINNAMES_H
21 | #define MBED_PINNAMES_H
22 |
23 | #include "cmsis.h"
24 | #include "PinNamesTypes.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef enum {
31 | ALT0 = 0x100,
32 | } ALTx;
33 |
34 | typedef enum {
35 | PA_0 = 0x00,
36 | PA_1 = 0x01,
37 | PA_2 = 0x02,
38 | PA_2_ALT0 = PA_2 | ALT0, // same pin used for alternate HW
39 | PA_3 = 0x03,
40 | PA_3_ALT0 = PA_3 | ALT0, // same pin used for alternate HW
41 | PA_4 = 0x04,
42 | PA_5 = 0x05,
43 | PA_6 = 0x06,
44 | PA_6_ALT0 = PA_6 | ALT0, // same pin used for alternate HW
45 | PA_7 = 0x07,
46 | PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
47 | PA_8 = 0x08,
48 | PA_9 = 0x09,
49 | PA_10 = 0x0A,
50 | PA_11 = 0x0B,
51 | PA_12 = 0x0C,
52 | PA_13 = 0x0D,
53 | PA_14 = 0x0E,
54 | PA_14_ALT0 = PA_14 | ALT0, // same pin used for alternate HW
55 | PA_15 = 0x0F,
56 | PB_0 = 0x10,
57 | PB_1 = 0x11,
58 | PB_2 = 0x12,
59 | PB_3 = 0x13,
60 | PB_4 = 0x14,
61 | PB_4_ALT0 = PB_4 | ALT0, // same pin used for alternate HW
62 | PB_5 = 0x15,
63 | PB_5_ALT0 = PB_5 | ALT0, // same pin used for alternate HW
64 | PB_6 = 0x16,
65 | PB_7 = 0x17,
66 | PB_8 = 0x18,
67 | PB_9 = 0x19,
68 | PB_10 = 0x1A,
69 | PB_11 = 0x1B,
70 | PB_12 = 0x1C,
71 | PB_13 = 0x1D,
72 | PB_14 = 0x1E,
73 | PB_15 = 0x1F,
74 | PC_0 = 0x20,
75 | PC_1 = 0x21,
76 | PC_2 = 0x22,
77 | PC_13 = 0x2D,
78 | PC_14 = 0x2E,
79 | PC_15 = 0x2F,
80 | PH_0 = 0x70,
81 | PH_1 = 0x71,
82 |
83 | /**** ADC internal channels ****/
84 |
85 | ADC_TEMP = 0xF0, // Internal pin virtual value
86 | ADC_VREF = 0xF1, // Internal pin virtual value
87 | ADC_VBAT = 0xF2, // Internal pin virtual value
88 |
89 | // STDIO for console print
90 | #ifdef MBED_CONF_TARGET_STDIO_UART_TX
91 | CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
92 | #else
93 | CONSOLE_TX = PA_2,
94 | #endif
95 | #ifdef MBED_CONF_TARGET_STDIO_UART_RX
96 | CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
97 | #else
98 | CONSOLE_RX = PA_3,
99 | #endif
100 |
101 |
102 | /**** USB pins ****/
103 | USB_DM = PA_11,
104 | USB_DP = PA_12,
105 |
106 | /**** OSCILLATOR pins ****/
107 | RCC_OSC32_IN = PC_14,
108 | RCC_OSC32_OUT = PC_15,
109 | RCC_OSC_IN = PH_0,
110 | RCC_OSC_OUT = PH_1,
111 |
112 | /**** DEBUG pins ****/
113 | SYS_PVD_IN = PB_7,
114 | SYS_SWCLK = PA_14,
115 | SYS_SWDIO = PA_13,
116 | SYS_VREF_OUT_PB0 = PB_0,
117 | SYS_VREF_OUT_PB1 = PB_1,
118 | SYS_WKUP1 = PA_0,
119 | SYS_WKUP2 = PC_13,
120 |
121 | // Not connected
122 | NC = (int)0xFFFFFFFF
123 | } PinName;
124 |
125 |
126 | // Standardized LED and button names
127 | #define LED1 PB_12 // Blue
128 | #define BUTTON1 PB_5 // Button
129 |
130 | // Aliases
131 | #define I2C_SCL PB_8
132 | #define I2C_SDA PB_9
133 |
134 | #define SPI_MOSI PB_15 // Also Connected to LoRa DIO4
135 | #define SPI_MISO PB_14
136 | #define SPI_SCK PB_13
137 | #define SPI_CS PB_12
138 |
139 | #define LORA_SPI_MOSI PA_7
140 | #define LORA_SPI_MISO PA_6
141 | #define LORA_SPI_SCLK PB_3
142 | #define LORA_CS PA_15
143 | #define LORA_RESET PC_0
144 | #define LORA_DIO0 PB_4
145 | #define LORA_DIO1 PB_1
146 | #define LORA_DIO2 PB_0
147 | #define LORA_DIO3 PC_13
148 | #define LORA_ANT_RX PA_1
149 | #define LORA_ANT_TX PC_2
150 | #define LORA_ANT_BOOST PC_1
151 | #define LORA_VDD_TXCO PB_14
152 |
153 | #define D0 PA_10
154 | #define D1 PA_9
155 | #define D2 PB_5 // User Button
156 | #define D3 PB_6 // BMA400 Interrupt 2
157 | #define D4 PB_7 // GNSS PPS
158 | #define D5 PB_2 // Enable GNSS
159 | #define D8 PA_13
160 | #define D9 PA_14
161 | #define D10 PB_12
162 | #define D11 PB_15
163 | #define D12 PB_14
164 | #define D13 PB_13
165 |
166 | #define A0 PA_4 // GNSS VDD Backup
167 | #define A1 PA_5 // Battery Voltage
168 | #define A2 PA_2
169 | #define A3 PA_3
170 | #define A4 PA_0 // BMA400 Interrupt 1
171 |
172 | #define TX2 PA_2 // Console TX
173 | #define RX2 PA_3 // Console RX
174 |
175 | #define TX3 PA_14
176 | #define RX3 PA_13
177 |
178 | #define PIN_VBUS PA_8
179 | #define PIN_VBAT A1
180 | #define PIN_GNSS_ENABLE D5
181 | #define PIN_GNSS_BACKUP A0
182 | #define PIN_GNSS_PPS D4
183 | #define PIN_GNSS_RX PA_10
184 | #define PIN_GNSS_TX PA_9
185 |
186 | #define BMA400_INT1 A4
187 | #define BMA400_INT2 D3
188 |
189 |
190 | #ifdef __cplusplus
191 | }
192 | #endif
193 |
194 | #endif
195 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/TARGET_GRASSHOPPER/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-grasshopper INTERFACE)
5 |
6 | target_include_directories(mbed-grasshopper
7 | INTERFACE
8 | .
9 | )
10 |
11 | target_link_libraries(mbed-grasshopper INTERFACE
12 | mbed-stm32l082xz
13 | mbed-mtb-murata-abz
14 | )
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/TARGET_GRASSHOPPER/PinNames.h:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32L082CZUx.xml
16 | */
17 |
18 | /* MBED TARGET LIST: MTB_MURATA_ABZ */
19 |
20 | #ifndef MBED_PINNAMES_H
21 | #define MBED_PINNAMES_H
22 |
23 | #include "cmsis.h"
24 | #include "PinNamesTypes.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef enum {
31 | ALT0 = 0x100,
32 | } ALTx;
33 |
34 | typedef enum {
35 | PA_0 = 0x00,
36 | PA_1 = 0x01,
37 | PA_2 = 0x02,
38 | PA_2_ALT0 = PA_2 | ALT0, // same pin used for alternate HW
39 | PA_3 = 0x03,
40 | PA_3_ALT0 = PA_3 | ALT0, // same pin used for alternate HW
41 | PA_4 = 0x04,
42 | PA_5 = 0x05,
43 | PA_6 = 0x06,
44 | PA_6_ALT0 = PA_6 | ALT0, // same pin used for alternate HW
45 | PA_7 = 0x07,
46 | PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
47 | PA_8 = 0x08,
48 | PA_9 = 0x09,
49 | PA_10 = 0x0A,
50 | PA_11 = 0x0B,
51 | PA_12 = 0x0C,
52 | PA_13 = 0x0D,
53 | PA_14 = 0x0E,
54 | PA_14_ALT0 = PA_14 | ALT0, // same pin used for alternate HW
55 | PA_15 = 0x0F,
56 | PB_0 = 0x10,
57 | PB_1 = 0x11,
58 | PB_2 = 0x12,
59 | PB_3 = 0x13,
60 | PB_4 = 0x14,
61 | PB_4_ALT0 = PB_4 | ALT0, // same pin used for alternate HW
62 | PB_5 = 0x15,
63 | PB_5_ALT0 = PB_5 | ALT0, // same pin used for alternate HW
64 | PB_6 = 0x16,
65 | PB_7 = 0x17,
66 | PB_8 = 0x18,
67 | PB_9 = 0x19,
68 | PB_10 = 0x1A,
69 | PB_11 = 0x1B,
70 | PB_12 = 0x1C,
71 | PB_13 = 0x1D,
72 | PB_14 = 0x1E,
73 | PB_15 = 0x1F,
74 | PC_0 = 0x20,
75 | PC_1 = 0x21,
76 | PC_2 = 0x22,
77 | PC_13 = 0x2D,
78 | PC_14 = 0x2E,
79 | PC_15 = 0x2F,
80 | PH_0 = 0x70,
81 | PH_1 = 0x71,
82 |
83 | /**** ADC internal channels ****/
84 |
85 | ADC_TEMP = 0xF0, // Internal pin virtual value
86 | ADC_VREF = 0xF1, // Internal pin virtual value
87 | ADC_VBAT = 0xF2, // Internal pin virtual value
88 |
89 | // STDIO for console print
90 | #ifdef MBED_CONF_TARGET_STDIO_UART_TX
91 | CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
92 | #else
93 | CONSOLE_TX = PA_9,
94 | #endif
95 | #ifdef MBED_CONF_TARGET_STDIO_UART_RX
96 | CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
97 | #else
98 | CONSOLE_RX = PA_10,
99 | #endif
100 |
101 |
102 | /**** USB pins ****/
103 | USB_DM = PA_11,
104 | USB_DP = PA_12,
105 |
106 | /**** OSCILLATOR pins ****/
107 | RCC_OSC32_IN = PC_14,
108 | RCC_OSC32_OUT = PC_15,
109 | RCC_OSC_IN = PH_0,
110 | RCC_OSC_OUT = PH_1,
111 |
112 | /**** DEBUG pins ****/
113 | SYS_PVD_IN = PB_7,
114 | SYS_SWCLK = PA_14,
115 | SYS_SWDIO = PA_13,
116 | SYS_VREF_OUT_PB0 = PB_0,
117 | SYS_VREF_OUT_PB1 = PB_1,
118 | SYS_WKUP1 = PA_0,
119 | SYS_WKUP2 = PC_13,
120 |
121 | // Not connected
122 | NC = (int)0xFFFFFFFF
123 | } PinName;
124 |
125 |
126 | // Standardized LED and button names
127 | #define LED1 PB_13 // Red
128 |
129 | // Aliases
130 | #define I2C_SCL PB_8
131 | #define I2C_SDA PB_9
132 |
133 | #define SPI_MOSI PB_15
134 | #define SPI_MISO PB_14
135 | #define SPI_SCK PB_13
136 | #define SPI_CS PB_12
137 |
138 | #define LORA_SPI_MOSI PA_7
139 | #define LORA_SPI_MISO PA_6
140 | #define LORA_SPI_SCLK PB_3
141 | #define LORA_CS PA_15
142 | #define LORA_RESET PC_0
143 | #define LORA_DIO0 PB_4
144 | #define LORA_DIO1 PB_1
145 | #define LORA_DIO2 PB_0
146 | #define LORA_DIO3 PC_13
147 | #define LORA_ANT_RX PA_1
148 | #define LORA_ANT_TX PC_2
149 | #define LORA_ANT_BOOST PC_1
150 | #define LORA_VDD_TXCO PH_1
151 |
152 | #define D0 PA_10
153 | #define D1 PA_9
154 | #define D2 PB_5
155 | #define D3 PB_6
156 | #define D4 PB_7
157 | #define D5 PB_2
158 | #define D8 PA_13
159 | #define D9 PA_14
160 | #define D10 PB_12
161 | #define D11 PB_15
162 | #define D12 PB_14
163 | #define D13 PB_13
164 |
165 | #define A0 PA_4
166 | #define A1 PA_5
167 | #define A2 PA_2
168 | #define A3 PA_3
169 | #define A4 PA_0
170 |
171 | #define TX2 PA_2
172 | #define RX2 PA_3
173 |
174 | #define TX3 PA_14
175 | #define RX3 PA_13
176 |
177 | #ifdef __cplusplus
178 | }
179 | #endif
180 |
181 | #endif
182 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/TARGET_MTB_MURATA_ABZ/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-mtb-murata-abz INTERFACE)
5 |
6 | target_sources(mbed-mtb-murata-abz
7 | INTERFACE
8 | PeripheralPins.c
9 | system_clock.c
10 | )
11 |
12 | target_include_directories(mbed-mtb-murata-abz
13 | INTERFACE
14 | .
15 | )
16 |
17 | target_link_libraries(mbed-mtb-murata-abz INTERFACE mbed-stm32l082xz)
18 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/TARGET_MTB_MURATA_ABZ/PinNames.h:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32L082CZUx.xml
16 | */
17 |
18 | /* MBED TARGET LIST: MTB_MURATA_ABZ */
19 |
20 | #ifndef MBED_PINNAMES_H
21 | #define MBED_PINNAMES_H
22 |
23 | #include "cmsis.h"
24 | #include "PinNamesTypes.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef enum {
31 | ALT0 = 0x100,
32 | } ALTx;
33 |
34 | typedef enum {
35 | PA_0 = 0x00,
36 | PA_1 = 0x01,
37 | PA_2 = 0x02,
38 | PA_2_ALT0 = PA_2 | ALT0, // same pin used for alternate HW
39 | PA_3 = 0x03,
40 | PA_3_ALT0 = PA_3 | ALT0, // same pin used for alternate HW
41 | PA_4 = 0x04,
42 | PA_5 = 0x05,
43 | PA_6 = 0x06,
44 | PA_6_ALT0 = PA_6 | ALT0, // same pin used for alternate HW
45 | PA_7 = 0x07,
46 | PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
47 | PA_8 = 0x08,
48 | PA_9 = 0x09,
49 | PA_10 = 0x0A,
50 | PA_11 = 0x0B,
51 | PA_12 = 0x0C,
52 | PA_13 = 0x0D,
53 | PA_14 = 0x0E,
54 | PA_14_ALT0 = PA_14 | ALT0, // same pin used for alternate HW
55 | PA_15 = 0x0F,
56 | PB_0 = 0x10,
57 | PB_1 = 0x11,
58 | PB_2 = 0x12,
59 | PB_3 = 0x13,
60 | PB_4 = 0x14,
61 | PB_4_ALT0 = PB_4 | ALT0, // same pin used for alternate HW
62 | PB_5 = 0x15,
63 | PB_5_ALT0 = PB_5 | ALT0, // same pin used for alternate HW
64 | PB_6 = 0x16,
65 | PB_7 = 0x17,
66 | PB_8 = 0x18,
67 | PB_9 = 0x19,
68 | PB_10 = 0x1A,
69 | PB_11 = 0x1B,
70 | PB_12 = 0x1C,
71 | PB_13 = 0x1D,
72 | PB_14 = 0x1E,
73 | PB_15 = 0x1F,
74 | PC_0 = 0x20,
75 | PC_1 = 0x21,
76 | PC_2 = 0x22,
77 | PC_13 = 0x2D,
78 | PC_14 = 0x2E,
79 | PC_15 = 0x2F,
80 | PH_0 = 0x70,
81 | PH_1 = 0x71,
82 |
83 | /**** ADC internal channels ****/
84 |
85 | ADC_TEMP = 0xF0, // Internal pin virtual value
86 | ADC_VREF = 0xF1, // Internal pin virtual value
87 | ADC_VBAT = 0xF2, // Internal pin virtual value
88 |
89 | // STDIO for console print
90 | #ifdef MBED_CONF_TARGET_STDIO_UART_TX
91 | CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
92 | #else
93 | CONSOLE_TX = PA_9,
94 | #endif
95 | #ifdef MBED_CONF_TARGET_STDIO_UART_RX
96 | CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
97 | #else
98 | CONSOLE_RX = PA_10,
99 | #endif
100 |
101 |
102 | /**** USB pins ****/
103 | USB_DM = PA_11,
104 | USB_DP = PA_12,
105 |
106 | /**** OSCILLATOR pins ****/
107 | RCC_OSC32_IN = PC_14,
108 | RCC_OSC32_OUT = PC_15,
109 | RCC_OSC_IN = PH_0,
110 | RCC_OSC_OUT = PH_1,
111 |
112 | /**** DEBUG pins ****/
113 | SYS_PVD_IN = PB_7,
114 | SYS_SWCLK = PA_14,
115 | SYS_SWDIO = PA_13,
116 | SYS_VREF_OUT_PB0 = PB_0,
117 | SYS_VREF_OUT_PB1 = PB_1,
118 | SYS_WKUP1 = PA_0,
119 | SYS_WKUP2 = PC_13,
120 |
121 | // Not connected
122 | NC = (int)0xFFFFFFFF
123 | } PinName;
124 |
125 |
126 | // Standardized LED and button names
127 | #define LED1 PA_4 // Red
128 | #define LED2 PA_5 // Blue
129 | #define LED3 PA_0 // Green
130 | #define BUTTON1 PA_3
131 |
132 | // Aliases
133 | #define I2C_SCL PB_8
134 | #define I2C_SDA PB_9
135 |
136 | #define SPI_MOSI PB_15
137 | #define SPI_MISO PB_14
138 | #define SPI_SCK PB_13
139 |
140 | #define SD_CS PB_12
141 |
142 | #define LCD_A0 PB_2
143 | #define LCD_RESET PB_5
144 | #define LCD_NCS PB_6
145 |
146 | #define LORA_SPI_MOSI PA_7
147 | #define LORA_SPI_MISO PA_6
148 | #define LORA_SPI_SCLK PB_3
149 | #define LORA_CS PA_15
150 | #define LORA_RESET PC_0
151 | #define LORA_DIO0 PB_4
152 | #define LORA_DIO1 PB_1
153 | #define LORA_DIO2 PB_0
154 | #define LORA_DIO3 PC_13
155 | #define LORA_ANT_RX PA_1
156 | #define LORA_ANT_TX PC_2
157 | #define LORA_ANT_BOOST PC_1
158 | #define LORA_VDD_TXCO NC
159 |
160 | #define FLASH_NCS PA_8
161 | #define POT PA_2 // ADC2 - input !
162 |
163 | #ifdef __cplusplus
164 | }
165 | #endif
166 |
167 | #endif
168 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L0/TARGET_MTB_MURATA_ABZ/system_clock.c:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * Copyright (c) 2006-2017 ARM Limited
3 | * SPDX-License-Identifier: Apache-2.0
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * This file configures the system clock as follows:
20 | *-----------------------------------------------------------------
21 | * System clock source | internal 16 MHz
22 | *-----------------------------------------------------------------
23 | * SYSCLK(MHz) | 32
24 | * AHBCLK (MHz) | 32
25 | * APB1CLK (MHz) | 32
26 | * USB capable | YES
27 | *-----------------------------------------------------------------
28 | */
29 |
30 | #include "stm32l0xx.h"
31 | #include "mbed_error.h"
32 |
33 | uint8_t SetSysClock_PLL_HSI(void);
34 |
35 |
36 | /**
37 | * @brief Configures the System clock source, PLL Multiplier and Divider factors,
38 | * AHB/APBx prescalers and Flash settings
39 | * @note This function should be called only once the RCC clock configuration
40 | * is reset to the default reset state (done in SystemInit() function).
41 | * @param None
42 | * @retval None
43 | */
44 | void SetSysClock(void)
45 | {
46 | if (SetSysClock_PLL_HSI() == 0) {
47 | {
48 | error("SetSysClock failed\n");
49 | }
50 | }
51 |
52 | /* Output clock on MCO1 pin(PA8) for debugging purpose */
53 | //HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
54 | //HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI48, RCC_MCODIV_1);
55 | }
56 |
57 | /******************************************************************************/
58 | /* PLL (clocked by HSI) used as System clock source */
59 | /******************************************************************************/
60 | uint8_t SetSysClock_PLL_HSI(void)
61 | {
62 | RCC_ClkInitTypeDef RCC_ClkInitStruct;
63 | RCC_OscInitTypeDef RCC_OscInitStruct;
64 | RCC_PeriphCLKInitTypeDef RCC_PeriphClkInit;
65 |
66 | /* The voltage scaling allows optimizing the power consumption when the device is
67 | clocked below the maximum system frequency, to update the voltage scaling value
68 | regarding system frequency refer to product datasheet. */
69 | __PWR_CLK_ENABLE();
70 | __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
71 |
72 | /* Enable HSI and HSI48 oscillators and activate PLL with HSI as source */
73 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48;
74 | RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
75 | RCC_OscInitStruct.HSIState = RCC_HSI_ON;
76 | RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
77 | RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; /* For USB and RNG clock */
78 | // PLLCLK = (16 MHz * 4)/2 = 32 MHz
79 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
80 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
81 | RCC_OscInitStruct.PLL.PLLMUL = RCC_PLLMUL_4;
82 | RCC_OscInitStruct.PLL.PLLDIV = RCC_PLLDIV_2;
83 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
84 | return 0; // FAIL
85 | }
86 |
87 | /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
88 | RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
89 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; // 32 MHz
90 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 32 MHz
91 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; // 32 MHz
92 | RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; // 32 MHz
93 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
94 | return 0; // FAIL
95 | }
96 |
97 | RCC_PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
98 | RCC_PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
99 | if (HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInit) != HAL_OK) {
100 | return 0; // FAIL
101 | }
102 |
103 | /* Output clock on MCO1 pin(PA8) for debugging purpose */
104 | //HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); // 16 MHz
105 |
106 | return 1; // OK
107 | }
108 |
109 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L1/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L4/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_subdirectory(TARGET_STWIN EXCLUDE_FROM_ALL)
5 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L4/TARGET_STWIN/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-stwin INTERFACE)
5 |
6 | target_sources(mbed-stwin
7 | INTERFACE
8 | PeripheralPins.c
9 | )
10 |
11 | target_include_directories(mbed-stwin
12 | INTERFACE
13 | .
14 | )
15 |
16 | target_link_libraries(mbed-stwin INTERFACE mbed-stm32l4r9xi)
17 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L4/TARGET_STWIN/PinNames.h:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32L4R9Z(G-I)Tx.xml
16 | */
17 |
18 | /* MBED TARGET LIST: STWIN */
19 |
20 | #ifndef MBED_PINNAMES_H
21 | #define MBED_PINNAMES_H
22 |
23 | #include "cmsis.h"
24 | #include "PinNamesTypes.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef enum {
31 | ALT0 = 0x100,
32 | ALT1 = 0x200,
33 | ALT2 = 0x300,
34 | } ALTx;
35 |
36 | typedef enum {
37 | PA_0 = 0x00,
38 | PA_1 = 0x01,
39 | PA_1_ALT0 = PA_1 | ALT0, // same pin used for alternate HW
40 | PA_2 = 0x02,
41 | PA_2_ALT0 = PA_2 | ALT0, // same pin used for alternate HW
42 | PA_3 = 0x03,
43 | PA_3_ALT0 = PA_3 | ALT0, // same pin used for alternate HW
44 | PA_4 = 0x04,
45 | PA_4_ALT0 = PA_4 | ALT0, // same pin used for alternate HW
46 | PA_5 = 0x05,
47 | PA_5_ALT0 = PA_5 | ALT0, // same pin used for alternate HW
48 | PA_6 = 0x06,
49 | PA_6_ALT0 = PA_6 | ALT0, // same pin used for alternate HW
50 | PA_7 = 0x07,
51 | PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
52 | PA_7_ALT1 = PA_7 | ALT1, // same pin used for alternate HW
53 | PA_7_ALT2 = PA_7 | ALT2, // same pin used for alternate HW
54 | PA_8 = 0x08,
55 | PA_9 = 0x09,
56 | PA_10 = 0x0A,
57 | PA_11 = 0x0B,
58 | PA_12 = 0x0C,
59 | PA_13 = 0x0D,
60 | PA_14 = 0x0E,
61 | PA_15 = 0x0F,
62 | PA_15_ALT0 = PA_15 | ALT0, // same pin used for alternate HW
63 | PB_0 = 0x10,
64 | PB_0_ALT0 = PB_0 | ALT0, // same pin used for alternate HW
65 | PB_0_ALT1 = PB_0 | ALT1, // same pin used for alternate HW
66 | PB_1 = 0x11,
67 | PB_1_ALT0 = PB_1 | ALT0, // same pin used for alternate HW
68 | PB_1_ALT1 = PB_1 | ALT1, // same pin used for alternate HW
69 | PB_2 = 0x12,
70 | PB_3 = 0x13,
71 | PB_3_ALT0 = PB_3 | ALT0, // same pin used for alternate HW
72 | PB_4 = 0x14,
73 | PB_4_ALT0 = PB_4 | ALT0, // same pin used for alternate HW
74 | PB_5 = 0x15,
75 | PB_5_ALT0 = PB_5 | ALT0, // same pin used for alternate HW
76 | PB_6 = 0x16,
77 | PB_6_ALT0 = PB_6 | ALT0, // same pin used for alternate HW
78 | PB_7 = 0x17,
79 | PB_7_ALT0 = PB_7 | ALT0, // same pin used for alternate HW
80 | PB_8 = 0x18,
81 | PB_8_ALT0 = PB_8 | ALT0, // same pin used for alternate HW
82 | PB_9 = 0x19,
83 | PB_9_ALT0 = PB_9 | ALT0, // same pin used for alternate HW
84 | PB_10 = 0x1A,
85 | PB_10_ALT0 = PB_10 | ALT0, // same pin used for alternate HW
86 | PB_11 = 0x1B,
87 | PB_11_ALT0 = PB_11 | ALT0, // same pin used for alternate HW
88 | PB_12 = 0x1C,
89 | PB_13 = 0x1D,
90 | PB_13_ALT0 = PB_13 | ALT0, // same pin used for alternate HW
91 | PB_14 = 0x1E,
92 | PB_14_ALT0 = PB_14 | ALT0, // same pin used for alternate HW
93 | PB_14_ALT1 = PB_14 | ALT1, // same pin used for alternate HW
94 | PB_15 = 0x1F,
95 | PB_15_ALT0 = PB_15 | ALT0, // same pin used for alternate HW
96 | PB_15_ALT1 = PB_15 | ALT1, // same pin used for alternate HW
97 | PC_0 = 0x20,
98 | PC_1 = 0x21,
99 | PC_2 = 0x22,
100 | PC_3 = 0x23,
101 | PC_4 = 0x24,
102 | PC_5 = 0x25,
103 | PC_6 = 0x26,
104 | PC_6_ALT0 = PC_6 | ALT0, // same pin used for alternate HW
105 | PC_7 = 0x27,
106 | PC_7_ALT0 = PC_7 | ALT0, // same pin used for alternate HW
107 | PC_8 = 0x28,
108 | PC_8_ALT0 = PC_8 | ALT0, // same pin used for alternate HW
109 | PC_9 = 0x29,
110 | PC_9_ALT0 = PC_9 | ALT0, // same pin used for alternate HW
111 | PC_10 = 0x2A,
112 | PC_10_ALT0 = PC_10 | ALT0, // same pin used for alternate HW
113 | PC_11 = 0x2B,
114 | PC_11_ALT0 = PC_11 | ALT0, // same pin used for alternate HW
115 | PC_12 = 0x2C,
116 | PC_13 = 0x2D,
117 | PC_14 = 0x2E,
118 | PC_15 = 0x2F,
119 | PD_0 = 0x30,
120 | PD_1 = 0x31,
121 | PD_2 = 0x32,
122 | PD_3 = 0x33,
123 | PD_4 = 0x34,
124 | PD_5 = 0x35,
125 | PD_6 = 0x36,
126 | PD_7 = 0x37,
127 | PD_8 = 0x38,
128 | PD_9 = 0x39,
129 | PD_10 = 0x3A,
130 | PD_11 = 0x3B,
131 | PD_12 = 0x3C,
132 | PD_13 = 0x3D,
133 | PD_14 = 0x3E,
134 | PD_15 = 0x3F,
135 | PE_0 = 0x40,
136 | PE_1 = 0x41,
137 | PE_2 = 0x42,
138 | PE_3 = 0x43,
139 | PE_4 = 0x44,
140 | PE_5 = 0x45,
141 | PE_6 = 0x46,
142 | PE_7 = 0x47,
143 | PE_8 = 0x48,
144 | PE_9 = 0x49,
145 | PE_10 = 0x4A,
146 | PE_11 = 0x4B,
147 | PE_12 = 0x4C,
148 | PE_13 = 0x4D,
149 | PE_14 = 0x4E,
150 | PE_15 = 0x4F,
151 | PF_0 = 0x50,
152 | PF_1 = 0x51,
153 | PF_2 = 0x52,
154 | PF_3 = 0x53,
155 | PF_4 = 0x54,
156 | PF_5 = 0x55,
157 | PF_6 = 0x56,
158 | PF_7 = 0x57,
159 | PF_10 = 0x5A,
160 | PF_11 = 0x5B,
161 | PF_12 = 0x5C,
162 | PF_13 = 0x5D,
163 | PF_14 = 0x5E,
164 | PF_15 = 0x5F,
165 | PG_0 = 0x60,
166 | PG_1 = 0x61,
167 | PG_2 = 0x62,
168 | PG_3 = 0x63,
169 | PG_4 = 0x64,
170 | PG_5 = 0x65,
171 | PG_6 = 0x66,
172 | PG_7 = 0x67,
173 | PG_8 = 0x68,
174 | PG_9 = 0x69,
175 | PG_10 = 0x6A,
176 | PG_11 = 0x6B,
177 | PG_12 = 0x6C,
178 | PG_15 = 0x6F,
179 | PH_0 = 0x70,
180 | PH_1 = 0x71,
181 | PH_3 = 0x73,
182 |
183 | /**** ADC internal channels ****/
184 |
185 | ADC_TEMP = 0xF0, // Internal pin virtual value
186 | ADC_VREF = 0xF1, // Internal pin virtual value
187 | ADC_VBAT = 0xF2, // Internal pin virtual value
188 |
189 |
190 | // STDIO for console print
191 | #ifdef MBED_CONF_TARGET_STDIO_UART_TX
192 | CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
193 | #else
194 | CONSOLE_TX = PD_5,
195 | #endif
196 | #ifdef MBED_CONF_TARGET_STDIO_UART_RX
197 | CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
198 | #else
199 | CONSOLE_RX = PD_6,
200 | #endif
201 |
202 | /**** USB FS pins ****/
203 | USB_OTG_FS_DM = PA_11,
204 | USB_OTG_FS_DP = PA_12,
205 | USB_OTG_FS_ID = PA_10,
206 | USB_OTG_FS_NOE = PA_13,
207 | USB_OTG_FS_NOE_ALT0 = PC_9,
208 | USB_OTG_FS_SOF = PA_8,
209 | USB_OTG_FS_SOF_ALT0 = PA_14,
210 | USB_OTG_FS_VBUS = PA_9,
211 |
212 | /**** OSCILLATOR pins ****/
213 | RCC_OSC32_IN = PC_14,
214 | RCC_OSC32_OUT = PC_15,
215 | RCC_OSC_IN = PH_0,
216 | RCC_OSC_OUT = PH_1,
217 |
218 | /**** DEBUG pins ****/
219 | SYS_JTCK_SWCLK = PA_14,
220 | SYS_JTDI = PA_15,
221 | SYS_JTDO_SWO = PB_3,
222 | SYS_JTMS_SWDIO = PA_13,
223 | SYS_JTRST = PB_4,
224 | SYS_PVD_IN = PB_7,
225 | SYS_TRACECLK = PE_2,
226 | SYS_TRACED0 = PE_3,
227 | SYS_TRACED0_ALT0 = PC_1,
228 | SYS_TRACED0_ALT1 = PC_9,
229 | SYS_TRACED1 = PE_4,
230 | SYS_TRACED1_ALT0 = PC_10,
231 | SYS_TRACED2 = PE_5,
232 | SYS_TRACED2_ALT0 = PD_2,
233 | SYS_TRACED3 = PE_6,
234 | SYS_TRACED3_ALT0 = PC_12,
235 | SYS_WKUP1 = PA_0,
236 | SYS_WKUP2 = PC_13,
237 | SYS_WKUP3 = PE_6,
238 | SYS_WKUP4 = PA_2,
239 |
240 | /**** STMOD+ pins ****/
241 | STMOD_1 = PB_13,
242 | STMOD_2 = PD_8, // PC_3
243 | STMOD_3 = PD_9, // PD_3
244 | STMOD_4 = PD_1, // PB_1
245 | // STMOD_5 is connected to GND
246 | // STMOD_6 is connected to +5V
247 | STMOD_7 = PD_12, // I2C4_SCL
248 | STMOD_8 = PB_15, // SPI2_MOSI_p2
249 | STMOD_9 = PC_2, // SPI2_MISO_p2
250 | STMOD_10 = PD_13, // I2C4_SDA
251 | STMOD_11 = PC_5,
252 | STMOD_12 = PD_11, // EX_RESET
253 | STMOD_13 = PA_5, // EX_ADC
254 | STMOD_14 = PA_15, // EX_PWM
255 | // STMOD_15 is connected to +5V
256 | // STMOD_16 is connected to GND
257 | STMOD_17 = PB_14,
258 | STMOD_18 = PG_9,
259 | STMOD_19 = PG_10,
260 | STMOD_20 = PG_12,
261 |
262 | // Not connected
263 | NC = (int)0xFFFFFFFF
264 | } PinName;
265 |
266 | // Standardized LED and button names
267 | #define LED1 PE_1 // green
268 | #define LED2 PD_0 // orange
269 | #define BUTTON1 PE_0
270 |
271 | #ifdef __cplusplus
272 | }
273 | #endif
274 |
275 | #endif
276 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32L5/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32U5/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2021 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WB/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_subdirectory(TARGET_LORA_E5 EXCLUDE_FROM_ALL)
5 | add_subdirectory(TARGET_LORA_E5_BREAKOUT EXCLUDE_FROM_ALL)
6 | add_subdirectory(TARGET_LORA_E5_MINI EXCLUDE_FROM_ALL)
7 | add_subdirectory(TARGET_LORA_E5_DEV_BOARD EXCLUDE_FROM_ALL)
8 | add_subdirectory(TARGET_LORA_E5_TINY EXCLUDE_FROM_ALL)
9 | add_subdirectory(TARGET_RAK3172 EXCLUDE_FROM_ALL)
10 | add_subdirectory(TARGET_RAK3172_BREAKOUT EXCLUDE_FROM_ALL)
11 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_LORA_E5/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-lora-e5 INTERFACE)
5 |
6 | target_sources(mbed-lora-e5
7 | INTERFACE
8 | PeripheralPins.c
9 | LORA_E5_radio_driver.cpp
10 | )
11 |
12 | target_include_directories(mbed-lora-e5
13 | INTERFACE
14 | .
15 | )
16 |
17 | target_link_libraries(mbed-lora-e5 INTERFACE
18 | mbed-stm32wle5xc
19 | mbed-lorawan
20 | )
21 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_LORA_E5/LORA_E5_radio_driver.cpp:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | */
15 |
16 | #include "STM32WL_radio_driver.h"
17 | #include "drivers/DigitalOut.h"
18 |
19 |
20 | /* Sets up radio switch position according to the radio mode */
21 | /* This configuration is for LORA-E5 */
22 | void set_antenna_switch(RBI_Switch_TypeDef state)
23 | {
24 |
25 | // Radio specific controls (TX/RX duplexer switch control)
26 | mbed::DigitalOut _rf_switch_ctrl1(PA_4);
27 | mbed::DigitalOut _rf_switch_ctrl2(PA_5);
28 |
29 | switch (state) {
30 | case RBI_SWITCH_OFF: {
31 | /* Turn off switch */
32 | _rf_switch_ctrl1 = 0;
33 | _rf_switch_ctrl2 = 0;
34 | break;
35 | }
36 | case RBI_SWITCH_RX: {
37 | /*Turns On in Rx Mode the RF Switch */
38 | _rf_switch_ctrl1 = 1;
39 | _rf_switch_ctrl2 = 0;
40 | break;
41 | }
42 | case RBI_SWITCH_RFO_LP: {
43 | /* This mode does not exists on this target */
44 | /* so configure as HP only */
45 | /*Turns On in Tx High Power the RF Switch */
46 | _rf_switch_ctrl1 = 0;
47 | _rf_switch_ctrl2 = 1;
48 | break;
49 | }
50 | case RBI_SWITCH_RFO_HP: {
51 | /*Turns On in Tx High Power the RF Switch */
52 | _rf_switch_ctrl1 = 0;
53 | _rf_switch_ctrl2 = 1;
54 | break;
55 | }
56 | default:
57 | break;
58 | }
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_LORA_E5/PinNames.h:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32WLE5JCIx.xml
16 | */
17 |
18 | /* MBED TARGET LIST: LORA_E5, LORA_E5_BREAKOUT, LORA_E5_MINI, LORA_E5_DEV_BOARD, LORA_E5_TINY */
19 |
20 | #ifndef MBED_PINNAMES_H
21 | #define MBED_PINNAMES_H
22 |
23 | #include "cmsis.h"
24 | #include "PinNamesTypes.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef enum {
31 | ALT0 = 0x100,
32 | } ALTx;
33 |
34 | typedef enum {
35 | PA_0 = 0x00,
36 | PA_1 = 0x01,
37 | PA_1_ALT0 = PA_1 | ALT0, // same pin used for alternate HW
38 | PA_2 = 0x02,
39 | PA_2_ALT0 = PA_2 | ALT0, // same pin used for alternate HW
40 | PA_3 = 0x03,
41 | PA_3_ALT0 = PA_3 | ALT0, // same pin used for alternate HW
42 | PA_4 = 0x04,
43 | PA_5 = 0x05,
44 | PA_6 = 0x06,
45 | PA_7 = 0x07,
46 | PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
47 | PA_8 = 0x08,
48 | PA_9 = 0x09,
49 | PA_10 = 0x0A,
50 | PA_11 = 0x0B,
51 | PA_12 = 0x0C,
52 | PA_13 = 0x0D,
53 | PA_14 = 0x0E,
54 | PA_15 = 0x0F,
55 | PB_0 = 0x10,
56 | PB_1 = 0x11,
57 | PB_2 = 0x12,
58 | PB_3 = 0x13,
59 | PB_4 = 0x14,
60 | PB_5 = 0x15,
61 | PB_6 = 0x16,
62 | PB_7 = 0x17,
63 | PB_8 = 0x18,
64 | PB_8_ALT0 = PB_8 | ALT0, // same pin used for alternate HW
65 | PB_9 = 0x19,
66 | PB_9_ALT0 = PB_9 | ALT0, // same pin used for alternate HW
67 | PB_10 = 0x1A,
68 | PB_11 = 0x1B,
69 | PB_12 = 0x1C,
70 | PB_13 = 0x1D,
71 | PB_14 = 0x1E,
72 | PB_15 = 0x1F,
73 | PC_0 = 0x20,
74 | PC_1 = 0x21,
75 | PC_2 = 0x22,
76 | PC_3 = 0x23,
77 | PC_4 = 0x24,
78 | PC_5 = 0x25,
79 | PC_6 = 0x26,
80 | PC_13 = 0x2D,
81 | PC_14 = 0x2E,
82 | PC_15 = 0x2F,
83 | PH_3 = 0x73,
84 |
85 | /**** ADC internal channels ****/
86 |
87 | ADC_TEMP = 0xF0, // Internal pin virtual value
88 | ADC_VREF = 0xF1, // Internal pin virtual value
89 | ADC_VBAT = 0xF2, // Internal pin virtual value
90 |
91 | // STDIO for console print
92 | #ifdef MBED_CONF_TARGET_STDIO_UART_TX
93 | CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
94 | #else
95 | CONSOLE_TX = PB_6,
96 | #endif
97 | #ifdef MBED_CONF_TARGET_STDIO_UART_RX
98 | CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
99 | #else
100 | CONSOLE_RX = PB_7,
101 | #endif
102 |
103 | /**** OSCILLATOR pins ****/
104 | RCC_OSC32_IN = PC_14,
105 | RCC_OSC32_OUT = PC_15,
106 |
107 | /**** DEBUG pins ****/
108 | DEBUG_JTCK_SWCLK = PA_14,
109 | DEBUG_JTDI = PA_15,
110 | DEBUG_JTDO_SWO = PB_3,
111 | DEBUG_JTMS_SWDIO = PA_13,
112 | DEBUG_JTRST = PB_4,
113 | DEBUG_PWR_LDORDY = PA_2,
114 | DEBUG_PWR_REGLP1S = PA_0,
115 | DEBUG_PWR_REGLP2S = PA_1,
116 | DEBUG_RF_BUSY = PA_12,
117 | DEBUG_RF_DTB1 = PB_3,
118 | DEBUG_RF_HSE32RDY = PA_10,
119 | DEBUG_RF_LDORDY = PB_4,
120 | DEBUG_RF_NRESET = PA_11,
121 | DEBUG_RF_SMPSRDY = PB_2,
122 | DEBUG_SUBGHZSPI_MISOOUT = PA_6,
123 | DEBUG_SUBGHZSPI_MOSIOUT = PA_7,
124 | DEBUG_SUBGHZSPI_NSSOUT = PA_4,
125 | DEBUG_SUBGHZSPI_SCKOUT = PA_5,
126 | PWR_PVD_IN = PB_7,
127 | SYS_PWR_WKUP1 = PA_0,
128 | SYS_PWR_WKUP2 = PC_13,
129 | SYS_PWR_WKUP3 = PB_3,
130 |
131 | // Not connected
132 | NC = (int)0xFFFFFFFF
133 | } PinName;
134 |
135 | // Legacy I2C aliases
136 | #define I2C_SDA PA_15
137 | #define I2C_SCL PB_15
138 | // Legacy SPI aliases
139 | #define SPI_CS PB_9
140 | #define SPI_MOSI PA_10
141 | #define SPI_MISO PB_14
142 | #define SPI_SCK PB_13
143 |
144 | #ifdef __cplusplus
145 | }
146 | #endif
147 |
148 | #endif
149 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_LORA_E5_BREAKOUT/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-lora-e5-breakout INTERFACE)
5 |
6 | target_include_directories(mbed-lora-e5-breakout
7 | INTERFACE
8 | .
9 | )
10 |
11 | target_link_libraries(mbed-lora-e5-breakout INTERFACE
12 | mbed-stm32wle5xc
13 | mbed-lora-e5
14 | )
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_LORA_E5_DEV_BOARD/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-lora-e5-dev-board INTERFACE)
5 |
6 | target_include_directories(mbed-lora-e5-dev-board
7 | INTERFACE
8 | .
9 | )
10 |
11 | target_link_libraries(mbed-lora-e5-dev-board INTERFACE
12 | mbed-stm32wle5xc
13 | mbed-lora-e5
14 | )
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_LORA_E5_MINI/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-lora-e5-mini INTERFACE)
5 |
6 | target_include_directories(mbed-lora-e5-mini
7 | INTERFACE
8 | .
9 | )
10 |
11 | target_link_libraries(mbed-lora-e5-mini INTERFACE
12 | mbed-stm32wle5xc
13 | mbed-lora-e5
14 | )
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_LORA_E5_TINY/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-lora-e5-tiny INTERFACE)
5 |
6 | target_include_directories(mbed-lora-e5-tiny
7 | INTERFACE
8 | .
9 | )
10 |
11 | target_link_libraries(mbed-lora-e5-tiny INTERFACE
12 | mbed-stm32wle5xc
13 | mbed-lora-e5
14 | )
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_RAK3172/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-rak3172 INTERFACE)
5 |
6 | target_sources(mbed-rak3172
7 | INTERFACE
8 | PeripheralPins.c
9 | RAK3172_radio_driver.cpp
10 | )
11 |
12 | target_include_directories(mbed-rak3172
13 | INTERFACE
14 | .
15 | )
16 |
17 | target_link_libraries(mbed-rak3172 INTERFACE
18 | mbed-stm32wle5xc
19 | mbed-lorawan
20 | )
21 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_RAK3172/PeripheralPins.c:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32WLE5CCUx.xml
16 | */
17 |
18 | #include "PeripheralPins.h"
19 | #include "mbed_toolchain.h"
20 |
21 | //==============================================================================
22 | // Notes
23 | //
24 | // - The pins mentioned Px_y_ALTz are alternative possibilities which use other
25 | // HW peripheral instances. You can use them the same way as any other "normal"
26 | // pin (i.e. PwmOut pwm(PA_7_ALT0);). These pins are not displayed on the board
27 | // pinout image on mbed.org.
28 | //
29 | // - The pins which are connected to other components present on the board have
30 | // the comment "Connected to xxx". The pin function may not work properly in this
31 | // case. These pins may not be displayed on the board pinout image on mbed.org.
32 | // Please read the board reference manual and schematic for more information.
33 | //
34 | // - Warning: pins connected to the default STDIO_UART_TX and STDIO_UART_RX pins are commented
35 | // See https://os.mbed.com/teams/ST/wiki/STDIO for more information.
36 | //
37 | //==============================================================================
38 |
39 |
40 | //*** ADC ***
41 |
42 | MBED_WEAK const PinMap PinMap_ADC[] = {
43 | {PA_10, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6
44 | {PA_11, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7
45 | {PA_12, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8
46 | {PA_13, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9
47 | {PA_14, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC_IN10
48 | {PA_15, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC_IN11
49 | {PB_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4
50 | {PB_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2
51 | {PB_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3
52 | {NC, NC, 0}
53 | };
54 |
55 | MBED_WEAK const PinMap PinMap_ADC_Internal[] = {
56 | {ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)},
57 | {ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)},
58 | {ADC_VBAT, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)},
59 | {NC, NC, 0}
60 | };
61 |
62 | //*** DAC ***
63 |
64 | MBED_WEAK const PinMap PinMap_DAC[] = {
65 | {PA_10, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
66 | {NC, NC, 0}
67 | };
68 |
69 | //*** I2C ***
70 |
71 | MBED_WEAK const PinMap PinMap_I2C_SDA[] = {
72 | {PA_10, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
73 | {PA_11, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
74 | {PA_15, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
75 | {PB_4, I2C_3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
76 | {PB_7, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
77 | {NC, NC, 0}
78 | };
79 |
80 | MBED_WEAK const PinMap PinMap_I2C_SCL[] = {
81 | {PA_7, I2C_3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
82 | {PA_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
83 | {PA_12, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
84 | {PB_6, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
85 | {PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
86 | {NC, NC, 0}
87 | };
88 |
89 | //*** PWM ***
90 |
91 | // TIM2 cannot be used because already used by the us_ticker
92 | // (update us_ticker_data.h file if another timer is chosen)
93 | MBED_WEAK const PinMap PinMap_PWM[] = {
94 | // {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
95 | // {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
96 | // {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
97 | // {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
98 | // {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
99 | {PA_6, PWM_16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1
100 | {PA_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
101 | {PA_7_ALT0, PWM_17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_TIM17, 1, 0)}, // TIM17_CH1
102 | {PA_8, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
103 | {PA_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
104 | {PA_10, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
105 | {PA_11, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
106 | // {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
107 | // {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
108 | {PB_6, PWM_16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_TIM16, 1, 1)}, // TIM16_CH1N
109 | {PB_7, PWM_17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_TIM17, 1, 1)}, // TIM17_CH1N
110 | {PB_8, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
111 | {PB_8_ALT0, PWM_16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1
112 | {NC, NC, 0}
113 | };
114 |
115 | //*** SERIAL ***
116 |
117 | MBED_WEAK const PinMap PinMap_UART_TX[] = {
118 | {PA_2, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
119 | {PA_2_ALT0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
120 | {PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
121 | {PB_6, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
122 | {NC, NC, 0}
123 | };
124 |
125 | MBED_WEAK const PinMap PinMap_UART_RX[] = {
126 | {PA_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
127 | {PA_3_ALT0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
128 | {PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
129 | {PB_7, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
130 | {NC, NC, 0}
131 | };
132 |
133 | MBED_WEAK const PinMap PinMap_UART_RTS[] = {
134 | {PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
135 | {PA_1_ALT0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
136 | {PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
137 | {PB_3, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
138 | {PB_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
139 | {NC, NC, 0}
140 | };
141 |
142 | MBED_WEAK const PinMap PinMap_UART_CTS[] = {
143 | {PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
144 | {PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
145 | {PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
146 | {PB_4, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
147 | {NC, NC, 0}
148 | };
149 |
150 | //*** SPI ***
151 |
152 | MBED_WEAK const PinMap PinMap_SPI_MOSI[] = {
153 | {PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
154 | {PA_10, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)},
155 | {PA_12, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
156 | {PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
157 | {NC, NC, 0}
158 | };
159 |
160 | MBED_WEAK const PinMap PinMap_SPI_MISO[] = {
161 | {PA_5, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF3_SPI2)},
162 | {PA_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
163 | {PA_11, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
164 | {PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
165 | {NC, NC, 0}
166 | };
167 |
168 | MBED_WEAK const PinMap PinMap_SPI_SCLK[] = {
169 | {PA_1, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
170 | {PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
171 | {PA_8, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)},
172 | {PA_9, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)},
173 | {PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
174 | {NC, NC, 0}
175 | };
176 |
177 | MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
178 | {PA_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
179 | {PA_9, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF3_SPI2)},
180 | {PA_15, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
181 | {PB_2, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
182 | {PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)},
183 | {NC, NC, 0}
184 | };
185 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_RAK3172/PinNames.h:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2016-2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | *
15 | * Automatically generated from STM32CubeMX/db/mcu/STM32WLE5CCUx.xml
16 | */
17 |
18 | /* MBED TARGET LIST: RAK3172, RAK3172_BREAKOUT */
19 |
20 | #ifndef MBED_PINNAMES_H
21 | #define MBED_PINNAMES_H
22 |
23 | #include "cmsis.h"
24 | #include "PinNamesTypes.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | typedef enum {
31 | ALT0 = 0x100,
32 | } ALTx;
33 |
34 | typedef enum {
35 | PA_0 = 0x00,
36 | PA_1 = 0x01,
37 | PA_1_ALT0 = PA_1 | ALT0, // same pin used for alternate HW
38 | PA_2 = 0x02,
39 | PA_2_ALT0 = PA_2 | ALT0, // same pin used for alternate HW
40 | PA_3 = 0x03,
41 | PA_3_ALT0 = PA_3 | ALT0, // same pin used for alternate HW
42 | PA_4 = 0x04,
43 | PA_5 = 0x05,
44 | PA_6 = 0x06,
45 | PA_7 = 0x07,
46 | PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
47 | PA_8 = 0x08,
48 | PA_9 = 0x09,
49 | PA_10 = 0x0A,
50 | PA_11 = 0x0B,
51 | PA_12 = 0x0C,
52 | PA_13 = 0x0D,
53 | PA_14 = 0x0E,
54 | PA_15 = 0x0F,
55 | PB_0 = 0x10,
56 | PB_2 = 0x12,
57 | PB_3 = 0x13,
58 | PB_4 = 0x14,
59 | PB_5 = 0x15,
60 | PB_6 = 0x16,
61 | PB_7 = 0x17,
62 | PB_8 = 0x18,
63 | PB_8_ALT0 = PB_8 | ALT0, // same pin used for alternate HW
64 | PB_12 = 0x1C,
65 | PC_13 = 0x2D,
66 | PC_14 = 0x2E,
67 | PC_15 = 0x2F,
68 | PH_3 = 0x73,
69 |
70 | /**** ADC internal channels ****/
71 |
72 | ADC_TEMP = 0xF0, // Internal pin virtual value
73 | ADC_VREF = 0xF1, // Internal pin virtual value
74 | ADC_VBAT = 0xF2, // Internal pin virtual value
75 |
76 | // STDIO for console print
77 | #ifdef MBED_CONF_TARGET_STDIO_UART_TX
78 | CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
79 | #else
80 | CONSOLE_TX = PA_2,
81 | #endif
82 | #ifdef MBED_CONF_TARGET_STDIO_UART_RX
83 | CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
84 | #else
85 | CONSOLE_RX = PA_3,
86 | #endif
87 |
88 | /**** OSCILLATOR pins ****/
89 | RCC_OSC32_IN = PC_14,
90 | RCC_OSC32_OUT = PC_15,
91 |
92 | /**** DEBUG pins ****/
93 | DEBUG_JTCK_SWCLK = PA_14,
94 | DEBUG_JTDI = PA_15,
95 | DEBUG_JTDO_SWO = PB_3,
96 | DEBUG_JTMS_SWDIO = PA_13,
97 | DEBUG_JTRST = PB_4,
98 | DEBUG_PWR_LDORDY = PA_2,
99 | DEBUG_PWR_REGLP1S = PA_0,
100 | DEBUG_PWR_REGLP2S = PA_1,
101 | DEBUG_RF_BUSY = PA_12,
102 | DEBUG_RF_DTB1 = PB_3,
103 | DEBUG_RF_HSE32RDY = PA_10,
104 | DEBUG_RF_LDORDY = PB_4,
105 | DEBUG_RF_NRESET = PA_11,
106 | DEBUG_RF_SMPSRDY = PB_2,
107 | DEBUG_SUBGHZSPI_MISOOUT = PA_6,
108 | DEBUG_SUBGHZSPI_MOSIOUT = PA_7,
109 | DEBUG_SUBGHZSPI_NSSOUT = PA_4,
110 | DEBUG_SUBGHZSPI_SCKOUT = PA_5,
111 | PWR_PVD_IN = PB_7,
112 | SYS_PWR_WKUP1 = PA_0,
113 | SYS_PWR_WKUP2 = PC_13,
114 | SYS_PWR_WKUP3 = PB_3,
115 |
116 | // Not connected
117 | NC = (int)0xFFFFFFFF
118 | } PinName;
119 |
120 | // Legacy I2C aliases
121 | #define I2C_SDA PA_11
122 | #define I2C_SCL PA_12
123 | // Legacy SPI aliases
124 | #define SPI_CS PA_4
125 | #define SPI_MOSI PA_7
126 | #define SPI_MISO PA_6
127 | #define SPI_SCK PA_5
128 |
129 | #ifdef __cplusplus
130 | }
131 | #endif
132 |
133 | #endif
134 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_RAK3172/RAK3172_radio_driver.cpp:
--------------------------------------------------------------------------------
1 | /* mbed Microcontroller Library
2 | * SPDX-License-Identifier: BSD-3-Clause
3 | ******************************************************************************
4 | *
5 | * Copyright (c) 2021 STMicroelectronics.
6 | * All rights reserved.
7 | *
8 | * This software component is licensed by ST under BSD 3-Clause license,
9 | * the "License"; You may not use this file except in compliance with the
10 | * License. You may obtain a copy of the License at:
11 | * opensource.org/licenses/BSD-3-Clause
12 | *
13 | ******************************************************************************
14 | */
15 |
16 | #include "STM32WL_radio_driver.h"
17 | #include "drivers/DigitalOut.h"
18 |
19 |
20 | /* Sets up radio switch position according to the radio mode */
21 | /* This configuration is for RAK3172 */
22 | void set_antenna_switch(RBI_Switch_TypeDef state)
23 | {
24 | // Radio specific controls (TX/RX duplexer switch control)
25 | mbed::DigitalOut _rf_switch_ctrl1(PB_8);
26 | mbed::DigitalOut _rf_switch_ctrl2(PC_13);
27 |
28 | switch (state) {
29 | case RBI_SWITCH_OFF: {
30 | /* Turn off switch */
31 | _rf_switch_ctrl1 = 0;
32 | _rf_switch_ctrl2 = 0;
33 | break;
34 | }
35 | case RBI_SWITCH_RX: {
36 | /*Turns On in Rx Mode the RF Switch */
37 | _rf_switch_ctrl1 = 1;
38 | _rf_switch_ctrl2 = 0;
39 | break;
40 | }
41 | case RBI_SWITCH_RFO_LP: {
42 | /* This mode does not exists on this target */
43 | /* so configure as HP only */
44 | /*Turns On in Tx High Power the RF Switch */
45 | _rf_switch_ctrl1 = 0;
46 | _rf_switch_ctrl2 = 1;
47 | break;
48 | }
49 | case RBI_SWITCH_RFO_HP: {
50 | /*Turns On in Tx High Power the RF Switch */
51 | _rf_switch_ctrl1 = 0;
52 | _rf_switch_ctrl2 = 1;
53 | break;
54 | }
55 | default:
56 | break;
57 | }
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/TARGET_STM32WL/TARGET_RAK3172_BREAKOUT/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2020 ARM Limited. All rights reserved.
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | add_library(mbed-rak3172-breakout INTERFACE)
5 |
6 | target_include_directories(mbed-rak3172-breakout
7 | INTERFACE
8 | .
9 | )
10 |
11 | target_link_libraries(mbed-rak3172-breakout INTERFACE
12 | mbed-stm32wle5xc
13 | mbed-rak3172
14 | )
15 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/aci_build.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | """
4 | Copyright (c) 2021 STMicroelectronics. All rights reserved.
5 |
6 | SPDX-License-Identifier: Apache-2.0
7 |
8 | Licensed under the Apache License, Version 2.0 (the "License");
9 | you may not use this file except in compliance with the License.
10 | You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing, software
15 | distributed under the License is distributed on an "AS IS" BASIS,
16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | See the License for the specific language governing permissions and
18 | limitations under the License.
19 | """
20 |
21 | from argparse import ArgumentParser
22 | import sys
23 | import os
24 | import json
25 | import subprocess
26 | import re
27 |
28 | import aci_pinvalidate
29 |
30 | custom_targets_file = open("custom_targets.json", "r")
31 | custom_targets_info = json.load(custom_targets_file)
32 | custom_targets_file.close()
33 |
34 | print("")
35 | BuildType = "PATCH"
36 | Arguments = ArgumentParser(description="Quick script for build check")
37 | Arguments.add_argument("--toolchain", "-tc", help="ARM | GCC_ARM | IAR . Default is GCC_ARM")
38 | Arguments.add_argument("--targets", "-t", help="Specific target. Default is patched targets compared to master branch")
39 | Arguments.add_argument("--all", "-a", action="store_true", help="Build all targets. Default is patched targets compared to master branch")
40 | Arguments.add_argument("--baremetal", "-b", action="store_true", help="Build with baremetal profile")
41 | Arguments.add_argument("--cli2", "-c", action="store_true", help="Build with cmake (CLI2). Default is CLI1")
42 | Arguments.add_argument("--pin", "-p", action="store_true", help="Check pin name standart")
43 | Arguments.add_argument("--exit", "-e", action="store_true", help="Stop after 1st build failure")
44 | Arguments.add_argument("--paths", help="don't use it")
45 | Arguments.add_argument("--verbose", action="count", default=3, help="don't use it")
46 | args = Arguments.parse_args()
47 |
48 | if args.toolchain:
49 | requested_toolchain = args.toolchain
50 | else:
51 | requested_toolchain = "GCC_ARM"
52 |
53 | if args.cli2:
54 | mbed_tool = "mbedtools"
55 | else:
56 | mbed_tool = "mbed"
57 |
58 | if args.baremetal:
59 | mbed_lib = "mbed-baremetal"
60 | else:
61 | mbed_lib = "mbed-os"
62 |
63 | # TargetList is the copy of custom_targets.json
64 | # then skipped targets will be repoved from custom_targets_info
65 | TargetList = [*custom_targets_info]
66 |
67 | if args.targets:
68 | BuildType = "TARGET"
69 | print ("Explicit target is requested: %s" % args.targets)
70 | if args.targets not in TargetList:
71 | print("\tERROR => not part of custom_targets.json")
72 | sys.exit(1)
73 | for EachTarget in TargetList:
74 | if EachTarget == args.targets:
75 | pass
76 | else:
77 | print ("\t%s is skipped" % EachTarget)
78 | del custom_targets_info[EachTarget]
79 |
80 | if args.all:
81 | BuildType = "FULL"
82 |
83 | if BuildType == "PATCH":
84 | PatchedTargets = []
85 | PinNamesList = []
86 | print("git", "diff", "--name-only", "origin/master")
87 | try:
88 | CONSOLE = subprocess.check_output(["git", "diff", "--name-only", "origin/master"], stderr=subprocess.STDOUT).decode('ascii')
89 | CONSOLE = CONSOLE.splitlines()
90 |
91 | for EachPatchedFile in CONSOLE:
92 | print("patched file: %s" % EachPatchedFile)
93 | if args.pin:
94 | if "PinNames.h" in EachPatchedFile:
95 | PinNamesList.append(EachPatchedFile)
96 | else:
97 | TARGET_match = re.match(r"TARGET_STM32.*/TARGET_(.*)/", EachPatchedFile)
98 | if TARGET_match:
99 | if TARGET_match.group(1) not in PatchedTargets:
100 | TargetToBuild = TARGET_match.group(1)
101 | PatchedTargets.append(TargetToBuild)
102 | if TargetToBuild not in TargetList:
103 | print("ERROR => %s not part of custom_targets.json" % TargetToBuild)
104 | sys.exit(1)
105 | print(" => %s" % TargetToBuild)
106 |
107 | except:
108 | pass
109 |
110 | for EachTarget in TargetList:
111 | if EachTarget in PatchedTargets:
112 | pass
113 | else:
114 | print ("\t%s is skipped" % EachTarget)
115 | del custom_targets_info[EachTarget]
116 |
117 |
118 | ## MAIN APPLICATION
119 |
120 | application_file = open("main.cpp", 'w')
121 | application_code = ("""// generated file (automatic_build.py)
122 | #include "mbed.h"
123 | #define BLINKING_RATE 500ms
124 | int main()
125 | {
126 | DigitalOut led((PinName)0);
127 | while (true) {
128 | led = !led;
129 | ThisThread::sleep_for(BLINKING_RATE);
130 | }
131 | }
132 | """ % ())
133 | application_file.write(application_code)
134 | application_file.close()
135 |
136 |
137 | ## CONFIGURATION
138 |
139 | with open("mbed_app_template.json", "r") as sources:
140 | lines = sources.readlines()
141 | with open("mbed_app.json", "w") as sources:
142 | sources.write(lines[0])
143 | if args.baremetal:
144 | sources.write(' "requires": ["bare-metal", "sx1276-lora-driver", "stm32wl-lora-driver"],\n')
145 | for line in lines[1:]:
146 | sources.write(line)
147 |
148 |
149 | configuration_file = open(".mbedignore", 'w')
150 | configuration_code = ("""cmake_build/*
151 | """ % ())
152 | configuration_file.write(configuration_code)
153 | configuration_file.close()
154 |
155 |
156 | if args.cli2:
157 | configuration_file = open("mbed-os.lib", 'w')
158 | configuration_file.close()
159 |
160 | configuration_file = open("CMakeLists.txt", 'w')
161 | configuration_code = ("""# generated file (automatic_build.py)
162 |
163 | cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
164 |
165 | set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
166 | set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
167 | set(APP_TARGET ci-application)
168 |
169 | include(${MBED_PATH}/tools/cmake/app.cmake)
170 |
171 | project(${APP_TARGET})
172 |
173 | add_subdirectory(TARGET_STM32F0)
174 | add_subdirectory(TARGET_STM32F1)
175 | add_subdirectory(TARGET_STM32F2)
176 | add_subdirectory(TARGET_STM32F3)
177 | add_subdirectory(TARGET_STM32F4)
178 | add_subdirectory(TARGET_STM32F7)
179 | add_subdirectory(TARGET_STM32G0)
180 | add_subdirectory(TARGET_STM32G4)
181 | add_subdirectory(TARGET_STM32H7)
182 | add_subdirectory(TARGET_STM32L0)
183 | add_subdirectory(TARGET_STM32L1)
184 | add_subdirectory(TARGET_STM32L4)
185 | add_subdirectory(TARGET_STM32L5)
186 | add_subdirectory(TARGET_STM32U5)
187 | add_subdirectory(TARGET_STM32WB)
188 | add_subdirectory(TARGET_STM32WL)
189 |
190 | add_subdirectory(${MBED_PATH})
191 |
192 | add_executable(${APP_TARGET})
193 |
194 | mbed_configure_app_target(${APP_TARGET})
195 |
196 | target_sources(${APP_TARGET}
197 | PRIVATE
198 | main.cpp
199 | )
200 |
201 | target_link_libraries(${APP_TARGET}
202 | PRIVATE
203 | %s
204 | )
205 |
206 | mbed_set_post_build(${APP_TARGET})
207 | """ % (mbed_lib))
208 | configuration_file.write(configuration_code)
209 | configuration_file.close()
210 |
211 |
212 | BuildFailed = []
213 | BuildOK = []
214 |
215 | if args.pin:
216 | ## START PIN NAME VALIDATION
217 |
218 | if BuildType == "PATCH":
219 | for EachPinName in PinNamesList:
220 | cmdline = "python aci_pinvalidate.py -p %s -vvv" % EachPinName
221 | args.paths = EachPinName
222 | try:
223 | result = aci_pinvalidate.validate_pin_names(args)
224 | BuildOK.append(cmdline)
225 | except:
226 | BuildFailed.append(cmdline)
227 | if args.exit:
228 | print(cmdline)
229 | sys.exit(2)
230 |
231 | elif BuildType == "FULL":
232 | cmdline = "python aci_pinvalidate.py -a -vvv"
233 | try:
234 | result = aci_pinvalidate.validate_pin_names(args)
235 | BuildOK.append(cmdline)
236 | except:
237 | BuildFailed.append(cmdline)
238 | if args.exit:
239 | print(cmdline)
240 | sys.exit(2)
241 |
242 | else:
243 | cmdline = "python aci_pinvalidate.py -t %s -vvv" % args.targets
244 | try:
245 | result = aci_pinvalidate.validate_pin_names(args)
246 | BuildOK.append(cmdline)
247 | except:
248 | BuildFailed.append(cmdline)
249 | if args.exit:
250 | print(cmdline)
251 | sys.exit(2)
252 |
253 | else:
254 | ## START BUILD
255 |
256 | for EachTarget in custom_targets_info:
257 | cmdline = "%s compile -m %s -t %s" % (mbed_tool, EachTarget, requested_toolchain)
258 | print ("\n***************************************")
259 | print ("Executing: " + cmdline)
260 | sys.stdout.flush()
261 |
262 | if os.system(cmdline) != 0:
263 | BuildFailed.append(cmdline)
264 | if args.exit:
265 | print(cmdline)
266 | sys.exit(2)
267 | else:
268 | BuildOK.append(cmdline)
269 |
270 |
271 | if BuildOK != []:
272 | print()
273 | print("Succeeded build command:")
274 | for EachBuild in BuildOK:
275 | print(EachBuild)
276 | print()
277 |
278 | if BuildFailed != []:
279 | print()
280 | print("Failed build command:")
281 | for EachBuild in BuildFailed:
282 | print(EachBuild)
283 | print()
284 | sys.exit(1)
285 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/custom_targets.json:
--------------------------------------------------------------------------------
1 | {
2 | "BLUEPILL_F103C8": {
3 | "inherits": [
4 | "MCU_STM32F103x8"
5 | ],
6 | "overrides": {
7 | "clock_source": "USE_PLL_HSE_XTAL"
8 | },
9 | "device_has_add": [
10 | "USBDEVICE"
11 | ],
12 | "device_name": "STM32F103C8"
13 | },
14 | "MTB_MURATA_ABZ": {
15 | "inherits": [
16 | "MCU_STM32L082xZ"
17 | ],
18 | "detect_code": ["0456"],
19 | "device_name": "STM32L082CZYx"
20 | },
21 | "GRASSHOPPER": {
22 | "inherits": [
23 | "MTB_MURATA_ABZ"
24 | ]
25 | },
26 | "GNAT": {
27 | "inherits": [
28 | "MTB_MURATA_ABZ"
29 | ]
30 | },
31 | "STWIN": {
32 | "inherits": [
33 | "MCU_STM32L4R9xI"
34 | ],
35 | "device_name": "STM32L4R9ZITx",
36 | "supported_form_factors": [
37 | "STMOD"
38 | ],
39 | "components_add": [
40 | "BlueNRG_MS"
41 | ],
42 | "extra_labels_add": [
43 | "CORDIO"
44 | ],
45 | "features": [
46 | "BLE"
47 | ]
48 | },
49 | "LORA_E5": {
50 | "inherits": [
51 | "MCU_STM32WLE5xC"
52 | ],
53 | "device_name": "STM32WLE5JCIx"
54 | },
55 | "LORA_E5_BREAKOUT": {
56 | "inherits": [
57 | "LORA_E5"
58 | ],
59 | "macros_add": [
60 | "LED1=PB_5",
61 | "LED2=PB_10",
62 | "BUTTON1=PB_13"
63 | ]
64 | },
65 | "LORA_E5_MINI": {
66 | "inherits": [
67 | "LORA_E5"
68 | ],
69 | "macros_add": [
70 | "LED1=PB_5",
71 | "BUTTON1=PB_13"
72 | ]
73 | },
74 | "LORA_E5_DEV_BOARD": {
75 | "inherits": [
76 | "LORA_E5"
77 | ],
78 | "macros_add": [
79 | "LED1=PB_5",
80 | "EN_3V3=PA_9",
81 | "EN_5V=PB_10",
82 | "BUTTON1=PB_13",
83 | "BUTTON2=PA_0",
84 | "RS485_REDE=PB_4"
85 | ]
86 | },
87 | "LORA_E5_TINY": {
88 | "inherits": [
89 | "LORA_E5"
90 | ],
91 | "macros_add": [
92 | "LED1=PA_9",
93 | "LED2=PB_13",
94 | "BUTTON1=PB_4"
95 | ]
96 | },
97 | "RAK3172": {
98 | "inherits": [
99 | "MCU_STM32WLE5xC"
100 | ],
101 | "device_name": "STM32WLE5CCUx"
102 | },
103 | "RAK3172_BREAKOUT": {
104 | "inherits": [
105 | "RAK3172"
106 | ],
107 | "macros_add": [
108 | "LED1=PA_9",
109 | "LED2=PA_10"
110 | ]
111 | },
112 | "CORE2":
113 | {
114 | "inherits": ["MCU_STM32F4"],
115 | "extra_labels_add": ["STM32F407xG"],
116 | "macros_add": [
117 | "STM32F407xx",
118 | "ENCODER_1=TIM2",
119 | "ENCODER_2=TIM8",
120 | "ENCODER_3=TIM3",
121 | "ENCODER_4=TIM4",
122 | "UPPER_RESISTOR=5.6e4",
123 | "LOWER_RESISTOR=1.0e4",
124 | "VIN_MEAS_CORRECTION=0.986"
125 | ],
126 | "overrides": {
127 | "lse_available": 0,
128 | "clock_source": "USE_PLL_HSE_XTAL"
129 | },
130 | "device_has_add": ["TRNG", "CAN"],
131 | "device_has_remove": ["LPTICKER"],
132 | "device_name": "STM32F407ZG"
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/Code/v1/stm32customtargets/mbed_app_template.json:
--------------------------------------------------------------------------------
1 | {
2 | "config": {
3 | },
4 | "macros": [
5 | ],
6 | "target_overrides": {
7 | "*": {
8 | },
9 | "MTB_MURATA_ABZ": {
10 | "target.components_add": ["SX1276"],
11 | "sx1276-lora-driver.spi-mosi": "LORA_SPI_MOSI",
12 | "sx1276-lora-driver.spi-miso": "LORA_SPI_MISO",
13 | "sx1276-lora-driver.spi-sclk": "LORA_SPI_SCLK",
14 | "sx1276-lora-driver.spi-cs": "LORA_CS",
15 | "sx1276-lora-driver.reset": "LORA_RESET",
16 | "sx1276-lora-driver.dio0": "LORA_DIO0",
17 | "sx1276-lora-driver.dio1": "LORA_DIO1",
18 | "sx1276-lora-driver.dio2": "LORA_DIO2",
19 | "sx1276-lora-driver.dio3": "LORA_DIO3",
20 | "sx1276-lora-driver.txctl": "LORA_ANT_TX",
21 | "sx1276-lora-driver.rxctl": "LORA_ANT_RX",
22 | "sx1276-lora-driver.pwr-amp-ctl": "LORA_ANT_BOOST"
23 | },
24 | "GRASSHOPPER": {
25 | "target.components_add": ["SX1276"],
26 | "sx1276-lora-driver.spi-mosi": "LORA_SPI_MOSI",
27 | "sx1276-lora-driver.spi-miso": "LORA_SPI_MISO",
28 | "sx1276-lora-driver.spi-sclk": "LORA_SPI_SCLK",
29 | "sx1276-lora-driver.spi-cs": "LORA_CS",
30 | "sx1276-lora-driver.reset": "LORA_RESET",
31 | "sx1276-lora-driver.dio0": "LORA_DIO0",
32 | "sx1276-lora-driver.dio1": "LORA_DIO1",
33 | "sx1276-lora-driver.dio2": "LORA_DIO2",
34 | "sx1276-lora-driver.dio3": "LORA_DIO3",
35 | "sx1276-lora-driver.txctl": "LORA_ANT_TX",
36 | "sx1276-lora-driver.rxctl": "LORA_ANT_RX",
37 | "sx1276-lora-driver.pwr-amp-ctl": "LORA_ANT_BOOST",
38 | "sx1276-lora-driver.tcxo": "LORA_VDD_TXCO"
39 | },
40 | "GNAT": {
41 | "target.components_add": ["SX1276"],
42 | "sx1276-lora-driver.spi-mosi": "LORA_SPI_MOSI",
43 | "sx1276-lora-driver.spi-miso": "LORA_SPI_MISO",
44 | "sx1276-lora-driver.spi-sclk": "LORA_SPI_SCLK",
45 | "sx1276-lora-driver.spi-cs": "LORA_CS",
46 | "sx1276-lora-driver.reset": "LORA_RESET",
47 | "sx1276-lora-driver.dio0": "LORA_DIO0",
48 | "sx1276-lora-driver.dio1": "LORA_DIO1",
49 | "sx1276-lora-driver.dio2": "LORA_DIO2",
50 | "sx1276-lora-driver.dio3": "LORA_DIO3",
51 | "sx1276-lora-driver.txctl": "LORA_ANT_TX",
52 | "sx1276-lora-driver.rxctl": "LORA_ANT_RX",
53 | "sx1276-lora-driver.pwr-amp-ctl": "LORA_ANT_BOOST",
54 | "sx1276-lora-driver.tcxo": "LORA_VDD_TXCO"
55 | },
56 | "LORA_E5": {
57 | "stm32wl-lora-driver.rf_switch_config": 2
58 | },
59 | "LORA_E5_BREAKOUT": {
60 | "stm32wl-lora-driver.rf_switch_config": 2,
61 | "stm32wl-lora-driver.debug_tx": "PB_5",
62 | "stm32wl-lora-driver.debug_rx": "PB_10",
63 | "stm32wl-lora-driver.debug_invert": 1
64 | },
65 | "LORA_E5_TINY": {
66 | "stm32wl-lora-driver.rf_switch_config": 2,
67 | "stm32wl-lora-driver.debug_tx": "PB_13",
68 | "stm32wl-lora-driver.debug_rx": "PA_9"
69 | },
70 | "RAK3172": {
71 | "stm32wl-lora-driver.rf_switch_config": 2,
72 | "stm32wl-lora-driver.crystal_select" : 0
73 | },
74 | "RAK3172_BREAKOUT": {
75 | "stm32wl-lora-driver.rf_switch_config": 2,
76 | "stm32wl-lora-driver.crystal_select" : 0,
77 | "stm32wl-lora-driver.debug_tx": "PA_10",
78 | "stm32wl-lora-driver.debug_rx": "PA_9",
79 | "stm32wl-lora-driver.debug_invert": 1
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Code/v1/trace_helper.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017, Arm Limited and affiliates.
3 | * SPDX-License-Identifier: Apache-2.0
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * If we have tracing library available, we can see traces from within the
20 | * stack. The library could be made unavailable by removing FEATURE_COMMON_PAL
21 | * from the mbed_app.json to save RAM.
22 | */
23 |
24 | #include "mbed_trace.h"
25 |
26 | #ifdef FEA_TRACE_SUPPORT
27 | #include "platform/PlatformMutex.h"
28 |
29 | /**
30 | * Local mutex object for synchronization
31 | */
32 | static PlatformMutex mutex;
33 |
34 | static void serial_lock();
35 | static void serial_unlock();
36 |
37 | /**
38 | * Sets up trace for the application
39 | * Wouldn't do anything if the FEATURE_COMMON_PAL is not added
40 | * or if the trace is disabled using mbed_app.json
41 | */
42 | void setup_trace()
43 | {
44 | // setting up Mbed trace.
45 | mbed_trace_mutex_wait_function_set(serial_lock);
46 | mbed_trace_mutex_release_function_set(serial_unlock);
47 | mbed_trace_init();
48 | }
49 |
50 | /**
51 | * Lock provided for serial printing used by trace library
52 | */
53 | static void serial_lock()
54 | {
55 | mutex.lock();
56 | }
57 |
58 | /**
59 | * Releasing lock provided for serial printing used by trace library
60 | */
61 | static void serial_unlock()
62 | {
63 | mutex.unlock();
64 | }
65 | #else
66 | void setup_trace()
67 | {
68 |
69 | }
70 | #endif
71 |
72 |
73 |
--------------------------------------------------------------------------------
/Code/v1/trace_helper.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017, Arm Limited and affiliates.
3 | * SPDX-License-Identifier: Apache-2.0
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #ifndef APP_TRACE_HELPER_H_
19 | #define APP_TRACE_HELPER_H_
20 |
21 | /**
22 | * Helper function for the application to setup Mbed trace.
23 | * It Wouldn't do anything if the FEATURE_COMMON_PAL is not added
24 | * or if the trace is disabled using mbed_app.json
25 | */
26 | void setup_trace();
27 |
28 | #endif /* APP_TRACE_HELPER_H_ */
29 |
--------------------------------------------------------------------------------
/Images/boards.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/Images/boards.jpg
--------------------------------------------------------------------------------
/Images/iotcentral.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/Images/iotcentral.png
--------------------------------------------------------------------------------
/Images/kivyprototype.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/Images/kivyprototype.png
--------------------------------------------------------------------------------
/Images/ttndata.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/Images/ttndata.PNG
--------------------------------------------------------------------------------
/PCB/101-3/Gerbers/main-B_Mask.gbr:
--------------------------------------------------------------------------------
1 | %TF.GenerationSoftware,KiCad,Pcbnew,(5.1.10)-1*%
2 | %TF.CreationDate,2022-03-06T21:17:49+00:00*%
3 | %TF.ProjectId,main,6d61696e-2e6b-4696-9361-645f70636258,rev?*%
4 | %TF.SameCoordinates,Original*%
5 | %TF.FileFunction,Soldermask,Bot*%
6 | %TF.FilePolarity,Negative*%
7 | %FSLAX46Y46*%
8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
9 | G04 Created by KiCad (PCBNEW (5.1.10)-1) date 2022-03-06 21:17:49*
10 | %MOMM*%
11 | %LPD*%
12 | G01*
13 | G04 APERTURE LIST*
14 | %ADD10O,1.350000X1.700000*%
15 | %ADD11O,1.100000X1.500000*%
16 | %ADD12C,2.209800*%
17 | %ADD13C,2.006600*%
18 | %ADD14O,1.700000X1.700000*%
19 | %ADD15R,1.700000X1.700000*%
20 | G04 APERTURE END LIST*
21 | D10*
22 | %TO.C,USB_PWR1*%
23 | X171735000Y-143275000D03*
24 | X166275000Y-143275000D03*
25 | D11*
26 | X171425000Y-140275000D03*
27 | X166585000Y-140275000D03*
28 | %TD*%
29 | D12*
30 | %TO.C,J2*%
31 | X165610000Y-106690000D03*
32 | X165610000Y-111770000D03*
33 | X160530000Y-111770000D03*
34 | X160530000Y-106690000D03*
35 | D13*
36 | X163070000Y-109230000D03*
37 | %TD*%
38 | D14*
39 | %TO.C,J6*%
40 | X177380000Y-108300000D03*
41 | X179920000Y-108300000D03*
42 | X182460000Y-108300000D03*
43 | D15*
44 | X185000000Y-108300000D03*
45 | %TD*%
46 | D14*
47 | %TO.C,J4*%
48 | X172466000Y-119634000D03*
49 | X172466000Y-122174000D03*
50 | D15*
51 | X172466000Y-124714000D03*
52 | %TD*%
53 | D14*
54 | %TO.C,J1*%
55 | X146655000Y-140725000D03*
56 | X149195000Y-140725000D03*
57 | X151735000Y-140725000D03*
58 | X154275000Y-140725000D03*
59 | X156815000Y-140725000D03*
60 | D15*
61 | X159355000Y-140725000D03*
62 | %TD*%
63 | M02*
64 |
--------------------------------------------------------------------------------
/PCB/101-3/Gerbers/main-B_Paste.gbr:
--------------------------------------------------------------------------------
1 | %TF.GenerationSoftware,KiCad,Pcbnew,(5.1.10)-1*%
2 | %TF.CreationDate,2022-03-06T21:17:49+00:00*%
3 | %TF.ProjectId,main,6d61696e-2e6b-4696-9361-645f70636258,rev?*%
4 | %TF.SameCoordinates,Original*%
5 | %TF.FileFunction,Paste,Bot*%
6 | %TF.FilePolarity,Positive*%
7 | %FSLAX46Y46*%
8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
9 | G04 Created by KiCad (PCBNEW (5.1.10)-1) date 2022-03-06 21:17:49*
10 | %MOMM*%
11 | %LPD*%
12 | G01*
13 | G04 APERTURE LIST*
14 | G04 APERTURE END LIST*
15 | M02*
16 |
--------------------------------------------------------------------------------
/PCB/101-3/Gerbers/main-B_SilkS.gbr:
--------------------------------------------------------------------------------
1 | %TF.GenerationSoftware,KiCad,Pcbnew,(5.1.10)-1*%
2 | %TF.CreationDate,2022-03-06T21:17:49+00:00*%
3 | %TF.ProjectId,main,6d61696e-2e6b-4696-9361-645f70636258,rev?*%
4 | %TF.SameCoordinates,Original*%
5 | %TF.FileFunction,Legend,Bot*%
6 | %TF.FilePolarity,Positive*%
7 | %FSLAX46Y46*%
8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
9 | G04 Created by KiCad (PCBNEW (5.1.10)-1) date 2022-03-06 21:17:49*
10 | %MOMM*%
11 | %LPD*%
12 | G01*
13 | G04 APERTURE LIST*
14 | %ADD10O,1.350000X1.700000*%
15 | %ADD11O,1.100000X1.500000*%
16 | %ADD12C,2.209800*%
17 | %ADD13C,2.006600*%
18 | %ADD14O,1.700000X1.700000*%
19 | %ADD15R,1.700000X1.700000*%
20 | G04 APERTURE END LIST*
21 | %LPC*%
22 | D10*
23 | %TO.C,USB_PWR1*%
24 | X171735000Y-143275000D03*
25 | X166275000Y-143275000D03*
26 | D11*
27 | X171425000Y-140275000D03*
28 | X166585000Y-140275000D03*
29 | %TD*%
30 | D12*
31 | %TO.C,J2*%
32 | X165610000Y-106690000D03*
33 | X165610000Y-111770000D03*
34 | X160530000Y-111770000D03*
35 | X160530000Y-106690000D03*
36 | D13*
37 | X163070000Y-109230000D03*
38 | %TD*%
39 | D14*
40 | %TO.C,J6*%
41 | X177380000Y-108300000D03*
42 | X179920000Y-108300000D03*
43 | X182460000Y-108300000D03*
44 | D15*
45 | X185000000Y-108300000D03*
46 | %TD*%
47 | D14*
48 | %TO.C,J4*%
49 | X172466000Y-119634000D03*
50 | X172466000Y-122174000D03*
51 | D15*
52 | X172466000Y-124714000D03*
53 | %TD*%
54 | D14*
55 | %TO.C,J1*%
56 | X146655000Y-140725000D03*
57 | X149195000Y-140725000D03*
58 | X151735000Y-140725000D03*
59 | X154275000Y-140725000D03*
60 | X156815000Y-140725000D03*
61 | D15*
62 | X159355000Y-140725000D03*
63 | %TD*%
64 | M02*
65 |
--------------------------------------------------------------------------------
/PCB/101-3/Gerbers/main-Edge_Cuts.gbr:
--------------------------------------------------------------------------------
1 | %TF.GenerationSoftware,KiCad,Pcbnew,(5.1.10)-1*%
2 | %TF.CreationDate,2022-03-06T21:17:49+00:00*%
3 | %TF.ProjectId,main,6d61696e-2e6b-4696-9361-645f70636258,rev?*%
4 | %TF.SameCoordinates,Original*%
5 | %TF.FileFunction,Profile,NP*%
6 | %FSLAX46Y46*%
7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
8 | G04 Created by KiCad (PCBNEW (5.1.10)-1) date 2022-03-06 21:17:49*
9 | %MOMM*%
10 | %LPD*%
11 | G01*
12 | G04 APERTURE LIST*
13 | %TA.AperFunction,Profile*%
14 | %ADD10C,0.050000*%
15 | %TD*%
16 | G04 APERTURE END LIST*
17 | D10*
18 | X194000000Y-145000000D02*
19 | X144000000Y-145000000D01*
20 | X194000000Y-105000000D02*
21 | X194000000Y-145000000D01*
22 | X144000000Y-105000000D02*
23 | X194000000Y-105000000D01*
24 | X144000000Y-145000000D02*
25 | X144000000Y-105000000D01*
26 | M02*
27 |
--------------------------------------------------------------------------------
/PCB/101-3/Gerbers/main-job.gbrjob:
--------------------------------------------------------------------------------
1 | {
2 | "Header":
3 | {
4 | "GenerationSoftware":
5 | {
6 | "Vendor": "KiCad",
7 | "Application": "Pcbnew",
8 | "Version": "(5.1.10)-1"
9 | },
10 | "CreationDate": "2022-03-06T21:17:49+00:00"
11 | },
12 | "GeneralSpecs":
13 | {
14 | "ProjectId":
15 | {
16 | "Name": "main",
17 | "GUID": "6d61696e-2e6b-4696-9361-645f70636258",
18 | "Revision": "rev?"
19 | },
20 | "Size":
21 | {
22 | "X": 50.050,
23 | "Y": 40.050
24 | },
25 | "LayerNumber": 4,
26 | "BoardThickness": 1.600
27 | },
28 | "DesignRules":
29 | [
30 | {
31 | "Layers": "Outer",
32 | "PadToPad": 0.200,
33 | "PadToTrack": 0.200,
34 | "TrackToTrack": 0.200,
35 | "MinLineWidth": 0.250,
36 | "TrackToRegion": 0.508,
37 | "RegionToRegion": 0.508
38 | },
39 | {
40 | "Layers": "Inner",
41 | "PadToPad": 0.200,
42 | "PadToTrack": 0.200,
43 | "TrackToTrack": 0.200,
44 | "TrackToRegion": 0.508,
45 | "RegionToRegion": 0.508
46 | }
47 | ],
48 | "FilesAttributes":
49 | [
50 | {
51 | "Path": "main-F_Cu.gbr",
52 | "FileFunction": "Copper,L1,Top",
53 | "FilePolarity": "Positive"
54 | },
55 | {
56 | "Path": "main-GND.gbr",
57 | "FileFunction": "Copper,L2,Inr",
58 | "FilePolarity": "Positive"
59 | },
60 | {
61 | "Path": "main-PWR.gbr",
62 | "FileFunction": "Copper,L3,Inr",
63 | "FilePolarity": "Positive"
64 | },
65 | {
66 | "Path": "main-B_Cu.gbr",
67 | "FileFunction": "Copper,L4,Bot",
68 | "FilePolarity": "Positive"
69 | },
70 | {
71 | "Path": "main-F_Paste.gbr",
72 | "FileFunction": "SolderPaste,Top",
73 | "FilePolarity": "Positive"
74 | },
75 | {
76 | "Path": "main-B_Paste.gbr",
77 | "FileFunction": "SolderPaste,Bot",
78 | "FilePolarity": "Positive"
79 | },
80 | {
81 | "Path": "main-F_SilkS.gbr",
82 | "FileFunction": "Legend,Top",
83 | "FilePolarity": "Positive"
84 | },
85 | {
86 | "Path": "main-B_SilkS.gbr",
87 | "FileFunction": "Legend,Bot",
88 | "FilePolarity": "Positive"
89 | },
90 | {
91 | "Path": "main-F_Mask.gbr",
92 | "FileFunction": "SolderMask,Top",
93 | "FilePolarity": "Negative"
94 | },
95 | {
96 | "Path": "main-B_Mask.gbr",
97 | "FileFunction": "SolderMask,Bot",
98 | "FilePolarity": "Negative"
99 | },
100 | {
101 | "Path": "main-Edge_Cuts.gbr",
102 | "FileFunction": "Profile",
103 | "FilePolarity": "Positive"
104 | }
105 | ],
106 | "MaterialStackup":
107 | [
108 | {
109 | "Type": "Legend",
110 | "Notes": "Layer F.SilkS"
111 | },
112 | {
113 | "Type": "SolderPaste",
114 | "Notes": "Layer F.Paste"
115 | },
116 | {
117 | "Type": "SolderMask",
118 | "Notes": "Layer F.Mask"
119 | },
120 | {
121 | "Type": "Copper",
122 | "Notes": "Layer F.Cu"
123 | },
124 | {
125 | "Type": "Dielectric",
126 | "Material": "FR4",
127 | "Notes": "Layers L1/L2"
128 | },
129 | {
130 | "Type": "Copper",
131 | "Notes": "Layer GND"
132 | },
133 | {
134 | "Type": "Dielectric",
135 | "Material": "FR4",
136 | "Notes": "Layers L2/L3"
137 | },
138 | {
139 | "Type": "Copper",
140 | "Notes": "Layer PWR"
141 | },
142 | {
143 | "Type": "Dielectric",
144 | "Material": "FR4",
145 | "Notes": "Layers L3/L4"
146 | },
147 | {
148 | "Type": "Copper",
149 | "Notes": "Layer B.Cu"
150 | },
151 | {
152 | "Type": "SolderMask",
153 | "Notes": "Layer B.Mask"
154 | },
155 | {
156 | "Type": "SolderPaste",
157 | "Notes": "Layer B.Paste"
158 | },
159 | {
160 | "Type": "Legend",
161 | "Notes": "Layer B.SilkS"
162 | }
163 | ]
164 | }
165 |
--------------------------------------------------------------------------------
/PCB/101-3/Gerbers/main.drl:
--------------------------------------------------------------------------------
1 | M48
2 | ; DRILL file {KiCad (5.1.10)-1} date 03/06/22 21:17:51
3 | ; FORMAT={-:-/ absolute / metric / decimal}
4 | ; #@! TF.CreationDate,2022-03-06T21:17:51+00:00
5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,(5.1.10)-1
6 | FMAT,2
7 | METRIC
8 | T1C0.400
9 | T2C0.650
10 | T3C0.700
11 | T4C1.000
12 | T5C1.499
13 | T6C1.702
14 | %
15 | G90
16 | G05
17 | T1
18 | X145.6Y-137.8
19 | X145.8Y-127.2
20 | X146.2Y-119.6
21 | X146.2Y-143.8
22 | X147.0Y-135.7
23 | X147.6Y-110.6
24 | X148.4Y-137.8
25 | X149.0Y-126.2
26 | X149.6Y-132.6
27 | X150.6Y-113.2
28 | X151.0Y-107.8
29 | X151.2Y-125.6
30 | X151.2Y-143.4
31 | X151.4Y-137.4
32 | X151.6Y-134.2
33 | X151.8Y-118.0
34 | X154.2Y-143.0
35 | X154.3Y-136.8
36 | X154.6Y-118.4
37 | X155.2Y-123.6
38 | X155.6Y-129.8
39 | X155.6Y-131.4
40 | X155.6Y-136.8
41 | X155.8Y-115.6
42 | X156.6Y-127.3
43 | X157.0Y-124.4
44 | X157.0Y-131.4
45 | X157.2Y-129.6
46 | X158.2Y-130.6
47 | X158.33Y-111.85
48 | X158.4Y-128.6
49 | X158.4Y-138.0
50 | X158.4Y-143.6
51 | X158.43Y-106.65
52 | X158.8Y-124.0
53 | X159.6Y-129.0
54 | X159.6Y-130.2
55 | X161.0Y-129.0
56 | X161.0Y-130.2
57 | X161.2Y-125.6
58 | X161.2Y-127.4
59 | X161.2Y-141.8
60 | X161.8Y-113.4
61 | X161.8Y-114.6
62 | X161.8Y-115.8
63 | X161.8Y-117.0
64 | X161.8Y-118.2
65 | X161.8Y-119.4
66 | X161.8Y-123.2
67 | X162.4Y-125.0
68 | X162.4Y-129.0
69 | X162.4Y-130.2
70 | X162.4Y-138.8
71 | X162.8Y-126.2
72 | X163.0Y-127.8
73 | X163.2Y-143.6
74 | X163.4Y-123.6
75 | X163.6Y-141.4
76 | X164.2Y-139.0
77 | X164.5Y-120.5
78 | X164.6Y-115.2
79 | X164.6Y-116.4
80 | X164.6Y-117.6
81 | X165.6Y-120.2
82 | X165.8Y-115.0
83 | X165.8Y-118.0
84 | X166.4Y-114.0
85 | X166.4Y-119.2
86 | X167.0Y-122.4
87 | X167.72Y-111.85
88 | X168.07Y-106.61
89 | X168.8Y-121.4
90 | X169.4Y-119.2
91 | X169.4Y-138.8
92 | X170.0Y-115.6
93 | X170.4Y-138.8
94 | X170.8Y-134.4
95 | X171.0Y-127.0
96 | X171.4Y-132.4
97 | X173.4Y-113.2
98 | X174.2Y-127.0
99 | X174.4Y-119.5
100 | X174.6Y-108.0
101 | X176.0Y-127.2
102 | X176.6Y-119.6
103 | X177.0Y-125.0
104 | X177.0Y-142.2
105 | X177.4Y-113.0
106 | X178.0Y-135.4
107 | X178.8Y-124.2
108 | X179.2Y-133.2
109 | X179.2Y-139.8
110 | X180.0Y-141.8
111 | X180.6Y-137.0
112 | X181.8Y-134.5
113 | X182.0Y-127.6
114 | X182.4Y-106.3
115 | X182.8Y-120.0
116 | X183.2Y-115.4
117 | X184.4Y-127.0
118 | X184.9Y-106.3
119 | X186.2Y-134.3
120 | X186.2Y-139.5
121 | X186.4Y-135.6
122 | X186.4Y-136.6
123 | X186.4Y-138.0
124 | X186.6Y-120.4
125 | X186.8Y-113.6
126 | X187.4Y-127.2
127 | X188.0Y-133.2
128 | X188.0Y-141.8
129 | X188.8Y-123.0
130 | X189.0Y-110.4
131 | X189.0Y-132.0
132 | X189.2Y-121.6
133 | X189.8Y-135.6
134 | X190.6Y-141.8
135 | X191.0Y-129.2
136 | X191.2Y-114.2
137 | X191.4Y-137.6
138 | X191.8Y-107.4
139 | X192.0Y-134.8
140 | X192.4Y-120.4
141 | X193.0Y-129.2
142 | T4
143 | X146.655Y-140.725
144 | X149.195Y-140.725
145 | X151.735Y-140.725
146 | X154.275Y-140.725
147 | X156.815Y-140.725
148 | X159.355Y-140.725
149 | X172.466Y-119.634
150 | X172.466Y-122.174
151 | X172.466Y-124.714
152 | X177.38Y-108.3
153 | X179.92Y-108.3
154 | X182.46Y-108.3
155 | X185.0Y-108.3
156 | T5
157 | X163.07Y-109.23
158 | T6
159 | X160.53Y-106.69
160 | X160.53Y-111.77
161 | X165.61Y-106.69
162 | X165.61Y-111.77
163 | T2
164 | G00X166.585Y-140.475
165 | M15
166 | G01X166.585Y-140.075
167 | M16
168 | G05
169 | G00X171.425Y-140.475
170 | M15
171 | G01X171.425Y-140.075
172 | M16
173 | G05
174 | T3
175 | G00X166.275Y-143.525
176 | M15
177 | G01X166.275Y-143.025
178 | M16
179 | G05
180 | G00X171.735Y-143.525
181 | M15
182 | G01X171.735Y-143.025
183 | M16
184 | G05
185 | T0
186 | M30
187 |
--------------------------------------------------------------------------------
/PCB/101-3/Schematic.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/PCB/101-3/Schematic.pdf
--------------------------------------------------------------------------------
/PCB/101-3/Sensor.dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | $CMP ADE7758
4 | D Poly Phase Multifunction Energy Metering, SO-24
5 | K Energy Metering
6 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ADE7758.pdf
7 | $ENDCMP
8 | #
9 | $CMP ADE7763xRS
10 | D Single-Phase Active and Apparent Energy Metering, SSOP-20
11 | K Energy Metering
12 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ADE7763.pdf
13 | $ENDCMP
14 | #
15 | $CMP ADE7953xCP
16 | D Single Phase Multifunction Energy Metering with Neutral Current Measurement, LFCSP-28
17 | K Energy Metering
18 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ADE7953.pdf
19 | $ENDCMP
20 | #
21 | $CMP AS3935
22 | D Programmable fully integrated Lightning Sensor IC
23 | K lightning sensor
24 | F https://www.embeddedadventures.com/datasheets/AS3935_Datasheet_EN_v2.pdf
25 | $ENDCMP
26 | #
27 | $CMP BL0937
28 | D Single Phase Energy Meter IC with Integrated Oscillator, SOP-8
29 | K current sensor
30 | F http://www.belling.com.cn/media/file_object/bel_product/BL0937/datasheet/BL0937_V1.02_en.pdf
31 | $ENDCMP
32 | #
33 | $CMP BME280
34 | D 3-in-1 sensor, humidity, pressure, temperature, I2C and SPI interface, 1.71-3.6V, LGA-8
35 | K Bosch pressure humidity temperature environment environmental measurement digital
36 | F https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280-DS002.pdf
37 | $ENDCMP
38 | #
39 | $CMP BME680
40 | D 4-in-1 sensor, gas, humidity, pressure, temperature, I2C and SPI interface, 1.71-3.6V, LGA-8
41 | K Bosch gas pressure humidity temperature environment environmental measurement digital
42 | F https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME680-DS001.pdf
43 | $ENDCMP
44 | #
45 | $CMP CHT11
46 | D Temperature and humidity module
47 | K Digital temperature humidity sensor
48 | F http://aosong.com/en/products-21.html
49 | $ENDCMP
50 | #
51 | $CMP DHT11
52 | D Temperature and humidity module
53 | K Digital temperature humidity sensor
54 | F http://akizukidenshi.com/download/ds/aosong/DHT11.pdf
55 | $ENDCMP
56 | #
57 | $CMP INA260
58 | D Current/power/voltage monitor with Integrated 2mΩ Shunt Resistor, 2.7V - 5.5V, I2C, TSSOP-16
59 | K Current/power/voltage monitor
60 | F http://www.ti.com/lit/ds/symlink/ina260.pdf
61 | $ENDCMP
62 | #
63 | $CMP LTC2990
64 | D Temperature Voltage and Current Monitor, I2C Interface, MSOP-10
65 | K Temperature Voltage Current Monitor I2C AFE
66 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ltc2990.pdf
67 | $ENDCMP
68 | #
69 | $CMP MAX30102
70 | D Heart Rate Sensor, 14-OLGA
71 | K Heart Rate
72 | F https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf
73 | $ENDCMP
74 | #
75 | $CMP Nuclear-Radiation_Detector
76 | D Generic radiation detector
77 | K nuclear ionising radiation sensor geiger mueller muller tube neutron counter ionization chamber
78 | F ~
79 | $ENDCMP
80 | #
81 | $CMP SHT1x
82 | D Temperature and humidity module
83 | K digital temperature humidity sensor
84 | F https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/0_Datasheets/Humidity/Sensirion_Humidity_Sensors_SHT1x_Datasheet.pdf
85 | $ENDCMP
86 | #
87 | #End Doc Library
88 |
--------------------------------------------------------------------------------
/PCB/101-3/fp-lib-table:
--------------------------------------------------------------------------------
1 | (fp_lib_table
2 | (lib (name ant868)(type KiCad)(uri D:/KicadSpareLibrary/SamacSys_Parts.pretty)(options "")(descr ""))
3 | (lib (name 123)(type KiCad)(uri C:/Github/Indoor-Air-Quality-BME688-STM32WLE5JC/KiCad/KicadMainLibrary/footprints.pretty)(options "")(descr ""))
4 | )
5 |
--------------------------------------------------------------------------------
/PCB/101-3/main-rescue.dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | #End Doc Library
4 |
--------------------------------------------------------------------------------
/PCB/101-3/main-rescue.lib:
--------------------------------------------------------------------------------
1 | EESchema-LIBRARY Version 2.4
2 | #encoding utf-8
3 | #
4 | # ANT-868-USP410-Antenna
5 | #
6 | DEF ANT-868-USP410-Antenna E 0 40 Y N 1 L N
7 | F0 "E" 80 30 50 H V L BNN
8 | F1 "ANT-868-USP410-Antenna" 85 -40 50 H V L BNN
9 | F2 "XDCR_ANT-868-USP410" 0 0 50 H I L BNN
10 | F3 "" 0 0 50 H I L BNN
11 | F4 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD"
12 | F5 "DS20241-03ANT" 0 0 50 H I L BNN "PARTREV"
13 | F6 "Linx" 0 0 50 H I L BNN "MANUFACTURER"
14 | F7 "2.9 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT"
15 | DRAW
16 | P 2 0 0 10 -55 125 0 125 N
17 | P 2 0 0 10 -30 -130 30 -130 N
18 | P 2 0 0 10 -5 -160 10 -160 N
19 | P 2 0 0 10 0 -100 -50 -100 N
20 | P 2 0 0 10 0 -100 50 -100 N
21 | P 2 0 0 10 0 0 -55 125 N
22 | P 2 0 0 10 0 0 0 -100 N
23 | P 2 0 0 10 0 125 0 0 N
24 | P 2 0 0 10 0 125 55 125 N
25 | P 2 0 0 10 55 125 0 0 N
26 | X ~ 1 -100 0 100 R 40 40 0 0 P
27 | X ~ 2 -100 -100 100 R 40 40 0 0 W
28 | ENDDRAW
29 | ENDDEF
30 | #
31 | # BME688-BME688
32 | #
33 | DEF BME688-BME688 U 0 20 Y Y 1 F N
34 | F0 "U" -350 450 50 H V C CNN
35 | F1 "BME688-BME688" 300 450 50 H V C CNN
36 | F2 "Package_LGA:Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering" 1450 -450 50 H I C CNN
37 | F3 "" 0 -200 50 H I C CNN
38 | $FPLIST
39 | *LGA*3x3mm*P0.8mm*Clockwise*
40 | $ENDFPLIST
41 | DRAW
42 | S -400 400 400 -400 0 1 10 f
43 | X GND 1 -100 -600 200 U 50 50 1 1 W
44 | X CSB 2 600 100 200 L 50 50 1 1 I
45 | X SDI 3 -600 100 200 R 50 50 1 1 B
46 | X SCK 4 -600 -100 200 R 50 50 1 1 I
47 | X SDO 5 600 -100 200 L 50 50 1 1 B
48 | X VDDIO 6 -100 600 200 D 50 50 1 1 W
49 | X GND 7 100 -600 200 U 50 50 1 1 W
50 | X VDD 8 100 600 200 D 50 50 1 1 W
51 | ENDDRAW
52 | ENDDEF
53 | #
54 | #End Library
55 |
--------------------------------------------------------------------------------
/PCB/101-3/main.pro:
--------------------------------------------------------------------------------
1 | update=01/03/2022 00:15:06
2 | version=1
3 | last_client=kicad
4 | [general]
5 | version=1
6 | RootSch=
7 | BoardNm=
8 | [cvpcb]
9 | version=1
10 | NetIExt=net
11 | [eeschema]
12 | version=1
13 | LibDir=
14 | [eeschema/libraries]
15 | [schematic_editor]
16 | version=1
17 | PageLayoutDescrFile=
18 | PlotDirectoryName=
19 | SubpartIdSeparator=0
20 | SubpartFirstId=65
21 | NetFmtName=Pcbnew
22 | SpiceAjustPassiveValues=0
23 | LabSize=50
24 | ERC_TestSimilarLabels=1
25 | [pcbnew]
26 | version=1
27 | PageLayoutDescrFile=
28 | LastNetListRead=main.net
29 | CopperLayerCount=4
30 | BoardThickness=1.6
31 | AllowMicroVias=0
32 | AllowBlindVias=0
33 | RequireCourtyardDefinitions=0
34 | ProhibitOverlappingCourtyards=1
35 | MinTrackWidth=0.2
36 | MinViaDiameter=0.4
37 | MinViaDrill=0.3
38 | MinMicroViaDiameter=0.2
39 | MinMicroViaDrill=0.09999999999999999
40 | MinHoleToHole=0.25
41 | TrackWidth1=0.25
42 | TrackWidth2=0.293
43 | TrackWidth3=0.29337
44 | TrackWidth4=0.5
45 | TrackWidth5=1
46 | ViaDiameter1=0.8
47 | ViaDrill1=0.4
48 | ViaDiameter2=1
49 | ViaDrill2=0.8
50 | dPairWidth1=0.2
51 | dPairGap1=0.25
52 | dPairViaGap1=0.25
53 | SilkLineWidth=0.12
54 | SilkTextSizeV=1
55 | SilkTextSizeH=1
56 | SilkTextSizeThickness=0.15
57 | SilkTextItalic=0
58 | SilkTextUpright=1
59 | CopperLineWidth=0.2
60 | CopperTextSizeV=1.5
61 | CopperTextSizeH=1.5
62 | CopperTextThickness=0.3
63 | CopperTextItalic=0
64 | CopperTextUpright=1
65 | EdgeCutLineWidth=0.05
66 | CourtyardLineWidth=0.05
67 | OthersLineWidth=0.15
68 | OthersTextSizeV=1
69 | OthersTextSizeH=1
70 | OthersTextSizeThickness=0.15
71 | OthersTextItalic=0
72 | OthersTextUpright=1
73 | SolderMaskClearance=0
74 | SolderMaskMinWidth=0
75 | SolderPasteClearance=0
76 | SolderPasteRatio=-0
77 | [pcbnew/Layer.F.Cu]
78 | Name=F.Cu
79 | Type=0
80 | Enabled=1
81 | [pcbnew/Layer.In1.Cu]
82 | Name=GND
83 | Type=1
84 | Enabled=1
85 | [pcbnew/Layer.In2.Cu]
86 | Name=PWR
87 | Type=1
88 | Enabled=1
89 | [pcbnew/Layer.In3.Cu]
90 | Name=In3.Cu
91 | Type=0
92 | Enabled=0
93 | [pcbnew/Layer.In4.Cu]
94 | Name=In4.Cu
95 | Type=0
96 | Enabled=0
97 | [pcbnew/Layer.In5.Cu]
98 | Name=In5.Cu
99 | Type=0
100 | Enabled=0
101 | [pcbnew/Layer.In6.Cu]
102 | Name=In6.Cu
103 | Type=0
104 | Enabled=0
105 | [pcbnew/Layer.In7.Cu]
106 | Name=In7.Cu
107 | Type=0
108 | Enabled=0
109 | [pcbnew/Layer.In8.Cu]
110 | Name=In8.Cu
111 | Type=0
112 | Enabled=0
113 | [pcbnew/Layer.In9.Cu]
114 | Name=In9.Cu
115 | Type=0
116 | Enabled=0
117 | [pcbnew/Layer.In10.Cu]
118 | Name=In10.Cu
119 | Type=0
120 | Enabled=0
121 | [pcbnew/Layer.In11.Cu]
122 | Name=In11.Cu
123 | Type=0
124 | Enabled=0
125 | [pcbnew/Layer.In12.Cu]
126 | Name=In12.Cu
127 | Type=0
128 | Enabled=0
129 | [pcbnew/Layer.In13.Cu]
130 | Name=In13.Cu
131 | Type=0
132 | Enabled=0
133 | [pcbnew/Layer.In14.Cu]
134 | Name=In14.Cu
135 | Type=0
136 | Enabled=0
137 | [pcbnew/Layer.In15.Cu]
138 | Name=In15.Cu
139 | Type=0
140 | Enabled=0
141 | [pcbnew/Layer.In16.Cu]
142 | Name=In16.Cu
143 | Type=0
144 | Enabled=0
145 | [pcbnew/Layer.In17.Cu]
146 | Name=In17.Cu
147 | Type=0
148 | Enabled=0
149 | [pcbnew/Layer.In18.Cu]
150 | Name=In18.Cu
151 | Type=0
152 | Enabled=0
153 | [pcbnew/Layer.In19.Cu]
154 | Name=In19.Cu
155 | Type=0
156 | Enabled=0
157 | [pcbnew/Layer.In20.Cu]
158 | Name=In20.Cu
159 | Type=0
160 | Enabled=0
161 | [pcbnew/Layer.In21.Cu]
162 | Name=In21.Cu
163 | Type=0
164 | Enabled=0
165 | [pcbnew/Layer.In22.Cu]
166 | Name=In22.Cu
167 | Type=0
168 | Enabled=0
169 | [pcbnew/Layer.In23.Cu]
170 | Name=In23.Cu
171 | Type=0
172 | Enabled=0
173 | [pcbnew/Layer.In24.Cu]
174 | Name=In24.Cu
175 | Type=0
176 | Enabled=0
177 | [pcbnew/Layer.In25.Cu]
178 | Name=In25.Cu
179 | Type=0
180 | Enabled=0
181 | [pcbnew/Layer.In26.Cu]
182 | Name=In26.Cu
183 | Type=0
184 | Enabled=0
185 | [pcbnew/Layer.In27.Cu]
186 | Name=In27.Cu
187 | Type=0
188 | Enabled=0
189 | [pcbnew/Layer.In28.Cu]
190 | Name=In28.Cu
191 | Type=0
192 | Enabled=0
193 | [pcbnew/Layer.In29.Cu]
194 | Name=In29.Cu
195 | Type=0
196 | Enabled=0
197 | [pcbnew/Layer.In30.Cu]
198 | Name=In30.Cu
199 | Type=0
200 | Enabled=0
201 | [pcbnew/Layer.B.Cu]
202 | Name=B.Cu
203 | Type=0
204 | Enabled=1
205 | [pcbnew/Layer.B.Adhes]
206 | Enabled=1
207 | [pcbnew/Layer.F.Adhes]
208 | Enabled=1
209 | [pcbnew/Layer.B.Paste]
210 | Enabled=1
211 | [pcbnew/Layer.F.Paste]
212 | Enabled=1
213 | [pcbnew/Layer.B.SilkS]
214 | Enabled=1
215 | [pcbnew/Layer.F.SilkS]
216 | Enabled=1
217 | [pcbnew/Layer.B.Mask]
218 | Enabled=1
219 | [pcbnew/Layer.F.Mask]
220 | Enabled=1
221 | [pcbnew/Layer.Dwgs.User]
222 | Enabled=1
223 | [pcbnew/Layer.Cmts.User]
224 | Enabled=1
225 | [pcbnew/Layer.Eco1.User]
226 | Enabled=1
227 | [pcbnew/Layer.Eco2.User]
228 | Enabled=1
229 | [pcbnew/Layer.Edge.Cuts]
230 | Enabled=1
231 | [pcbnew/Layer.Margin]
232 | Enabled=1
233 | [pcbnew/Layer.B.CrtYd]
234 | Enabled=1
235 | [pcbnew/Layer.F.CrtYd]
236 | Enabled=1
237 | [pcbnew/Layer.B.Fab]
238 | Enabled=1
239 | [pcbnew/Layer.F.Fab]
240 | Enabled=1
241 | [pcbnew/Layer.Rescue]
242 | Enabled=0
243 | [pcbnew/Netclasses]
244 | [pcbnew/Netclasses/Default]
245 | Name=Default
246 | Clearance=0.2
247 | TrackWidth=0.25
248 | ViaDiameter=0.8
249 | ViaDrill=0.4
250 | uViaDiameter=0.3
251 | uViaDrill=0.1
252 | dPairWidth=0.2
253 | dPairGap=0.25
254 | dPairViaGap=0.25
255 |
--------------------------------------------------------------------------------
/PCB/101-3/report.txt:
--------------------------------------------------------------------------------
1 | Info: Processing component "R2:/617AAB6E:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
2 | Info: Processing component "GND1:/61981146:TestPoint:TestPoint_Pad_D1.5mm".
3 | Info: Processing component "HB1:/61853D6C:LED_SMD:LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
4 | Info: Processing component "J1:/617BE23C:Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical".
5 | Info: Processing component "J2:/61963625:TerminalBlock_TE-Connectivity:TerminalBlock_TE_282834-2_1x02_P2.54mm_Horizontal".
6 | Info: Processing component "J3:/6180F261:Connector_USB:USB_Micro-B_Amphenol_10103594-0001LF_Horizontal".
7 | Info: Processing component "3V3:/618832CE:LED_SMD:LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
8 | Info: Processing component "J5:/6195374E:Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical".
9 | Info: Processing component "J6:/621E8932:Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical".
10 | Info: Processing component "L1:/619CD27C:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
11 | Info: Processing component "R1:/617A9750:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
12 | Info: Processing component "J4:/618D8888:Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical".
13 | Info: Processing component "R3:/61856ED3:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
14 | Info: Processing component "R4:/618772FD:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
15 | Info: Processing component "R5:/618832D5:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
16 | Info: Processing component "RST1:/6197BBD1:TestPoint:TestPoint_Pad_D1.5mm".
17 | Info: Processing component "SCL1:/61906980:TestPoint:TestPoint_Pad_D1.5mm".
18 | Info: Processing component "SDA1:/619098E4:TestPoint:TestPoint_Pad_D1.5mm".
19 | Info: Processing component "U1:/6164AFD9:mmilibrary:LoRa-E5".
20 | Info: Processing component "U2:/61802F1D:Package_LGA:Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering".
21 | Info: Processing component "U3:/61787A56:Package_TO_SOT_SMD:SOT-23-5_HandSoldering".
22 | Info: Processing component "C3:/61781AAA:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
23 | Info: Processing component "3V3_OUT1:/618F8508:TestPoint:TestPoint_Pad_D1.5mm".
24 | Info: Processing component "ALERT1:/618772F6:LED_SMD:LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
25 | Info: Processing component "BOOT_TP1:/6197CBDD:TestPoint:TestPoint_Pad_D1.5mm".
26 | Info: Processing component "C1:/61772FC0:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
27 | Info: Processing component "C2:/6179A095:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
28 | Info: Processing component "C4:/6179A0A9:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
29 | Info: Processing component "C5:/618C5A71:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
30 | Info: Processing component "C6:/618C69FF:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
31 | Info: Processing component "C7:/619CC8DD:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
32 | Info: Processing component "C8:/619CDAB6:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
33 | Info: Processing component "E1:/619C1B4A:mmilibrary:XDCR_ANT-868-USP410".
34 | Info: Processing component "FB1:/618FFA2B:Capacitor_SMD:C_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
35 | Info: Processing component "FT1:/619C09A1:TestPoint:TestPoint_Pad_D1.5mm".
36 | Info: Processing component "F1:/61906770:Capacitor_SMD:C_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
37 | Add net Net-(U1-Pad20).
38 | Add net ADC_IN3.
39 | Connect U1 pin 7 to ADC_IN3.
40 | Add net Net-(U1-Pad11).
41 | Connect U1 pin 11 to Net-(U1-Pad11).
42 | Add net Net-(U1-Pad8).
43 | Connect U1 pin 8 to Net-(U1-Pad8).
44 | Add net Net-(U1-Pad12).
45 | Connect U1 pin 12 to Net-(U1-Pad12).
46 | Add net Net-(U1-Pad13).
47 | Connect U1 pin 13 to Net-(U1-Pad13).
48 | Change GND reference to GND1.
49 | Connect U1 pin 20 to Net-(U1-Pad20).
50 | Add net Net-(U1-Pad21).
51 | Connect U1 pin 21 to Net-(U1-Pad21).
52 | Add net Net-(U1-Pad25).
53 | Connect U1 pin 25 to Net-(U1-Pad25).
54 | Add net Net-(U1-Pad26).
55 | Connect U1 pin 26 to Net-(U1-Pad26).
56 | Change 3V3 reference to 3V3_OUT1.
57 | Connect USB_PWR pin 4 to Net-(J3-Pad4).
58 | Add net Net-(J1-Pad6).
59 | Add net Net-(J3-Pad2).
60 | Connect USB_PWR pin 2 to Net-(J3-Pad2).
61 | Change ANT reference to E1.
62 | Change UART reference to J4.
63 | Change USB_PWR reference to J3.
64 | Change USART reference to J5.
65 | Add net Net-(E1-Pad2).
66 | Add J6 (footprint "Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical").
67 | Connect ANT pin 2 to Net-(E1-Pad2).
68 | Connect DEBUG pin 6 to Net-(J1-Pad6).
69 | Connect USB_PWR pin 3 to Net-(J3-Pad3).
70 | Change DEBUG reference to J1.
71 | Change FT reference to FT1.
72 | Add net Net-(J3-Pad3).
73 | Change HB reference to HB1.
74 | Change RST reference to RST1.
75 | Change BOOT reference to BOOT_TP1.
76 | Change SCL reference to SCL1.
77 | Add net Net-(J3-Pad4).
78 | Change SDA reference to SDA1.
79 |
--------------------------------------------------------------------------------
/PCB/101-3/sym-lib-table:
--------------------------------------------------------------------------------
1 | (sym_lib_table
2 | (lib (name main-rescue)(type Legacy)(uri ${KIPRJMOD}/main-rescue.lib)(options "")(descr ""))
3 | (lib (name 868Ant)(type Legacy)(uri D:/KicadSpareLibrary/SamacSys_Parts.lib)(options "")(descr ""))
4 | (lib (name sma)(type Legacy)(uri C:/Github/Indoor-Air-Quality-BME688-STM32WLE5JC/KiCad/KicadMainLibrary/smaConnector.lib)(options "")(descr ""))
5 | )
6 |
--------------------------------------------------------------------------------
/PCB/101-5/Schematic.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mircerson/AERQ/dbc6496a244e5dd6573510e8facbebcb746e76b5/PCB/101-5/Schematic.pdf
--------------------------------------------------------------------------------
/PCB/101-5/Sensor.dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | $CMP ADE7758
4 | D Poly Phase Multifunction Energy Metering, SO-24
5 | K Energy Metering
6 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ADE7758.pdf
7 | $ENDCMP
8 | #
9 | $CMP ADE7763xRS
10 | D Single-Phase Active and Apparent Energy Metering, SSOP-20
11 | K Energy Metering
12 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ADE7763.pdf
13 | $ENDCMP
14 | #
15 | $CMP ADE7953xCP
16 | D Single Phase Multifunction Energy Metering with Neutral Current Measurement, LFCSP-28
17 | K Energy Metering
18 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ADE7953.pdf
19 | $ENDCMP
20 | #
21 | $CMP AS3935
22 | D Programmable fully integrated Lightning Sensor IC
23 | K lightning sensor
24 | F https://www.embeddedadventures.com/datasheets/AS3935_Datasheet_EN_v2.pdf
25 | $ENDCMP
26 | #
27 | $CMP BL0937
28 | D Single Phase Energy Meter IC with Integrated Oscillator, SOP-8
29 | K current sensor
30 | F http://www.belling.com.cn/media/file_object/bel_product/BL0937/datasheet/BL0937_V1.02_en.pdf
31 | $ENDCMP
32 | #
33 | $CMP BME280
34 | D 3-in-1 sensor, humidity, pressure, temperature, I2C and SPI interface, 1.71-3.6V, LGA-8
35 | K Bosch pressure humidity temperature environment environmental measurement digital
36 | F https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280-DS002.pdf
37 | $ENDCMP
38 | #
39 | $CMP BME680
40 | D 4-in-1 sensor, gas, humidity, pressure, temperature, I2C and SPI interface, 1.71-3.6V, LGA-8
41 | K Bosch gas pressure humidity temperature environment environmental measurement digital
42 | F https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME680-DS001.pdf
43 | $ENDCMP
44 | #
45 | $CMP CHT11
46 | D Temperature and humidity module
47 | K Digital temperature humidity sensor
48 | F http://aosong.com/en/products-21.html
49 | $ENDCMP
50 | #
51 | $CMP DHT11
52 | D Temperature and humidity module
53 | K Digital temperature humidity sensor
54 | F http://akizukidenshi.com/download/ds/aosong/DHT11.pdf
55 | $ENDCMP
56 | #
57 | $CMP INA260
58 | D Current/power/voltage monitor with Integrated 2mΩ Shunt Resistor, 2.7V - 5.5V, I2C, TSSOP-16
59 | K Current/power/voltage monitor
60 | F http://www.ti.com/lit/ds/symlink/ina260.pdf
61 | $ENDCMP
62 | #
63 | $CMP LTC2990
64 | D Temperature Voltage and Current Monitor, I2C Interface, MSOP-10
65 | K Temperature Voltage Current Monitor I2C AFE
66 | F https://www.analog.com/media/en/technical-documentation/data-sheets/ltc2990.pdf
67 | $ENDCMP
68 | #
69 | $CMP MAX30102
70 | D Heart Rate Sensor, 14-OLGA
71 | K Heart Rate
72 | F https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf
73 | $ENDCMP
74 | #
75 | $CMP Nuclear-Radiation_Detector
76 | D Generic radiation detector
77 | K nuclear ionising radiation sensor geiger mueller muller tube neutron counter ionization chamber
78 | F ~
79 | $ENDCMP
80 | #
81 | $CMP SHT1x
82 | D Temperature and humidity module
83 | K digital temperature humidity sensor
84 | F https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/0_Datasheets/Humidity/Sensirion_Humidity_Sensors_SHT1x_Datasheet.pdf
85 | $ENDCMP
86 | #
87 | #End Doc Library
88 |
--------------------------------------------------------------------------------
/PCB/101-5/fp-lib-table:
--------------------------------------------------------------------------------
1 | (fp_lib_table
2 | (lib (name Logo)(type KiCad)(uri "C:/Users/Mircea-Iuliu/Documents/KiCad Projects/MCU DIFFERENT PACKAGe/MICROCHIPLORABOARD/logo.pretty")(options "")(descr ""))
3 | )
4 |
--------------------------------------------------------------------------------
/PCB/101-5/main-rescue.dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | #End Doc Library
4 |
--------------------------------------------------------------------------------
/PCB/101-5/main-rescue.lib:
--------------------------------------------------------------------------------
1 | EESchema-LIBRARY Version 2.4
2 | #encoding utf-8
3 | #
4 | # ANT-868-USP410-Antenna
5 | #
6 | DEF ANT-868-USP410-Antenna E 0 40 Y N 1 L N
7 | F0 "E" 80 30 50 H V L BNN
8 | F1 "ANT-868-USP410-Antenna" 85 -40 50 H V L BNN
9 | F2 "XDCR_ANT-868-USP410" 0 0 50 H I L BNN
10 | F3 "" 0 0 50 H I L BNN
11 | F4 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD"
12 | F5 "DS20241-03ANT" 0 0 50 H I L BNN "PARTREV"
13 | F6 "Linx" 0 0 50 H I L BNN "MANUFACTURER"
14 | F7 "2.9 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT"
15 | DRAW
16 | P 2 0 0 10 -55 125 0 125 N
17 | P 2 0 0 10 -30 -130 30 -130 N
18 | P 2 0 0 10 -5 -160 10 -160 N
19 | P 2 0 0 10 0 -100 -50 -100 N
20 | P 2 0 0 10 0 -100 50 -100 N
21 | P 2 0 0 10 0 0 -55 125 N
22 | P 2 0 0 10 0 0 0 -100 N
23 | P 2 0 0 10 0 125 0 0 N
24 | P 2 0 0 10 0 125 55 125 N
25 | P 2 0 0 10 55 125 0 0 N
26 | X ~ 1 -100 0 100 R 40 40 0 0 P
27 | X ~ 2 -100 -100 100 R 40 40 0 0 W
28 | ENDDRAW
29 | ENDDEF
30 | #
31 | # BME688-BME688
32 | #
33 | DEF BME688-BME688 U 0 20 Y Y 1 F N
34 | F0 "U" -350 450 50 H V C CNN
35 | F1 "BME688-BME688" 300 450 50 H V C CNN
36 | F2 "Package_LGA:Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering" 1450 -450 50 H I C CNN
37 | F3 "" 0 -200 50 H I C CNN
38 | $FPLIST
39 | *LGA*3x3mm*P0.8mm*Clockwise*
40 | $ENDFPLIST
41 | DRAW
42 | S -400 400 400 -400 0 1 10 f
43 | X GND 1 -100 -600 200 U 50 50 1 1 W
44 | X CSB 2 600 100 200 L 50 50 1 1 I
45 | X SDI 3 -600 100 200 R 50 50 1 1 B
46 | X SCK 4 -600 -100 200 R 50 50 1 1 I
47 | X SDO 5 600 -100 200 L 50 50 1 1 B
48 | X VDDIO 6 -100 600 200 D 50 50 1 1 W
49 | X GND 7 100 -600 200 U 50 50 1 1 W
50 | X VDD 8 100 600 200 D 50 50 1 1 W
51 | ENDDRAW
52 | ENDDEF
53 | #
54 | #End Library
55 |
--------------------------------------------------------------------------------
/PCB/101-5/main.csv:
--------------------------------------------------------------------------------
1 | Source:,C:\Github\Indoor-Air-Quality-BME688-STM32WLE5JC\KiCad\Indoor Air Monitor\101-4\main.sch,,,,,,,,,
2 | Date:,13/03/2022 15:14,,,,,,,,,
3 | Tool:,Eeschema (5.1.10)-1,,,,,,,,,
4 | Generator:,C:\Program Files\KiCad\bin\scripting\plugins/bom_csv_grouped_by_value.py,,,,,,,,,
5 | Component Count:,35,,,,,,,,,
6 | ,,,,,,,,,,
7 | Individual Components:,,,,,,,,,,
8 | ,,,,,,,,,,
9 | Item,Qty,Reference(s),Value,LibPart,Footprint,Datasheet,MANUFACTURER,MAXIMUM_PACKAGE_HEIGHT,PARTREV,STANDARD
10 | ,,3V1,PWR,Device:LED_Small,LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder,~,,,,
11 | ,,3V3_OUT1,3V3_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
12 | ,,ALERT1,ALERT,Device:LED_Small,LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder,~,,,,
13 | ,,C1,100nF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
14 | ,,C2,100nF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
15 | ,,C3,4.7uF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
16 | ,,C4,100nF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
17 | ,,C5,1uF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
18 | ,,C6,1uF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
19 | ,,C7,DNP,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
20 | ,,C8,DNP,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
21 | ,,CON_DEBUG1,Conn_01x02_Male,Connector:Conn_01x02_Male,Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical,~,,,,
22 | ,,E1,ANT-868-USP410,main-rescue:ANT-868-USP410-Antenna,mmilibrary:XDCR_ANT-868-USP410,,Linx,2.9 mm,DS20241-03ANT,Manufacturer Recommendations
23 | ,,F1,300mA Fuse,Device:Polyfuse_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
24 | ,,FB1,FB,Device:Ferrite_Bead_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
25 | ,,FT1,FT_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
26 | ,,GND1,GND,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
27 | ,,HB1,HEARTBEAT,Device:LED_Small,LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder,~,,,,
28 | ,,J1,1x6 header,Connector:Conn_01x06_Male,Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical,~,,,,
29 | ,,J2,Screw_Terminal_01x02,Connector:Screw_Terminal_01x02,TerminalBlock_TE-Connectivity:TerminalBlock_TE_282834-2_1x02_P2.54mm_Horizontal,~,,,,
30 | ,,J4,Conn_01x03,Connector_Generic:Conn_01x03,Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical,~,,,,
31 | ,,J5,Conn_01x03,Connector_Generic:Conn_01x03,Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical,~,,,,
32 | ,,J6,Conn_01x04_Female,Connector:Conn_01x04_Female,Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_Vertical,~,,,,
33 | ,,L1,DNP,Device:L_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
34 | ,,R1,4.7k,Device:R_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
35 | ,,R2,4.7k,Device:R_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
36 | ,,R3,1.8k,Device:R_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
37 | ,,R4,1.8k,Device:R_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
38 | ,,R5,1.8k,Device:R_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
39 | ,,SCL1,SCL_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
40 | ,,SDA1,SDA_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
41 | ,,U1,LoRa-E5,LoRa-E5:LoRa-E5,mmilibrary:LoRa-E5,,,,,
42 | ,,U2,BME688,main-rescue:BME688-BME688,Package_LGA:Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering,,,,,
43 | ,,U3,TLV70333DBVR,mmiSymbol:TLV70333DBVR,Package_TO_SOT_SMD:SOT-23-5_HandSoldering,https://www.ti.com/lit/ds/symlink/tlv703.pdf?ts=1635229150191&ref_url=https%253A%252F%252Fwww.ti.com%252Fstore%252Fti%252Fen%252Fp%252Fproduct%252F%253Fp%253DTLV70333DBVR,,,,
44 | ,,USB_PWR1,USB_B_Micro,Connector:USB_B_Micro,Connector_USB:USB_Micro-B_Amphenol_10103594-0001LF_Horizontal,~,,,,
45 | ,,,,,,,,,,
46 | ,,,,,,,,,,
47 | ,,,,,,,,,,
48 | Collated Components:,,,,,,,,,,
49 | ,,,,,,,,,,
50 | Item,Qty,Reference(s),Value,LibPart,Footprint,Datasheet,MANUFACTURER,MAXIMUM_PACKAGE_HEIGHT,PARTREV,STANDARD
51 | 1,1,3V1,PWR,Device:LED_Small,LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder,~,,,,
52 | 2,1,3V3_OUT1,3V3_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
53 | 3,1,ALERT1,ALERT,Device:LED_Small,LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder,~,,,,
54 | 4,3,"C1, C2, C4",100nF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
55 | 5,1,C3,4.7uF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
56 | 6,2,"C5, C6",1uF,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
57 | 7,2,"C7, C8",DNP,Device:C_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
58 | 8,1,CON_DEBUG1,Conn_01x02_Male,Connector:Conn_01x02_Male,Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical,~,,,,
59 | 9,1,E1,ANT-868-USP410,main-rescue:ANT-868-USP410-Antenna,mmilibrary:XDCR_ANT-868-USP410,,Linx,2.9 mm,DS20241-03ANT,Manufacturer Recommendations
60 | 10,1,F1,300mA Fuse,Device:Polyfuse_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
61 | 11,1,FB1,FB,Device:Ferrite_Bead_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
62 | 12,1,FT1,FT_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
63 | 13,1,GND1,GND,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
64 | 14,1,HB1,HEARTBEAT,Device:LED_Small,LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder,~,,,,
65 | 15,1,J1,1x6 header,Connector:Conn_01x06_Male,Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical,~,,,,
66 | 16,1,J2,Screw_Terminal_01x02,Connector:Screw_Terminal_01x02,TerminalBlock_TE-Connectivity:TerminalBlock_TE_282834-2_1x02_P2.54mm_Horizontal,~,,,,
67 | 17,2,"J4, J5",Conn_01x03,Connector_Generic:Conn_01x03,Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical,~,,,,
68 | 18,1,J6,Conn_01x04_Female,Connector:Conn_01x04_Female,Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_Vertical,~,,,,
69 | 19,1,L1,DNP,Device:L_Small,Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder,~,,,,
70 | 20,2,"R1, R2",4.7k,Device:R_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
71 | 21,3,"R3, R4, R5",1.8k,Device:R_Small,Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder,~,,,,
72 | 22,1,SCL1,SCL_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
73 | 23,1,SDA1,SDA_TP,Connector:TestPoint_Small,TestPoint:TestPoint_Pad_D1.0mm,~,,,,
74 | 24,1,U1,LoRa-E5,LoRa-E5:LoRa-E5,mmilibrary:LoRa-E5,,,,,
75 | 25,1,U2,BME688,main-rescue:BME688-BME688,Package_LGA:Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering,,,,,
76 | 26,1,U3,TLV70333DBVR,mmiSymbol:TLV70333DBVR,Package_TO_SOT_SMD:SOT-23-5_HandSoldering,https://www.ti.com/lit/ds/symlink/tlv703.pdf?ts=1635229150191&ref_url=https%253A%252F%252Fwww.ti.com%252Fstore%252Fti%252Fen%252Fp%252Fproduct%252F%253Fp%253DTLV70333DBVR,,,,
77 | 27,1,USB_PWR1,USB_B_Micro,Connector:USB_B_Micro,Connector_USB:USB_Micro-B_Amphenol_10103594-0001LF_Horizontal,~,,,,
78 |
--------------------------------------------------------------------------------
/PCB/101-5/main.pro:
--------------------------------------------------------------------------------
1 | update=23/03/2022 21:49:07
2 | version=1
3 | last_client=kicad
4 | [general]
5 | version=1
6 | RootSch=
7 | BoardNm=
8 | [cvpcb]
9 | version=1
10 | NetIExt=net
11 | [eeschema]
12 | version=1
13 | LibDir=
14 | [eeschema/libraries]
15 | [pcbnew]
16 | version=1
17 | PageLayoutDescrFile=
18 | LastNetListRead=main.net
19 | CopperLayerCount=4
20 | BoardThickness=1.6
21 | AllowMicroVias=0
22 | AllowBlindVias=0
23 | RequireCourtyardDefinitions=0
24 | ProhibitOverlappingCourtyards=1
25 | MinTrackWidth=0.2
26 | MinViaDiameter=0.3
27 | MinViaDrill=0.3
28 | MinMicroViaDiameter=0.2
29 | MinMicroViaDrill=0.09999999999999999
30 | MinHoleToHole=0.25
31 | TrackWidth1=0.25
32 | TrackWidth2=0.293
33 | TrackWidth3=0.29337
34 | TrackWidth4=0.35
35 | TrackWidth5=0.5
36 | TrackWidth6=1
37 | ViaDiameter1=0.8
38 | ViaDrill1=0.4
39 | ViaDiameter2=1
40 | ViaDrill2=0.8
41 | dPairWidth1=0.2
42 | dPairGap1=0.25
43 | dPairViaGap1=0.25
44 | SilkLineWidth=0.12
45 | SilkTextSizeV=1
46 | SilkTextSizeH=1
47 | SilkTextSizeThickness=0.15
48 | SilkTextItalic=0
49 | SilkTextUpright=1
50 | CopperLineWidth=0.2
51 | CopperTextSizeV=1.5
52 | CopperTextSizeH=1.5
53 | CopperTextThickness=0.3
54 | CopperTextItalic=0
55 | CopperTextUpright=1
56 | EdgeCutLineWidth=0.05
57 | CourtyardLineWidth=0.05
58 | OthersLineWidth=0.15
59 | OthersTextSizeV=1
60 | OthersTextSizeH=1
61 | OthersTextSizeThickness=0.15
62 | OthersTextItalic=0
63 | OthersTextUpright=1
64 | SolderMaskClearance=0
65 | SolderMaskMinWidth=0
66 | SolderPasteClearance=0
67 | SolderPasteRatio=-0
68 | [pcbnew/Layer.F.Cu]
69 | Name=F.Cu
70 | Type=0
71 | Enabled=1
72 | [pcbnew/Layer.In1.Cu]
73 | Name=GND
74 | Type=1
75 | Enabled=1
76 | [pcbnew/Layer.In2.Cu]
77 | Name=PWR
78 | Type=1
79 | Enabled=1
80 | [pcbnew/Layer.In3.Cu]
81 | Name=In3.Cu
82 | Type=0
83 | Enabled=0
84 | [pcbnew/Layer.In4.Cu]
85 | Name=In4.Cu
86 | Type=0
87 | Enabled=0
88 | [pcbnew/Layer.In5.Cu]
89 | Name=In5.Cu
90 | Type=0
91 | Enabled=0
92 | [pcbnew/Layer.In6.Cu]
93 | Name=In6.Cu
94 | Type=0
95 | Enabled=0
96 | [pcbnew/Layer.In7.Cu]
97 | Name=In7.Cu
98 | Type=0
99 | Enabled=0
100 | [pcbnew/Layer.In8.Cu]
101 | Name=In8.Cu
102 | Type=0
103 | Enabled=0
104 | [pcbnew/Layer.In9.Cu]
105 | Name=In9.Cu
106 | Type=0
107 | Enabled=0
108 | [pcbnew/Layer.In10.Cu]
109 | Name=In10.Cu
110 | Type=0
111 | Enabled=0
112 | [pcbnew/Layer.In11.Cu]
113 | Name=In11.Cu
114 | Type=0
115 | Enabled=0
116 | [pcbnew/Layer.In12.Cu]
117 | Name=In12.Cu
118 | Type=0
119 | Enabled=0
120 | [pcbnew/Layer.In13.Cu]
121 | Name=In13.Cu
122 | Type=0
123 | Enabled=0
124 | [pcbnew/Layer.In14.Cu]
125 | Name=In14.Cu
126 | Type=0
127 | Enabled=0
128 | [pcbnew/Layer.In15.Cu]
129 | Name=In15.Cu
130 | Type=0
131 | Enabled=0
132 | [pcbnew/Layer.In16.Cu]
133 | Name=In16.Cu
134 | Type=0
135 | Enabled=0
136 | [pcbnew/Layer.In17.Cu]
137 | Name=In17.Cu
138 | Type=0
139 | Enabled=0
140 | [pcbnew/Layer.In18.Cu]
141 | Name=In18.Cu
142 | Type=0
143 | Enabled=0
144 | [pcbnew/Layer.In19.Cu]
145 | Name=In19.Cu
146 | Type=0
147 | Enabled=0
148 | [pcbnew/Layer.In20.Cu]
149 | Name=In20.Cu
150 | Type=0
151 | Enabled=0
152 | [pcbnew/Layer.In21.Cu]
153 | Name=In21.Cu
154 | Type=0
155 | Enabled=0
156 | [pcbnew/Layer.In22.Cu]
157 | Name=In22.Cu
158 | Type=0
159 | Enabled=0
160 | [pcbnew/Layer.In23.Cu]
161 | Name=In23.Cu
162 | Type=0
163 | Enabled=0
164 | [pcbnew/Layer.In24.Cu]
165 | Name=In24.Cu
166 | Type=0
167 | Enabled=0
168 | [pcbnew/Layer.In25.Cu]
169 | Name=In25.Cu
170 | Type=0
171 | Enabled=0
172 | [pcbnew/Layer.In26.Cu]
173 | Name=In26.Cu
174 | Type=0
175 | Enabled=0
176 | [pcbnew/Layer.In27.Cu]
177 | Name=In27.Cu
178 | Type=0
179 | Enabled=0
180 | [pcbnew/Layer.In28.Cu]
181 | Name=In28.Cu
182 | Type=0
183 | Enabled=0
184 | [pcbnew/Layer.In29.Cu]
185 | Name=In29.Cu
186 | Type=0
187 | Enabled=0
188 | [pcbnew/Layer.In30.Cu]
189 | Name=In30.Cu
190 | Type=0
191 | Enabled=0
192 | [pcbnew/Layer.B.Cu]
193 | Name=B.Cu
194 | Type=0
195 | Enabled=1
196 | [pcbnew/Layer.B.Adhes]
197 | Enabled=1
198 | [pcbnew/Layer.F.Adhes]
199 | Enabled=1
200 | [pcbnew/Layer.B.Paste]
201 | Enabled=1
202 | [pcbnew/Layer.F.Paste]
203 | Enabled=1
204 | [pcbnew/Layer.B.SilkS]
205 | Enabled=1
206 | [pcbnew/Layer.F.SilkS]
207 | Enabled=1
208 | [pcbnew/Layer.B.Mask]
209 | Enabled=1
210 | [pcbnew/Layer.F.Mask]
211 | Enabled=1
212 | [pcbnew/Layer.Dwgs.User]
213 | Enabled=1
214 | [pcbnew/Layer.Cmts.User]
215 | Enabled=1
216 | [pcbnew/Layer.Eco1.User]
217 | Enabled=1
218 | [pcbnew/Layer.Eco2.User]
219 | Enabled=1
220 | [pcbnew/Layer.Edge.Cuts]
221 | Enabled=1
222 | [pcbnew/Layer.Margin]
223 | Enabled=1
224 | [pcbnew/Layer.B.CrtYd]
225 | Enabled=1
226 | [pcbnew/Layer.F.CrtYd]
227 | Enabled=1
228 | [pcbnew/Layer.B.Fab]
229 | Enabled=1
230 | [pcbnew/Layer.F.Fab]
231 | Enabled=1
232 | [pcbnew/Layer.Rescue]
233 | Enabled=0
234 | [pcbnew/Netclasses]
235 | [pcbnew/Netclasses/Default]
236 | Name=Default
237 | Clearance=0.2
238 | TrackWidth=0.25
239 | ViaDiameter=0.8
240 | ViaDrill=0.4
241 | uViaDiameter=0.3
242 | uViaDrill=0.1
243 | dPairWidth=0.2
244 | dPairGap=0.25
245 | dPairViaGap=0.25
246 | [schematic_editor]
247 | version=1
248 | PageLayoutDescrFile=
249 | PlotDirectoryName=
250 | SubpartIdSeparator=0
251 | SubpartFirstId=65
252 | NetFmtName=Pcbnew
253 | SpiceAjustPassiveValues=0
254 | LabSize=50
255 | ERC_TestSimilarLabels=1
256 |
--------------------------------------------------------------------------------
/PCB/101-5/report.txt:
--------------------------------------------------------------------------------
1 | Info: Processing component "R2:/617AAB6E:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
2 | Info: Processing component "GND1:/61981146:TestPoint:TestPoint_Pad_D1.5mm".
3 | Info: Processing component "HB1:/61853D6C:LED_SMD:LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
4 | Info: Processing component "J1:/617BE23C:Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical".
5 | Info: Processing component "J2:/61963625:TerminalBlock_TE-Connectivity:TerminalBlock_TE_282834-2_1x02_P2.54mm_Horizontal".
6 | Info: Processing component "J3:/6180F261:Connector_USB:USB_Micro-B_Amphenol_10103594-0001LF_Horizontal".
7 | Info: Processing component "3V3:/618832CE:LED_SMD:LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
8 | Info: Processing component "J5:/6195374E:Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical".
9 | Info: Processing component "J6:/621E8932:Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical".
10 | Info: Processing component "L1:/619CD27C:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
11 | Info: Processing component "R1:/617A9750:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
12 | Info: Processing component "J4:/618D8888:Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical".
13 | Info: Processing component "R3:/61856ED3:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
14 | Info: Processing component "R4:/618772FD:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
15 | Info: Processing component "R5:/618832D5:Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder".
16 | Info: Processing component "RST1:/6197BBD1:TestPoint:TestPoint_Pad_D1.5mm".
17 | Info: Processing component "SCL1:/61906980:TestPoint:TestPoint_Pad_D1.5mm".
18 | Info: Processing component "SDA1:/619098E4:TestPoint:TestPoint_Pad_D1.5mm".
19 | Info: Processing component "U1:/6164AFD9:mmilibrary:LoRa-E5".
20 | Info: Processing component "U2:/61802F1D:Package_LGA:Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering".
21 | Info: Processing component "U3:/61787A56:Package_TO_SOT_SMD:SOT-23-5_HandSoldering".
22 | Info: Processing component "C3:/61781AAA:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
23 | Info: Processing component "3V3_OUT1:/618F8508:TestPoint:TestPoint_Pad_D1.5mm".
24 | Info: Processing component "ALERT1:/618772F6:LED_SMD:LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
25 | Info: Processing component "BOOT_TP1:/6197CBDD:TestPoint:TestPoint_Pad_D1.5mm".
26 | Info: Processing component "C1:/61772FC0:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
27 | Info: Processing component "C2:/6179A095:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
28 | Info: Processing component "C4:/6179A0A9:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
29 | Info: Processing component "C5:/618C5A71:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
30 | Info: Processing component "C6:/618C69FF:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
31 | Info: Processing component "C7:/619CC8DD:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
32 | Info: Processing component "C8:/619CDAB6:Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder".
33 | Info: Processing component "E1:/619C1B4A:mmilibrary:XDCR_ANT-868-USP410".
34 | Info: Processing component "FB1:/618FFA2B:Capacitor_SMD:C_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
35 | Info: Processing component "FT1:/619C09A1:TestPoint:TestPoint_Pad_D1.5mm".
36 | Info: Processing component "F1:/61906770:Capacitor_SMD:C_0201_0603Metric_Pad0.64x0.40mm_HandSolder".
37 | Add net Net-(U1-Pad20).
38 | Add net ADC_IN3.
39 | Connect U1 pin 7 to ADC_IN3.
40 | Add net Net-(U1-Pad11).
41 | Connect U1 pin 11 to Net-(U1-Pad11).
42 | Add net Net-(U1-Pad8).
43 | Connect U1 pin 8 to Net-(U1-Pad8).
44 | Add net Net-(U1-Pad12).
45 | Connect U1 pin 12 to Net-(U1-Pad12).
46 | Add net Net-(U1-Pad13).
47 | Connect U1 pin 13 to Net-(U1-Pad13).
48 | Change GND reference to GND1.
49 | Connect U1 pin 20 to Net-(U1-Pad20).
50 | Add net Net-(U1-Pad21).
51 | Connect U1 pin 21 to Net-(U1-Pad21).
52 | Add net Net-(U1-Pad25).
53 | Connect U1 pin 25 to Net-(U1-Pad25).
54 | Add net Net-(U1-Pad26).
55 | Connect U1 pin 26 to Net-(U1-Pad26).
56 | Change 3V3 reference to 3V3_OUT1.
57 | Connect USB_PWR pin 4 to Net-(J3-Pad4).
58 | Add net Net-(J1-Pad6).
59 | Add net Net-(J3-Pad2).
60 | Connect USB_PWR pin 2 to Net-(J3-Pad2).
61 | Change ANT reference to E1.
62 | Change UART reference to J4.
63 | Change USB_PWR reference to J3.
64 | Change USART reference to J5.
65 | Add net Net-(E1-Pad2).
66 | Add J6 (footprint "Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical").
67 | Connect ANT pin 2 to Net-(E1-Pad2).
68 | Connect DEBUG pin 6 to Net-(J1-Pad6).
69 | Connect USB_PWR pin 3 to Net-(J3-Pad3).
70 | Change DEBUG reference to J1.
71 | Change FT reference to FT1.
72 | Add net Net-(J3-Pad3).
73 | Change HB reference to HB1.
74 | Change RST reference to RST1.
75 | Change BOOT reference to BOOT_TP1.
76 | Change SCL reference to SCL1.
77 | Add net Net-(J3-Pad4).
78 | Change SDA reference to SDA1.
79 |
--------------------------------------------------------------------------------
/PCB/101-5/sym-lib-table:
--------------------------------------------------------------------------------
1 | (sym_lib_table
2 | (lib (name main-rescue)(type Legacy)(uri ${KIPRJMOD}/main-rescue.lib)(options "")(descr ""))
3 | (lib (name RescueMicrochip)(type Legacy)(uri "C:/Github/Indoor-Air-Quality-BME688-STM32WLE5JC/KiCad/KiCad Projects/MCU DIFFERENT PACKAGe/MICROCHIPLORABOARD/MICROCHIPLORABOARD-rescue.lib")(options "")(descr ""))
4 | )
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AERQ - Indoor air quality monitor
2 |
3 | ## Introduction
4 | This is the repository for AERQ, a USB-powered indoor air quality monitor using the
5 | [here](/PCB/101-5/) Bosch BME688 sensor, running on mbed os.
6 | It measures temperature, humidity, CO2 and IAQ using the BSEC 2.x library.
7 | This data is then sent to The Things Network.
8 | 
9 |
10 |
11 |
12 | ## PCB
13 | This project features a custom 4 layer board using the Seeed E5-LoRa and the Bosch BME688.
14 | Two variants of the board, one with a chip antenna ( Linx USP-410 ) and one with a u.Fl connector.
15 |
16 | Find more about the [STM32WL - Seeed E5-LoRa](https://www.seeedstudio.com/LoRa-E5-Wireless-Module-p-4745.html).
17 |
18 |
19 | For the PCB with the integrated antenna, click here [here](/PCB/101-5/)
20 |
21 |
22 | For the PCB with an external u.Fl connector, click [here](/PCB/101-3/)
23 |
24 |
25 |
26 |
27 |
28 | ## Code
29 |
30 | The code runs on mbed os 6.15.1 with the latest LoRaWan stack.
31 | Insert your TTN credentials in mbed_app.json before running the application.
32 |
33 | This code features a custom target on mbed os which configures the RF switch properly and adds a few macros for the board.
34 |
35 | See mbed_app.json and custom_targets.json for more details.
36 |
37 |
38 | Thanks to [hallard](https://github.com/hallard/LoRa-E5-Breakout) for adding the support in the official mbed os custom target repository.
39 |
40 |
41 | ## Payload decoder for TTN
42 | The payload should provide the following result:
43 | 
44 |
45 |
46 |
47 | ```
48 | function Decoder(bytes, port) {
49 | // Decode plain text; for testing only
50 | //var statusFromDevice = String.fromCharCode.apply(null, bytes.slice(12,13))
51 |
52 | let StringOfBytes = String.fromCharCode.apply(null, bytes);
53 |
54 | var temperature;
55 | var humidity;
56 | var iaq;
57 | var iaqAccuracy;
58 | var CO2;
59 |
60 | const Array = StringOfBytes.split(" ");
61 | temperature = Array[0];
62 | humidity = Array[1];
63 | statusFromDevice = Array[2];
64 | iaq = Array[3];
65 | CO2 = Array[4];
66 |
67 | var statusToDisplay;
68 |
69 | if (statusFromDevice == "0"){
70 | statusToDisplay = "Device warming up";
71 | } else if(statusFromDevice == "1")
72 | {
73 | statusToDisplay = "Device is adjusting to the envinroment - calibrating";
74 | }else if(statusFromDevice == "2")
75 | {
76 | statusToDisplay = "Environment has changed - re-calibrating";
77 | }
78 | else if(statusFromDevice == "2")
79 | {
80 | statusToDisplay = "Environment has changed - re-calibrating";
81 | }
82 | else if(statusFromDevice == "3")
83 | {
84 | statusToDisplay = "Device is calibrated and running";
85 | }
86 | else if(statusFromDevice == "4")
87 | {
88 | statusToDisplay = "Error communicating with the IAQ sensor. Critical";
89 | }
90 |
91 |
92 | return {
93 | Humidity: humidity,
94 | //IAQAccuracy:String.fromCharCode.apply(null, bytes.slice(12,13)),
95 | IAQ:iaq,
96 | CO2:CO2,
97 | Temperature:temperature,
98 | Status:statusToDisplay
99 | };
100 | }
101 | ```
102 |
103 | ## Android application
104 |
105 | A simple KivyMD app was made for Android to receive packets:
106 |
107 |
108 |
109 |
110 | ## Azure IoT Central
111 |
112 | Data can also be parsed through Azure IoT Hub to the Azure IoT Central
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------