Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d17ea4da0f | ||
|
|
2ea0066536 | ||
|
|
3d23211c1e | ||
|
|
1769680d9e | ||
|
|
92351c0b92 | ||
|
|
0f6c31386b | ||
|
|
a9009a8cee | ||
|
|
31e1d51dbd | ||
|
|
41819f2fd6 | ||
|
|
17043f634f | ||
|
|
e1c5761df9 | ||
|
|
fbaae21011 | ||
|
|
fa2064b957 | ||
|
|
21a194f43d | ||
|
|
b255402659 | ||
|
|
dfabfbb921 | ||
|
|
3b36a70c9a | ||
|
|
d1386a8e9d | ||
|
|
67b92b7f56 | ||
|
|
a1f8516e60 | ||
|
|
cf52021d38 | ||
|
|
b78c9387a6 | ||
|
|
b748d99437 | ||
|
|
9a33fc0a69 | ||
|
|
4cddc01f22 | ||
|
|
1d80b5fff7 | ||
|
|
140cf07173 | ||
|
|
1e3a82f439 | ||
|
|
c90794e9f5 | ||
|
|
03c723c73d | ||
|
|
bad2ffdd07 | ||
|
|
eed39c9cfb | ||
|
|
7bd6d1d815 | ||
|
|
bb7fcd5c4d | ||
|
|
9b8e00c7fa | ||
|
|
b97825d552 | ||
|
|
085b5aed16 | ||
|
|
7f43624824 | ||
|
|
1ed0000819 | ||
|
|
3b79636d00 | ||
|
|
5a4b932a37 | ||
|
|
dd2ae149ad | ||
|
|
0f5d0a8889 | ||
|
|
3750ae6953 | ||
|
|
5be993f9eb | ||
|
|
57c43ce515 | ||
|
|
159ffa76fd | ||
|
|
1ac3d30d84 | ||
|
|
631ef6ba59 | ||
|
|
27393e47c3 | ||
|
|
bd47772c04 | ||
|
|
f3871388ce | ||
|
|
62874bebf4 | ||
|
|
2ca368305c | ||
|
|
f697ae6f11 | ||
|
|
ef6dd35977 | ||
|
|
ccf21b4eab | ||
|
|
e99c6124e7 | ||
|
|
5721bd74d7 |
@@ -1,3 +1,4 @@
|
||||
# 2024-07-30
|
||||
Language: Cpp
|
||||
BasedOnStyle: LLVM
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
@@ -6,6 +7,7 @@ AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveMacros: AcrossComments
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
@@ -21,6 +23,7 @@ IndentCaseLabels: true
|
||||
IndentWidth: 4
|
||||
LambdaBodyIndentation: Signature
|
||||
MaxEmptyLinesToKeep: 1
|
||||
PenaltyReturnTypeOnItsOwnLine: 1000
|
||||
# PointerAlignment: Left # TODO enable this and reformat project
|
||||
QualifierAlignment: Left
|
||||
ReflowComments: true
|
||||
|
||||
35
.github/workflows/lint.yml
vendored
35
.github/workflows/lint.yml
vendored
@@ -1,35 +0,0 @@
|
||||
name: Lint check
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
lint-clang-format:
|
||||
name: Lint with clang-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Check code with clang-format
|
||||
uses: jidicula/clang-format-action@v4.5.0
|
||||
with:
|
||||
clang-format-version: "14"
|
||||
lint-black:
|
||||
name: Lint with black
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- name: Install test dependencies
|
||||
uses: BSFishy/pip-action@v1
|
||||
with:
|
||||
packages: |
|
||||
black
|
||||
isort
|
||||
- name: Check code with black
|
||||
run: black --check .
|
||||
- name: Check code with isort
|
||||
run: isort --profile black . --check-only
|
||||
46
.github/workflows/platformio-publish.yml
vendored
46
.github/workflows/platformio-publish.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: PlatformIO Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*.*.*
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
- name: Publish PlatformIO package
|
||||
run: pio package publish --non-interactive
|
||||
env:
|
||||
CI: true
|
||||
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
|
||||
- name: Get latest version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: ${{ steps.get_version.outputs.VERSION }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
12
.github/workflows/push-dev.yml
vendored
Normal file
12
.github/workflows/push-dev.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
name: Push (dev), Pull Request
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
jobs:
|
||||
lint-clang:
|
||||
name: Run Clang lint
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/lint-clang.yml@master
|
||||
lint-python:
|
||||
name: Run Python lint
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/lint-python.yml@master
|
||||
@@ -1,10 +1,8 @@
|
||||
name: Deploy docs on GitHub Pages
|
||||
|
||||
name: Push (master)
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
branches: ["master"]
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
docs:
|
||||
name: Deploy docs
|
||||
@@ -19,7 +17,7 @@ jobs:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install docs dependencies
|
||||
run: pip install -U ltchiptool boardgen
|
||||
run: pip install -U ltchiptool "boardgen>=0.11.0"
|
||||
|
||||
- name: Generate docs and static JSON files
|
||||
run: |
|
||||
22
.github/workflows/release.yml
vendored
Normal file
22
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags: ["v*.*.*"]
|
||||
jobs:
|
||||
lint-clang:
|
||||
name: Run Clang lint
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/lint-clang.yml@master
|
||||
publish-pio-platform:
|
||||
name: Publish PlatformIO platform
|
||||
needs:
|
||||
- lint-clang
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/publish-pio-platform.yml@master
|
||||
secrets:
|
||||
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
|
||||
gh-release:
|
||||
name: Publish GitHub release
|
||||
needs:
|
||||
- publish-pio-platform
|
||||
uses: kuba2k2/kuba2k2/.github/workflows/gh-release.yml@master
|
||||
permissions:
|
||||
contents: write
|
||||
71
README.md
71
README.md
@@ -1,9 +1,11 @@
|
||||
# LibreTiny
|
||||
|
||||
<small>(formerly LibreTuya)</small>
|
||||
|
||||
<div align="center" markdown>
|
||||
|
||||
[](https://kuba2k2.github.io/libretiny/)
|
||||

|
||||
[](https://docs.libretiny.eu/)
|
||||

|
||||
|
||||
[](.clang-format)
|
||||
[](https://github.com/psf/black)
|
||||
@@ -16,13 +18,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
## LibreTuya is now LibreTiny! 🎉
|
||||
|
||||
We have [renamed the project](https://github.com/kuba2k2/libretiny/issues/92) to LibreTiny, also marking the very first v1.0.0 release, along with a huge structure refactor. While some care has been taken to ensure that things don't break, you may still need to update some references in your code to use the new name.
|
||||
|
||||
---
|
||||
|
||||
PlatformIO development platform for IoT modules manufactured by Tuya Inc.
|
||||
PlatformIO development platform for BK7231 and RTL8710 IoT chips.
|
||||
|
||||
The main goal of this project is to provide a usable build environment for IoT developers. While also providing vendor SDKs as PlatformIO cores,
|
||||
the project focuses on developing working Arduino-compatible cores for supported families. The cores are inspired by Espressif's official core for ESP32,
|
||||
@@ -32,62 +28,11 @@ which should make it easier to port/run existing ESP apps on less-common, unsupp
|
||||
|
||||
**Note:** this project is work-in-progress.
|
||||
|
||||
## Usage
|
||||
<div align="center" markdown>
|
||||
|
||||
1. [Install PlatformIO](https://platformio.org/platformio-ide)
|
||||
2. `platformio platform install -f https://github.com/kuba2k2/libretiny`
|
||||
3. Create a project, build it and upload!
|
||||
4. See the [docs](https://docs.libretiny.eu/) for any questions/problems.
|
||||
## [⭐ Getting started ⭐](https://docs.libretiny.eu/docs/getting-started/)
|
||||
|
||||
<!--
|
||||
## Arduino Core support status
|
||||
|
||||
Note: this list will probably change with each functionality update.
|
||||
|
||||
| `realtek-ambz` | `beken-72xx`
|
||||
--------------------|----------------|-------------
|
||||
Core functions | ✔️ | ✔️
|
||||
GPIO/PWM/IRQ | ✔️/✔️/✔️ | ✔️/✔️/✔️
|
||||
Analog input (ADC) | ✔️ | ✔️
|
||||
Serial | ✔️ | ✔️
|
||||
Serial (extra) | 0, 1, 2 | 1, 2
|
||||
Flash I/O | ✔️ | ✔️
|
||||
**CORE LIBRARIES** | |
|
||||
SoftwareSerial | ✔️ | ❌
|
||||
SPI | ❌ | ❌
|
||||
Wire | ❗ | ❌
|
||||
**OTHER LIBRARIES** | |
|
||||
Wi-Fi STA/AP/Mixed | ✔️ | ✔️
|
||||
Wi-Fi Events | ✔️ | ✔️
|
||||
TCP Client (SSL) | ✔️ (✔️) | ✔️ (❗)
|
||||
TCP Server | ✔️ | ✔️
|
||||
IPv6 | ❌ | ❌
|
||||
HTTP Client (SSL) | ✔️ (✔️) | ❓
|
||||
HTTP Server | ✔️ | ✔️
|
||||
NVS / Preferences | ✔️ | ✔️
|
||||
SPIFFS | ❌ | ❌
|
||||
BLE | - | ❌
|
||||
NTP | ✔️ | ✔️
|
||||
OTA | ✔️ | ✔️
|
||||
MDNS | ✔️ | ✔️
|
||||
MQTT | ✅ | ❌
|
||||
SD | ❌ | ❌
|
||||
|
||||
Symbols:
|
||||
|
||||
- ✔️ working
|
||||
- ✅ tested, external library
|
||||
- ❓ untested
|
||||
- ❗ broken
|
||||
- ❌ not implemented (yet?)
|
||||
- \- not applicable
|
||||
|
||||
Names:
|
||||
|
||||
- Core functions - stuff like delay(), millis(), yield(), etc.
|
||||
- **CORE LIBRARIES** - included normally in all Arduino cores
|
||||
- **OTHER LIBRARIES** - included in ESP32 core or downloadable
|
||||
-->
|
||||
</div>
|
||||
|
||||
## License
|
||||
|
||||
|
||||
11
SUMMARY.md
11
SUMMARY.md
@@ -1,15 +1,20 @@
|
||||
* [Home](README.md)
|
||||
* [](SUMMARY.md)
|
||||
* [😊 Getting started](docs/getting-started/README.md)
|
||||
* [➡️ Info on accessing GPIOs](docs/getting-started/gpio.md)
|
||||
* [](SUMMARY.md)
|
||||
* [📺 Cloudcutter & ESPHome video guide](https://www.youtube.com/watch?v=sSj8f-HCHQ0)
|
||||
* [💡 ESPHome setup guide](docs/projects/esphome.md)
|
||||
* [🛖 ESPHome Hassio Add-On](https://github.com/libretiny-eu/esphome-hass-addon/pkgs/container/libretiny-esphome-hassio)
|
||||
* [](SUMMARY.md)
|
||||
* [📲 Flashing/dumping guide](docs/flashing/)
|
||||
* [🔌 How to connect the chip in download mode?](docs/flashing/chip-connection/)
|
||||
* [💻 Supported chips](docs/status/supported.md)
|
||||
* [🔌 How to flash/enter download mode?](docs/platform/)
|
||||
* [](SUMMARY.md)
|
||||
* [💻 Chips, boards, features](docs/status/supported.md)
|
||||
* [All boards](boards/)
|
||||
* [](SUMMARY.md)
|
||||
* 🍪 Chip family docs & info
|
||||
* [Beken BK72xx](docs/platform/beken-72xx/README.md)
|
||||
* [Finding encryption keys](docs/platform/beken-72xx/keys.md)
|
||||
* [Realtek Ameba - info](docs/platform/realtek-amb/README.md)
|
||||
* [Realtek AmebaZ](docs/platform/realtek-ambz/README.md)
|
||||
* [Debugging](docs/platform/realtek-ambz/debugging.md)
|
||||
|
||||
@@ -41,8 +41,7 @@
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"General info": "../../docs/platform/beken-72xx/README.md",
|
||||
"Flashing guide": "../../docs/platform/beken-72xx/flashing.md"
|
||||
"Info & flashing guide": "../../docs/platform/beken-72xx/README.md"
|
||||
},
|
||||
"extra": [
|
||||
"Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes."
|
||||
|
||||
90
boards/_base/pcb/afw121t.json
Normal file
90
boards/_base/pcb/afw121t.json
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"99iot-21p",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 16,
|
||||
"vars": {
|
||||
"TRACE_COLOR": "#FAFD9D"
|
||||
},
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"GND": null
|
||||
},
|
||||
"2": {
|
||||
"CTRL": "RF_O"
|
||||
},
|
||||
"3": {
|
||||
"GND": null
|
||||
},
|
||||
"4": {
|
||||
"NC": null
|
||||
},
|
||||
"5": {
|
||||
"CTRL": "CEN"
|
||||
},
|
||||
"6": {
|
||||
"IC": 13,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"7": {
|
||||
"IC": 14,
|
||||
"ARD": "D1"
|
||||
},
|
||||
"8": {
|
||||
"IC": 16,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"9": {
|
||||
"IC": 17,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"10": {
|
||||
"GND": null
|
||||
},
|
||||
"11": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"12": {
|
||||
"GND": null
|
||||
},
|
||||
"13": {
|
||||
"NC": null
|
||||
},
|
||||
"14": {
|
||||
"IC": 28,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"15": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"16": {
|
||||
"IC": 30,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"17": {
|
||||
"IC": 31,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"18": {
|
||||
"IC": 32,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"19": {
|
||||
"IC": 1,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"20": {
|
||||
"IC": 2,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"21": {
|
||||
"GND": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 10,
|
||||
"scale": 14,
|
||||
"test_pads": {
|
||||
"TSCK": "cb1s.back.sck.anchor",
|
||||
"TCSN": "cb1s.back.csn.anchor",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 11,
|
||||
"test_pads": {
|
||||
"TRST": "cb2l.back.rst.anchor",
|
||||
"TRX1": "cb2l.back.u1_rxd.anchor",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 11,
|
||||
"test_pads": {
|
||||
"TTX2": "cb2s.back.u2_txd.anchor",
|
||||
"TRX2": "cb2s.back.u2_rxd.anchor",
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI",
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"drawing_hidden": "SPI",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
|
||||
70
boards/_base/pcb/t112.json
Normal file
70
boards/_base/pcb/t112.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"pcb": {
|
||||
"templates": [
|
||||
"esp01m-14",
|
||||
"pcb-blue-light",
|
||||
"rf-type1"
|
||||
],
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"drawing_hidden": "I2C,SPI",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
},
|
||||
"2": {
|
||||
"IC": 2,
|
||||
"ARD": "D0"
|
||||
},
|
||||
"3": {
|
||||
"IC": 30,
|
||||
"ARD": [
|
||||
"D1",
|
||||
"A0"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"IC": 14,
|
||||
"ARD": "D2"
|
||||
},
|
||||
"5": {
|
||||
"IC": 13,
|
||||
"ARD": "D3"
|
||||
},
|
||||
"6": {
|
||||
"IC": 16,
|
||||
"ARD": "D4"
|
||||
},
|
||||
"7": {
|
||||
"NC": null
|
||||
},
|
||||
"8": {
|
||||
"IC": 28,
|
||||
"ARD": "D5"
|
||||
},
|
||||
"9": {
|
||||
"IC": 29,
|
||||
"ARD": "D6"
|
||||
},
|
||||
"10": {
|
||||
"IC": 17,
|
||||
"ARD": "D7"
|
||||
},
|
||||
"11": {
|
||||
"IC": 32,
|
||||
"ARD": "D8"
|
||||
},
|
||||
"12": {
|
||||
"IC": 31,
|
||||
"ARD": "D9"
|
||||
},
|
||||
"13": {
|
||||
"IC": 1,
|
||||
"ARD": "D10"
|
||||
},
|
||||
"14": {
|
||||
"GND": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 10.5,
|
||||
"scale": 11,
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-blue-light",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 11,
|
||||
"test_pads": {
|
||||
"TRST": "wb2l.back.rst.anchor",
|
||||
"TRX1": "wb2l.back.u1_rxd.anchor",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 10.5,
|
||||
"templates": [
|
||||
"tuya2",
|
||||
"pcb-blue-light",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"vars": {
|
||||
"PINHOLE": 0
|
||||
},
|
||||
"pinout_hidden": "I2S,SD,SPI",
|
||||
"pinout_hidden": "I2S,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"NC": null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI",
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"drawing_hidden": "SPI",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"pcb": {
|
||||
"scale": 10.5,
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI,SDA0",
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SDA0",
|
||||
"drawing_hidden": "SPI",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"PWR": 3.3
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"templates": [
|
||||
"pcb-black"
|
||||
],
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI",
|
||||
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD",
|
||||
"pinout": {
|
||||
"1": {
|
||||
"NC": null
|
||||
|
||||
16
boards/_base/realtek-ambz-1mb-468k.json
Normal file
16
boards/_base/realtek-ambz-1mb-468k.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"build": {
|
||||
"amb_boot_all": "boot_all_77F7.bin"
|
||||
},
|
||||
"flash": {
|
||||
"ota1": "0x00B000+0x75000",
|
||||
"ota2": "0x080000+0x75000",
|
||||
"kvs": "0x0F5000+0x4000",
|
||||
"userdata": "0x0F9000+0x7000"
|
||||
},
|
||||
"upload": {
|
||||
"flash_size": 1048576,
|
||||
"maximum_size": 479232
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,7 @@
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"General info": "../../docs/platform/realtek-amb/README.md",
|
||||
"Flashing guide": "../../docs/platform/realtek-ambz/flashing.md",
|
||||
"Info & flashing guide": "../../docs/platform/realtek-ambz/README.md",
|
||||
"Debugging": "../../docs/platform/realtek-ambz/debugging.md"
|
||||
}
|
||||
}
|
||||
|
||||
24
boards/afw121t.json
Normal file
24
boards/afw121t.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"_base": [
|
||||
"realtek-ambz",
|
||||
"realtek-ambz-1mb-468k",
|
||||
"realtek-ambz-bx",
|
||||
"ic/rtl8710bn",
|
||||
"pcb/afw121t"
|
||||
],
|
||||
"build": {
|
||||
"mcu": "rtl8710bx",
|
||||
"variant": "afw121t"
|
||||
},
|
||||
"name": "AFW121T",
|
||||
"url": "https://item.szlcsc.com/357903.html?fromZone=l_b__%2522brand%2522",
|
||||
"vendor": "99iot(Shenzhen)co.,ltd",
|
||||
"pcb": {
|
||||
"symbol": "AFW121T"
|
||||
},
|
||||
"doc": {
|
||||
"links": {
|
||||
"Vendor datasheet": "https://item.szlcsc.com/datasheet/AFW121TI-AY1LED1/357903.html"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
"extra": [
|
||||
"## Information",
|
||||
"This is a generic board definition for RTL8710BX with 4 MiB of flash. It has a bigger application partition size (980 KiB). The used bootloader is also different from the standard Tuya one.",
|
||||
"It can be found in [Ezviz T31 smart plug](https://www.ezviz.com/product/T31/2021) - bare chip soldered onto the manufacturer-made PCB. The plug is not Tuya/SmartLife-compatible and has a 25Q32CSIG flash chip. Refer to [libretiny#23](https://github.com/kuba2k2/libretiny/issues/23) for photos and more information.",
|
||||
"It can be found in [Ezviz T31 smart plug](https://www.ezviz.com/product/T31/2021) - bare chip soldered onto the manufacturer-made PCB. The plug is not Tuya/SmartLife-compatible and has a 25Q32CSIG flash chip. Refer to [libretiny#23](https://github.com/libretiny-eu/libretiny/issues/23) for photos and more information.",
|
||||
"Note that stock firmware seems to use smaller app images (0x80000 / 512 KiB). After 0x180000 some product-test data and device logs can be found. Because the OTA2 offset is 0x100000, the board definition was configured to use all available space."
|
||||
]
|
||||
},
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"url": "https://docs.libretiny.eu/boards/t102-v1.1/",
|
||||
"vendor": "Unknown",
|
||||
"doc": {
|
||||
"fccid": "2AU7O-T102V11"
|
||||
"fccid": "2AU7O-T102V11",
|
||||
"mcu": "w302"
|
||||
},
|
||||
"pcb": {
|
||||
"symbol": "T102_V1.1"
|
||||
|
||||
22
boards/t112-v1.1.json
Normal file
22
boards/t112-v1.1.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"_base": [
|
||||
"realtek-ambz",
|
||||
"realtek-ambz-2mb-788k",
|
||||
"ic/rtl8710bn",
|
||||
"pcb/t112"
|
||||
],
|
||||
"build": {
|
||||
"mcu": "rtl8710bn",
|
||||
"variant": "t112-v1.1"
|
||||
},
|
||||
"name": "T112_V1.1",
|
||||
"url": "https://docs.libretiny.eu/boards/t112-v1.1/",
|
||||
"vendor": "Unknown",
|
||||
"doc": {
|
||||
"fccid": "2AU7O-T102V11",
|
||||
"mcu": "w302"
|
||||
},
|
||||
"pcb": {
|
||||
"symbol": "T112_V1.1"
|
||||
}
|
||||
}
|
||||
142
boards/templates/99iot-21p.json
Normal file
142
boards/templates/99iot-21p.json
Normal file
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"name": "99iot-21p",
|
||||
"title": "99iot 21-pin modules",
|
||||
"width": 18,
|
||||
"height": 22,
|
||||
"vars": {
|
||||
"PINTYPE_VERT": "pin_vert_cast_nohole",
|
||||
"PINTYPE_HORZ": "pin_horz_cast_nohole",
|
||||
"RASTER": 1.2,
|
||||
"RF_W": 18,
|
||||
"RF_H": 3.9
|
||||
},
|
||||
"front": [
|
||||
{
|
||||
"comment": "PCB soldermask",
|
||||
"type": "rect",
|
||||
"pos": "0,0",
|
||||
"size": "18,22",
|
||||
"preset": "${MASK_PRESET}"
|
||||
},
|
||||
{
|
||||
"comment": "Metal shielding",
|
||||
"type": "rect",
|
||||
"pos": "1.105,7",
|
||||
"size": "15.79,14.58",
|
||||
"preset": "shield"
|
||||
},
|
||||
{
|
||||
"comment": "Pins (1-3)",
|
||||
"id": "left_t",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 3,
|
||||
"pos": "0,3.9",
|
||||
"vars": {
|
||||
"PINDIR": "left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Pins (3-10)",
|
||||
"id": "left_b",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 7,
|
||||
"pos": "0,12.8",
|
||||
"vars": {
|
||||
"PINDIR": "left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Pins (10-20)",
|
||||
"id": "right_b",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 10,
|
||||
"pos": "18,9.2",
|
||||
"vars": {
|
||||
"PINDIR": "right"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Pin 21",
|
||||
"id": "right_t",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 1,
|
||||
"pos": "18,7",
|
||||
"vars": {
|
||||
"PINDIR": "right"
|
||||
}
|
||||
}
|
||||
],
|
||||
"back": [
|
||||
{
|
||||
"comment": "PCB soldermask",
|
||||
"type": "rect",
|
||||
"pos": "0,0",
|
||||
"size": "18,22",
|
||||
"preset": "${MASK_PRESET}"
|
||||
},
|
||||
{
|
||||
"comment": "Pins (1-3)",
|
||||
"id": "left_t",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 3,
|
||||
"pos": "0,3.9",
|
||||
"vars": {
|
||||
"PINDIR": "left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Pins (3-10)",
|
||||
"id": "left_b",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 7,
|
||||
"pos": "0,12.8",
|
||||
"vars": {
|
||||
"PINDIR": "left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Pins (10-20)",
|
||||
"id": "right_b",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 10,
|
||||
"pos": "18,9.2",
|
||||
"vars": {
|
||||
"PINDIR": "right"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Pin 21",
|
||||
"id": "right_t",
|
||||
"name": "r_pins_vert",
|
||||
"repeat": 1,
|
||||
"pos": "18,7",
|
||||
"vars": {
|
||||
"PINDIR": "right"
|
||||
}
|
||||
}
|
||||
],
|
||||
"pads": {
|
||||
"1": "99iot-21p.front.left_t.pin1",
|
||||
"2": "99iot-21p.front.left_t.pin2",
|
||||
"3": "99iot-21p.front.left_t.pin3",
|
||||
"4": "99iot-21p.front.left_b.pin1",
|
||||
"5": "99iot-21p.front.left_b.pin2",
|
||||
"6": "99iot-21p.front.left_b.pin3",
|
||||
"7": "99iot-21p.front.left_b.pin4",
|
||||
"8": "99iot-21p.front.left_b.pin5",
|
||||
"9": "99iot-21p.front.left_b.pin6",
|
||||
"10": "99iot-21p.front.left_b.pin7",
|
||||
"11": "99iot-21p.front.right_b.pin10",
|
||||
"12": "99iot-21p.front.right_b.pin9",
|
||||
"13": "99iot-21p.front.right_b.pin8",
|
||||
"14": "99iot-21p.front.right_b.pin7",
|
||||
"15": "99iot-21p.front.right_b.pin6",
|
||||
"16": "99iot-21p.front.right_b.pin5",
|
||||
"17": "99iot-21p.front.right_b.pin4",
|
||||
"18": "99iot-21p.front.right_b.pin3",
|
||||
"19": "99iot-21p.front.right_b.pin2",
|
||||
"20": "99iot-21p.front.right_b.pin1",
|
||||
"21": "99iot-21p.front.right_t.pin1"
|
||||
},
|
||||
"test_pads": {}
|
||||
}
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"pos": "7.0,5.0",
|
||||
"pos": "6.0,5.5",
|
||||
"text": "${SYMBOL}",
|
||||
"font_size": 1.0,
|
||||
"fill": {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"pos": "4.0,5.5",
|
||||
"pos": "6.0,5.5",
|
||||
"text": "${SYMBOL}",
|
||||
"font_size": 1.0,
|
||||
"fill": {
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"pos": "4.0,5.5",
|
||||
"pos": "6.5,5.0",
|
||||
"text": "${SYMBOL}",
|
||||
"font_size": 1.0,
|
||||
"fill": {
|
||||
|
||||
48
boards/variants/afw121t.c
Normal file
48
boards/variants/afw121t.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/* This file was auto-generated from afw121t.json using boardgen */
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef LT_VARIANT_INCLUDE
|
||||
#include LT_VARIANT_INCLUDE
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
|
||||
// D0: PA14, PWM0, SWCLK
|
||||
{PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0},
|
||||
// D1: PA15, PWM1, SWDIO
|
||||
{PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0},
|
||||
// D2: PA00, PWM2
|
||||
{PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
|
||||
// D3: PA12, PWM3
|
||||
{PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
|
||||
// D4: PA29, UART2_RX, I2C0_SCL, PWM4
|
||||
{PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0},
|
||||
// D5: PA05, PWM4, WAKE1
|
||||
{PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
|
||||
// D6: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0
|
||||
{PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D7: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX
|
||||
{PA_19, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D8: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2
|
||||
{PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D9: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3
|
||||
{PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D10: PA30, UART2_TX, I2C0_SDA, PWM4
|
||||
{PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0},
|
||||
};
|
||||
|
||||
PinInfo *lt_arduino_pin_gpio_map[] = {
|
||||
[0] = &(lt_arduino_pin_info_list[2]), // PA_0 (D2)
|
||||
[5] = &(lt_arduino_pin_info_list[5]), // PA_5 (D5)
|
||||
[12] = &(lt_arduino_pin_info_list[3]), // PA_12 (D3)
|
||||
[14] = &(lt_arduino_pin_info_list[0]), // PA_14 (D0)
|
||||
[15] = &(lt_arduino_pin_info_list[1]), // PA_15 (D1)
|
||||
[18] = &(lt_arduino_pin_info_list[6]), // PA_18 (D6)
|
||||
[19] = &(lt_arduino_pin_info_list[7]), // PA_19 (D7)
|
||||
[22] = &(lt_arduino_pin_info_list[8]), // PA_22 (D8)
|
||||
[23] = &(lt_arduino_pin_info_list[9]), // PA_23 (D9)
|
||||
[29] = &(lt_arduino_pin_info_list[4]), // PA_29 (D4)
|
||||
[30] = &(lt_arduino_pin_info_list[10]), // PA_30 (D10)
|
||||
};
|
||||
// clang-format on
|
||||
136
boards/variants/afw121t.h
Normal file
136
boards/variants/afw121t.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/* This file was auto-generated from afw121t.json using boardgen */
|
||||
|
||||
#pragma once
|
||||
|
||||
// clang-format off
|
||||
|
||||
// Pins
|
||||
// ----
|
||||
#define PINS_COUNT 11 // Total GPIO count
|
||||
#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs
|
||||
#define NUM_ANALOG_INPUTS 0 // ADC inputs
|
||||
#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs
|
||||
#define PINS_GPIO_MAX 30 // Last usable GPIO number
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE0_SCL_0 22u // PA_22
|
||||
#define PIN_WIRE0_SCL_1 29u // PA_29
|
||||
#define PIN_WIRE0_SDA_0 19u // PA_19
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
#define PIN_ADC1 19u // PA_19
|
||||
#define PIN_CS0 19u // PA_19
|
||||
#define PIN_CS1 19u // PA_19
|
||||
#define PIN_CTS0 19u // PA_19
|
||||
#define PIN_MISO0 22u // PA_22
|
||||
#define PIN_MISO1 22u // PA_22
|
||||
#define PIN_MOSI0 23u // PA_23
|
||||
#define PIN_MOSI1 23u // PA_23
|
||||
#define PIN_PA00 0u // PA_0
|
||||
#define PIN_PA05 5u // PA_5
|
||||
#define PIN_PA12 12u // PA_12
|
||||
#define PIN_PA14 14u // PA_14
|
||||
#define PIN_PA15 15u // PA_15
|
||||
#define PIN_PA18 18u // PA_18
|
||||
#define PIN_PA19 19u // PA_19
|
||||
#define PIN_PA22 22u // PA_22
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
#define PIN_PWM4 29u // PA_29
|
||||
#define PIN_PWM5 22u // PA_22
|
||||
#define PIN_RTS0 22u // PA_22
|
||||
#define PIN_RX0 18u // PA_18
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
// Port availability
|
||||
// -----------------
|
||||
#define HAS_SERIAL0 1
|
||||
#define HAS_SERIAL2 1
|
||||
#define HAS_SPI0 1
|
||||
#define HAS_SPI1 1
|
||||
#define HAS_WIRE0 1
|
||||
#define HAS_WIRE1 1
|
||||
#define SERIAL_INTERFACES_COUNT 2
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define WIRE_INTERFACES_COUNT 2
|
||||
|
||||
// Arduino pin names
|
||||
// -----------------
|
||||
#define PIN_D0 14u // PA_14
|
||||
#define PIN_D1 15u // PA_15
|
||||
#define PIN_D2 0u // PA_0
|
||||
#define PIN_D3 12u // PA_12
|
||||
#define PIN_D4 29u // PA_29
|
||||
#define PIN_D5 5u // PA_5
|
||||
#define PIN_D6 18u // PA_18
|
||||
#define PIN_D7 19u // PA_19
|
||||
#define PIN_D8 22u // PA_22
|
||||
#define PIN_D9 23u // PA_23
|
||||
#define PIN_D10 30u // PA_30
|
||||
|
||||
// Static pin names
|
||||
// ----------------
|
||||
static const unsigned char D0 = PIN_D0;
|
||||
static const unsigned char D1 = PIN_D1;
|
||||
static const unsigned char D2 = PIN_D2;
|
||||
static const unsigned char D3 = PIN_D3;
|
||||
static const unsigned char D4 = PIN_D4;
|
||||
static const unsigned char D5 = PIN_D5;
|
||||
static const unsigned char D6 = PIN_D6;
|
||||
static const unsigned char D7 = PIN_D7;
|
||||
static const unsigned char D8 = PIN_D8;
|
||||
static const unsigned char D9 = PIN_D9;
|
||||
static const unsigned char D10 = PIN_D10;
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -62,7 +80,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -73,9 +90,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 22u // PA_22
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
#define PIN_SPI0_MOSI_1 19u // PIN_A19
|
||||
#define PIN_SPI0_SCK_0 16u // PIN_A16
|
||||
#define PIN_SPI0_SCK_1 3u // PIN_A3
|
||||
#define PINS_SPI0_CS (pin_size_t[]){2u, 15u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){20u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){4u, 19u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){16u, 3u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -30,6 +34,8 @@
|
||||
#define PIN_WIRE0_SDA_0 20u // PIN_A20
|
||||
#define PIN_WIRE0_SDA_1 16u // PIN_A16
|
||||
#define PIN_WIRE0_SDA_2 3u // PIN_A3
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){2u, 15u, 19u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){20u, 16u, 3u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
@@ -44,14 +50,21 @@
|
||||
#define PIN_SERIAL2_RTS 20u // PIN_A20
|
||||
#define PIN_SERIAL2_RX 15u // PIN_A15
|
||||
#define PIN_SERIAL2_TX 16u // PIN_A16
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){13u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){14u}
|
||||
#define PINS_SERIAL1_CTS (pin_size_t[]){4u}
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){2u, 0u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){3u, 1u}
|
||||
#define PINS_SERIAL2_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL2_RTS (pin_size_t[]){20u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){15u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){16u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
#define PIN_CS0 15u // PIN_A15
|
||||
#define PIN_CTS1 4u // PIN_A4
|
||||
#define PIN_CTS2 19u // PIN_A19
|
||||
#define PIN_MISO0 20u // PIN_A20
|
||||
#define PIN_MOSI0 19u // PIN_A19
|
||||
#define PIN_PA00 0u // PIN_A0
|
||||
#define PIN_PA01 1u // PIN_A1
|
||||
#define PIN_PA02 2u // PIN_A2
|
||||
@@ -65,23 +78,15 @@
|
||||
#define PIN_PA18 18u // PIN_A18
|
||||
#define PIN_PA19 19u // PIN_A19
|
||||
#define PIN_PA20 20u // PIN_A20
|
||||
#define PIN_PWM0 0u // PIN_A0
|
||||
#define PIN_PWM1 1u // PIN_A1
|
||||
#define PIN_PWM2 14u // PIN_A14
|
||||
#define PIN_PWM3 3u // PIN_A3
|
||||
#define PIN_PWM4 16u // PIN_A16
|
||||
#define PIN_PWM5 17u // PIN_A17
|
||||
#define PIN_PWM6 18u // PIN_A18
|
||||
#define PIN_PWM7 13u // PIN_A13
|
||||
#define PIN_RTS2 20u // PIN_A20
|
||||
#define PIN_RX0 13u // PIN_A13
|
||||
#define PIN_RX1 0u // PIN_A0
|
||||
#define PIN_RX2 15u // PIN_A15
|
||||
#define PIN_SCK0 3u // PIN_A3
|
||||
#define PIN_SCL0 19u // PIN_A19
|
||||
#define PIN_SDA0 3u // PIN_A3
|
||||
#define PIN_TX0 14u // PIN_A14
|
||||
#define PIN_TX1 1u // PIN_A1
|
||||
#define PIN_TX2 16u // PIN_A16
|
||||
|
||||
// Port availability
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,9 +14,12 @@
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,15 +14,21 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,9 +14,12 @@
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -17,12 +17,17 @@
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA_0 21u // GPIO21
|
||||
#define PIN_WIRE1_SDA_1 21u // GPIO21
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u, 21u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,15 +14,21 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,15 +14,21 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,19 +14,29 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_CTS 12u // GPIO12
|
||||
#define PIN_SERIAL1_RTS 13u // GPIO13
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_CTS 12u // GPIO12
|
||||
#define PIN_SERIAL1_RTS 13u // GPIO13
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_CTS (pin_size_t[]){12u}
|
||||
#define PINS_SERIAL1_RTS (pin_size_t[]){13u}
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -75,7 +93,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -86,9 +103,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 29u // PA_29
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -75,7 +93,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -86,9 +103,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 29u // PA_29
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -74,7 +92,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -85,9 +102,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 29u // PA_29
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
#define PIN_SPI0_SCK_0 3u // PIN_A3
|
||||
#define PIN_SPI0_SCK_1 8u // PIN_A8
|
||||
#define PIN_SPI0_SCK_2 16u // PIN_A16
|
||||
#define PINS_SPI0_CS (pin_size_t[]){2u, 7u, 15u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){10u, 20u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){4u, 9u, 19u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){3u, 8u, 16u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -36,6 +40,8 @@
|
||||
#define PIN_WIRE0_SDA_1 12u // PIN_A12
|
||||
#define PIN_WIRE0_SDA_2 16u // PIN_A16
|
||||
#define PIN_WIRE0_SDA_3 20u // PIN_A20
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){2u, 11u, 15u, 19u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){3u, 12u, 16u, 20u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
@@ -54,6 +60,17 @@
|
||||
#define PIN_SERIAL2_RTS 20u // PIN_A20
|
||||
#define PIN_SERIAL2_RX 15u // PIN_A15
|
||||
#define PIN_SERIAL2_TX 16u // PIN_A16
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){9u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){12u, 13u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){11u, 14u}
|
||||
#define PINS_SERIAL1_CTS (pin_size_t[]){4u}
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){0u, 2u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){1u, 3u}
|
||||
#define PINS_SERIAL2_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL2_RTS (pin_size_t[]){20u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){15u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){16u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -61,7 +78,6 @@
|
||||
#define PIN_CTS0 10u // PIN_A10
|
||||
#define PIN_CTS1 4u // PIN_A4
|
||||
#define PIN_CTS2 19u // PIN_A19
|
||||
#define PIN_MISO0 20u // PIN_A20
|
||||
#define PIN_MOSI0 19u // PIN_A19
|
||||
#define PIN_PA00 0u // PIN_A0
|
||||
#define PIN_PA01 1u // PIN_A1
|
||||
@@ -84,23 +100,13 @@
|
||||
#define PIN_PA20 20u // PIN_A20
|
||||
#define PIN_PA23 23u // PIN_A23
|
||||
#define PIN_PWM0 20u // PIN_A20
|
||||
#define PIN_PWM1 12u // PIN_A12
|
||||
#define PIN_PWM2 14u // PIN_A14
|
||||
#define PIN_PWM3 15u // PIN_A15
|
||||
#define PIN_PWM4 16u // PIN_A16
|
||||
#define PIN_PWM5 17u // PIN_A17
|
||||
#define PIN_PWM6 18u // PIN_A18
|
||||
#define PIN_PWM7 23u // PIN_A23
|
||||
#define PIN_RTS0 9u // PIN_A9
|
||||
#define PIN_RTS2 20u // PIN_A20
|
||||
#define PIN_RX0 13u // PIN_A13
|
||||
#define PIN_RX1 2u // PIN_A2
|
||||
#define PIN_RX2 15u // PIN_A15
|
||||
#define PIN_SCK0 16u // PIN_A16
|
||||
#define PIN_SCL0 19u // PIN_A19
|
||||
#define PIN_SDA0 20u // PIN_A20
|
||||
#define PIN_TX0 14u // PIN_A14
|
||||
#define PIN_TX1 3u // PIN_A3
|
||||
#define PIN_TX2 16u // PIN_A16
|
||||
|
||||
// Port availability
|
||||
|
||||
@@ -14,15 +14,21 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,15 +14,21 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE0_SCL 29u // PA_29
|
||||
#define PIN_WIRE0_SDA 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PIN_WIRE0_SCL 29u // PA_29
|
||||
#define PIN_WIRE0_SDA 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -39,7 +47,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 14u // PA_14
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -63,7 +81,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -74,9 +91,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 29u // PA_29
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
48
boards/variants/t112-v1.1.c
Normal file
48
boards/variants/t112-v1.1.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/* This file was auto-generated from t112-v1.1.json using boardgen */
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef LT_VARIANT_INCLUDE
|
||||
#include LT_VARIANT_INCLUDE
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
|
||||
// D0: PA29, UART2_RX, I2C0_SCL, PWM4
|
||||
{PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0},
|
||||
// D1: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX
|
||||
{PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D2: PA15, PWM1, SWDIO
|
||||
{PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0},
|
||||
// D3: PA14, PWM0, SWCLK
|
||||
{PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0},
|
||||
// D4: PA00, PWM2
|
||||
{PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
|
||||
// D5: PA05, PWM4, WAKE1
|
||||
{PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
|
||||
// D6: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0
|
||||
{PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D7: PA12, PWM3
|
||||
{PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
|
||||
// D8: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3
|
||||
{PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D9: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2
|
||||
{PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0},
|
||||
// D10: PA30, UART2_TX, I2C0_SDA, PWM4
|
||||
{PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0},
|
||||
};
|
||||
|
||||
PinInfo *lt_arduino_pin_gpio_map[] = {
|
||||
[0] = &(lt_arduino_pin_info_list[4]), // PA_0 (D4)
|
||||
[5] = &(lt_arduino_pin_info_list[5]), // PA_5 (D5)
|
||||
[12] = &(lt_arduino_pin_info_list[7]), // PA_12 (D7)
|
||||
[14] = &(lt_arduino_pin_info_list[3]), // PA_14 (D3)
|
||||
[15] = &(lt_arduino_pin_info_list[2]), // PA_15 (D2)
|
||||
[18] = &(lt_arduino_pin_info_list[6]), // PA_18 (D6)
|
||||
[19] = &(lt_arduino_pin_info_list[1]), // PA_19 (D1)
|
||||
[22] = &(lt_arduino_pin_info_list[9]), // PA_22 (D9)
|
||||
[23] = &(lt_arduino_pin_info_list[8]), // PA_23 (D8)
|
||||
[29] = &(lt_arduino_pin_info_list[0]), // PA_29 (D0)
|
||||
[30] = &(lt_arduino_pin_info_list[10]), // PA_30 (D10)
|
||||
};
|
||||
// clang-format on
|
||||
138
boards/variants/t112-v1.1.h
Normal file
138
boards/variants/t112-v1.1.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/* This file was auto-generated from t112-v1.1.json using boardgen */
|
||||
|
||||
#pragma once
|
||||
|
||||
// clang-format off
|
||||
|
||||
// Pins
|
||||
// ----
|
||||
#define PINS_COUNT 11 // Total GPIO count
|
||||
#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs
|
||||
#define NUM_ANALOG_INPUTS 1 // ADC inputs
|
||||
#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs
|
||||
#define PINS_GPIO_MAX 30 // Last usable GPIO number
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE0_SCL_0 29u // PA_29
|
||||
#define PIN_WIRE0_SCL_1 22u // PA_22
|
||||
#define PIN_WIRE0_SDA_0 19u // PA_19
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
#define PIN_ADC1 19u // PA_19
|
||||
#define PIN_CS0 19u // PA_19
|
||||
#define PIN_CS1 19u // PA_19
|
||||
#define PIN_CTS0 19u // PA_19
|
||||
#define PIN_MISO0 22u // PA_22
|
||||
#define PIN_MISO1 22u // PA_22
|
||||
#define PIN_MOSI0 23u // PA_23
|
||||
#define PIN_MOSI1 23u // PA_23
|
||||
#define PIN_PA00 0u // PA_0
|
||||
#define PIN_PA05 5u // PA_5
|
||||
#define PIN_PA12 12u // PA_12
|
||||
#define PIN_PA14 14u // PA_14
|
||||
#define PIN_PA15 15u // PA_15
|
||||
#define PIN_PA18 18u // PA_18
|
||||
#define PIN_PA19 19u // PA_19
|
||||
#define PIN_PA22 22u // PA_22
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
#define PIN_PWM4 30u // PA_30
|
||||
#define PIN_PWM5 22u // PA_22
|
||||
#define PIN_RTS0 22u // PA_22
|
||||
#define PIN_RX0 18u // PA_18
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
// Port availability
|
||||
// -----------------
|
||||
#define HAS_SERIAL0 1
|
||||
#define HAS_SERIAL2 1
|
||||
#define HAS_SPI0 1
|
||||
#define HAS_SPI1 1
|
||||
#define HAS_WIRE0 1
|
||||
#define HAS_WIRE1 1
|
||||
#define SERIAL_INTERFACES_COUNT 2
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define WIRE_INTERFACES_COUNT 2
|
||||
|
||||
// Arduino pin names
|
||||
// -----------------
|
||||
#define PIN_D0 29u // PA_29
|
||||
#define PIN_D1 19u // PA_19
|
||||
#define PIN_D2 15u // PA_15
|
||||
#define PIN_D3 14u // PA_14
|
||||
#define PIN_D4 0u // PA_0
|
||||
#define PIN_D5 5u // PA_5
|
||||
#define PIN_D6 18u // PA_18
|
||||
#define PIN_D7 12u // PA_12
|
||||
#define PIN_D8 23u // PA_23
|
||||
#define PIN_D9 22u // PA_22
|
||||
#define PIN_D10 30u // PA_30
|
||||
#define PIN_A0 19u // PA_19
|
||||
|
||||
// Static pin names
|
||||
// ----------------
|
||||
static const unsigned char A0 = PIN_A0;
|
||||
static const unsigned char D0 = PIN_D0;
|
||||
static const unsigned char D1 = PIN_D1;
|
||||
static const unsigned char D2 = PIN_D2;
|
||||
static const unsigned char D3 = PIN_D3;
|
||||
static const unsigned char D4 = PIN_D4;
|
||||
static const unsigned char D5 = PIN_D5;
|
||||
static const unsigned char D6 = PIN_D6;
|
||||
static const unsigned char D7 = PIN_D7;
|
||||
static const unsigned char D8 = PIN_D8;
|
||||
static const unsigned char D9 = PIN_D9;
|
||||
static const unsigned char D10 = PIN_D10;
|
||||
@@ -14,14 +14,19 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,15 +14,21 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PIN_WIRE1_SCL 20u // GPIO20
|
||||
#define PIN_WIRE1_SDA 21u // GPIO21
|
||||
#define PIN_WIRE2_SCL 0u // GPIO0
|
||||
#define PIN_WIRE2_SDA 1u // GPIO1
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
|
||||
#define PINS_WIRE2_SCL (pin_size_t[]){0u}
|
||||
#define PINS_WIRE2_SDA (pin_size_t[]){1u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PIN_SERIAL1_RX 10u // GPIO10
|
||||
#define PIN_SERIAL1_TX 11u // GPIO11
|
||||
#define PIN_SERIAL2_RX 1u // GPIO1
|
||||
#define PIN_SERIAL2_TX 0u // GPIO0
|
||||
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
|
||||
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){1u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 19u // PA_19
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -62,7 +80,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 14u // PA_14
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM4 29u // PA_29
|
||||
@@ -72,9 +89,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 22u // PA_22
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 19u // PA_19
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 19u // PA_19
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -62,7 +80,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 14u // PA_14
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
#define PIN_PWM4 29u // PA_29
|
||||
@@ -72,9 +89,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 22u // PA_22
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 19u // PA_19
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE0_SCL 29u // PA_29
|
||||
#define PIN_WIRE0_SDA 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PIN_WIRE0_SCL 29u // PA_29
|
||||
#define PIN_WIRE0_SDA 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -40,7 +48,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 14u // PA_14
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
|
||||
@@ -19,14 +19,23 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -46,7 +55,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 14u // PA_14
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
#define PIN_PWM4 29u // PA_29
|
||||
@@ -56,7 +64,6 @@
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 29u // PA_29
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -63,7 +81,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -74,9 +91,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 29u // PA_29
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 19u // PA_19
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -63,7 +81,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -74,9 +91,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 22u // PA_22
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 19u // PA_19
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -63,7 +81,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -74,9 +91,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 29u // PA_29
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 30u // PA_30
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
|
||||
// SPI Interfaces
|
||||
// --------------
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PIN_SPI0_CS 19u // PA_19
|
||||
#define PIN_SPI0_MISO 22u // PA_22
|
||||
#define PIN_SPI0_MOSI 23u // PA_23
|
||||
#define PIN_SPI0_SCK 18u // PA_18
|
||||
#define PIN_SPI1_CS 19u // PA_19
|
||||
#define PIN_SPI1_MISO 22u // PA_22
|
||||
#define PIN_SPI1_MOSI 23u // PA_23
|
||||
#define PIN_SPI1_SCK 18u // PA_18
|
||||
#define PINS_SPI0_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI0_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI0_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI0_SCK (pin_size_t[]){18u}
|
||||
#define PINS_SPI1_CS (pin_size_t[]){19u}
|
||||
#define PINS_SPI1_MISO (pin_size_t[]){22u}
|
||||
#define PINS_SPI1_MOSI (pin_size_t[]){23u}
|
||||
#define PINS_SPI1_SCK (pin_size_t[]){18u}
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
@@ -31,15 +39,25 @@
|
||||
#define PIN_WIRE0_SDA_1 19u // PA_19
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_CTS 19u // PA_19
|
||||
#define PIN_SERIAL0_RTS 22u // PA_22
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_CTS (pin_size_t[]){19u}
|
||||
#define PINS_SERIAL0_RTS (pin_size_t[]){22u}
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -63,7 +81,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
@@ -74,9 +91,7 @@
|
||||
#define PIN_RX2 29u // PA_29
|
||||
#define PIN_SCK0 18u // PA_18
|
||||
#define PIN_SCK1 18u // PA_18
|
||||
#define PIN_SCL0 22u // PA_22
|
||||
#define PIN_SCL1 18u // PA_18
|
||||
#define PIN_SDA0 19u // PA_19
|
||||
#define PIN_SDA1 23u // PA_23
|
||||
#define PIN_TX0 23u // PA_23
|
||||
#define PIN_TX2 30u // PA_30
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
|
||||
// Wire Interfaces
|
||||
// ---------------
|
||||
#define PIN_WIRE0_SCL 29u // PA_29
|
||||
#define PIN_WIRE0_SDA 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PIN_WIRE0_SCL 29u // PA_29
|
||||
#define PIN_WIRE0_SDA 30u // PA_30
|
||||
#define PIN_WIRE1_SCL 18u // PA_18
|
||||
#define PIN_WIRE1_SDA 23u // PA_23
|
||||
#define PINS_WIRE0_SCL (pin_size_t[]){29u}
|
||||
#define PINS_WIRE0_SDA (pin_size_t[]){30u}
|
||||
#define PINS_WIRE1_SCL (pin_size_t[]){18u}
|
||||
#define PINS_WIRE1_SDA (pin_size_t[]){23u}
|
||||
|
||||
// Serial ports
|
||||
// ------------
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PIN_SERIAL0_RX 18u // PA_18
|
||||
#define PIN_SERIAL0_TX 23u // PA_23
|
||||
#define PIN_SERIAL2_RX 29u // PA_29
|
||||
#define PIN_SERIAL2_TX 30u // PA_30
|
||||
#define PINS_SERIAL0_RX (pin_size_t[]){18u}
|
||||
#define PINS_SERIAL0_TX (pin_size_t[]){23u}
|
||||
#define PINS_SERIAL2_RX (pin_size_t[]){29u}
|
||||
#define PINS_SERIAL2_TX (pin_size_t[]){30u}
|
||||
|
||||
// Pin function macros
|
||||
// -------------------
|
||||
@@ -40,7 +48,6 @@
|
||||
#define PIN_PA23 23u // PA_23
|
||||
#define PIN_PA29 29u // PA_29
|
||||
#define PIN_PA30 30u // PA_30
|
||||
#define PIN_PWM0 23u // PA_23
|
||||
#define PIN_PWM1 15u // PA_15
|
||||
#define PIN_PWM2 0u // PA_0
|
||||
#define PIN_PWM3 12u // PA_12
|
||||
|
||||
@@ -427,8 +427,8 @@ env.Replace(
|
||||
# same OTA images for flasher and device
|
||||
f"{image_firmware_is},{image_firmware_is}=device:ota1,ota2;flasher:ota1,ota2",
|
||||
# having flashed an application image, update the bootloader and partition table (incl. keys)
|
||||
f"{image_bootloader}=device:boot;flasher:boot",
|
||||
f"{image_part_table}=device:part_table;flasher:part_table",
|
||||
f"{image_bootloader},{image_bootloader}=flasher:boot,boot",
|
||||
f"{image_part_table},{image_part_table}=flasher:part_table,part_table",
|
||||
# clearing headers of the "other" OTA image (hence the indexes are swapped)
|
||||
f"{image_ota_clear},{image_ota_clear}=device:ota2,ota1;flasher:ota2,ota1",
|
||||
],
|
||||
|
||||
@@ -20,8 +20,6 @@ env.ParseCustomOptions(platform)
|
||||
env.ParseCustomFlashLayout(platform, board)
|
||||
# Add flash layout C defines
|
||||
env.AddFlashLayout(board)
|
||||
# Write custom header options
|
||||
env.ApplyCustomOptions(platform)
|
||||
# Export board manifest for ltchiptool
|
||||
env.ExportBoardData(board)
|
||||
# Print information about versions and custom options
|
||||
|
||||
@@ -17,6 +17,13 @@ env: Environment = DefaultEnvironment()
|
||||
platform: PlatformBase = env.PioPlatform()
|
||||
board: PlatformBoardConfig = env.BoardConfig()
|
||||
|
||||
python_deps = {
|
||||
"ltchiptool": ">=4.5.1,<5.0",
|
||||
}
|
||||
env.SConscript("python-venv.py", exports="env")
|
||||
env.ConfigurePythonVenv()
|
||||
env.InstallPythonDependencies(python_deps)
|
||||
|
||||
# Utilities
|
||||
env.SConscript("utils/config.py", exports="env")
|
||||
env.SConscript("utils/cores.py", exports="env")
|
||||
@@ -24,7 +31,7 @@ env.SConscript("utils/env.py", exports="env")
|
||||
env.SConscript("utils/flash.py", exports="env")
|
||||
env.SConscript("utils/libs-external.py", exports="env")
|
||||
env.SConscript("utils/libs-queue.py", exports="env")
|
||||
env.SConscript("utils/ltchiptool.py", exports="env")
|
||||
env.SConscript("utils/ltchiptool-util.py", exports="env")
|
||||
|
||||
# Firmware name
|
||||
if env.get("PROGNAME", "program") == "program":
|
||||
|
||||
122
builder/python-venv.py
Normal file
122
builder/python-venv.py
Normal file
@@ -0,0 +1,122 @@
|
||||
# Copyright (c) Kuba Szczodrzyński 2023-09-07.
|
||||
|
||||
import json
|
||||
import site
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import semantic_version
|
||||
from platformio.compat import IS_WINDOWS
|
||||
from platformio.package.version import pepver_to_semver
|
||||
from platformio.platform.base import PlatformBase
|
||||
from SCons.Script import DefaultEnvironment, Environment
|
||||
|
||||
env: Environment = DefaultEnvironment()
|
||||
platform: PlatformBase = env.PioPlatform()
|
||||
|
||||
# code borrowed and modified from espressif32/builder/frameworks/espidf.py
|
||||
|
||||
|
||||
def env_configure_python_venv(env: Environment):
|
||||
venv_path = Path(env.subst("${PROJECT_CORE_DIR}"), "penv", ".libretiny")
|
||||
|
||||
pip_path = venv_path.joinpath(
|
||||
"Scripts" if IS_WINDOWS else "bin",
|
||||
"pip" + (".exe" if IS_WINDOWS else ""),
|
||||
)
|
||||
python_path = venv_path.joinpath(
|
||||
"Scripts" if IS_WINDOWS else "bin",
|
||||
"python" + (".exe" if IS_WINDOWS else ""),
|
||||
)
|
||||
site_path = venv_path.joinpath(
|
||||
"Lib" if IS_WINDOWS else "lib",
|
||||
"." if IS_WINDOWS else f"python{sys.version_info[0]}.{sys.version_info[1]}",
|
||||
"site-packages",
|
||||
)
|
||||
|
||||
if not pip_path.is_file():
|
||||
# Use the built-in PlatformIO Python to create a standalone virtual env
|
||||
result = env.Execute(
|
||||
env.VerboseAction(
|
||||
f'"$PYTHONEXE" -m venv --clear "{venv_path.absolute()}"',
|
||||
"LibreTiny: Creating a virtual environment for Python dependencies",
|
||||
)
|
||||
)
|
||||
if not python_path.is_file():
|
||||
# Creating the venv failed
|
||||
raise RuntimeError(
|
||||
f"Failed to create virtual environment. Error code {result}"
|
||||
)
|
||||
if not pip_path.is_file():
|
||||
# Creating the venv succeeded but pip didn't get installed
|
||||
# (i.e. Debian/Ubuntu without ensurepip)
|
||||
print(
|
||||
"LibreTiny: Failed to install pip, running get-pip.py", file=sys.stderr
|
||||
)
|
||||
import requests
|
||||
|
||||
with requests.get("https://bootstrap.pypa.io/get-pip.py") as r:
|
||||
p = subprocess.Popen(
|
||||
args=str(python_path.absolute()),
|
||||
stdin=subprocess.PIPE,
|
||||
)
|
||||
p.communicate(r.content)
|
||||
p.wait()
|
||||
|
||||
assert (
|
||||
pip_path.is_file()
|
||||
), f"Error: Missing the pip binary in virtual environment `{pip_path.absolute()}`"
|
||||
assert (
|
||||
python_path.is_file()
|
||||
), f"Error: Missing Python executable file `{python_path.absolute()}`"
|
||||
assert (
|
||||
site_path.is_dir()
|
||||
), f"Error: Missing site-packages directory `{site_path.absolute()}`"
|
||||
|
||||
env.Replace(LTPYTHONEXE=python_path.absolute(), LTPYTHONENV=venv_path.absolute())
|
||||
site.addsitedir(str(site_path.absolute()))
|
||||
|
||||
|
||||
def env_install_python_dependencies(env: Environment, dependencies: dict):
|
||||
try:
|
||||
pip_output = subprocess.check_output(
|
||||
[
|
||||
env.subst("${LTPYTHONEXE}"),
|
||||
"-m",
|
||||
"pip",
|
||||
"list",
|
||||
"--format=json",
|
||||
"--disable-pip-version-check",
|
||||
]
|
||||
)
|
||||
pip_data = json.loads(pip_output)
|
||||
packages = {p["name"]: pepver_to_semver(p["version"]) for p in pip_data}
|
||||
except:
|
||||
print(
|
||||
"LibreTiny: Warning! Couldn't extract the list of installed Python packages"
|
||||
)
|
||||
packages = {}
|
||||
|
||||
to_install = []
|
||||
for name, spec in dependencies.items():
|
||||
install_spec = f'"{name}{dependencies[name]}"'
|
||||
if name not in packages:
|
||||
to_install.append(install_spec)
|
||||
elif spec:
|
||||
version_spec = semantic_version.Spec(spec)
|
||||
if not version_spec.match(packages[name]):
|
||||
to_install.append(install_spec)
|
||||
|
||||
if to_install:
|
||||
env.Execute(
|
||||
env.VerboseAction(
|
||||
'"${LTPYTHONEXE}" -m pip install --prefer-binary -U '
|
||||
+ " ".join(to_install),
|
||||
"LibreTiny: Installing Python dependencies",
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
env.AddMethod(env_configure_python_venv, "ConfigurePythonVenv")
|
||||
env.AddMethod(env_install_python_dependencies, "InstallPythonDependencies")
|
||||
@@ -89,15 +89,17 @@ def env_add_arduino_libraries(env: Environment, queue, name: str, path: str) ->
|
||||
srcs=[
|
||||
"+<**/*.c*>",
|
||||
],
|
||||
includes=[
|
||||
"!<*/.>",
|
||||
"!<*/*>",
|
||||
]
|
||||
if name.startswith("common")
|
||||
else [
|
||||
"!<.>",
|
||||
"!<*>",
|
||||
],
|
||||
includes=(
|
||||
[
|
||||
"!<*/.>",
|
||||
"!<*/*>",
|
||||
]
|
||||
if name.startswith("common")
|
||||
else [
|
||||
"!<.>",
|
||||
"!<*>",
|
||||
]
|
||||
),
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ from subprocess import PIPE, Popen
|
||||
from typing import Dict
|
||||
|
||||
from ltchiptool import Family, get_version
|
||||
from ltchiptool.util.lvm import LVM
|
||||
from ltchiptool.util.misc import sizeof
|
||||
from platformio.platform.base import PlatformBase
|
||||
from platformio.platform.board import PlatformBoardConfig
|
||||
@@ -77,7 +78,7 @@ def env_configure(
|
||||
# ltchiptool config:
|
||||
# -r output raw log messages
|
||||
# -i 1 indent log messages
|
||||
LTCHIPTOOL='"${PYTHONEXE}" -m ltchiptool -r -i 1',
|
||||
LTCHIPTOOL='"${LTPYTHONEXE}" -m ltchiptool -r -i 1 -L "${LT_DIR}"',
|
||||
# Fix for link2bin to get tmpfile name in argv
|
||||
LINKCOM="${LINK} ${LINKARGS}",
|
||||
LINKARGS="${TEMPFILE('-o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS', '$LINKCOMSTR')}",
|
||||
@@ -87,6 +88,8 @@ def env_configure(
|
||||
)
|
||||
# Store family parameters as environment variables
|
||||
env.Replace(**dict(family))
|
||||
# Set platform directory in ltchiptool (for use in this process only)
|
||||
LVM.add_path(platform.get_dir())
|
||||
return family
|
||||
|
||||
|
||||
@@ -123,7 +126,7 @@ def env_print_info(
|
||||
if env.get("FLASH_IS_CUSTOM", False):
|
||||
print("CUSTOM FLASH LAYOUT:")
|
||||
for name, layout in board.get("flash").items():
|
||||
(_, _, length) = v.partition("+")
|
||||
(_, _, length) = layout.partition("+")
|
||||
length = int(length, 16)
|
||||
print(f" - {name}: {layout} ({sizeof(length)})")
|
||||
|
||||
|
||||
@@ -184,6 +184,9 @@ class LibraryQueue:
|
||||
else:
|
||||
self.env.Append(CPPPATH=self.includes)
|
||||
|
||||
# prepend headers with custom options
|
||||
self.env.ApplyCustomOptions(self.env.PioPlatform())
|
||||
|
||||
# clone the environment for the whole library queue
|
||||
queue_env = self.env.Clone()
|
||||
# add private options to the cloned environment
|
||||
|
||||
@@ -47,6 +47,10 @@ void SerialClass::configure(unsigned long baudrate, uint16_t config) {
|
||||
.flow_control = FLOW_CTRL_DISABLED,
|
||||
};
|
||||
|
||||
if (port == 1)
|
||||
uart1_init();
|
||||
else if (port == 2)
|
||||
uart2_init();
|
||||
uart_hw_set_change(port, &cfg);
|
||||
uart_rx_callback_set(port, callback, &BUF);
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include <sdk_private.h>
|
||||
|
||||
typedef struct {
|
||||
RingBuffer buf;
|
||||
SerialRingBuffer buf;
|
||||
} SerialData;
|
||||
|
||||
#define DATA ((SerialData *)data)
|
||||
#define BUF (DATA->buf)
|
||||
#define pBUF ((RingBuffer *)param)
|
||||
#define pBUF ((SerialRingBuffer *)param)
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
WiFiClass::WiFiClass() {
|
||||
data = (WiFiData *)calloc(1, sizeof(WiFiData));
|
||||
|
||||
DATA->scanSem = xSemaphoreCreateBinary();
|
||||
STA_CFG.dhcp_mode = DHCP_CLIENT;
|
||||
DATA->scanSem = xSemaphoreCreateBinary();
|
||||
STA_CFG.dhcp_mode = DHCP_CLIENT;
|
||||
STA_ADV_CFG.dhcp_mode = DHCP_CLIENT;
|
||||
}
|
||||
|
||||
WiFiClass::~WiFiClass() {
|
||||
|
||||
@@ -27,6 +27,40 @@ static void wifiEventTask(void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
// There is a race condition, when we have an event about a successful
|
||||
// connection but no SSID yet returned by BDK. Even a single millisecond
|
||||
// delay should prevent this from happening. It's better to waste a bit
|
||||
// of time here than to lose a valid connection down the line.
|
||||
static String waitForValidSSID(WiFiClass *pWiFi) {
|
||||
String result;
|
||||
|
||||
// Read the initial value that might just be available already.
|
||||
result = pWiFi->SSID();
|
||||
|
||||
if (!result.length()) {
|
||||
std::size_t i = 0;
|
||||
for (; i < 10; i++) {
|
||||
// Delay and query again.
|
||||
delay(1);
|
||||
result = pWiFi->SSID();
|
||||
|
||||
if (result.length()) {
|
||||
LT_DM(WIFI, "Got valid SSID after %u delays", i + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
// It's a good idea to yield.
|
||||
yield();
|
||||
}
|
||||
|
||||
if (!result.length()) {
|
||||
LT_WM(WIFI, "Could not obtain a valid SSID after %u delays", i);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void wifiEventSendArduino(EventId event) {
|
||||
event = (EventId)(RW_EVT_ARDUINO | event);
|
||||
wifiStatusCallback((rw_evt_type *)&event);
|
||||
@@ -52,11 +86,6 @@ void wifiEventHandler(rw_evt_type event) {
|
||||
|
||||
LT_DM(WIFI, "BK event %u", event);
|
||||
|
||||
if (event <= RW_EVT_STA_GOT_IP)
|
||||
pDATA->lastStaEvent = event;
|
||||
else
|
||||
pDATA->lastApEvent = event;
|
||||
|
||||
EventId eventId;
|
||||
EventInfo eventInfo;
|
||||
String ssid;
|
||||
@@ -103,7 +132,7 @@ void wifiEventHandler(rw_evt_type event) {
|
||||
|
||||
case RW_EVT_STA_CONNECTED:
|
||||
eventId = ARDUINO_EVENT_WIFI_STA_CONNECTED;
|
||||
ssid = pWiFi->SSID();
|
||||
ssid = waitForValidSSID(pWiFi);
|
||||
eventInfo.wifi_sta_connected.ssid_len = ssid.length();
|
||||
eventInfo.wifi_sta_connected.channel = pWiFi->channel();
|
||||
eventInfo.wifi_sta_connected.authmode = pWiFi->getEncryption();
|
||||
@@ -145,5 +174,13 @@ void wifiEventHandler(rw_evt_type event) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Publish state update only after the event data is retrieved.
|
||||
// This relates to the race condition with RW_EVT_STA_CONNECTED.
|
||||
if (event <= RW_EVT_STA_GOT_IP) {
|
||||
pDATA->lastStaEvent = event;
|
||||
} else {
|
||||
pDATA->lastApEvent = event;
|
||||
}
|
||||
|
||||
pWiFi->postEvent(eventId, eventInfo);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,30 @@ IPAddress WiFiClass::hostByName(const char *hostname) {
|
||||
ip_addr_t ip;
|
||||
int ret = netconn_gethostbyname(hostname, &ip);
|
||||
if (ret == ERR_OK) {
|
||||
return ip.addr;
|
||||
#ifdef CONFIG_IPV6
|
||||
if (IP_IS_V6(&ip)) {
|
||||
ip6_addr_t *ip6 = ip_2_ip6(&ip);
|
||||
return IPAddress(
|
||||
IP6_ADDR_BLOCK1(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK1(ip6) & 0xff,
|
||||
IP6_ADDR_BLOCK2(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK2(ip6) & 0xff,
|
||||
IP6_ADDR_BLOCK3(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK3(ip6) & 0xff,
|
||||
IP6_ADDR_BLOCK4(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK4(ip6) & 0xff,
|
||||
IP6_ADDR_BLOCK5(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK5(ip6) & 0xff,
|
||||
IP6_ADDR_BLOCK6(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK6(ip6) & 0xff,
|
||||
IP6_ADDR_BLOCK7(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK7(ip6) & 0xff,
|
||||
IP6_ADDR_BLOCK8(ip6) >> 8,
|
||||
IP6_ADDR_BLOCK8(ip6) & 0xff
|
||||
);
|
||||
}
|
||||
#endif
|
||||
return IPAddress(ip_addr_get_ip4_u32(&ip));
|
||||
}
|
||||
return IPAddress();
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ extern void wifiEventHandler(rw_evt_type event);
|
||||
|
||||
typedef struct {
|
||||
network_InitTypeDef_st configSta;
|
||||
network_InitTypeDef_adv_st configStaAdv;
|
||||
network_InitTypeDef_ap_st configAp;
|
||||
unsigned long scannedAt;
|
||||
SemaphoreHandle_t scanSem;
|
||||
@@ -73,6 +74,7 @@ typedef struct {
|
||||
#define cDATA ((WiFiData *)cls->data)
|
||||
|
||||
#define STA_CFG (DATA->configSta)
|
||||
#define STA_ADV_CFG (DATA->configStaAdv)
|
||||
#define AP_CFG (DATA->configAp)
|
||||
#define IP_STATUS (DATA->statusIp)
|
||||
#define LINK_STATUS (DATA->statusLink)
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
#include "WiFiPrivate.h"
|
||||
|
||||
WiFiStatus
|
||||
WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
|
||||
WiFiStatus WiFiClass::begin(
|
||||
const char *ssid,
|
||||
const char *passphrase,
|
||||
int32_t channel,
|
||||
const uint8_t *bssid,
|
||||
bool connect
|
||||
) {
|
||||
if (!enableSTA(true))
|
||||
return WL_CONNECT_FAILED;
|
||||
if (!validate(ssid, passphrase))
|
||||
@@ -13,11 +18,26 @@ WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, cons
|
||||
|
||||
disconnect(false);
|
||||
|
||||
strcpy(STA_CFG.wifi_ssid, ssid);
|
||||
if (passphrase) {
|
||||
strcpy(STA_CFG.wifi_key, passphrase);
|
||||
if (bssid) {
|
||||
strcpy(STA_ADV_CFG.ap_info.ssid, ssid);
|
||||
if (passphrase) {
|
||||
strcpy(STA_ADV_CFG.key, passphrase);
|
||||
STA_ADV_CFG.key_len = strlen(passphrase);
|
||||
} else {
|
||||
STA_ADV_CFG.key[0] = '\0';
|
||||
STA_ADV_CFG.key_len = 0;
|
||||
}
|
||||
STA_ADV_CFG.ap_info.channel = channel;
|
||||
STA_ADV_CFG.wifi_retry_interval = 100;
|
||||
} else {
|
||||
STA_CFG.wifi_bssid[0] = '\0';
|
||||
strcpy(STA_CFG.wifi_ssid, ssid);
|
||||
if (passphrase) {
|
||||
strcpy(STA_CFG.wifi_key, passphrase);
|
||||
} else {
|
||||
STA_CFG.wifi_key[0] = '\0';
|
||||
}
|
||||
STA_CFG.wifi_retry_interval = 100;
|
||||
STA_CFG.wifi_mode = BK_STATION;
|
||||
}
|
||||
|
||||
if (reconnect(bssid))
|
||||
@@ -27,21 +47,31 @@ WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, cons
|
||||
}
|
||||
|
||||
bool WiFiClass::config(IPAddress localIP, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2) {
|
||||
STA_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT;
|
||||
STA_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT;
|
||||
STA_ADV_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT;
|
||||
if (localIP) {
|
||||
sprintf(STA_CFG.local_ip_addr, IP_FMT, localIP[0], localIP[1], localIP[2], localIP[3]);
|
||||
sprintf(STA_CFG.net_mask, IP_FMT, subnet[0], subnet[1], subnet[2], subnet[3]);
|
||||
sprintf(STA_CFG.gateway_ip_addr, IP_FMT, gateway[0], gateway[1], gateway[2], gateway[3]);
|
||||
sprintf(STA_ADV_CFG.local_ip_addr, IP_FMT, localIP[0], localIP[1], localIP[2], localIP[3]);
|
||||
sprintf(STA_ADV_CFG.net_mask, IP_FMT, subnet[0], subnet[1], subnet[2], subnet[3]);
|
||||
sprintf(STA_ADV_CFG.gateway_ip_addr, IP_FMT, gateway[0], gateway[1], gateway[2], gateway[3]);
|
||||
if (dns1) {
|
||||
sprintf(STA_CFG.dns_server_ip_addr, IP_FMT, dns1[0], dns1[1], dns1[2], dns1[3]);
|
||||
sprintf(STA_ADV_CFG.dns_server_ip_addr, IP_FMT, dns1[0], dns1[1], dns1[2], dns1[3]);
|
||||
} else {
|
||||
STA_CFG.dns_server_ip_addr[0] = '\0';
|
||||
STA_CFG.dns_server_ip_addr[0] = '\0';
|
||||
STA_ADV_CFG.dns_server_ip_addr[0] = '\0';
|
||||
}
|
||||
} else {
|
||||
STA_CFG.local_ip_addr[0] = '\0';
|
||||
STA_CFG.net_mask[0] = '\0';
|
||||
STA_CFG.gateway_ip_addr[0] = '\0';
|
||||
STA_CFG.dns_server_ip_addr[0] = '\0';
|
||||
STA_CFG.local_ip_addr[0] = '\0';
|
||||
STA_CFG.net_mask[0] = '\0';
|
||||
STA_CFG.gateway_ip_addr[0] = '\0';
|
||||
STA_CFG.dns_server_ip_addr[0] = '\0';
|
||||
STA_ADV_CFG.local_ip_addr[0] = '\0';
|
||||
STA_ADV_CFG.net_mask[0] = '\0';
|
||||
STA_ADV_CFG.gateway_ip_addr[0] = '\0';
|
||||
STA_ADV_CFG.dns_server_ip_addr[0] = '\0';
|
||||
}
|
||||
|
||||
// from wlan_ui.c:1370
|
||||
@@ -74,10 +104,8 @@ bool WiFiClass::reconnect(const uint8_t *bssid) {
|
||||
|
||||
LT_DM(WIFI, "Data = %p", DATA->configSta);
|
||||
|
||||
STA_CFG.wifi_mode = BK_STATION;
|
||||
STA_CFG.wifi_retry_interval = 100;
|
||||
if (bssid)
|
||||
memcpy(STA_CFG.wifi_bssid, bssid, 6);
|
||||
memcpy(STA_ADV_CFG.ap_info.bssid, bssid, 6);
|
||||
else
|
||||
memset(STA_CFG.wifi_bssid, 0x00, 6);
|
||||
|
||||
@@ -91,7 +119,11 @@ bool WiFiClass::reconnect(const uint8_t *bssid) {
|
||||
LT_DM(WIFI, "Starting WiFi...");
|
||||
|
||||
__wrap_bk_printf_disable();
|
||||
bk_wlan_start_sta(&STA_CFG);
|
||||
if (bssid) {
|
||||
bk_wlan_start_sta_adv(&STA_ADV_CFG);
|
||||
} else {
|
||||
bk_wlan_start_sta(&STA_CFG);
|
||||
}
|
||||
__wrap_bk_printf_enable();
|
||||
|
||||
LT_DM(WIFI, "Start OK");
|
||||
@@ -219,3 +251,41 @@ WiFiAuthMode WiFiClass::getEncryption() {
|
||||
STA_GET_LINK_STATUS_RETURN(WIFI_AUTH_INVALID);
|
||||
return securityTypeToAuthMode(LINK_STATUS.security);
|
||||
}
|
||||
#ifdef CONFIG_IPV6
|
||||
bool WiFiClass::enableIpV6() {
|
||||
return true;
|
||||
}
|
||||
|
||||
IPv6Address WiFiClass::localIPv6() {
|
||||
struct netif *ifs = (struct netif *)net_get_sta_handle();
|
||||
std::vector<IPv6Address> result;
|
||||
struct wlan_ip_config addr;
|
||||
int nr_addresses = 0;
|
||||
|
||||
if (sta_ip_is_start())
|
||||
nr_addresses = net_get_if_ipv6_pref_addr(&addr, ifs);
|
||||
|
||||
for (int i = 0; i < nr_addresses; i++) {
|
||||
if (ip6_addr_islinklocal(&addr.ipv6[i]))
|
||||
return IPv6Address(addr.ipv6[i].addr);
|
||||
}
|
||||
|
||||
return IPv6Address();
|
||||
}
|
||||
|
||||
std::vector<IPv6Address> WiFiClass::allLocalIPv6() {
|
||||
struct netif *ifs = (struct netif *)net_get_sta_handle();
|
||||
std::vector<IPv6Address> result;
|
||||
struct wlan_ip_config addr;
|
||||
int nr_addresses = 0;
|
||||
|
||||
if (sta_ip_is_start())
|
||||
nr_addresses = net_get_if_ipv6_pref_addr(&addr, ifs);
|
||||
|
||||
for (int i = 0; i < nr_addresses; i++) {
|
||||
result.push_back(IPv6Address(addr.ipv6[i].addr));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -15,20 +15,27 @@ static void scanHandler(void *ctx, uint8_t param) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t apNum = 0;
|
||||
ScanResult_adv result;
|
||||
result.ApNum = 0;
|
||||
result.ApList = NULL;
|
||||
if (wlan_sta_scan_result(&result)) {
|
||||
LT_EM(WIFI, "Failed to get scan result");
|
||||
goto end;
|
||||
}
|
||||
LT_IM(WIFI, "Found %d APs", result.ApNum);
|
||||
|
||||
cls->scanAlloc(result.ApNum);
|
||||
if (!scan->ap) {
|
||||
apNum = cls->scanAlloc(result.ApNum);
|
||||
if (0 == apNum) {
|
||||
LT_WM(WIFI, "scan->ap alloc failed");
|
||||
goto end;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < result.ApNum; i++) {
|
||||
if (apNum < result.ApNum) {
|
||||
LT_WM(WIFI, "alloc failed, only %d APs will be copied");
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < apNum; i++) {
|
||||
scan->ap[i].ssid = strdup(result.ApList[i].ssid);
|
||||
scan->ap[i].auth = securityTypeToAuthMode(result.ApList[i].security);
|
||||
scan->ap[i].rssi = result.ApList[i].ApPower;
|
||||
@@ -47,6 +54,9 @@ end:
|
||||
scan->running = false;
|
||||
xSemaphoreGive(cDATA->scanSem);
|
||||
}
|
||||
if (result.ApList) {
|
||||
free(result.ApList);
|
||||
}
|
||||
LT_HEAP_I();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,10 +108,13 @@ void pinRemoveMode(PinInfo *pin, uint32_t mask) {
|
||||
pinDisable(pin, PIN_IRQ);
|
||||
}
|
||||
if ((mask & PIN_PWM) && (pin->enabled & PIN_PWM)) {
|
||||
data->pwm->cfg.bits.en = PWM_DISABLE;
|
||||
__wrap_bk_printf_disable();
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_DEINIT_PARAM, data->pwm);
|
||||
__wrap_bk_printf_enable();
|
||||
if (data->pwmState != LT_PWM_STOPPED) {
|
||||
data->pwmState = LT_PWM_STOPPED;
|
||||
data->pwm.cfg.bits.en = PWM_DISABLE;
|
||||
__wrap_bk_printf_disable();
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_DEINIT_PARAM, &data->pwm);
|
||||
__wrap_bk_printf_enable();
|
||||
}
|
||||
pinDisable(pin, PIN_PWM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ static uint8_t gpioToAdc(GPIO_INDEX gpio) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static pwm_param_t pwm;
|
||||
static uint16_t adcData[1];
|
||||
|
||||
uint16_t analogReadVoltage(pin_size_t pinNumber) {
|
||||
@@ -66,13 +65,21 @@ uint16_t analogReadVoltage(pin_size_t pinNumber) {
|
||||
adc.pData = adcData;
|
||||
adc.data_buff_size = 1;
|
||||
handle = ddev_open(SARADC_DEV_NAME, &status, (uint32_t)&adc);
|
||||
if (status)
|
||||
if (handle == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (status != SARADC_SUCCESS) {
|
||||
ddev_close(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// wait for data
|
||||
while (!adc.has_data || adc.current_sample_data_cnt < 1) {
|
||||
delay(1);
|
||||
}
|
||||
ddev_control(handle, SARADC_CMD_RUN_OR_STOP_ADC, (void *)false);
|
||||
uint8_t run_stop = 0; // stop
|
||||
ddev_control(handle, SARADC_CMD_RUN_OR_STOP_ADC, &run_stop);
|
||||
ddev_close(handle);
|
||||
return adcData[0];
|
||||
}
|
||||
@@ -87,46 +94,57 @@ void analogWrite(pin_size_t pinNumber, int value) {
|
||||
// GPIO can't be used together with PWM
|
||||
pinRemoveMode(pin, PIN_GPIO | PIN_IRQ);
|
||||
|
||||
float percent = value * 1.0 / ((1 << _analogWriteResolution) - 1);
|
||||
uint32_t frequency = 26 * _analogWritePeriod - 1;
|
||||
|
||||
if (!pinEnabled(pin, PIN_PWM)) {
|
||||
pinEnable(pin, PIN_PWM);
|
||||
data->pwmState = LT_PWM_STOPPED;
|
||||
data->pwm.channel = gpioToPwm(pin->gpio);
|
||||
data->pwm.cfg.bits.en = PWM_ENABLE;
|
||||
data->pwm.cfg.bits.int_en = PWM_INT_DIS;
|
||||
data->pwm.cfg.bits.mode = PWM_PWM_MODE;
|
||||
data->pwm.cfg.bits.clk = PWM_CLK_26M;
|
||||
data->pwm.end_value = frequency;
|
||||
data->pwm.p_Int_Handler = NULL;
|
||||
}
|
||||
|
||||
float percent = value * 1.0 / ((1 << _analogWriteResolution) - 1);
|
||||
uint32_t dutyCycle = percent * frequency;
|
||||
pwm.channel = gpioToPwm(pin->gpio);
|
||||
uint32_t channel = data->pwm.channel;
|
||||
#if CFG_SOC_NAME != SOC_BK7231N
|
||||
pwm.duty_cycle = dutyCycle;
|
||||
data->pwm.duty_cycle = dutyCycle;
|
||||
#else
|
||||
pwm.duty_cycle1 = dutyCycle;
|
||||
pwm.duty_cycle2 = 0;
|
||||
pwm.duty_cycle3 = 0;
|
||||
data->pwm.duty_cycle1 = dutyCycle;
|
||||
data->pwm.duty_cycle2 = 0;
|
||||
data->pwm.duty_cycle3 = 0;
|
||||
#endif
|
||||
|
||||
if (dutyCycle) {
|
||||
if (!pinEnabled(pin, PIN_PWM)) {
|
||||
if ((data->pwmState == LT_PWM_STOPPED) || (data->pwmState == LT_PWM_PAUSED)) {
|
||||
if (dutyCycle) {
|
||||
// enable PWM and set its value
|
||||
pwm.cfg.bits.en = PWM_ENABLE;
|
||||
pwm.cfg.bits.int_en = PWM_INT_DIS;
|
||||
pwm.cfg.bits.mode = PWM_PWM_MODE;
|
||||
pwm.cfg.bits.clk = PWM_CLK_26M;
|
||||
pwm.end_value = frequency;
|
||||
pwm.p_Int_Handler = NULL;
|
||||
|
||||
__wrap_bk_printf_disable();
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_PARAM, &pwm);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_LEVL_SET_HIGH, &pwm.channel);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_UNIT_ENABLE, &pwm.channel);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_PARAM, &data->pwm);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_LEVL_SET_HIGH, &channel);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_UNIT_ENABLE, &channel);
|
||||
__wrap_bk_printf_enable();
|
||||
|
||||
data->pwmState = LT_PWM_RUNNING;
|
||||
}
|
||||
} else if (data->pwmState == LT_PWM_RUNNING) {
|
||||
if (dutyCycle) {
|
||||
__wrap_bk_printf_disable();
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_LEVL_SET_HIGH, &channel);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_SET_DUTY_CYCLE, &data->pwm);
|
||||
__wrap_bk_printf_enable();
|
||||
// pass global PWM object pointer
|
||||
data->pwm = &pwm;
|
||||
pinEnable(pin, PIN_PWM);
|
||||
} else {
|
||||
// update duty cycle
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_SET_DUTY_CYCLE, &pwm);
|
||||
__wrap_bk_printf_disable();
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_LEVL_SET_LOW, &channel);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_SET_DUTY_CYCLE, &data->pwm);
|
||||
sddev_control(PWM_DEV_NAME, CMD_PWM_UNIT_DISABLE, &channel);
|
||||
__wrap_bk_printf_enable();
|
||||
|
||||
data->pwmState = LT_PWM_PAUSED;
|
||||
}
|
||||
} else {
|
||||
if (pinEnabled(pin, PIN_PWM)) {
|
||||
// disable PWM
|
||||
pinRemoveMode(pin, PIN_PWM);
|
||||
}
|
||||
// force level as LOW
|
||||
pinMode(pinNumber, OUTPUT);
|
||||
digitalWrite(pinNumber, LOW);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum lt_pwm_state_tag { LT_PWM_STOPPED, LT_PWM_RUNNING, LT_PWM_PAUSED } lt_pwm_state_t;
|
||||
|
||||
struct PinData_s {
|
||||
pwm_param_t *pwm;
|
||||
pwm_param_t pwm;
|
||||
lt_pwm_state_t pwmState;
|
||||
PinMode gpioMode;
|
||||
PinStatus irqMode;
|
||||
void *irqHandler;
|
||||
|
||||
@@ -9,19 +9,19 @@ static void irqHandler(unsigned char gpio) {
|
||||
PinData *data = pinData(pin);
|
||||
if (!data->irqHandler)
|
||||
return;
|
||||
if (data->irqChange) {
|
||||
if (data->gpioMode == INPUT_PULLDOWN) {
|
||||
data->gpioMode = INPUT_PULLUP;
|
||||
gpio_int_enable(pin->gpio, GPIO_INT_LEVEL_FALLING, irqHandler);
|
||||
} else if (data->gpioMode == INPUT_PULLUP) {
|
||||
data->gpioMode = INPUT_PULLDOWN;
|
||||
gpio_int_enable(pin->gpio, GPIO_INT_LEVEL_RISING, irqHandler);
|
||||
}
|
||||
}
|
||||
if (!data->irqParam)
|
||||
((voidFuncPtr)data->irqHandler)();
|
||||
else
|
||||
((voidFuncPtrParam)data->irqHandler)(data->irqParam);
|
||||
if (data->irqChange) {
|
||||
if (data->irqMode == RISING) {
|
||||
data->irqMode = FALLING;
|
||||
gpio_int_enable(pin->gpio, GPIO_INT_LEVEL_FALLING, irqHandler);
|
||||
} else {
|
||||
data->irqMode = RISING;
|
||||
gpio_int_enable(pin->gpio, GPIO_INT_LEVEL_RISING, irqHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void attachInterruptParam(pin_size_t interruptNumber, voidFuncPtrParam callback, PinStatus mode, void *param) {
|
||||
@@ -52,7 +52,13 @@ void attachInterruptParam(pin_size_t interruptNumber, voidFuncPtrParam callback,
|
||||
event = GPIO_INT_LEVEL_RISING;
|
||||
break;
|
||||
case CHANGE:
|
||||
event = GPIO_INT_LEVEL_FALLING;
|
||||
if (gpio_input(pin->gpio)) {
|
||||
event = GPIO_INT_LEVEL_FALLING;
|
||||
mode = FALLING;
|
||||
} else {
|
||||
event = GPIO_INT_LEVEL_RISING;
|
||||
mode = RISING;
|
||||
}
|
||||
change = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -31,10 +31,12 @@ lt_reboot_reason_t lt_get_reboot_reason() {
|
||||
case RESET_SOURCE_CRASH_UNUSED:
|
||||
case RESET_SOURCE_CRASH_PER_XAT0:
|
||||
return REBOOT_REASON_CRASH;
|
||||
case RESET_SOURCE_DEEPPS_GPIO:
|
||||
case RESET_SOURCE_DEEPPS_RTC:
|
||||
case RESET_SOURCE_DEEPPS_USB:
|
||||
return REBOOT_REASON_SLEEP;
|
||||
return REBOOT_REASON_SLEEP_USB;
|
||||
case RESET_SOURCE_DEEPPS_GPIO:
|
||||
return REBOOT_REASON_SLEEP_GPIO;
|
||||
case RESET_SOURCE_DEEPPS_RTC:
|
||||
return REBOOT_REASON_SLEEP_RTC;
|
||||
default:
|
||||
return REBOOT_REASON_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -6,4 +6,9 @@
|
||||
void lt_init_family() {
|
||||
// set default UART output port
|
||||
uart_print_port = LT_UART_DEFAULT_PORT - 1;
|
||||
// initialize the UART (needed e.g. after deep sleep)
|
||||
if (uart_print_port == 1)
|
||||
uart1_init();
|
||||
else if (uart_print_port == 2)
|
||||
uart2_init();
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ void lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high) {
|
||||
deep_sleep_param.wake_up_way |= PS_DEEP_WAKEUP_GPIO;
|
||||
deep_sleep_param.gpio_index_map |= gpio_index_map;
|
||||
if (on_high) {
|
||||
deep_sleep_param.gpio_edge_map &= (~gpio_index_map);
|
||||
} else {
|
||||
deep_sleep_param.gpio_edge_map |= gpio_index_map;
|
||||
} else {
|
||||
deep_sleep_param.gpio_edge_map &= (~gpio_index_map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,14 +19,21 @@ void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map) {
|
||||
deep_sleep_param.gpio_index_map &= (~gpio_index_map);
|
||||
}
|
||||
|
||||
void lt_deep_sleep_config_timer(uint32_t sleep_duration) {
|
||||
deep_sleep_param.wake_up_way |= PS_DEEP_WAKEUP_RTC;
|
||||
uint64_t duration_math = 32768 * sleep_duration;
|
||||
if (duration_math / 1000 > 0xFFFFFFFF) {
|
||||
// Sleep forever
|
||||
deep_sleep_param.sleep_time = 0xFFFFFFFF;
|
||||
void lt_deep_sleep_keep_floating_gpio(uint32_t gpio_index_map, bool enabled) {
|
||||
if (enabled) {
|
||||
deep_sleep_param.gpio_stay_lo_map |= gpio_index_map;
|
||||
} else {
|
||||
deep_sleep_param.sleep_time = (duration_math / 1000) & 0xFFFFFFFF;
|
||||
deep_sleep_param.gpio_stay_lo_map &= (~gpio_index_map);
|
||||
}
|
||||
}
|
||||
|
||||
void lt_deep_sleep_config_timer(uint32_t sleep_duration_ms) {
|
||||
deep_sleep_param.wake_up_way |= PS_DEEP_WAKEUP_RTC;
|
||||
uint64_t sleep_ticks = 32.768 * sleep_duration_ms;
|
||||
if (sleep_ticks >= 0xFFFFFFFF) {
|
||||
deep_sleep_param.sleep_time = 0xFFFFFFFE;
|
||||
} else {
|
||||
deep_sleep_param.sleep_time = sleep_ticks & 0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +41,7 @@ void lt_deep_sleep_enter() {
|
||||
bk_misc_update_set_type(RESET_SOURCE_DEEPPS_GPIO);
|
||||
GLOBAL_INT_DECLARATION();
|
||||
GLOBAL_INT_DISABLE();
|
||||
sctrl_enter_rtos_deep_sleep((PS_DEEP_CTRL_PARAM *)&deep_sleep_param);
|
||||
sctrl_enter_rtos_deep_sleep_fix((PS_DEEP_CTRL_PARAM *)&deep_sleep_param);
|
||||
ps_delay(500);
|
||||
GLOBAL_INT_RESTORE();
|
||||
}
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
#define LWIP_NETIF_EXT_STATUS_CALLBACK 1
|
||||
#define MEMP_NUM_UDP_PCB (MAX_SOCKETS_UDP + 2 + 1)
|
||||
|
||||
#ifndef CONFIG_IPV6
|
||||
#define ip_addr ip4_addr
|
||||
#define ip_addr_t ip4_addr_t
|
||||
#endif
|
||||
|
||||
// increase TCP/IP thread stack size (was 512)
|
||||
#undef TCPIP_THREAD_STACKSIZE
|
||||
|
||||
9
cores/beken-72xx/base/config/tls_config.h
Normal file
9
cores/beken-72xx/base/config/tls_config.h
Normal file
@@ -0,0 +1,9 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2024-05-18. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include_next "tls_config.h"
|
||||
|
||||
// allow more entropy sources
|
||||
#undef MBEDTLS_ENTROPY_MAX_SOURCES
|
||||
#define MBEDTLS_ENTROPY_MAX_SOURCES 10
|
||||
431
cores/beken-72xx/base/fixups/sys_ctrl.c
Normal file
431
cores/beken-72xx/base/fixups/sys_ctrl.c
Normal file
@@ -0,0 +1,431 @@
|
||||
#include "include.h"
|
||||
#include "sys_ctrl.h"
|
||||
|
||||
#include "flash_pub.h"
|
||||
#include "power_save_pub.h"
|
||||
#include "gpio_pub.h"
|
||||
#include "reg_rc.h"
|
||||
#include "manual_ps_pub.h"
|
||||
|
||||
// usage:
|
||||
// extern void sctrl_enter_rtos_deep_sleep_fix(PS_DEEP_CTRL_PARAM *deep_param);
|
||||
|
||||
static void sctrl_mac_ahb_slave_clock_disable(void)
|
||||
{
|
||||
UINT32 reg;
|
||||
#if (CFG_SOC_NAME == SOC_BK7271)
|
||||
reg = REG_READ(SCTRL_CONTROL);
|
||||
reg &= ~MAC_HCLK_EN_BIT;
|
||||
REG_WRITE(SCTRL_CONTROL, reg);
|
||||
#else
|
||||
reg = REG_READ(SCTRL_MODEM_CORE_RESET_PHY_HCLK);
|
||||
reg &= ~MAC_HCLK_EN_BIT;
|
||||
REG_WRITE(SCTRL_MODEM_CORE_RESET_PHY_HCLK, reg);
|
||||
#endif
|
||||
}
|
||||
|
||||
// This is a patched version, where `gpio_stay_*_map` arguments are actually
|
||||
// taken into account as intended. The offical doc says that they control
|
||||
// whether the original voltage should 'stay' (float) instead of configuring
|
||||
// pins to pullup/pulldown.
|
||||
//
|
||||
// https://docs.bekencorp.com/sdk_3.0.x/bk7238/build/en/latest/developer-guide/power_save/sleep_test.html
|
||||
void sctrl_enter_rtos_deep_sleep_fix(PS_DEEP_CTRL_PARAM *deep_param)
|
||||
{
|
||||
DD_HANDLE flash_hdl;
|
||||
UINT32 status;
|
||||
UINT32 param;
|
||||
UINT32 reg;
|
||||
UINT32 i;
|
||||
|
||||
uart_wait_tx_over();
|
||||
|
||||
/* close all peri clock*/
|
||||
REG_WRITE(ICU_PERI_CLK_PWD, 0xfffff); // icu: 0x2;
|
||||
|
||||
#if CFG_USE_UART2
|
||||
uart2_exit();
|
||||
#endif
|
||||
#if CFG_USE_UART1
|
||||
uart1_exit();
|
||||
#endif
|
||||
|
||||
#if (CFG_SOC_NAME == SOC_BK7231U) || (SOC_BK7231N == CFG_SOC_NAME)
|
||||
reg = REG_READ(SCTRL_LOW_PWR_CLK);
|
||||
reg &=~(LPO_CLK_MUX_MASK);
|
||||
reg |=(LPO_SRC_ROSC << LPO_CLK_MUX_POSI);
|
||||
REG_WRITE(SCTRL_LOW_PWR_CLK, reg);
|
||||
|
||||
REG_WRITE(SCTRL_ROSC_CAL, 0x75);
|
||||
REG_WRITE(SCTRL_ROSC_CAL, 0x77);
|
||||
#else
|
||||
/*ana_reg set*/
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL0, 0x7819a59b);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL1, 0x7819a59b);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL2, 0x84036080);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL3, 0x180004a0);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL4, 0x84200e52);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL5, 0x3b13b13b);
|
||||
#if (CFG_SOC_NAME != SOC_BK7231)
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL6, 0xb09350);
|
||||
#endif
|
||||
#if (CFG_SOC_NAME == SOC_BK7221U)
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL7, 0x441a7f0);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL8, 0x3b187c);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL9, 0x82204007);
|
||||
REG_WRITE(SCTRL_ANALOG_CTRL10, 0x80801432);
|
||||
#endif
|
||||
#endif
|
||||
ps_delay(10);
|
||||
/*clear int*/
|
||||
REG_WRITE(ICU_INTERRUPT_ENABLE, 0);
|
||||
|
||||
extern void gpio_ops_disable_filter(void);
|
||||
gpio_ops_disable_filter();
|
||||
|
||||
/* disable gpio0~31*/
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_EN,0x0); //sys_ctrl : 0x48;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_INT_STATUS,0xFFFFFFFF); //sys_ctrl : 0x4a;
|
||||
|
||||
#if (CFG_SOC_NAME != SOC_BK7231N)
|
||||
/* disable gpio32~39*/
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_EN1,0x0); //sys_ctrl : 0x51;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_INT_STATUS1,0xFF); //sys_ctrl : 0x53;
|
||||
#endif
|
||||
|
||||
REG_WRITE(SCTRL_BLOCK_EN_MUX, 0x0); //sys_ctrl : 0x4F;
|
||||
|
||||
/* ROSC_TIMER_int_clear*/
|
||||
reg = REG_READ(SCTRL_ROSC_TIMER);
|
||||
reg = reg| ROSC_TIMER_INT_STATUS_BIT ;
|
||||
REG_WRITE(SCTRL_ROSC_TIMER,reg); //sys_ctrl : 0x47;
|
||||
|
||||
/*ROSC_TIMER close */
|
||||
reg = REG_READ(SCTRL_ROSC_TIMER);
|
||||
reg = reg & (~ROSC_TIMER_ENABLE_BIT); //'C'
|
||||
REG_WRITE(SCTRL_ROSC_TIMER,reg);
|
||||
|
||||
reg = REG_READ(SCTRL_LOW_PWR_CLK);
|
||||
reg &=~(LPO_CLK_MUX_MASK);
|
||||
if(deep_param->lpo_32k_src == LPO_SELECT_32K_XTAL)
|
||||
{
|
||||
reg |=(LPO_SRC_32K_XTAL << LPO_CLK_MUX_POSI);
|
||||
}
|
||||
else
|
||||
{
|
||||
reg |=(LPO_SRC_ROSC << LPO_CLK_MUX_POSI);
|
||||
}
|
||||
|
||||
REG_WRITE(SCTRL_LOW_PWR_CLK, reg); //sys_ctrl : 0x40;
|
||||
|
||||
/* close all peri int*/
|
||||
// REG_WRITE(ICU_INTERRUPT_ENABLE, 0);
|
||||
|
||||
/* MAC pwd*/
|
||||
REG_WRITE(SCTRL_PWR_MAC_MODEM, MAC_PWD << MAC_PWD_POSI); //sys_ctrl : 0x43;
|
||||
|
||||
sctrl_mac_ahb_slave_clock_disable();
|
||||
|
||||
/* Mac Subsystem clock 480m disable*/
|
||||
reg = REG_READ(SCTRL_CONTROL);
|
||||
REG_WRITE(SCTRL_CONTROL, reg | MAC_CLK480M_PWD_BIT);
|
||||
|
||||
/* Modem pwd*/
|
||||
REG_WRITE(SCTRL_PWR_MAC_MODEM, MODEM_PWD << MODEM_PWD_POSI);
|
||||
|
||||
/* Modem AHB clock disable*/
|
||||
reg = REG_READ(SCTRL_MODEM_CORE_RESET_PHY_HCLK);
|
||||
reg &= ~PHY_HCLK_EN_BIT;
|
||||
REG_WRITE(SCTRL_MODEM_CORE_RESET_PHY_HCLK, reg);
|
||||
|
||||
/* Modem Subsystem clock 480m disable*/
|
||||
reg = REG_READ(SCTRL_CONTROL);
|
||||
REG_WRITE(SCTRL_CONTROL, reg | MODEM_CLK480M_PWD_BIT);
|
||||
|
||||
/* Flash 26MHz clock select dco clock*/
|
||||
flash_hdl = ddev_open(FLASH_DEV_NAME, &status, 0);
|
||||
ASSERT(DD_HANDLE_UNVALID != flash_hdl);
|
||||
ddev_control(flash_hdl, CMD_FLASH_SET_DCO, 0);
|
||||
|
||||
/* MCLK(main clock) select:dco*/ /* MCLK division*/
|
||||
reg = REG_READ(SCTRL_CONTROL);
|
||||
reg &= ~(MCLK_MUX_MASK << MCLK_MUX_POSI);
|
||||
reg &= ~(MCLK_DIV_MASK << MCLK_DIV_POSI);
|
||||
REG_WRITE(SCTRL_CONTROL, reg); //0x02
|
||||
|
||||
if(deep_param->lpo_32k_src == LPO_SELECT_32K_XTAL)
|
||||
{
|
||||
reg = REG_READ(SCTRL_CONTROL);
|
||||
reg =((reg & (~0xF0)) | (0<<4));
|
||||
reg =((reg & (~0x03)) | (0<<MCLK_MUX_POSI));
|
||||
reg =((reg & (~0x100)) | FLASH_26M_MUX_BIT);
|
||||
REG_WRITE(SCTRL_CONTROL,reg); //sys_ctrl : 0x02;
|
||||
}
|
||||
|
||||
ps_delay(10);
|
||||
|
||||
reg = 0x0;
|
||||
reg = (reg &(~(BLOCK_EN_WORD_MASK << 20))&(~(0x7FFFUL<<5)) &(~(0x01UL<<1)));
|
||||
reg = (reg |(BLOCK_EN_WORD_PWD<< 20 )|BLK_EN_FLASH|BLK_EN_ROSC32K|BLK_EN_DIGITAL_CORE|BLK_EN_ANALOG_SYS_LDO);
|
||||
if(deep_param->lpo_32k_src == LPO_SELECT_32K_XTAL)
|
||||
{
|
||||
reg = (reg |BLK_EN_32K_XTAL|BLK_EN_26M_XTAL);
|
||||
}
|
||||
REG_WRITE(SCTRL_BLOCK_EN_CFG, reg); //sys_ctrl : 0x4B; //'E'
|
||||
|
||||
#if (CFG_SOC_NAME != SOC_BK7231U) && (SOC_BK7231N != CFG_SOC_NAME)
|
||||
reg = REG_READ(SCTRL_ROSC_CAL); //ROSC Calibration disable
|
||||
reg =(reg & (~0x01));
|
||||
REG_WRITE(SCTRL_ROSC_CAL, reg);
|
||||
#endif
|
||||
|
||||
for(i=0; i<GPIONUM; i++)
|
||||
{
|
||||
#if (CFG_SOC_NAME == SOC_BK7231N)
|
||||
if(((i > GPIO1) && (i < GPIO6))
|
||||
|| ((i > GPIO11) && (i < GPIO14))
|
||||
|| ((i > GPIO17) && (i < GPIO20))
|
||||
|| ((i > GPIO24) && (i < GPIO26))
|
||||
|| ((i > GPIO26) && (i < GPIO28)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if(((i < BITS_INT)&&(deep_param->gpio_stay_lo_map & (0x01UL << i)))
|
||||
||((deep_param->gpio_index_map & (0x01UL << i)))
|
||||
||((deep_param->gpio_last_index_map & (0x01UL << i)))
|
||||
||((i >= BITS_INT)&&(deep_param->gpio_stay_hi_map & (0x01UL << (i - BITS_INT)))) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
param = GPIO_CFG_PARAM(i, GMODE_DEEP_PS); /*set gpio 0~39 as high impendance*/
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
}
|
||||
|
||||
if (((deep_param->wake_up_way & PS_DEEP_WAKEUP_RTC))
|
||||
&& (deep_param->sleep_time!= 0xffffffff))
|
||||
{
|
||||
/*ROSC_TIMER init*/
|
||||
#if (CFG_SOC_NAME != SOC_BK7231)
|
||||
reg = (deep_param->sleep_time >> 16)& 0xffff; //'A'
|
||||
REG_WRITE(SCTRL_ROSC_TIMER_H,reg);
|
||||
#endif
|
||||
|
||||
reg = REG_READ(SCTRL_ROSC_TIMER);
|
||||
reg |= ROSC_TIMER_INT_STATUS_BIT; //'C'
|
||||
REG_WRITE(SCTRL_ROSC_TIMER,reg); //sys_ctrl : 0x47;
|
||||
|
||||
reg = REG_READ(SCTRL_ROSC_TIMER);
|
||||
reg &= ~(ROSC_TIMER_PERIOD_MASK << ROSC_TIMER_PERIOD_POSI);
|
||||
reg |= ((deep_param->sleep_time & ROSC_TIMER_PERIOD_MASK) << ROSC_TIMER_PERIOD_POSI);
|
||||
REG_WRITE(SCTRL_ROSC_TIMER,reg); //sys_ctrl : 0x47; //'D'
|
||||
|
||||
reg = REG_READ(SCTRL_ROSC_TIMER);
|
||||
reg |= ROSC_TIMER_ENABLE_BIT;
|
||||
REG_WRITE(SCTRL_ROSC_TIMER,reg); //sys_ctrl : 0x47; //'B'
|
||||
|
||||
if(deep_param->lpo_32k_src == LPO_SELECT_32K_XTAL)
|
||||
{
|
||||
REG_WRITE(SCTRL_CONTROL, 0x330100);
|
||||
REG_WRITE(SCTRL_BLOCK_EN_CFG, (0x15D|(0xA5C<<20)));
|
||||
REG_WRITE(SCTRL_ROSC_CAL, 0x30);
|
||||
REG_WRITE(SCTRL_LOW_PWR_CLK, 0x01);
|
||||
REG_WRITE(SCTRL_MODEM_CORE_RESET_PHY_HCLK, 0x03);
|
||||
REG_WRITE(SCTRL_CLK_GATING, 0x1ff);
|
||||
}
|
||||
}
|
||||
|
||||
#if ((CFG_SOC_NAME != SOC_BK7231N) && (CFG_SOC_NAME != SOC_BK7236))
|
||||
if ((deep_param->wake_up_way & PS_DEEP_WAKEUP_GPIO))
|
||||
{
|
||||
for (i = 0; i < BITS_INT; i++)
|
||||
{
|
||||
#if(BITS_INT > GPIONUM)
|
||||
if(i >= GPIONUM)
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (deep_param->gpio_index_map & (0x01UL << i)) /*set gpio 0~31 mode*/
|
||||
{
|
||||
if( deep_param->gpio_edge_map & (0x01UL << i)) //0:high,1:low.
|
||||
{
|
||||
if (deep_param->gpio_stay_lo_map & (0x01UL << i)) {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT);
|
||||
} else {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT_PULLUP);
|
||||
}
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
if(0x1 != (UINT32)gpio_ctrl( CMD_GPIO_INPUT, &i))
|
||||
{ /*check gpio really input value,to correct wrong edge setting*/
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT);
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
deep_param->gpio_edge_map &= ~(0x01UL << i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (deep_param->gpio_stay_lo_map & (0x01UL << i)) {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT);
|
||||
} else {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT_PULLDOWN);
|
||||
}
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
if(0x0 != (UINT32)gpio_ctrl( CMD_GPIO_INPUT, &i))
|
||||
{ /*check gpio really input value,to correct wrong edge setting*/
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT);
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
deep_param->gpio_edge_map |= (0x01UL << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < (GPIONUM - BITS_INT); i++)
|
||||
{
|
||||
if (deep_param->gpio_last_index_map & (0x01UL << i)) /*set gpio 32~39 mode*/
|
||||
{
|
||||
if( deep_param->gpio_last_edge_map & (0x01UL << i))
|
||||
{
|
||||
if (deep_param->gpio_stay_hi_map & (0x01UL << (i - BITS_INT))) {
|
||||
param = GPIO_CFG_PARAM(i + BITS_INT, GMODE_INPUT);
|
||||
} else {
|
||||
param = GPIO_CFG_PARAM(i + BITS_INT, GMODE_INPUT_PULLUP);
|
||||
}
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
reg = i + BITS_INT;
|
||||
if(0x1 != (UINT32)gpio_ctrl( CMD_GPIO_INPUT, ®))
|
||||
{ /*check gpio really input value,to correct wrong edge setting*/
|
||||
param = GPIO_CFG_PARAM(i + BITS_INT, GMODE_INPUT);
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
deep_param->gpio_last_edge_map &= ~(0x01UL << i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (deep_param->gpio_stay_hi_map & (0x01UL << (i - BITS_INT))) {
|
||||
param = GPIO_CFG_PARAM(i + BITS_INT, GMODE_INPUT);
|
||||
} else {
|
||||
param = GPIO_CFG_PARAM(i + BITS_INT, GMODE_INPUT_PULLDOWN);
|
||||
}
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
reg = i + BITS_INT;
|
||||
if(0x0 != (UINT32)gpio_ctrl( CMD_GPIO_INPUT, ®))
|
||||
{ /*check gpio really input value,to correct wrong edge setting*/
|
||||
param = GPIO_CFG_PARAM(i + BITS_INT, GMODE_INPUT);
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
deep_param->gpio_last_edge_map |= (0x01UL << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* set gpio 0~31 mode*/
|
||||
reg = 0xFFFFFFFF;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_INT_STATUS,reg);
|
||||
reg = deep_param->gpio_edge_map;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_TYPE,reg);
|
||||
reg = deep_param->gpio_index_map;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_EN,reg);
|
||||
|
||||
/* set gpio 31~32 mode*/
|
||||
reg = 0xFF;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_INT_STATUS1,reg);
|
||||
|
||||
reg = deep_param->gpio_last_edge_map;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_TYPE1,reg);
|
||||
|
||||
reg = deep_param->gpio_last_index_map;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_EN1,reg);
|
||||
}
|
||||
#elif ((CFG_SOC_NAME == SOC_BK7231N) || (CFG_SOC_NAME == SOC_BK7236))
|
||||
if(( deep_param->wake_up_way & PS_DEEP_WAKEUP_GPIO ))
|
||||
{
|
||||
for ( i = 0; i < BITS_INT; i++ )
|
||||
{
|
||||
#if(BITS_INT > GPIONUM)
|
||||
if( i >= GPIONUM )
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if((( i > GPIO1 ) && ( i < GPIO6 ))
|
||||
|| (( i > GPIO11 ) && ( i < GPIO14 ))
|
||||
|| (( i > GPIO17 ) && ( i < GPIO20 ))
|
||||
|| (( i > GPIO24 ) && ( i < GPIO26 ))
|
||||
|| (( i > GPIO26 ) && ( i < GPIO28 )))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( deep_param->gpio_index_map & ( 0x01UL << i ))
|
||||
{
|
||||
int type_h,type_l;
|
||||
type_l = deep_param->gpio_edge_map;
|
||||
type_h = 0x0;
|
||||
|
||||
/* low level or negedge wakeup */
|
||||
if(( type_h & ( 0x01UL << i )) == ( type_l & ( 0x01UL << i )))
|
||||
{
|
||||
if (deep_param->gpio_stay_lo_map & (0x01UL << i)) {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT);
|
||||
} else {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT_PULLUP);
|
||||
}
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
}
|
||||
else /* high level or posedge wakeup */
|
||||
{
|
||||
if (deep_param->gpio_stay_lo_map & (0x01UL << i)) {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT);
|
||||
} else {
|
||||
param = GPIO_CFG_PARAM(i, GMODE_INPUT_PULLDOWN);
|
||||
}
|
||||
sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m);
|
||||
}
|
||||
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_TYPE, type_l);
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_TYPE_SELECT, type_h);
|
||||
}
|
||||
}
|
||||
|
||||
reg = deep_param->gpio_index_map;
|
||||
REG_WRITE(SCTRL_GPIO_WAKEUP_EN,reg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (CFG_SOC_NAME != SOC_BK7231N)
|
||||
REG_WRITE(SCTRL_USB_PLUG_WAKEUP,USB_PLUG_IN_INT_BIT|USB_PLUG_OUT_INT_BIT);
|
||||
if(deep_param->wake_up_way & PS_DEEP_WAKEUP_USB)
|
||||
{
|
||||
REG_WRITE(SCTRL_USB_PLUG_WAKEUP,USB_PLUG_IN_EN_BIT|USB_PLUG_OUT_EN_BIT);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BK_DEEP_SLEEP_DEBUG
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_CONTROL=0x%08X\r\n", REG_READ(SCTRL_CONTROL));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_SLEEP=0x%08X\r\n", REG_READ(SCTRL_SLEEP));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_ROSC_TIMER=0x%08X\r\n", REG_READ(SCTRL_ROSC_TIMER));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_BLOCK_EN_CFG=0x%08X\r\n", REG_READ(SCTRL_BLOCK_EN_CFG));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_ROSC_CAL=0x%08X\r\n", REG_READ(SCTRL_ROSC_CAL));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_BLOCK_EN_MUX=0x%08X\r\n", REG_READ(SCTRL_BLOCK_EN_MUX));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_LOW_PWR_CLK=0x%08X\r\n", REG_READ(SCTRL_LOW_PWR_CLK));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_PWR_MAC_MODEM=0x%08X\r\n", REG_READ(SCTRL_PWR_MAC_MODEM));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_MODEM_CORE_RESET_PHY_HCLK=0x%08X\r\n", REG_READ(SCTRL_MODEM_CORE_RESET_PHY_HCLK));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_CLK_GATING=0x%08X\r\n", REG_READ(SCTRL_CLK_GATING));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_GPIO_WAKEUP_INT_STATUS=0x%08X\r\n", REG_READ(SCTRL_GPIO_WAKEUP_INT_STATUS));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_GPIO_WAKEUP_TYPE=0x%08X\r\n", REG_READ(SCTRL_GPIO_WAKEUP_TYPE));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_GPIO_WAKEUP_EN=0x%08X\r\n", REG_READ(SCTRL_GPIO_WAKEUP_EN));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_GPIO_WAKEUP_INT_STATUS1=0x%08X\r\n", REG_READ(SCTRL_GPIO_WAKEUP_INT_STATUS1));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_GPIO_WAKEUP_TYPE1=0x%08X\r\n", REG_READ(SCTRL_GPIO_WAKEUP_TYPE1));
|
||||
BK_DEEP_SLEEP_PRT("SCTRL_GPIO_WAKEUP_EN1=0x%08X\r\n", REG_READ(SCTRL_GPIO_WAKEUP_EN1));
|
||||
#endif
|
||||
|
||||
/* enter deep_sleep mode */
|
||||
reg = REG_READ(SCTRL_SLEEP);
|
||||
reg &= ~(SLEEP_MODE_MASK << SLEEP_MODE_POSI);
|
||||
reg = reg | SLEEP_MODE_CFG_DEEP_WORD;
|
||||
REG_WRITE(SCTRL_SLEEP, reg);
|
||||
|
||||
delay(5);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user