SDK 2.0.0 release

This commit is contained in:
graham sanderson 2024-08-08 06:02:04 -05:00
parent 45984e276f
commit efe2103f9b
933 changed files with 349909 additions and 66256 deletions

4
.bazelignore Normal file
View File

@ -0,0 +1,4 @@
# Don't accidentally pick up external CMake deps with Bazel build files.
build
# Don't treat submodules as part of this project.
lib

View File

@ -2,5 +2,9 @@
build --incompatible_enable_cc_toolchain_resolution
build --@rules_cc//cc/toolchains:experimental_enable_rule_based_toolchains
# Silence all C/C++ warnings in external code.
common --per_file_copt=external/.*@-w
common --host_per_file_copt=external/.*@-w
# Produce useful output when the build fails.
common --verbose_failures

View File

@ -1 +1 @@
7.0.2
7.2.1

2
.gitignore vendored
View File

@ -3,8 +3,10 @@
cmake-*
.DS_Store
build
build-*
bazel-*
# Ignore until https://github.com/bazelbuild/bazel/issues/20369 is fixed.
MODULE.bazel.lock
__pycache__/

View File

@ -15,6 +15,11 @@ if (NOT TARGET _pico_sdk_inclusion_marker)
pico_register_common_scope_var(PICO_C_COMPILER_IS_CLANG)
pico_register_common_scope_var(PICO_C_COMPILER_IS_GNU)
pico_register_common_scope_var(PICO_C_COMPILER_IS_IAR)
pico_register_common_scope_var(PICO_SDK_VERSION_MAJOR)
pico_register_common_scope_var(PICO_SDK_VERSION_MINOR)
pico_register_common_scope_var(PICO_SDK_VERSION_REVISION)
pico_register_common_scope_var(PICO_SDK_VERSION_PRE_RELEASE_ID)
pico_register_common_scope_var(PICO_SDK_VERSION_STRING)
message("Build type is ${CMAKE_BUILD_TYPE}")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
@ -38,6 +43,9 @@ if (NOT TARGET _pico_sdk_inclusion_marker)
add_sub_list_dirs(PICO_SDK_PRE_LIST_DIRS)
add_sub_list_files(PICO_SDK_PRE_LIST_FILES)
# needed by certain functions
set(PICO_TOOLS_DIR "${CMAKE_CURRENT_LIST_DIR}/tools" CACHE INTERNAL "")
add_subdirectory(tools)
add_subdirectory(src)

View File

@ -1,8 +1,12 @@
module(name = "pico-sdk", version = "1.6.0-rc1")
bazel_dep(name = "platforms", version = "0.0.8")
module(
name = "pico-sdk",
version = "2.0.0",
)
bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_python", version = "0.22.1")
bazel_dep(name = "picotool", version = "2.0.0")
# Note: rules_cc is special-cased repository; a dependency on rules_cc in a
# module will not ensure that the root Bazel module has that same version of
@ -15,84 +19,123 @@ bazel_dep(name = "rules_cc", version = "0.0.9")
# project's MODULE.bazel too.
archive_override(
module_name = "rules_cc",
urls = "https://github.com/bazelbuild/rules_cc/archive/1acf5213b6170f1f0133e273cb85ede0e732048f.zip",
integrity = "sha256-zdQo/pQWKdIAPKSflBxOSWZNwCbc86T7SechKZo/3Xw=",
strip_prefix = "rules_cc-1acf5213b6170f1f0133e273cb85ede0e732048f",
integrity = "sha256-NddP6xi6LzsIHT8bMSVJ2NtoURbN+l3xpjvmIgB6aSg=",
urls = "https://github.com/bazelbuild/rules_cc/archive/1acf5213b6170f1f0133e273cb85ede0e732048f.tar.gz",
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "arm_gcc_linux-x86_64",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
)
http_archive(
name = "arm_gcc_win-x86_64",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
)
http_archive(
name = "arm_gcc_mac-x86_64",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
)
http_archive(
name = "arm_gcc_mac-aarch64",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
)
http_archive(
name = "clang_linux-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "e12ee0db9226f5b4a4400c5eb2c0f757d7056181b651622b5453acb00105fd87",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/linux-amd64/+/git_revision:248c53429427034f45705af60d47f3b1090c4799",
)
http_archive(
name = "clang_win-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "8c41e8b507f4dfede80842f98a716cac209f552064088fa1b7f4c64a1e547534",
type = "zip",
# Windows doesn't like `:` in the produced filename, so replace it with `%3A`.
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/windows-amd64/+/git_revision:248c53429427034f45705af60d47f3b1090c4799".replace("git_revision:", "git_revision%3A"),
)
http_archive(
name = "clang_mac-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "1d92f52609d3c1e958fd56f5e9a68ab99b2042ddcc6e90a5eb5009cf7ac4897d",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-amd64/+/git_revision:248c53429427034f45705af60d47f3b1090c4799",
)
http_archive(
name = "clang_mac-aarch64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "53184680db7e0043a8fba1556c7644b8f5e6c8cdffa4436a92a8e8adb0f45b8d",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-arm64/+/git_revision:248c53429427034f45705af60d47f3b1090c4799",
)
# TODO: Provide tinyusb as a proper Bazel module.
http_archive(
name = "tinyusb",
url = "https://github.com/hathach/tinyusb/archive/86c416d4c0fb38432460b3e11b08b9de76941bf5.zip",
strip_prefix = "tinyusb-86c416d4c0fb38432460b3e11b08b9de76941bf5",
build_file = "//src/rp2_common/tinyusb:tinyusb.BUILD",
sha256 = "ac57109bba00d26ffa33312d5f334990ec9a9a4d82bf890ed8b825b4610d1da2",
sha256 = "d64728aef58b80d5ce3747cad133f520da46e2b7ea3aadfda0e981aba6b658b3",
strip_prefix = "tinyusb-4232642899362fa5e9cf0dc59bad6f1f6d32c563",
url = "https://github.com/hathach/tinyusb/archive/4232642899362fa5e9cf0dc59bad6f1f6d32c563.tar.gz",
)
# TODO: Provide btstack as a proper Bazel module.
http_archive(
name = "btstack",
url = "https://github.com/bluekitchen/btstack/archive/72ef1732c954d938091467961e41f4aa9b976b34.zip",
strip_prefix = "btstack-72ef1732c954d938091467961e41f4aa9b976b34",
build_file = "//src/rp2_common/pico_btstack:btstack.BUILD",
sha256 = "f45d72b5d404dd2f8e311287de6f2ba3561fc8ae956737eeb611b277aadc2391",
sha256 = "64e86d9cf82b346e743fe1d4818b9380712b17abdb3f2c3524e92464b5ef3d19",
strip_prefix = "btstack-2b49e57bd1fae85ac32ac1f41cdb7c794de335f6",
url = "https://github.com/bluekitchen/btstack/archive/2b49e57bd1fae85ac32ac1f41cdb7c794de335f6.tar.gz",
)
# TODO: Provide btstack as a proper Bazel module.
http_archive(
name = "cyw43-driver",
url = "https://github.com/georgerobotics/cyw43-driver/archive/8ef38a6d32c54f850bff8f189bdca19ded33792a.zip",
strip_prefix = "cyw43-driver-8ef38a6d32c54f850bff8f189bdca19ded33792a",
build_file = "//src/rp2_common/pico_cyw43_driver:cyw43-driver.BUILD",
sha256 = "0b44a19ea58537ee954357606cde5ed20c3a42be77adfebb07b7c0e4740f6228",
sha256 = "0fcc7707fef95dd562d5572604713266613a27caeeae2f10afeccee9592a53ce",
strip_prefix = "cyw43-driver-faf36381bad1f668a30172b6336c9a970966ef4c",
url = "https://github.com/georgerobotics/cyw43-driver/archive/faf36381bad1f668a30172b6336c9a970966ef4c.tar.gz",
)
# TODO: Provide lwip as a proper Bazel module.
http_archive(
name = "lwip",
url = "https://github.com/lwip-tcpip/lwip/archive/239918ccc173cb2c2a62f41a40fd893f57faf1d6.zip",
strip_prefix = "lwip-239918ccc173cb2c2a62f41a40fd893f57faf1d6",
build_file = "//src/rp2_common/pico_lwip:lwip.BUILD",
sha256 = "7ee9e02f2719c0422377e1fcce5a21716ca2e2e855cca56695f9ef7cb020e5dd",
sha256 = "72856d557f72911cf6826ef745c23c54822df83a474557823241164a1d1361aa",
strip_prefix = "lwip-0a0452b2c39bdd91e252aef045c115f88f6ca773",
url = "https://github.com/lwip-tcpip/lwip/archive/0a0452b2c39bdd91e252aef045c115f88f6ca773.tar.gz",
)
register_toolchains(
"//bazel/toolchain:arm_gcc_linux-x86_64",
"//bazel/toolchain:arm_gcc_win-x86_64",
"//bazel/toolchain:arm_gcc_mac-x86_64",
"//bazel/toolchain:arm_gcc_mac-aarch64",
"//bazel/toolchain:linux-x86_64-rp2040",
"//bazel/toolchain:linux-x86_64-rp2350",
"//bazel/toolchain:win-x86_64-rp2040",
"//bazel/toolchain:win-x86_64-rp2350",
"//bazel/toolchain:mac-x86_64-rp2040",
"//bazel/toolchain:mac-x86_64-rp2350",
"//bazel/toolchain:mac-aarch64-rp2040",
"//bazel/toolchain:mac-aarch64-rp2350",
# Require users to opt-in to the Pico SDK's toolchains.
dev_dependency = True,
)

View File

@ -1,31 +1,31 @@
# Raspberry Pi Pico SDK
The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries and build system
necessary to write programs for the RP2040-based devices such as the Raspberry Pi Pico
necessary to write programs for the RP-series microcontroller-based devices such as the Raspberry Pi Pico or Raspberry Pi Pico 2
in C, C++ or assembly language.
The SDK is designed to provide an API and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
A single program runs on the device at a time and starts with a conventional `main()` method. Standard C/C++ libraries are supported along with
C level libraries/APIs for accessing all of the RP2040's hardware include PIO (Programmable IO).
C-level libraries/APIs for accessing all of the RP-series microcontroller's hardware including PIO (Programmable IO).
Additionally the SDK provides higher level libraries for dealing with timers, synchronization, USB (TinyUSB) and multi-core programming
along with various utilities.
Additionally, the SDK provides higher level libraries for dealing with timers, synchronization, Wi-Fi and Bluetooth networking, USB and multicore programming. These libraries should be comprehensive enough that your application code rarely, if at all, needs to access hardware registers directly. However, if you do need or prefer to access the raw hardware registers, you will also find complete and fully-commented register definition headers in the SDK. There's no need to look up addresses in the datasheet.
The SDK can be used to build anything from simple applications, to fully fledged runtime environments such as MicroPython, to low level software
such as RP2040's on-chip bootrom itself.
The SDK can be used to build anything from simple applications, fully-fledged runtime environments such as MicroPython, to low level software
such as the RP-series microcontroller's on-chip bootrom itself.
The design goal for entire SDK is to be simple but powerful.
Additional libraries/APIs that are not yet ready for inclusion in the SDK can be found in [pico-extras](https://github.com/raspberrypi/pico-extras).
# Documentation
See [Getting Started with the Raspberry Pi Pico](https://rptl.io/pico-get-started) for information on how to setup your
hardware, IDE/environment and for how to build and debug software for the Raspberry Pi Pico
and other RP2040-based devices.
See [Getting Started with the Raspberry Pi Pico-Series](https://rptl.io/pico-get-started) for information on how to setup your
hardware, IDE/environment and how to build and debug software for the Raspberry Pi Pico and other RP-series microcontroller based devices.
See [Connecting to the Internet with Raspberry Pi Pico W](https://rptl.io/picow-connect) to learn more about writing
applications for your Raspberry Pi Pico W that connect to the internet.
See [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk) to learn more about programming using the
See [Raspberry Pi Pico-Series C/C++ SDK](https://rptl.io/pico-c-sdk) to learn more about programming using the
SDK, to explore more advanced features, and for complete PDF-based API documentation.
See [Online Raspberry Pi Pico SDK API docs](https://rptl.io/pico-doxygen) for HTML-based API documentation.
@ -42,10 +42,16 @@ _latest stable release_ of the SDK. If you need or want to test upcoming feature
# Quick-start your own project
These instructions are extremely terse, and Linux-based only. For detailed steps,
instructions for other platforms, and just in general, we recommend you see [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk)
## Using Visual Studio Code
1. Install CMake (at least version 3.13), and GCC cross compiler
You can install the [Raspberry Pi Pico Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico) in VS Code.
## Unix command line
These instructions are extremely terse, and Linux-based only. For detailed steps,
instructions for other platforms, and just in general, we recommend you see [Raspberry Pi Pico-Series C/C++ SDK](https://rptl.io/pico-c-sdk)
1. Install CMake (at least version 3.13), and a GCC cross compiler
```
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
```
@ -137,7 +143,7 @@ instructions for other platforms, and just in general, we recommend you see [Ras
# rest of your project
```
1. Write your code (see [pico-examples](https://github.com/raspberrypi/pico-examples) or the [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk) documentation for more information)
1. Write your code (see [pico-examples](https://github.com/raspberrypi/pico-examples) or the [Raspberry Pi Pico-Series C/C++ SDK](https://rptl.io/pico-c-sdk) documentation for more information)
About the simplest you can do is a single source file (e.g. hello_world.c)
@ -146,7 +152,7 @@ instructions for other platforms, and just in general, we recommend you see [Ras
#include "pico/stdlib.h"
int main() {
setup_default_uart();
stdio_init_all();
printf("Hello, world!\n");
return 0;
}
@ -176,12 +182,11 @@ instructions for other platforms, and just in general, we recommend you see [Ras
$ cmake ..
```
When building for a board other than the Raspberry Pi Pico, you should pass `-DPICO_BOARD=board_name` to the `cmake` command above, e.g. `cmake -DPICO_BOARD=pico_w ..`
to configure the SDK and build options accordingly for that particular board.
When building for a board other than the Raspberry Pi Pico, you should pass `-DPICO_BOARD=board_name` to the `cmake` command above, e.g. `cmake -DPICO_BOARD=pico2 ..` or `cmake -DPICO_BOARD=pico_w ..` to configure the SDK and build options accordingly for that particular board.
Doing so sets up various compiler defines (e.g. default pin numbers for UART and other hardware) and in certain
Specifying `PICO_BOARD=<booardname>` sets up various compiler defines (e.g. default pin numbers for UART and other hardware) and in certain
cases also enables the use of additional libraries (e.g. wireless support when building for `PICO_BOARD=pico_w`) which cannot
be built without a board which provides the requisite functionality.
be built without a board which provides the requisite hardware functionality.
For a list of boards defined in the SDK itself, look in [this directory](src/boards/include/boards) which has a
header for each named board.
@ -191,4 +196,8 @@ instructions for other platforms, and just in general, we recommend you see [Ras
$ make hello_world
```
1. You now have `hello_world.elf` to load via a debugger, or `hello_world.uf2` that can be installed and run on your Raspberry Pi Pico via drag and drop.
1. You now have `hello_world.elf` to load via a debugger, or `hello_world.uf2` that can be installed and run on your Raspberry Pi Pico-series device via drag and drop.
# RISC-V support on RP2350
See [Raspberry Pi Pico-series C/C++ SDK](https://rptl.io/pico-c-sdk) for information on setting up a build environment for RISC-V on RP2350.

0
WORKSPACE Normal file
View File

View File

@ -55,3 +55,9 @@ cc_library(
cc_library(
name = "empty_cc_lib",
)
# A library incompatible with everything. Use to mark an invalid configuration.
cc_library(
name = "incompatible_cc_lib",
target_compatible_with = ["@platforms//:incompatible"],
)

View File

@ -7,9 +7,10 @@ First, in your `MODULE.bazel` file, add a dependency on the Pico SDK:
```python
bazel_dep(
name = "pico-sdk",
version = "1.6.0-rc1",
version = "2.0.0",
)
```
Second, in the same file you'll need to add an explicit dependency on
`rules_cc`, as it's a special-cased Bazel module:
```python
@ -35,10 +36,14 @@ These toolchains tell Bazel how to compile for ARM cores. Add the following
to the `MODULE.bazel` for your project:
```python
register_toolchains(
"@pico-sdk//bazel/toolchain:arm_gcc_linux-x86_64",
"@pico-sdk//bazel/toolchain:arm_gcc_win-x86_64",
"@pico-sdk//bazel/toolchain:arm_gcc_mac-x86_64",
"@pico-sdk//bazel/toolchain:arm_gcc_mac-aarch64",
"@pico-sdk//bazel/toolchain:linux-x86_64-rp2040",
"@pico-sdk//bazel/toolchain:linux-x86_64-rp2350",
"@pico-sdk//bazel/toolchain:win-x86_64-rp2040",
"@pico-sdk//bazel/toolchain:win-x86_64-rp2350",
"@pico-sdk//bazel/toolchain:mac-x86_64-rp2040",
"@pico-sdk//bazel/toolchain:mac-x86_64-rp2350",
"@pico-sdk//bazel/toolchain:mac-aarch64-rp2040",
"@pico-sdk//bazel/toolchain:mac-aarch64-rp2350",
)
```
@ -82,7 +87,7 @@ rule basis, or through an aspect. Running a wildcard build with the
firmware image.
```console
$ bazel build --platforms=@pico-sdk//bazel/platform:rp2040 \
$ bazelisk build --platforms=@pico-sdk//bazel/platform:rp2040 \
--aspects @pico-sdk//tools:uf2_aspect.bzl%pico_uf2_aspect \
--output_groups=+pico_uf2_files \
//...
@ -97,6 +102,13 @@ launcher) to build the Pico SDK.
We strongly recommend you set up
[Bazelisk](https://bazel.build/install/bazelisk).
You will also need a working compiler configured if you wish to build Picotool
or pioasm.
* Linux: `sudo apt-get install build-essential` or similar.
* macOS: `xcode-select --install`
* Windows: [Install MSVC](https://visualstudio.microsoft.com/vs/features/cplusplus/)
### Building
To build all of the Pico SDK, run the following command:
```console
@ -111,6 +123,23 @@ you encounter along the way.
Currently, the following features are not supported:
* "None" variants of pico_double, pico_float, and pico_printf are not yet
supported.
* The pioasm parser cannot be built from source via Bazel.
* Windows MSVC wildcard build (`bazel build //...`) does not work when targeting
host.
* Bazel does not yet provide RISC-V support for Pico 2/RP2350.
* Pico W wireless libraries have link issues.
## Contributing
When making changes to the Bazel build, please run the Bazel validation script
to ensure all supported configurations build properly:
```console
$ ./tools/run_all_bazel_checks.py
```
If you need to check against a local version of Picotool, you can run the script
with `--picotool-dir`:
```console
$ ./tools/run_all_bazel_checks.py --picotool-dir=/path/to/picotool
```

View File

@ -2,7 +2,17 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "int_flag", "strin
package(default_visibility = ["//visibility:public"])
# PICO_BAZEL_CONFIG: PICO_BOARD, The board name being built for, type=string, default=pico, group=build
# PICO_BAZEL_CONFIG: PICO_TOOLCHAIN, The toolchain to use, type=string, default=gcc, group=build
string_flag(
name = "PICO_TOOLCHAIN",
build_setting_default = "gcc",
values = [
"gcc",
"clang",
],
)
# PICO_BAZEL_CONFIG: PICO_BOARD, Board name being built for, type=string, default=pico or pico2, group=build, docref=cmake-platform-board-config
string_flag(
name = "PICO_BOARD",
build_setting_default = "pico",
@ -14,7 +24,7 @@ bool_flag(
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_NO_GC_SECTIONS, Disable -ffunction-sections -fdata-sections and --gc-sections, type=bool, default=0, advanced=true, group=pico_standard_link
# PICO_BAZEL_CONFIG: PICO_NO_GC_SECTIONS, Disable `-ffunction-sections` `-fdata-sections` and `--gc-sections`, type=bool, default=0, advanced=true, group=pico_standard_link
bool_flag(
name = "PICO_NO_GC_SECTIONS",
build_setting_default = False,
@ -23,57 +33,124 @@ bool_flag(
# PICO_BAZEL_CONFIG: PICO_DEFAULT_BOOT_STAGE2_FILE, Boot stage 2 file to use; this should point to a filegroup with the .S file to use, type=string, group=build
label_flag(
name = "PICO_DEFAULT_BOOT_STAGE2_FILE",
build_setting_default = "//src/rp2_common/boot_stage2:build_selected_boot2",
build_setting_default = "//src/rp2_common:build_selected_boot2",
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_BOOT_STAGE2, Simpler alternative to specifying PICO_DEFAULT_BOOT_STAGE2_FILE where the file is src/rp2_common/boot_stage2/{PICO_DEFAULT_BOOT_STAGE2}.S, type=string, default=compile_time_choice, group=build
# PICO_BAZEL_CONFIG: PICO_DEFAULT_BOOT_STAGE2, Simpler alternative to specifying PICO_DEFAULT_BOOT_STAGE2_FILE where the latter is set to src/rp2_common/boot_stage2/{PICO_DEFAULT_BOOT_STAGE2}.S, type=string, default=compile_time_choice, group=build
string_flag(
name = "PICO_DEFAULT_BOOT_STAGE2",
build_setting_default = "compile_time_choice",
)
# PICO_BAZEL_CONFIG: PICO_BOOT_STAGE2_LINK_IMAGE, [Bazel only] The final boot_stage2 image target to link in. Use this to fully override/replace boot_stage2, default=@pico-sdk//src/rp2_common/boot_stage2:boot_stage2, group=build
# PICO_BAZEL_CONFIG: PICO_BOOT_STAGE2_LINK_IMAGE, [Bazel only] The final boot_stage2 image target to link in. Use this to fully override/replace boot_stage2, default=@pico-sdk//src/rp2_common:boot_stage2, group=build
label_flag(
name = "PICO_BOOT_STAGE2_LINK_IMAGE",
build_setting_default = "//src/rp2_common/boot_stage2:boot_stage2",
build_setting_default = "//src/rp2_common:boot_stage2",
)
# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_EXCEPTIONS, Enabled CXX exception handling, type=bool, default=0, group=pico_cxx_options
# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_EXCEPTIONS, Enable CXX exception handling, type=bool, default=0, group=pico_cxx_options
bool_flag(
name = "PICO_CXX_ENABLE_EXCEPTIONS",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_RTTI, Enabled CXX rtti, type=bool, default=0, group=pico_cxx_options
# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_RTTI, Enable CXX rtti, type=bool, default=0, group=pico_cxx_options
bool_flag(
name = "PICO_CXX_ENABLE_RTTI",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_CXA_ATEXIT, Enabled cxa-atexit, type=bool, default=0, group=pico_cxx_options
# PICO_BAZEL_CONFIG: PICO_CXX_ENABLE_CXA_ATEXIT, Enable cxa-atexit, type=bool, default=0, group=pico_cxx_options
bool_flag(
name = "PICO_CXX_ENABLE_CXA_ATEXIT",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_STDIO_UART, OPTION: Globally enable stdio UART, type=bool, default=1, group=pico_stdlib
# PICO_BAZEL_CONFIG: PICO_STDIO_UART, Option to globally enable stdio UART for all targets by default, type=bool, default=1, group=pico_stdlib
bool_flag(
name = "PICO_STDIO_UART",
build_setting_default = True,
)
# PICO_BAZEL_CONFIG: PICO_STDIO_USB, OPTION: Globally enable stdio USB, type=bool, default=0, group=pico_stdlib
# PICO_BAZEL_CONFIG: PICO_STDIO_USB, Option to globally enable stdio USB for all targets by default, type=bool, default=0, group=pico_stdlib
bool_flag(
name = "PICO_STDIO_USB",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_STDIO_SEMIHOSTING, OPTION: Globally enable stdio semihosting, type=bool, default=0, group=pico_stdlib
# PICO_BAZEL_CONFIG: PICO_STDIO_SEMIHOSTING, Option to globally enable stdio semi-hosting for all targets by default, type=bool, default=0, group=pico_stdlib
bool_flag(
name = "PICO_STDIO_SEMIHOSTING",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_STDIO_RTT, Option to globally enable stdio RTT for all targets by default, type=bool, default=0, group=pico_stdlib
bool_flag(
name = "PICO_STDIO_RTT",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_MULTICORE_ENABLED, OPTION: Enable multicore handling, type=bool, default=1, group=pico_stdlib
bool_flag(
name = "PICO_MULTICORE_ENABLED",
build_setting_default = True,
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_DOUBLE_IMPL, The default implementation for pico_double to link. auto selects an appropriate default for the current platform. rp2040 is only supported on the rp2040. dcp is only supported on rp2350, type=string, default=auto, group=build
string_flag(
name = "PICO_DEFAULT_DOUBLE_IMPL",
build_setting_default = "auto",
values = [
"auto",
"compiler",
"dcp",
"rp2040",
"none",
],
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_FLOAT_IMPL, The default implementation for pico_float to link. auto selects an appropriate default for the current platform. rp2040 is only supported on the rp2040. vfp and dcp are only supported on rp2350, type=string, default=auto, group=build
string_flag(
name = "PICO_DEFAULT_FLOAT_IMPL",
build_setting_default = "auto",
values = [
"auto",
"compiler",
"dcp",
"rp2040",
"vfp",
"none",
],
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_DIVIDER_IMPL, The default implementation for pico_divider to link. hardware uses accelerated divide instructions while compiler allows the compiler to decide how to handle divide instructions. auto uses the platform default (hardware on RP2040 and compiler on RP2350), type=string, default=auto, group=build
string_flag(
name = "PICO_DEFAULT_DIVIDER_IMPL",
build_setting_default = "auto",
values = [
"auto",
"hardware",
"compiler",
],
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_PRINTF_IMPL, The default implementation for pico_printf to link. compiler lets the compiler control printf behavior while pico provides a pico-specific implementation, type=string, default=double, group=build
string_flag(
name = "PICO_DEFAULT_PRINTF_IMPL",
build_setting_default = "pico",
values = [
"pico",
"compiler",
"none",
],
)
# PICO_BAZEL_CONFIG: PICO_BINARY_INFO_ENABLED, Whether to include binary info in final firmware, type=bool, default=1, group=pico_stdlib
bool_flag(
name = "PICO_BINARY_INFO_ENABLED",
build_setting_default = True,
)
# PICO_BAZEL_CONFIG: PICO_CMSIS_PATH, Label of a cc_ibrary providing CMSIS core, default="included stub CORE only impl", group=build
label_flag(
name = "PICO_CMSIS_PATH",
@ -98,10 +175,17 @@ label_flag(
build_setting_default = "@tinyusb//:tinyusb",
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_BINARY_INFO, [Bazel only] The library that provides custom_pico_binary_info to link into all binaries, default=//src/rp2_common/pico_standard_link:default_binary_info, group=pico_standard_link
# TODO: Bazel build for mbedtls at @mbedtls//:mbedtls.
# PICO_BAZEL_CONFIG: PICO_MBEDTLS_LIB, [Bazel only] The library that provides mbedtls, default=@mbedtls//:mbedtls, group=build
label_flag(
name = "PICO_MBEDTLS_LIB",
build_setting_default = "//bazel:incompatible_cc_lib",
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_BINARY_INFO, [Bazel only] The library that provides custom_pico_binary_info to link into all binaries, default=//src/rp2_common/pico_standard_binary_info:default_binary_info, group=pico_standard_link
label_flag(
name = "PICO_DEFAULT_BINARY_INFO",
build_setting_default = "//src/rp2_common/pico_standard_link:default_binary_info",
build_setting_default = "//src/rp2_common/pico_standard_binary_info:default_binary_info",
)
# PICO_BAZEL_CONFIG: PICO_BAZEL_BUILD_TYPE, The type of build (e.g. Debug or Release) to embed in binary info, type=string, default=pico, group=build
@ -110,10 +194,10 @@ string_flag(
build_setting_default = "Debug",
)
# PICO_BAZEL_CONFIG: PICO_DEFAULT_LINKER_SCRIPT, [Bazel only] The library that provides a linker script to link into all binaries, default=//src/rp2_common/pico_standard_link:default_linker_script, group=pico_standard_link
# PICO_BAZEL_CONFIG: PICO_DEFAULT_LINKER_SCRIPT, [Bazel only] The library that provides a linker script to link into all binaries, default=//src/rp2_common/pico_crt0:default_linker_script, group=pico_standard_link
label_flag(
name = "PICO_DEFAULT_LINKER_SCRIPT",
build_setting_default = "//src/rp2_common/pico_standard_link:default_linker_script",
build_setting_default = "//src/rp2_common/pico_crt0:default_linker_script",
)
# PICO_BAZEL_CONFIG: PICO_NO_TARGET_NAME, Don't define PICO_TARGET_NAME, type=bool, default=0, group=build
@ -128,7 +212,7 @@ label_flag(
build_setting_default = "//bazel:no_extra_headers",
)
# PICO_BAZEL_CONFIG: PICO_CONFIG_PLATFORM_HEADER, [Bazel only] The cc_library that provides "pico_config_platform_headers.h" and defines PICO_BOARD, default=//src/common/pico_base:default_platform_headers, group=pico_base
# PICO_BAZEL_CONFIG: PICO_CONFIG_PLATFORM_HEADER, [Bazel only] The cc_library that provides "pico_config_platform_headers.h" and defines PICO_BOARD, default=//src/common/pico_base_headers:default_platform_headers, group=pico_base
label_flag(
name = "PICO_CONFIG_PLATFORM_HEADER",
build_setting_default = "//src/boards:default",
@ -140,6 +224,18 @@ label_flag(
build_setting_default = "//bazel:generate_config_header",
)
# PICO_BAZEL_CONFIG: PICO_CLIB, [Bazel only] The flavor of libc porting layer to use. auto infers the correct value to use from PICO_TOOLCHAIN, group=pico_standard_link
string_flag(
name = "PICO_CLIB",
build_setting_default = "auto",
values = [
"auto",
"llvm_libc",
"newlib",
"picolibc",
],
)
# PICO_BAZEL_CONFIG: PICO_BTSTACK_CONFIG, [Bazel only] The cc_library that provides btstack_config.h, default=//bazel:empty_cc_lib, group=wireless
label_flag(
name = "PICO_BTSTACK_CONFIG",

View File

@ -21,6 +21,13 @@ constraint_value(
constraint_setting = ":sdk_target",
)
# This constraint value is used to guide parts of the build that are specific
# to the rp2350.
constraint_value(
name = "rp2350",
constraint_setting = ":sdk_target",
)
constraint_setting(
name = "wireless_support",
default_constraint_value = "no_wireless",
@ -41,6 +48,16 @@ config_setting(
flag_values = {"//bazel/config:PICO_BOARD": "pico_w"},
)
config_setting(
name = "pico_toolchain_clang_enabled",
flag_values = {"//bazel/config:PICO_TOOLCHAIN": "clang"},
)
config_setting(
name = "pico_toolchain_gcc_enabled",
flag_values = {"//bazel/config:PICO_TOOLCHAIN": "gcc"},
)
config_setting(
name = "pico_baremetal_enabled",
flag_values = {"//bazel/config:PICO_BARE_METAL": "True"},
@ -81,6 +98,81 @@ config_setting(
flag_values = {"//bazel/config:PICO_STDIO_SEMIHOSTING": "True"},
)
config_setting(
name = "pico_stdio_rtt_enabled",
flag_values = {"//bazel/config:PICO_STDIO_RTT": "True"},
)
config_setting(
name = "pico_multicore_enabled",
flag_values = {"//bazel/config:PICO_MULTICORE_ENABLED": "True"},
)
config_setting(
name = "pico_float_auto_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "auto"},
)
config_setting(
name = "pico_float_compiler_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "compiler"},
)
config_setting(
name = "pico_float_dcp_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "dcp"},
)
config_setting(
name = "pico_float_rp2040_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "rp2040"},
)
config_setting(
name = "pico_float_vfp_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_FLOAT_IMPL": "vfp"},
)
config_setting(
name = "pico_double_auto_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "auto"},
)
config_setting(
name = "pico_double_compiler_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "compiler"},
)
config_setting(
name = "pico_double_dcp_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "dcp"},
)
config_setting(
name = "pico_double_rp2040_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_DOUBLE_IMPL": "rp2040"},
)
config_setting(
name = "pico_divider_hardware_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_DIVIDER_IMPL": "hardware"},
)
config_setting(
name = "pico_divider_auto_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_DIVIDER_IMPL": "auto"},
)
config_setting(
name = "pico_printf_pico_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_PRINTF_IMPL": "pico"},
)
config_setting(
name = "pico_printf_compiler_enabled",
flag_values = {"//bazel/config:PICO_DEFAULT_PRINTF_IMPL": "compiler"},
)
config_setting(
name = "pico_use_default_max_page_size_enabled",
flag_values = {"//bazel/config:PICO_USE_DEFAULT_MAX_PAGE_SIZE": "True"},
@ -91,17 +183,32 @@ config_setting(
flag_values = {"//bazel/config:PICO_NO_TARGET_NAME": "True"},
)
config_setting(
name = "pico_clib_llvm_libc_enabled",
flag_values = {"//bazel/config:PICO_CLIB": "llvm_libc"},
)
config_setting(
name = "pico_clib_newlib_enabled",
flag_values = {"//bazel/config:PICO_CLIB": "newlib"},
)
config_setting(
name = "pico_clib_picolibc_enabled",
flag_values = {"//bazel/config:PICO_CLIB": "picolibc"},
)
config_setting(
name = "pico_btstack_config_unset",
flag_values = {"//bazel/config:PICO_BTSTACK_CONFIG": "@pico-sdk//bazel:empty_cc_lib"},
flag_values = {"//bazel/config:PICO_BTSTACK_CONFIG": "//bazel:empty_cc_lib"},
)
config_setting(
name = "pico_lwip_config_unset",
flag_values = {"//bazel/config:PICO_LWIP_CONFIG": "@pico-sdk//bazel:empty_cc_lib"},
flag_values = {"//bazel/config:PICO_LWIP_CONFIG": "//bazel:empty_cc_lib"},
)
config_setting(
name = "pico_freertos_unset",
flag_values = {"//bazel/config:PICO_FREERTOS_LIB": "@pico-sdk//bazel:empty_cc_lib"},
flag_values = {"//bazel/config:PICO_FREERTOS_LIB": "//bazel:empty_cc_lib"},
)

View File

@ -35,7 +35,7 @@ def _parse_args():
return parser.parse_args()
_EXPANSION_REGEX = re.compile("(?:\$\{)([a-zA-Z]\w*)(?:\})")
_EXPANSION_REGEX = re.compile(r"(?:\$\{)([a-zA-Z]\w*)(?:\})")
def generate_version_header(version_string, template, output):

View File

@ -4,6 +4,14 @@ platform(
name = "rp2040",
constraint_values = [
"@pico-sdk//bazel/constraint:rp2040",
"@platforms//cpu:armv6-m", # This is just FYI.
"@platforms//cpu:armv6-m",
],
)
platform(
name = "rp2350",
constraint_values = [
"@pico-sdk//bazel/constraint:rp2350",
"@platforms//cpu:armv8-m",
],
)

View File

@ -6,6 +6,24 @@ load("configurable_feature.bzl", "configurable_toolchain_feature")
package(default_visibility = ["//visibility:public"])
cc_args(
name = "armv6m-none-eabi",
actions = [
"@rules_cc//cc/toolchains/actions:compile_actions",
"@rules_cc//cc/toolchains/actions:link_actions",
],
args = ["--target=armv6m-none-eabi"],
)
cc_args(
name = "armv8m.main-none-eabi",
actions = [
"@rules_cc//cc/toolchains/actions:compile_actions",
"@rules_cc//cc/toolchains/actions:link_actions",
],
args = ["--target=armv8m.main-none-eabi"],
)
cc_args(
name = "cortex-m0",
actions = [
@ -19,20 +37,50 @@ cc_args(
)
cc_args(
name = "bazel_no_absolute_paths",
actions = ["@rules_cc//cc/toolchains/actions:compile_actions"],
name = "cortex-m33",
actions = [
"@rules_cc//cc/toolchains/actions:compile_actions",
"@rules_cc//cc/toolchains/actions:link_actions",
],
args = [
"-fno-canonical-system-headers",
"-no-canonical-prefixes",
"-mcpu=cortex-m33",
"-march=armv8-m.main+fp+dsp",
"-mfloat-abi=softfp",
"-mthumb",
"-mcmse",
],
)
cc_args(
name = "no-canonical-system-headers",
actions = ["@rules_cc//cc/toolchains/actions:compile_actions"],
args = ["-fno-canonical-system-headers"],
)
cc_args(
name = "no-canonical-prefixes",
actions = ["@rules_cc//cc/toolchains/actions:compile_actions"],
args = ["-no-canonical-prefixes"],
)
cc_args(
name = "nostdlibxx",
actions = ["@rules_cc//cc/toolchains/actions:link_actions"],
args = ["-nostdlib++"],
)
cc_args(
name = "nostartfiles",
actions = ["@rules_cc//cc/toolchains/actions:link_actions"],
args = ["-nostartfiles"],
)
cc_args_list(
name = "all_unconditional_args",
args = [
":cortex-m0",
":bazel_no_absolute_paths",
],
name = "bazel_no_absolute_paths",
args = select({
"//bazel/constraint:pico_toolchain_clang_enabled": [],
"//conditions:default": [":no-canonical-system-headers"],
}) + [":no-canonical-prefixes"],
)
cc_args(
@ -151,7 +199,13 @@ _HOST_CPU_CONSTRAINTS = {
"@arm_gcc_{}-{}//:arm-none-eabi-objcopy".format(host_os, host_cpu),
"@arm_gcc_{}-{}//:arm-none-eabi-strip".format(host_os, host_cpu),
],
args = ["@pico-sdk//bazel/toolchain:all_unconditional_args"],
args = select({
"//bazel/constraint:rp2040": [":cortex-m0"],
"//bazel/constraint:rp2350": [":cortex-m33"],
"//conditions:default": [],
}) + [
":bazel_no_absolute_paths",
],
compiler = "gcc", # Useful for distinguishing gcc vs clang.
cxx_builtin_include_directories = [
"%sysroot%/arm-none-eabi/include/newlib-nano",
@ -168,9 +222,48 @@ _HOST_CPU_CONSTRAINTS = {
],
sysroot = "external/arm_gcc_{}-{}".format(host_os, host_cpu),
tags = ["manual"], # Don't try to build this in wildcard builds.
target_compatible_with = [
"@pico-sdk//bazel/constraint:rp2040",
toolchain_features = [
"@pico-sdk//bazel/toolchain:legacy_features",
"@pico-sdk//bazel/toolchain:override_debug",
"@pico-sdk//bazel/toolchain:gc_sections",
"@pico-sdk//bazel/toolchain:cxx_no_exceptions",
"@pico-sdk//bazel/toolchain:cxx_no_rtti",
"@pico-sdk//bazel/toolchain:cxx_no_cxa_atexit",
"@pico-sdk//bazel/toolchain:override_max_page_size",
],
) for host_os, host_cpu in HOSTS]
[cc_toolchain(
name = "clang_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
action_type_configs = [
"@clang_{}-{}//:llvm-ar".format(host_os, host_cpu),
"@clang_{}-{}//:clang".format(host_os, host_cpu),
"@clang_{}-{}//:clang++".format(host_os, host_cpu),
"@clang_{}-{}//:lld".format(host_os, host_cpu),
"@clang_{}-{}//:llvm-objcopy".format(host_os, host_cpu),
"@clang_{}-{}//:llvm-strip".format(host_os, host_cpu),
],
args = select({
"//bazel/constraint:rp2040": [
":armv6m-none-eabi",
":cortex-m0",
],
"//bazel/constraint:rp2350": [
":armv8m.main-none-eabi",
":cortex-m33",
],
"//conditions:default": [],
}) + [
":bazel_no_absolute_paths",
":nostdlibxx",
":nostartfiles",
],
compiler = "clang", # Useful for distinguishing gcc vs clang.
exec_compatible_with = [
_HOST_CPU_CONSTRAINTS[host_cpu],
_HOST_OS_CONSTRAINTS[host_os],
],
tags = ["manual"], # Don't try to build this in wildcard builds.
toolchain_features = [
"@pico-sdk//bazel/toolchain:legacy_features",
"@pico-sdk//bazel/toolchain:override_debug",
@ -183,7 +276,7 @@ _HOST_CPU_CONSTRAINTS = {
) for host_os, host_cpu in HOSTS]
[toolchain(
name = "arm_gcc_{}-{}".format(host_os, host_cpu),
name = "{}-{}-rp2040".format(host_os, host_cpu),
exec_compatible_with = [
_HOST_CPU_CONSTRAINTS[host_cpu],
_HOST_OS_CONSTRAINTS[host_os],
@ -191,6 +284,25 @@ _HOST_CPU_CONSTRAINTS = {
target_compatible_with = [
"@pico-sdk//bazel/constraint:rp2040",
],
toolchain = ":arm_gcc_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
toolchain = select({
"//bazel/constraint:pico_toolchain_clang_enabled": "clang_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
"//conditions:default": ":arm_gcc_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
}),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
) for host_os, host_cpu in HOSTS]
[toolchain(
name = "{}-{}-rp2350".format(host_os, host_cpu),
exec_compatible_with = [
_HOST_CPU_CONSTRAINTS[host_cpu],
_HOST_OS_CONSTRAINTS[host_os],
],
target_compatible_with = [
"@pico-sdk//bazel/constraint:rp2350",
],
toolchain = select({
"//bazel/constraint:pico_toolchain_clang_enabled": "clang_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
"//conditions:default": ":arm_gcc_{}-{}_toolchain_cortex-m".format(host_os, host_cpu),
}),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
) for host_os, host_cpu in HOSTS]

170
bazel/toolchain/clang.BUILD Normal file
View File

@ -0,0 +1,170 @@
load("@rules_cc//cc/toolchains:action_type_config.bzl", "cc_action_type_config")
load("@rules_cc//cc/toolchains:tool.bzl", "cc_tool")
package(default_visibility = ["//visibility:public"])
cc_tool(
name = "llvm-ar_tool",
src = select({
"@platforms//os:windows": "//:bin/llvm-ar.exe",
"//conditions:default": "//:bin/llvm-ar",
}),
data = select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
cc_action_type_config(
name = "llvm-ar",
action_types = ["@rules_cc//cc/toolchains/actions:ar_actions"],
tools = [":llvm-ar_tool"],
)
cc_tool(
name = "clang_tool",
src = select({
"@platforms//os:windows": "//:bin/clang.exe",
"//conditions:default": "//:bin/clang",
}),
data = glob([
"include/armv*-unknown-none-eabi/**",
"lib/clang/*/include/**",
]) + select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
cc_action_type_config(
name = "clang",
action_types = [
"@rules_cc//cc/toolchains/actions:assembly_actions",
"@rules_cc//cc/toolchains/actions:c_compile",
],
tools = [":clang_tool"],
)
cc_tool(
name = "clang++_tool",
src = select({
"@platforms//os:windows": "//:bin/clang++.exe",
"//conditions:default": "//:bin/clang++",
}),
data = glob([
"include/armv*-unknown-none-eabi/**",
"include/c++/**",
"lib/clang/*/include/**",
]) + select({
# Windows doesn't have llvm.exe.
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
cc_action_type_config(
name = "clang++",
action_types = ["@rules_cc//cc/toolchains/actions:cpp_compile_actions"],
tools = [":clang++_tool"],
)
# This tool is actually just clang++ under the hood, but this specifies a
# different set of data files to pull into the sandbox at runtime.
cc_tool(
name = "lld_tool",
src = select({
"@platforms//os:windows": "//:bin/clang++.exe",
"//conditions:default": "//:bin/clang++",
}),
data = glob([
"lib/armv*-unknown-none-eabi/**",
"lib/clang/*/lib/armv*-unknown-none-eabi/**",
]) + select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
cc_action_type_config(
name = "lld",
action_types = ["@rules_cc//cc/toolchains/actions:link_actions"],
tools = [":lld_tool"],
)
cc_tool(
name = "llvm-objcopy_tool",
src = select({
"@platforms//os:windows": "//:bin/llvm-objcopy.exe",
"//conditions:default": "//:bin/llvm-objcopy",
}),
data = select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
cc_action_type_config(
name = "llvm-objcopy",
action_types = ["@rules_cc//cc/toolchains/actions:objcopy_embed_data"],
tools = [":llvm-objcopy_tool"],
)
cc_tool(
name = "llvm-strip_tool",
src = select({
"@platforms//os:windows": "//:bin/llvm-strip.exe",
"//conditions:default": "//:bin/llvm-strip",
}),
data = select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
cc_action_type_config(
name = "llvm-strip",
action_types = ["@rules_cc//cc/toolchains/actions:strip"],
tools = [":llvm-strip_tool"],
)
cc_tool(
name = "llvm-objdump_tool",
src = select({
"@platforms//os:windows": "//:bin/llvm-objdump.exe",
"//conditions:default": "//:bin/llvm-objdump",
}),
data = select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
# There is not yet a well-known action type for llvm-objdump.
cc_tool(
name = "llvm-profdata_tool",
src = select({
"@platforms//os:windows": "//:bin/llvm-profdata.exe",
"//conditions:default": "//:bin/llvm-profdata",
}),
data = select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
# There is not yet a well-known action type for llvm-profdata.
cc_tool(
name = "llvm-cov_tool",
src = select({
"@platforms//os:windows": "//:bin/llvm-cov.exe",
"//conditions:default": "//:bin/llvm-cov",
}),
data = select({
"@platforms//os:windows": [],
"//conditions:default": ["//:bin/llvm"],
}),
)
# There is not yet a well-known action type for llvm-cov.

View File

@ -113,6 +113,26 @@ kitchen_sink_test_binary = declare_transtion(
},
)
# This transition sets SDK configuration options required to build test binaries
# for the pico_float_test suite of tests.
pico_float_test_binary = declare_transtion(
attrs = {
"pico_printf_impl": attr.string(),
"extra_copts": attr.string_list(),
# This could be shared, but we don't in order to make it clearer that
# a transition is in use.
"_allowlist_function_transition": attr.label(
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
),
},
flag_overrides = {
"@pico-sdk//bazel/config:PICO_DEFAULT_PRINTF_IMPL": "pico_printf_impl",
},
append_to_flags = {
"//command_line_option:copt": "extra_copts",
},
)
# This is a general purpose transition that applies the listed copt flags to
# all transitive dependencies.
extra_copts_for_all_deps = declare_transtion(

View File

@ -1,18 +1,33 @@
# For boards without their own cmake file, simply include a header
# For boards without their own cmake file, we look for a header file
# PICO_CMAKE_CONFIG: PICO_BOARD_HEADER_DIRS, Directories to look for <PICO_BOARD>.h in. This is overridable from the user environment, type=list, group=build
# PICO_CMAKE_CONFIG: PICO_BOARD_HEADER_DIRS, List of directories to look for <PICO_BOARD>.h in. This may be specified the user environment, type=list, group=build
if (DEFINED ENV{PICO_BOARD_HEADER_DIRS})
set(PICO_BOARD_HEADER_DIRS $ENV{PICO_BOARD_HEADER_DIRS})
message("Using PICO_BOARD_HEADER_DIRS from environment ('${PICO_BOARD_HEADER_DIRS}')")
endif()
set(PICO_BOARD_HEADER_DIRS ${PICO_BOARD_HEADER_DIRS} CACHE STRING "PICO board header directories" FORCE)
list(APPEND PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}/include/boards)
list(APPEND PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}/../src/boards/include/boards)
pico_find_in_paths(PICO_BOARD_HEADER_FILE PICO_BOARD_HEADER_DIRS ${PICO_BOARD}.h)
if (EXISTS ${PICO_BOARD_HEADER_FILE})
message("Using board configuration from ${PICO_BOARD_HEADER_FILE}")
list(APPEND PICO_CONFIG_HEADER_FILES ${PICO_BOARD_HEADER_FILE})
# we parse the header file to configure the defaults
file(STRINGS ${PICO_BOARD_HEADER_FILE} HEADER_FILE_CONTENTS)
while(HEADER_FILE_CONTENTS)
list(POP_FRONT HEADER_FILE_CONTENTS LINE)
if (LINE MATCHES "^[ \t\]*//[ \t\]*pico_cmake_set[ \t\]*([a-zA-Z_][a-zA-Z0-9_]*)[ \t\]*=[ \t\]*(.*)")
set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
endif()
if (LINE MATCHES "^[ \t\]*//[ \t\]*pico_cmake_set_default[ \t\]*([a-zA-Z_][a-zA-Z0-9_]*)[ \t\]*=[ \t\]*(.*)")
if (NOT DEFINED "${CMAKE_MATCH_1}")
set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
endif()
endif()
endwhile()
else()
set(msg "Unable to find definition of board '${PICO_BOARD}' (specified by PICO_BOARD):\n")
list(JOIN PICO_BOARD_HEADER_DIRS ", " DIRS)

View File

@ -1,21 +1,135 @@
# PICO_CMAKE_CONFIG: PICO_PLATFORM, platform to build for e.g. rp2040/host, type=string, default=rp2040 or environment value, group=build
if (DEFINED ENV{PICO_PLATFORM} AND (NOT PICO_PLATFORM))
# PICO_BOARD is the root of config as it can define PICO_PLATFORM and other build vars
# PICO_CMAKE_CONFIG: PICO_BOARD, Board name being built for. This may be specified in the user environment, type=string, default=pico or pico2, group=build, docref=cmake-platform-board-config
if (DEFINED ENV{PICO_BOARD} AND NOT PICO_BOARD)
set(PICO_BOARD $ENV{PICO_BOARD})
message("Initializing PICO_BOARD from environment ('${PICO_BOARD}')")
endif()
# PICO_CMAKE_CONFIG: PICO_PLATFORM, Platform to build for e.g. rp2040/rp2350/rp2350-arm-s/rp2350-riscv/host. This may be specified in the user environment, type=string, default=based on PICO_BOARD or environment value, group=build, docref=cmake-platform-board-config
if (DEFINED ENV{PICO_PLATFORM} AND NOT PICO_PLATFORM)
set(PICO_PLATFORM $ENV{PICO_PLATFORM})
message("Using PICO_PLATFORM from environment ('${PICO_PLATFORM}')")
else()
message("Initializing PICO_PLATFORM from environment ('${PICO_PLATFORM}')")
endif()
set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}")
# If PICO_PLATFORM is specified byt not PICO_BOARD, we'll make a stab at defaulting
if (NOT PICO_DEFAULT_BOARD_rp2040)
set(PICO_DEFAULT_BOARD_rp2040 "pico")
endif()
if (NOT PICO_DEFAULT_BOARD_rp2350)
set(PICO_DEFAULT_BOARD_rp2350 "pico2")
endif()
if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s)
set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2")
endif()
if (NOT PICO_DEFAULT_BOARD_rp2350-riscv)
set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2")
endif()
if (NOT PICO_DEFAULT_BOARD_host)
set(PICO_DEFAULT_BOARD_host "none")
endif()
if (NOT PICO_DEFAULT_PLATFORM)
set(PICO_DEFAULT_PLATFORM "rp2040")
endif()
if (NOT PICO_BOARD)
if (NOT PICO_PLATFORM)
set(PICO_PLATFORM "rp2040")
pico_message("Defaulting PICO_PLATFORM to ${PICO_PLATFORM} since not specified.")
else()
message("PICO platform is ${PICO_PLATFORM}.")
# if we have neither BOARD nor PLATFORM default PLATFORM silently, so we don't end up with a board of "none"
# on platform that does have a default board (we want default PLATFORM and BOARD in that case)
set(PICO_PLATFORM ${PICO_DEFAULT_PLATFORM})
# set PICO_SAVED_PLATFORM so we don't print "Defaulting" again below
set(PICO_SAVED_PLATFORM ${PICO_DEFAULT_PLATFORM})
pico_message("Defaulting platform (PICO_PLATFORM) to '${PICO_PLATFORM}' since not specified.")
endif()
endif ()
if (PICO_DEFAULT_BOARD_${PICO_PLATFORM})
set(PICO_BOARD ${PICO_DEFAULT_BOARD_${PICO_PLATFORM}})
else()
set(PICO_BOARD "none")
endif()
pico_message("Defaulting target board (PICO_BOARD) to '${PICO_BOARD}' since not specified.")
else()
message("Target board (PICO_BOARD) is '${PICO_BOARD}'.")
endif()
set(PICO_BOARD ${PICO_BOARD} CACHE STRING "PICO target board (e.g. pico, pico2)" FORCE)
set(PICO_PLATFORM ${PICO_PLATFORM} CACHE STRING "PICO Build platform (e.g. rp2040, host)")
# PICO_CMAKE_CONFIG: PICO_BOARD_CMAKE_DIRS, List of directories to look for <PICO_BOARD>.cmake in. This may be specified in the user environment, type=list, group=build
if (DEFINED ENV{PICO_BOARD_CMAKE_DIRS})
set(PICO_BOARD_CMAKE_DIRS $ENV{PICO_BOARD_CMAKE_DIRS})
message("Using PICO_BOARD_CMAKE_DIRS from environment ('${PICO_BOARD_CMAKE_DIRS}')")
endif()
# PICO_CMAKE_CONFIG: PICO_CMAKE_PRELOAD_PLATFORM_FILE, custom CMake file to use to set up the platform environment, type=string, group=build
set(PICO_CMAKE_PRELOAD_PLATFORM_FILE "" CACHE INTERNAL "")
set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/platforms" CACHE INTERNAL "")
list(APPEND PICO_BOARD_CMAKE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../src/boards)
pico_find_in_paths(PICO_BOARD_CMAKE_FILE PICO_BOARD_CMAKE_DIRS ${PICO_BOARD}.cmake)
if (EXISTS "${PICO_BOARD_CMAKE_FILE}")
message("Using CMake board configuration from ${PICO_BOARD_CMAKE_FILE}")
include(${PICO_BOARD_CMAKE_FILE} board_config)
else()
include(generic_board)
endif()
list(APPEND PICO_INCLUDE_DIRS ${PICO_SDK_PATH}/src/boards/include) # so boards/foo.h can be explicitly included
# PICO_CMAKE_CONFIG: PICO_DEFAULT_RP2350_PLATFORM, Default actual platform to build for if rp2350 is specified for PICO_PLATFORM e.g. rp2350-arm-s/rp2350-riscv, type=string, default=rp2350-arm-s, group=build
if (DEFINED ENV{PICO_DEFAULT_RP2350_PLATFORM} AND NOT PICO_DEFAULT_RP2350_PLATFORM)
set(PICO_DEFAULT_RP2350_PLATFORM $ENV{PICO_DEFAULT_RP2350_PLATFORM})
endif()
if (NOT PICO_DEFAULT_RP2350_PLATFORM)
set(PICO_DEFAULT_RP2350_PLATFORM "rp2350-arm-s")
endif()
if (NOT COMMAND pico_expand_pico_platform)
function(pico_expand_pico_platform FUNC DO_MESSAGE)
if (${FUNC} STREQUAL "rp2350")
if (DO_MESSAGE)
message("Auto-converting non-specific PICO_PLATFORM='rp2350' to 'rp2350-arm-s'")
endif()
set(${FUNC} "${PICO_DEFAULT_RP2350_PLATFORM}" PARENT_SCOPE)
endif()
endfunction()
endif()
if (NOT PICO_PLATFORM)
set(PICO_PLATFORM ${PICO_DEFAULT_PLATFORM})
pico_message("Defaulting platform (PICO_PLATFORM) to '${PICO_PLATFORM}' since not specified.")
else()
if (NOT PICO_SAVED_PLATFORM)
pico_expand_pico_platform(PICO_PLATFORM 1)
pico_message("Defaulting platform (PICO_PLATFORM) to '${PICO_PLATFORM}' based on PICO_BOARD setting.")
else()
string(REGEX REPLACE "-.*" "" PICO_PLATFORM_PREFIX ${PICO_PLATFORM})
string(REGEX REPLACE "-.*" "" PICO_SAVED_PLATFORM_PREFIX ${PICO_SAVED_PLATFORM})
if (PICO_PLATFORM_PREFIX STREQUAL PICO_SAVED_PLATFORM_PREFIX)
# the PICO_PLATFORM specified based on the board is compatible based on the one we were
# already using, so use that
pico_expand_pico_platform(PICO_SAVED_PLATFORM 0)
set(PICO_PLATFORM ${PICO_SAVED_PLATFORM})
message("Pico Platform (PICO_PLATFORM) is '${PICO_PLATFORM}'.")
else()
message(FATAL_ERROR "PICO_PLATFORM is specified to be '${PICO_SAVED_PLATFORM}', but PICO_BOARD='${PICO_BOARD}' uses \
'${PICO_PLATFORM}' which is incompatible. You need to delete the CMake cache or build directory and reconfigure to proceed. \
The best practice is to use separate build directories for different platforms.")
endif()
endif()
endif()
unset(PICO_SAVED_PLATFORM)
if (PICO_PREVIOUS_PLATFORM AND NOT PICO_PREVIOUS_PLATFORM STREQUAL PICO_PLATFORM)
message(FATAL_ERROR "PICO_PLATFORM has been modified from '${PICO_SAVED_PLATFORM}' to '${PICO_PLATFORM}.\
You need to delete the CMake cache or build directory and reconfigure to proceed.\
The best practice is to use separate build directories for different platforms.")
endif()
set(PICO_PLATFORM ${PICO_PLATFORM} CACHE STRING "PICO Build platform (e.g. rp2040, rp2350, rp2350-riscv, host)" FORCE)
set(PICO_PREVIOUS_PLATFORM ${PICO_PLATFORM} CACHE STRING "Saved PICO Build platform (e.g. rp2040, rp2350, rp2350-riscv, host)" INTERNAL)
# PICO_CMAKE_CONFIG: PICO_CMAKE_PRELOAD_PLATFORM_FILE, Custom CMake file to use to set up the platform environment, type=string, group=build
set(PICO_CMAKE_PRELOAD_PLATFORM_FILE ${PICO_CMAKE_PRELOAD_PLATFORM_FILE} CACHE INTERNAL "")
if (NOT PICO_CMAKE_PRELOAD_PLATFORM_DIR)
set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/platforms")
endif()
set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${PICO_CMAKE_PRELOAD_PLATFORM_DIR}" CACHE INTERNAL "")
if (NOT PICO_CMAKE_PRELOAD_PLATFORM_FILE)
set(PICO_CMAKE_PRELOAD_PLATFORM_FILE ${PICO_CMAKE_PRELOAD_PLATFORM_DIR}/${PICO_PLATFORM}.cmake CACHE INTERNAL "")

View File

@ -1,9 +1,11 @@
# PICO_CMAKE_CONFIG: PICO_TOOLCHAIN_PATH, Path to search for compiler, type=string, default=none (i.e. search system paths), group=build
# PICO_CMAKE_CONFIG: PICO_TOOLCHAIN_PATH, Path to search for compiler, type=string, default=none (i.e. search system paths), group=build, docref=cmake-toolchain-config
set(PICO_TOOLCHAIN_PATH "${PICO_TOOLCHAIN_PATH}" CACHE INTERNAL "")
# Set a default build type if none was specified
set(default_build_type "Release")
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_PREFIX_PATH)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Defaulting build type to '${default_build_type}' since not specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build, options are: 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'." FORCE)
@ -16,28 +18,59 @@ if (CMAKE_BUILD_TYPE STREQUAL "Default")
error("Default build type is NOT supported")
endif()
# PICO_CMAKE_CONFIG: PICO_COMPILER, Optionally specifies a different compiler (other than pico_arm_gcc.cmake) - this is not yet fully supported, type=string, group=build
# If PICO_COMPILER is specified, set toolchain file to ${PICO_COMPILER}.cmake.
if (DEFINED PICO_COMPILER)
if (DEFINED CMAKE_TOOLCHAIN_FILE)
get_filename_component(toolchain "${CMAKE_TOOLCHAIN_FILE}" NAME_WE)
if (NOT "${PICO_COMPILER}" STREQUAL "${toolchain}")
message(WARNING "CMAKE_TOOLCHAIN_FILE is already defined to ${toolchain}.cmake, you\
need to delete cache and reconfigure if you want to switch compiler.")
endif ()
else ()
set(toolchain_dir "${CMAKE_CURRENT_LIST_DIR}/preload/toolchains")
set(toolchain_file "${toolchain_dir}/${PICO_COMPILER}.cmake")
if (EXISTS "${toolchain_file}")
set(CMAKE_TOOLCHAIN_FILE "${toolchain_file}" CACHE INTERNAL "")
else ()
# todo improve message
message(FATAL_ERROR "Toolchain file \"${PICO_COMPILER}.cmake\" does not exist, please\
select one from \"cmake/toolchains\" folder.")
endif ()
endif ()
message("PICO compiler is ${PICO_COMPILER}")
if (NOT (DEFINED PICO_COMPILER OR DEFINED CMAKE_TOOLCHAIN_FILE))
if (DEFINED PICO_DEFAULT_COMPILER)
pico_message("Defaulting compiler (PICO_COMPILER) to '${PICO_DEFAULT_COMPILER}' since not specified.")
set(PICO_COMPILER ${PICO_DEFAULT_COMPILER})
endif()
endif ()
# PICO_CMAKE_CONFIG: PICO_COMPILER, Specifies the compiler family to use, type=string, group=build, default=PICO_DEFAULT_COMPILER which is set based on PICO_PLATFORM, docref=cmake-toolchain-config
# If PICO_COMPILER is specified, set toolchain file to ${PICO_COMPILER}.cmake.
if (DEFINED PICO_COMPILER)
# maintain backwards compatibility with RP2040 SDK compilers
set(ORIG_PICO_COMPILER "${PICO_COMPILER}")
if (PICO_COMPILER STREQUAL "pico_arm_gcc")
if (PICO_PLATFORM STREQUAL "rp2040")
set(PICO_COMPILER "pico_arm_cortex_m0plus_gcc")
elseif(PICO_PLATFORM STREQUAL "rp2350")
set(PICO_COMPILER "pico_arm_cortex_m33_gcc")
endif()
elseif(PICO_COMPILER STREQUAL "pico_arm_clang")
if (PICO_PLATFORM STREQUAL "rp2040")
set(PICO_COMPILER "pico_arm_cortex_m0plus_clang")
elseif(PICO_PLATFORM STREQUAL "rp2350-arm-s")
set(PICO_COMPILER "pico_arm_cortex_m33_clang")
elseif(PICO_PLATFORM STREQUAL "rp2350-arm-ns")
set(PICO_COMPILER "pico_arm_cortex_m33_clang")
endif()
endif()
if (NOT PICO_COMPILER STREQUAL ORIG_PICO_COMPILER)
message("Accepting PICO_COMPILER value '${ORIG_PICO_COMPILER}' for compatibility, but using '${PICO_COMPILER}' instead")
endif()
if (NOT DEFINED PICO_TOOLCHAIN_DIR)
set(PICO_TOOLCHAIN_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/toolchains")
endif()
set(toolchain_file "${PICO_TOOLCHAIN_DIR}/${PICO_COMPILER}.cmake")
if (EXISTS "${toolchain_file}")
set(CMAKE_TOOLCHAIN_FILE "${toolchain_file}")
else ()
# todo improve message
message(FATAL_ERROR "Toolchain file \"${PICO_COMPILER}.cmake\" does not exist, please\
select one from \"cmake/toolchains\" folder.")
endif ()
message("Configuring toolchain based on PICO_COMPILER '${PICO_COMPILER}'")
endif ()
if (PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE)
if (NOT "${PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE}" STREQUAL "${CMAKE_TOOLCHAIN_FILE}")
message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE was previously defined to ${PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE}, and now\
is being changed to ${CMAKE_TOOLCHAIN_FILE}. You\
need to delete the CMake cache and reconfigure if you want to switch compiler.\
The best practice is to use separate build directories for different platforms or compilers.")
endif ()
endif ()
set(PICO_PREVIOUS_CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE} CACHE INTERNAL "Saved CMAKE_TOOLCHAIN_FILE" FORCE)
unset(PICO_COMPILER CACHE)

View File

@ -0,0 +1,3 @@
set(PICO_DEFAULT_COMPILER "pico_arm_cortex_m33_gcc")
set(PICO_CHIP rp2350)

View File

@ -1,7 +0,0 @@
if (NOT (DEFINED PICO_COMPILER OR DEFINED CMAKE_TOOLCHAIN_FILE))
pico_message("Defaulting PICO platform compiler to pico_arm_gcc since not specified.")
set(PICO_COMPILER "pico_arm_gcc")
endif ()

View File

@ -1 +1,2 @@
include(${CMAKE_CURRENT_LIST_DIR}/pico/pico.cmake)
set(PICO_DEFAULT_COMPILER "pico_arm_cortex_m0plus_gcc")
set(PICO_CHIP rp2040)

View File

@ -0,0 +1,3 @@
set(PICO_DEFAULT_COMPILER "pico_arm_cortex_m33_gcc")
set(PICO_CHIP rp2350)

View File

@ -0,0 +1,3 @@
set(PICO_DEFAULT_COMPILER "pico_riscv_gcc")
set(PICO_CHIP rp2350)

View File

@ -1,47 +0,0 @@
# NOTE: THIS IS A WIP ONLY PICO_ARM_GCC IS CURRENTLY SUPPORTED, however should work with LLVM Embedded Toolchain for ARM
# version 14.0.0 https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/tag/release-14.0.0
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
# i.e. CMake<Lang>Information and whatnot
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
# include our Platform/pico.cmake
set(CMAKE_SYSTEM_NAME PICO)
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
# Find CLANG
pico_find_compiler(PICO_COMPILER_CC clang)
pico_find_compiler(PICO_COMPILER_CXX clang)
#pico_find_compiler(PICO_COMPILER_ASM armasm)
set(PICO_COMPILER_ASM "${PICO_COMPILER_CC}" CACHE INTERNAL "")
pico_find_compiler(PICO_OBJCOPY llvm-objcopy)
pico_find_compiler(PICO_OBJDUMP llvm-objdump)
# Specify the cross compiler.
set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
set(CMAKE_C_OUTPUT_EXTENSION .o)
# todo should we be including CMakeASMInformation anyway - i guess that is host side
set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_INCLUDE_FLAG_ASM "-I")
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
# Add target system root to cmake find path.
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
# Look for includes and libraries only in the target system prefix.
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
# Oz is preferred for Clang (verses CMake default -Os) see also https://gitlab.kitware.com/cmake/cmake/-/issues/22458
set(CMAKE_C_FLAGS_MINSIZEREL "-Oz -DNDEBUG")
set(ARM_TOOLCHAIN_COMMON_FLAGS "--target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m --sysroot ${PICO_COMPILER_DIR}/../lib/clang-runtimes/armv6m_soft_nofp")
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)

View File

@ -1,7 +1,7 @@
# NOTE: THIS IS A WIP ONLY PICO_ARM_GCC IS CURRENTLY SUPPORTED
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
# i.e. CMake<Lang>Information and whatnot
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/util/find_compiler.cmake)
# include our Platform/PICO.cmake
set(CMAKE_SYSTEM_NAME PICO)
@ -37,7 +37,5 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
set(ARM_TOOLCHAIN_COMMON_FLAGS " --cpu=Cortex-M0plus")
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/util/set_flags.cmake)

View File

@ -0,0 +1,8 @@
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
# these are all the directories under LLVM embedded toolchain for ARM (newlib or pibolibc) and under llvm_libc
set(PICO_CLANG_RUNTIMES armv6m_soft_nofp armv6m-unknown-none-eabi)
set(PICO_COMMON_LANG_FLAGS "--target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m")
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_clang_common.cmake)

View File

@ -0,0 +1,7 @@
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
set(PICO_DEFAULT_GCC_TRIPLE arm-none-eabi)
# on ARM -mcpu should not be mixed with -march
set(PICO_COMMON_LANG_FLAGS " -mcpu=cortex-m0plus -mthumb")
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_gcc_common.cmake)

View File

@ -0,0 +1,15 @@
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
# i.e. CMake<Lang>Information and whatnot
set(CMAKE_SYSTEM_PROCESSOR cortex-m23)
set(PICO_DEFAULT_GCC_TRIPLE arm-none-eabi)
# todo amy should this be -mfloat-abi=hard?
set(PICO_COMMON_LANG_FLAGS " -mcpu=cortex-m23 -mthumb -march=armv8-m.base")
# todo probably need a setting here, also do we want `softfp`?
set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mfloat-abi=softfp")
if (NOT PICO_NO_CMSE)
set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mcmse")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_gcc_common.cmake)

View File

@ -0,0 +1,8 @@
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
# these are all the directories under LLVM embedded toolchain for ARM (newlib or pibolibc) and under llvm_libc
set(PICO_CLANG_RUNTIMES armv8m.main_soft_nofp armv8m.main-unknown-none-eabi)
set(PICO_COMMON_LANG_FLAGS "-mcpu=cortex-m33 --target=armv8m.main-none-eabi -mfloat-abi=softfp -march=armv8m.main+fp+dsp")
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_clang_common.cmake)

View File

@ -0,0 +1,10 @@
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
set(PICO_DEFAULT_GCC_TRIPLE arm-none-eabi)
set(PICO_COMMON_LANG_FLAGS " -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp")
set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mfloat-abi=softfp")
if (NOT PICO_NO_CMSE)
set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mcmse")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_gcc_common.cmake)

View File

@ -1,52 +0,0 @@
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
# i.e. CMake<Lang>Information and whatnot
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
# include our Platform/PICO.cmake
set(CMAKE_SYSTEM_NAME PICO)
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
if (NOT PICO_GCC_TRIPLE)
if (DEFINED ENV{PICO_GCC_TRIPLE})
set(PICO_GCC_TRIPLE $ENV{PICO_GCC_TRIPLE})
message("PICO_GCC_TRIPLE set from environment: $ENV{PICO_GCC_TRIPLE}")
else()
set(PICO_GCC_TRIPLE arm-none-eabi)
#pico_message_debug("PICO_GCC_TRIPLE defaulted to arm-none-eabi")
endif()
endif()
# Find GCC for ARM.
pico_find_compiler(PICO_COMPILER_CC ${PICO_GCC_TRIPLE}-gcc)
pico_find_compiler(PICO_COMPILER_CXX ${PICO_GCC_TRIPLE}-g++)
set(PICO_COMPILER_ASM "${PICO_COMPILER_CC}" CACHE INTERNAL "")
pico_find_compiler(PICO_OBJCOPY ${PICO_GCC_TRIPLE}-objcopy)
pico_find_compiler(PICO_OBJDUMP ${PICO_GCC_TRIPLE}-objdump)
# Specify the cross compiler.
set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
set(CMAKE_C_OUTPUT_EXTENSION .o)
# todo should we be including CMakeASMInformation anyway - i guess that is host side
set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_INCLUDE_FLAG_ASM "-I")
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
# Add target system root to cmake find path.
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
# Look for includes and libraries only in the target system prefix.
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
# on ARM -mcpu should not be mixed with -march
set(ARM_TOOLCHAIN_COMMON_FLAGS " -mcpu=cortex-m0plus -mthumb")
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)

View File

@ -0,0 +1,7 @@
set(CMAKE_SYSTEM_PROCESSOR hazard3)
set(PICO_DEFAULT_GCC_TRIPLE riscv32-unknown-elf riscv32-corev-elf)
set(PICO_COMMON_LANG_FLAGS " -march=rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb -mabi=ilp32")
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_gcc_common.cmake)

View File

@ -0,0 +1,10 @@
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
# i.e. CMake<Lang>Information and whatnot
set(CMAKE_SYSTEM_PROCESSOR hazard3)
set(PICO_DEFAULT_GCC_TRIPLE riscv32-unknown-elf riscv32-corev-elf)
set(PICO_COMMON_LANG_FLAGS " -march=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb_zcmp -mabi=ilp32")
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_gcc_common.cmake)

View File

@ -7,10 +7,10 @@ endif ()
# Find the compiler executable and store its path in a cache entry ${compiler_path}.
# If not found, issue a fatal message and stop processing. PICO_TOOLCHAIN_PATH can be provided from
# commandline as additional search path.
function(pico_find_compiler compiler_path compiler_exe)
function(pico_find_compiler compiler_path compiler_exes)
# Search user provided path first.
find_program(
${compiler_path} ${compiler_exe}
${compiler_path} NAMES ${compiler_exes}
PATHS ENV PICO_TOOLCHAIN_PATH
PATH_SUFFIXES bin
NO_DEFAULT_PATH
@ -21,11 +21,21 @@ function(pico_find_compiler compiler_path compiler_exe)
if (DEFINED ENV{PICO_TOOLCHAIN_PATH})
message(WARNING "PICO_TOOLCHAIN_PATH specified ($ENV{PICO_TOOLCHAIN_PATH}), but ${compiler_exe} not found there")
endif()
find_program(${compiler_path} ${compiler_exe})
find_program(${compiler_path} NAMES ${compiler_exes})
endif ()
if ("${${compiler_path}}" STREQUAL "${compiler_path}-NOTFOUND")
set(PICO_TOOLCHAIN_PATH "" CACHE PATH "Path to search for compiler.")
message(FATAL_ERROR "Compiler '${compiler_exe}' not found, you can specify search path with\
list(JOIN compiler_exes " / " compiler_exes)
message(FATAL_ERROR "Compiler '${compiler_exes}' not found, you can specify search path with\
\"PICO_TOOLCHAIN_PATH\".")
endif ()
endfunction()
# Find the compiler executable and store its path in a cache entry ${compiler_path}.
# If not found, issue a fatal message and stop processing. PICO_TOOLCHAIN_PATH can be provided from
# commandline as additional search path.
function(pico_find_compiler_with_triples compiler_path triples compiler_suffix)
list(TRANSFORM triples APPEND "-${compiler_suffix}")
pico_find_compiler(${compiler_path} "${triples}")
set(${compiler_path} ${${compiler_path}} PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,97 @@
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
# include our Platform/PICO.cmake
set(CMAKE_SYSTEM_NAME PICO)
# Find Clang
pico_find_compiler(PICO_COMPILER_CC clang)
pico_find_compiler(PICO_COMPILER_CXX clang++)
set(PICO_COMPILER_ASM "${PICO_COMPILER_CC}" CACHE INTERNAL "")
pico_find_compiler(PICO_OBJCOPY llvm-objcopy)
pico_find_compiler(PICO_OBJDUMP llvm-objdump)
# Specify the cross compiler.
set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
# workaround for projects that don't enable ASM
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_INCLUDE_FLAG_ASM "-I")
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_OUTPUT_EXTENSION .o)
endforeach()
# Add target system root to cmake find path.
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
# Look for includes and libraries only in the target system prefix.
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Oz is preferred for Clang (verses CMake default -Os) see also https://gitlab.kitware.com/cmake/cmake/-/issues/22458
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_FLAGS_MINSIZEREL_INIT "-Oz -DNDEBUG")
endforeach()
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES PICO_CLIB)
foreach(PICO_CLANG_RUNTIME IN LISTS PICO_CLANG_RUNTIMES)
# LLVM embedded-toolchain for ARM style
find_path(PICO_COMPILER_SYSROOT NAMES include/stdio.h
HINTS
${PICO_COMPILER_DIR}/../lib/clang-runtimes/arm-none-eabi/${PICO_CLANG_RUNTIME}
${PICO_COMPILER_DIR}/../lib/clang-runtimes/${PICO_CLANG_RUNTIME}
)
if (PICO_COMPILER_SYSROOT)
if (NOT PICO_CLIB)
# this is a bit of a hack; to try to autodetect the C library used:
# `picolibc.h` seems to exist on the newer versions of LLVM embedded toolchain for ARM using picolibc whereas
# `newlib.h` appears in all versions, so isn't very useful
if (EXISTS "${PICO_COMPILER_SYSROOT}/include/picolibc.h")
message("Setting default C library to picolibc as LLVM appears to be using it")
set(PICO_CLIB "picolibc" CACHE INTERNAL "")
endif()
endif()
break()
endif()
# llvm_libc style
find_path(PICO_COMPILER_SYSROOT NAMES stdio.h
HINTS
${PICO_COMPILER_DIR}/../include/${PICO_CLANG_RUNTIME}
)
if (PICO_COMPILER_SYSROOT)
if (NOT PICO_CLIB)
message("Setting default C library to llvm_libc as LLVM appears to be using it")
set(PICO_CLIB "llvm_libc" CACHE INTERNAL "")
endif()
break()
endif()
endforeach()
# moving this here as a reminder from pico_standard_link; it was commented out theee, but if ever needed,
# it belongs here as part of LINKER_FLAGS_INIT
#target_link_options(pico_standard_link INTERFACE "LINKER:-fuse-ld=lld")
if (PICO_CLIB STREQUAL "llvm_libc")
# TODO: Remove -nostdlib++ once we include libc++ in the toolchain.
# TODO: Move -nostartfiles to the appropriate library.
foreach(TYPE IN ITEMS EXE SHARED MODULE)
set(CMAKE_${TYPE}_LINKER_FLAGS_INIT "-nostdlib++ -nostartfiles")
endforeach()
else()
if (NOT PICO_COMPILER_SYSROOT)
message(FATAL_ERROR "Could not find an llvm runtime for '${PICO_CLANG_RUNTIME}'")
endif()
set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} --sysroot ${PICO_COMPILER_SYSROOT}")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)

View File

@ -0,0 +1,57 @@
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
# include our Platform/PICO.cmake
set(CMAKE_SYSTEM_NAME PICO)
# PICO_CMAKE_CONFIG: PICO_GCC_TRIPLE, List of GCC_TRIPLES -- usually only one -- to try when searching for a compiler. This may be specified the user environment, type=int, default=PICO_DEFAULT_GCC_TRIPLE which is set based on PICO_COMPILER, group=pico_base, doxref=cmake-toolchain-config
if (NOT PICO_GCC_TRIPLE)
if (DEFINED ENV{_SAVED_PICO_GCC_TRIPLE})
# saved within the same cmake invocation
set(PICO_GCC_TRIPLE $ENV{_SAVED_PICO_GCC_TRIPLE})
elseif (DEFINED ENV{PICO_GCC_TRIPLE})
set(PICO_GCC_TRIPLE $ENV{PICO_GCC_TRIPLE})
message("Initializing PICO_GCC_TRIPLE from environment ('${PICO_GCC_TRIPLE}')")
elseif(DEFINED PICO_DEFAULT_GCC_TRIPLE)
message("Defaulting PICO_GCC_TRIPLE to '${PICO_DEFAULT_GCC_TRIPLE}'")
set(PICO_GCC_TRIPLE ${PICO_DEFAULT_GCC_TRIPLE})
else()
message(FATAL_ERROR "PICO_DEFAULT_GCC_TRIPLE is not defined")
endif()
endif()
set(PICO_GCC_TRIPLE "${PICO_GCC_TRIPLE}" CACHE INTERNAL "")
set(ENV{_SAVED_PICO_GCC_TRIPLE} "${PICO_GCC_TRIPLE}")
# Find GCC
pico_find_compiler_with_triples(PICO_COMPILER_CC "${PICO_GCC_TRIPLE}" gcc)
pico_find_compiler_with_triples(PICO_COMPILER_CXX "${PICO_GCC_TRIPLE}" g++)
set(PICO_COMPILER_ASM "${PICO_COMPILER_CC}" CACHE INTERNAL "")
pico_find_compiler_with_triples(PICO_OBJCOPY "${PICO_GCC_TRIPLE}" objcopy)
pico_find_compiler_with_triples(PICO_OBJDUMP "${PICO_GCC_TRIPLE}" objdump)
# Specify the cross compiler.
set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
# workaround for projects that don't enable ASM
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_INCLUDE_FLAG_ASM "-I")
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_OUTPUT_EXTENSION .o)
endforeach()
# Add target system root to cmake find path.
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
# Look for includes and libraries only in the target system prefix.
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)

View File

@ -1,13 +1,19 @@
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
option(PICO_DEBUG_INFO_IN_RELEASE "Include debug info in release builds" 1)
get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_FLAGS_INIT "${ARM_TOOLCHAIN_COMMON_FLAGS}")
set(CMAKE_${LANG}_FLAGS_INIT "${PICO_COMMON_LANG_FLAGS}")
unset(CMAKE_${LANG}_FLAGS_DEBUG CACHE)
if (PICO_DEOPTIMIZED_DEBUG)
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0")
else()
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-Og")
endif()
if (PICO_DEBUG_INFO_IN_RELEASE)
set(CMAKE_${LANG}_FLAGS_RELEASE_INIT "-g")
set(CMAKE_${LANG}_FLAGS_MINSIZEREL_INIT "-g")
endif()
set(CMAKE_${LANG}_LINK_FLAGS "-Wl,--build-id=none")
# try_compile is where the feature testing is done, and at that point,

View File

@ -40,13 +40,26 @@ if(PICO_BUILD_DOCS)
endif()
set(DOXY_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
set(DOXY_INPUT_DIRS "${PICO_DOXYGEN_PATHS}")
set(DOXY_EXCLUDE_DIRS "${PICO_DOXYGEN_EXCLUDE_PATHS}")
string(REPLACE ";" " " DOXY_INPUT_DIRS "${PICO_DOXYGEN_PATHS}")
string(REPLACE ";" " " DOXY_EXCLUDE_DIRS "${PICO_DOXYGEN_EXCLUDE_PATHS}")
string(REPLACE ";" " " DOXY_PREDEFINED "${PICO_DOXYGEN_PRE_DEFINES}")
string(REPLACE ";" " " DOXY_ENABLED_SECTIONS "${PICO_DOXYGEN_ENABLED_SECTIONS}")
set(DOXY_EXAMPLE_DIR "${PICO_EXAMPLES_PATH}")
# auto genereate additional section enables from library paths
foreach (DIR IN LISTS PICO_DOXYGEN_PATHS)
get_filename_component(NAME "${DIR}" NAME)
if (NOT DIR STREQUAL "src")
set(DOXY_ENABLED_SECTIONS "${DOXY_ENABLED_SECTIONS} ${NAME}")
endif()
endforeach ()
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
if (PICO_PLATFORM STREQUAL "rp2040")
set(PICO_DOXYGEN_TAG "(RP2040)")
elseif (PICO_PLATFORM STREQUAL "rp2350-arm-s" OR PICO_PLATFORM STREQUAL "rp2350-riscv")
set(PICO_DOXYGEN_TAG "(RP2350)")
endif()
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
add_custom_target(docs

View File

@ -1,6 +1,6 @@
PROJECT_NAME = "Raspberry Pi Pico SDK"
PROJECT_BRIEF = "Raspberry Pi Pico SDK documentation"
PROJECT_NUMBER = @PICO_SDK_VERSION_STRING@
PROJECT_NUMBER = @PICO_SDK_VERSION_STRING@ @PICO_DOXYGEN_TAG@
#STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@
STRIP_FROM_PATH = @DOXY_INPUT_DIRS@
@ -50,15 +50,19 @@ EXTRACT_STATIC = YES
EXTRACT_ALL = NO
ALWAYS_DETAILED_SEC = NO
#REPEAT_BRIEF = NO
#REPEAT_BRIEF = NO
ENABLE_PREPROCESSING = YES
# Need these next options to ensure that functions with modifiers do not confuse the Doxygen parser.
# And any further function modifiers here.
MACRO_EXPANSION = YES
PREDEFINED = __not_in_flash_func(x) \
__time_critical_func(x) \
PREDEFINED = __not_in_flash_func(x)= \
__time_critical_func(x)= \
__not_in_flash(x)= \
__no_inline_not_in_flash(x)= \
__attribute__(x)= \
DOXYGEN_GENERATION=
DOXYGEN_GENERATION= \
@DOXY_PREDEFINED@
ENABLED_SECTIONS = @DOXY_ENABLED_SECTIONS@

View File

@ -6,67 +6,88 @@
// Here to organize documentation order
// for some reason cond/endcond work better here than if/endif
/**
* \defgroup hardware Hardware APIs
* This group of libraries provides a thin and efficient C API / abstractions to access the RP2040 hardware without having to read and write
* This group of libraries provides a thin and efficient C API / abstractions to access the RP-series microcontroller hardware without having to read and write
* hardware registers directly.
* @{
* \defgroup hardware_adc hardware_adc
* \defgroup hardware_base hardware_base
* \defgroup hardware_claim hardware_claim
* \defgroup hardware_clocks hardware_clocks
* \defgroup hardware_divider hardware_divider
* \defgroup hardware_dma hardware_dma
* \defgroup hardware_exception hardware_exception
* \defgroup hardware_flash hardware_flash
* \defgroup hardware_gpio hardware_gpio
* \defgroup hardware_i2c hardware_i2c
* \defgroup hardware_interp hardware_interp
* \defgroup hardware_irq hardware_irq
* \defgroup hardware_pio hardware_pio
* \defgroup hardware_pll hardware_pll
* \defgroup hardware_pwm hardware_pwm
* \defgroup hardware_resets hardware_resets
* \defgroup hardware_rtc hardware_rtc
* \defgroup hardware_spi hardware_spi
* \defgroup hardware_sync hardware_sync
* \defgroup hardware_timer hardware_timer
* \defgroup hardware_uart hardware_uart
* \defgroup hardware_vreg hardware_vreg
* \defgroup hardware_watchdog hardware_watchdog
* \defgroup hardware_xosc hardware_xosc
* \cond hardware_adc \defgroup hardware_adc hardware_adc \endcond
* \cond hardware_base \defgroup hardware_base hardware_base \endcond
* \cond hardware_bootlock \defgroup hardware_bootlock hardware_bootlock \endcond
* \cond hardware_claim \defgroup hardware_claim hardware_claim \endcond
* \cond hardware_clocks \defgroup hardware_clocks hardware_clocks \endcond
* \cond hardware_divider \defgroup hardware_divider hardware_divider \endcond
* \cond hardware_dcp \defgroup hardware_dcp hardware_dcp \endcond
* \cond hardware_dma \defgroup hardware_dma hardware_dma \endcond
* \cond hardware_exception \defgroup hardware_exception hardware_exception \endcond
* \cond hardware_flash \defgroup hardware_flash hardware_flash \endcond
* \cond hardware_gpio \defgroup hardware_gpio hardware_gpio \endcond
* \cond hardware_hazard3 \defgroup hardware_hazard3 hardware_hazard3 \endcond
* \cond hardware_i2c \defgroup hardware_i2c hardware_i2c \endcond
* \cond hardware_interp \defgroup hardware_interp hardware_interp \endcond
* \cond hardware_irq \defgroup hardware_irq hardware_irq \endcond
* \cond hardware_pio \defgroup hardware_pio hardware_pio \endcond
* \cond hardware_pll \defgroup hardware_pll hardware_pll \endcond
* \cond hardware_powman \defgroup hardware_powman hardware_powman \endcond
* \cond hardware_pwm \defgroup hardware_pwm hardware_pwm \endcond
* \cond hardware_pwm \defgroup hardware_pwm hardware_pwm \endcond
* \cond hardware_resets \defgroup hardware_resets hardware_resets \endcond
* \cond hardware_riscv \defgroup hardware_riscv hardware_riscv \endcond
* \cond hardware_riscv_platform_timer \defgroup hardware_riscv_platform_timer hardware_riscv_platform_timer \endcond
* \cond hardware_rtc \defgroup hardware_rtc hardware_rtc \endcond
* \cond hardware_rcp \defgroup hardware_rcp hardware_rcp \endcond
* \cond hardware_spi \defgroup hardware_spi hardware_spi \endcond
* \cond hardware_sha256 \defgroup hardware_sha256 hardware_sha256 \endcond
* \cond hardware_sync \defgroup hardware_sync hardware_sync \endcond
* \cond hardware_ticks \defgroup hardware_ticks hardware_ticks \endcond
* \cond hardware_timer \defgroup hardware_timer hardware_timer \endcond
* \cond hardware_uart \defgroup hardware_uart hardware_uart \endcond
* \cond hardware_vreg \defgroup hardware_vreg hardware_vreg \endcond
* \cond hardware_watchdog \defgroup hardware_watchdog hardware_watchdog \endcond
* \cond hardware_xosc \defgroup hardware_xosc hardware_xosc \endcond
* \cond hardware_powman hardware_powman
* \cond hardware_hazard3 hardware_hazard3
* \cond hardware_riscv hardware_riscv
* @}
*
* \defgroup high_level High Level APIs
* This group of libraries provide higher level functionality that isn't hardware related or provides a richer
* set of functionality above the basic hardware interfaces
* @{
* \defgroup pico_async_context pico_async_context
* \defgroup pico_flash pico_flash
* \defgroup pico_i2c_slave pico_i2c_slave
* \defgroup pico_multicore pico_multicore
* \defgroup pico_rand pico_rand
* \defgroup pico_stdlib pico_stdlib
* \defgroup pico_sync pico_sync
* \defgroup pico_time pico_time
* \defgroup pico_unique_id pico_unique_id
* \defgroup pico_util pico_util
* \cond pico_aon_timer \defgroup pico_aon_timer pico_aon_timer \endcond
* \cond pico_async_context \defgroup pico_async_context pico_async_context \endcond
* \cond pico_bootsel_via_double_reset \defgroup pico_bootsel_via_double_reset pico_bootsel_via_double_reset \endcond
* \cond pico_flash \defgroup pico_flash pico_flash \endcond
* \cond pico_i2c_slave \defgroup pico_i2c_slave pico_i2c_slave \endcond
* \cond pico_multicore \defgroup pico_multicore pico_multicore \endcond
* \cond pico_rand \defgroup pico_rand pico_rand \endcond
* \cond pico_sha256 \defgroup pico_sha256 pico_sha256 \endcond
* \cond pico_stdlib \defgroup pico_stdlib pico_stdlib \endcond
* \cond pico_sync \defgroup pico_sync pico_sync \endcond
* \cond pico_time \defgroup pico_time pico_time \endcond
* \cond pico_unique_id \defgroup pico_unique_id pico_unique_id \endcond
* \cond pico_util \defgroup pico_util pico_util \endcond
* @}
*
* \defgroup third_party Third-party Libraries
* Third party libraries for implementing high level functionality.
* @{
* \cond tinyusb
* \defgroup tinyusb_device tinyusb_device
* \defgroup tinyusb_host tinyusb_host
* \endcond
* @}
*
* \defgroup networking Networking Libraries
* Functions for implementing networking
* @{
* \defgroup pico_btstack pico_btstack
* \defgroup pico_lwip pico_lwip
* \defgroup pico_cyw43_driver pico_cyw43_driver
* \defgroup pico_cyw43_arch pico_cyw43_arch
* \cond pico_btstack \defgroup pico_btstack pico_btstack \endcond
* \cond pico_lwip \defgroup pico_lwip pico_lwip \endcond
* \cond pico_cyw43_driver \defgroup pico_cyw43_driver pico_cyw43_driver \endcond
* \cond pico_cyw43_arch \defgroup pico_cyw43_arch pico_cyw43_arch \endcond
* @}
*
* \defgroup runtime Runtime Infrastructure
@ -74,30 +95,36 @@
* language level and C library functions, as well as CMake INTERFACE libraries
* abstracting the compilation and link steps in the SDK
* @{
* \defgroup boot_stage2 boot_stage2
* \defgroup pico_base pico_base
* \defgroup pico_binary_info pico_binary_info
* \defgroup pico_bit_ops pico_bit_ops
* \defgroup pico_bootrom pico_bootrom
* \defgroup pico_bootsel_via_double_reset pico_bootsel_via_double_reset
* \defgroup pico_cxx_options pico_cxx_options
* \defgroup pico_divider pico_divider
* \defgroup pico_double pico_double
* \defgroup pico_float pico_float
* \defgroup pico_int64_ops pico_int64_ops
* \defgroup pico_malloc pico_malloc
* \defgroup pico_mem_ops pico_mem_ops
* \defgroup pico_platform pico_platform
* \defgroup pico_printf pico_printf
* \defgroup pico_runtime pico_runtime
* \defgroup pico_stdio pico_stdio
* \defgroup pico_standard_link pico_standard_link
* \cond boot_stage2 \defgroup boot_stage2 boot_stage2 \endcond
* \cond pico_atomic \defgroup pico_atomic pico_atomic \endcond
* \cond pico_base_headers \defgroup pico_base pico_base \endcond
* \cond pico_binary_info \defgroup pico_binary_info pico_binary_info \endcond
* \cond pico_bootrom \defgroup pico_bootrom pico_bootrom \endcond
* \cond pico_bit_ops \defgroup pico_bit_ops pico_bit_ops \endcond
* \cond pico_cxx_options \defgroup pico_cxx_options pico_cxx_options \endcond
* \cond pico_clib_interface \defgroup pico_clib_interface pico_clib_interface \endcond
* \cond pico_crt0 \defgroup pico_crt0 pico_crt0 \endcond
* \cond pico_divider \defgroup pico_divider pico_divider \endcond
* \cond pico_double \defgroup pico_double pico_double \endcond
* \cond pico_float \defgroup pico_float pico_float \endcond
* \cond pico_int64_ops \defgroup pico_int64_ops pico_int64_ops \endcond
* \cond pico_malloc \defgroup pico_malloc pico_malloc \endcond
* \cond pico_mem_ops \defgroup pico_mem_ops pico_mem_ops \endcond
* \cond pico_platform \defgroup pico_platform pico_platform \endcond
* \cond pico_printf \defgroup pico_printf pico_printf \endcond
* \cond pico_runtime \defgroup pico_runtime pico_runtime \endcond
* \cond pico_runtime_init \defgroup pico_runtime_init pico_runtime_init \endcond
* \cond pico_stdio \defgroup pico_stdio pico_stdio \endcond
* \cond pico_standard_binary_info \defgroup pico_standard_binary_info pico_standard_binary_info \endcond
* \cond pico_standard_link \defgroup pico_standard_link pico_standard_link \endcond
* @}
*
* \defgroup misc External API Headers
* Headers for interfaces that are shared with code outside of the SDK
* @{
* \defgroup boot_picoboot boot_picoboot
* \defgroup boot_uf2 boot_uf2
* \cond boot_picobin_headers \defgroup boot_picobin_headers boot_picobin_headers \endcond
* \cond boot_picoboot_headers \defgroup boot_picoboot_headers boot_picoboot_headers \endcond
* \cond boot_uf2_headers \defgroup boot_uf2_headers boot_uf2_headers \endcond
* \cond pico_usb_reset_interface_headers \defgroup pico_usb_reset_interface_headers pico_usb_reset_interface_headers \endcond
* @}
*/

View File

@ -1,16 +1,16 @@
# Raspberry Pi Pico SDK
The Raspberry Pi Pico SDK (Software Development Kit), henceforth SDK, provides the headers, libraries and build system necessary to write programs for RP2040-based devices such as the Raspberry Pi Pico in C, C++ or assembly language. The SDK is designed to provide an API (Application Programming Interface) and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
The Raspberry Pi Pico SDK (Software Development Kit), henceforth SDK, provides the headers, libraries and build system necessary to write programs for RP-series microcontroller devices such as the Raspberry Pi Pico in C, C++ or assembly language. The SDK is designed to provide an API (Application Programming Interface) and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
A single program runs on the device at a time with a conventional `main()` method. Standard C/C++ libraries are supported along with APIs for accessing the RP2040s hardware, including DMA, IRQs, and the wide variety of fixed-function peripherals and PIO (Programmable IO).
A single program runs on the device at a time with a conventional `main()` method. Standard C/C++ libraries are supported along with APIs for accessing the microcontroller's hardware, including DMA, IRQs, and the wide variety of fixed-function peripherals and PIO (Programmable IO).
Additionally the SDK provides higher-level libraries for dealing with timers, USB, synchronization and multi-core programming, along with additional high-level functionality built using PIO, such as audio. The SDK can be used to build anything from simple applications, or full-fledged runtime environments such as MicroPython, to low-level software such as the RP2040s on-chip bootrom itself.
Additionally the SDK provides higher-level libraries for dealing with timers, USB, synchronization and multi-core programming, along with additional high-level functionality built using PIO, such as audio. The SDK can be used to build anything from simple applications, or full-fledged runtime environments such as MicroPython, to low-level software such as the microcontroller's on-chip bootrom itself.
This documentation is generated from the SDK source tree using Doxygen. It provides basic information on the APIs used for each library, but does not provide usage information. Please refer to the Databooks for usage and more technical information.
## SDK Design
The RP2040 is a powerful chip, however it is an embedded environment, so both RAM and program space are at premium. Additionally the trade-offs between performance and other factors (e.g. edge-case error handling, runtime vs compile-time configuration) are necessarily much more visible to the developer than they might be on other higher-level platforms.
The RP-series microcontroller range are powerful chips, however they are used in an embedded environment, so both RAM and program space are at premium. Additionally the trade-offs between performance and other factors (e.g. edge-case error handling, runtime vs compile-time configuration) are necessarily much more visible to the developer than they might be on other higher-level platforms.
The intention within the SDK has been for features to just work out of the box, with sensible defaults, but also to give the developer as much control and power as possible (if they want it) to fine-tune every aspect of the application they are building and the libraries used.
@ -20,7 +20,7 @@ The SDK uses CMake to manage the build. CMake is widely supported by IDEs (Integ
Apart from being a widely-used build system for C/C++ development, CMake is fundamental to the way the SDK is structured, and how applications are configured and built.
The SDK builds an executable which is bare-metal, i.e. it includes the entirety of the code needed to run on the device (other than floating-point and other optimized code contained in the bootrom within the RP2040).
The SDK builds an executable which is bare-metal, i.e. it includes the entirety of the code needed to run on the device (other than device specific floating-point and other optimized code contained in the bootrom within the microcontroller).
## Examples

View File

@ -4,6 +4,8 @@ The full documentation for the RP2040 and Raspberry Pi Pico board can be found a
- [RP2040 Datasheet](https://rptl.io/rp2040-datasheet)
- [Raspberry Pi Pico Datasheet](https://rptl.io/pico-datasheet)
- [RP235x Datasheet](https://rptl.io/rp2040-datasheet)
- [Raspberry Pi Pico2 Datasheet](https://rptl.io/pico-datasheet)
- [Raspberry Pi Pico W Datasheet](https://rptl.io/picow-datasheet)
- [Hardware design with RP2040](https://rptl.io/rp2040-design)
- [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk)

@ -1 +1 @@
Subproject commit 7ee0b7bd4a4fd13b5e03a0bab7f80491ae37e9ab
Subproject commit faf36381bad1f668a30172b6336c9a970966ef4c

@ -1 +1 @@
Subproject commit a77287f8fa6b76f74984121fdafc8563147435c8
Subproject commit 5a764e5555c64337ed17444410269ff21cb617b1

@ -1 +1 @@
Subproject commit 86c416d4c0fb38432460b3e11b08b9de76941bf5
Subproject commit 4232642899362fa5e9cf0dc59bad6f1f6d32c563

View File

@ -41,13 +41,6 @@ if (NOT TARGET _pico_sdk_pre_init_marker)
include(pico_utils)
message("PICO_SDK_PATH is ${CMAKE_CURRENT_LIST_DIR}")
include(pico_pre_load_platform)
# We want to configure correct toolchain prior to project load
# todo perhaps this should be included by the platform instead?
include(pico_pre_load_toolchain)
macro(pico_sdk_init)
if (NOT CMAKE_PROJECT_NAME)
message(WARNING "pico_sdk_init() should be called after the project is created (and languages added)")
@ -90,4 +83,10 @@ if (NOT TARGET _pico_sdk_pre_init_marker)
SET(${VAR} ${${VAR}} PARENT_SCOPE)
endforeach()
endmacro()
include(pico_pre_load_platform)
# We want to configure correct toolchain prior to project load
# todo perhaps this should be included by the platform instead?
include(pico_pre_load_toolchain)
endif()

View File

@ -1,18 +1,18 @@
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, group=pico_base
set(PICO_SDK_VERSION_MAJOR 1)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
set(PICO_SDK_VERSION_MINOR 5)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
set(PICO_SDK_VERSION_REVISION 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, default=Current SDK major version, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, default=Current SDK major version, group=pico_base
set(PICO_SDK_VERSION_MAJOR 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, default=Current SDK minor version, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, default=Current SDK minor version, group=pico_base
set(PICO_SDK_VERSION_MINOR 0)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
set(PICO_SDK_VERSION_REVISION 0)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
#set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base
set(PICO_SDK_VERSION_STRING "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}")
if (PICO_SDK_VERSION_PRE_RELEASE_ID)

26
src/BUILD.bazel Normal file
View File

@ -0,0 +1,26 @@
package(default_visibility = ["//visibility:public"])
# This shim exists as a way to break internal header dependency cycles
# that occur within the dependency chain of the pico_platform target below.
alias(
name = "pico_platform_internal",
actual = select({
"//bazel/constraint:host": "//src/host/pico_platform:pico_platform_internal",
"//conditions:default": "//src/rp2_common:pico_platform_internal",
}),
visibility = [
"//src/common/boot_picobin_headers:__pkg__",
"//src/common/boot_picoboot_headers:__pkg__",
"//src/common/hardware_claim:__pkg__",
"//src/common/pico_base_headers:__pkg__",
"//src/common/pico_binary_info:__pkg__",
],
)
alias(
name = "pico_platform",
actual = select({
"//bazel/constraint:host": "//src/host/pico_platform",
"//conditions:default": "//src/rp2_common:pico_platform",
}),
)

View File

@ -1,9 +1,15 @@
cmake_policy(SET CMP0079 NEW) # allow inserting of dependencies into our INTERFACE libraries
set(PICO_PLATFORM_CMAKE_FILE "" CACHE INTERNAL "")
set(PICO_PLATFORM_CMAKE_FILE "${PICO_PLATFORM_CMAKE_FILE}" CACHE INTERNAL "")
set(PICO_DOXYGEN_PATHS "" CACHE INTERNAL "") # generated each time
set(PICO_DOXYGEN_EXCLUDE_PATHS "" CACHE INTERNAL "") # generated each time
set(PICO_DOXYGEN_PRE_DEFINES "" CACHE INTERNAL "") # generated each time
set(PICO_DOXYGEN_ENABLED_SECTIONS "" CACHE INTERNAL "") # generated each time
if (NOT PICO_PLATFORM_CMAKE_DIR)
set(PICO_PLATFORM_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
endif()
if (NOT PICO_PLATFORM_CMAKE_FILE)
set(PICO_PLATFORM_CMAKE_FILE ${CMAKE_CURRENT_LIST_DIR}/${PICO_PLATFORM}.cmake CACHE INTERNAL "")
set(PICO_PLATFORM_CMAKE_FILE ${PICO_PLATFORM_CMAKE_DIR}/${PICO_PLATFORM}.cmake CACHE INTERNAL "")
endif ()
if (NOT EXISTS "${PICO_PLATFORM_CMAKE_FILE}")
@ -11,17 +17,28 @@ if (NOT EXISTS "${PICO_PLATFORM_CMAKE_FILE}")
Either specify a valid PICO_PLATFORM (or PICO_PLATFORM_CMAKE_FILE).")
endif ()
# Initialize board related build/compile settings
include(${CMAKE_CURRENT_LIST_DIR}/board_setup.cmake)
# call add_subdirectory(subdir) unless SKIP_SUBDIR evaluates to true
# second argument is optional path
function(pico_add_subdirectory subdir)
# todo add option to disable skip flag
string(TOUPPER ${subdir} subdir_upper)
# we do not include any path part of the subdir
get_filename_component(subdir_upper ${subdir_upper} NAME)
set(replace_flag SKIP_${subdir_upper})
if (NOT ${replace_flag})
add_subdirectory(${subdir})
else ()
string(TOUPPER ${subdir} subdir_upper)
set(replace_flag SKIP_${subdir_upper})
if (${ARGC} GREATER 1)
# argv1 is the root where the subdir is relative to
add_subdirectory(${ARGV1}/${subdir} ${subdir})
# todo make this optional?
pico_add_doxygen(${ARGV1}/${subdir})
else()
add_subdirectory(${subdir})
# todo make this optional?
pico_add_doxygen(${subdir})
endif()
else()
message("Not including ${subdir} because ${replace_flag} defined.")
endif ()
pico_promote_common_scope_vars()
@ -57,11 +74,12 @@ endfunction()
# add map file generation for the given target
function(pico_add_map_output TARGET)
pico_get_runtime_output_directory(${TARGET} output_path)
get_target_property(target_type ${TARGET} TYPE)
if ("EXECUTABLE" STREQUAL "${target_type}")
target_link_options(${TARGET} PRIVATE "LINKER:-Map=$<IF:$<BOOL:$<TARGET_PROPERTY:OUTPUT_NAME>>,$<TARGET_PROPERTY:OUTPUT_NAME>,$<TARGET_PROPERTY:NAME>>${CMAKE_EXECUTABLE_SUFFIX}.map")
target_link_options(${TARGET} PRIVATE "LINKER:-Map=${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:OUTPUT_NAME>>,$<TARGET_PROPERTY:OUTPUT_NAME>,$<TARGET_PROPERTY:NAME>>${CMAKE_EXECUTABLE_SUFFIX}.map")
else ()
target_link_options(${TARGET} INTERFACE "LINKER:-Map=$<IF:$<BOOL:$<TARGET_PROPERTY:OUTPUT_NAME>>,$<TARGET_PROPERTY:OUTPUT_NAME>,$<TARGET_PROPERTY:NAME>>${CMAKE_EXECUTABLE_SUFFIX}.map")
target_link_options(${TARGET} INTERFACE "LINKER:-Map=${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:OUTPUT_NAME>>,$<TARGET_PROPERTY:OUTPUT_NAME>,$<TARGET_PROPERTY:NAME>>${CMAKE_EXECUTABLE_SUFFIX}.map")
endif ()
endfunction()
@ -102,7 +120,7 @@ macro(pico_simple_hardware_headers_target NAME)
if (NOT TARGET hardware_${NAME}_headers)
add_library(hardware_${NAME}_headers INTERFACE)
target_include_directories(hardware_${NAME}_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_include_directories(hardware_${NAME}_headers SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_link_libraries(hardware_${NAME}_headers INTERFACE pico_base_headers)
if (NOT PICO_NO_HARDWARE)
target_link_libraries(hardware_${NAME}_headers INTERFACE hardware_structs hardware_claim_headers)
@ -122,7 +140,7 @@ macro(pico_simple_hardware_headers_only_target NAME)
add_library(hardware_${NAME}_headers INTERFACE)
# a headers only target should still have an explicit _headers library for consistency
target_include_directories(hardware_${NAME}_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_include_directories(hardware_${NAME}_headers SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_link_libraries(hardware_${NAME}_headers INTERFACE pico_base_headers)
if (NOT PICO_NO_HARDWARE)
target_link_libraries(hardware_${NAME}_headers INTERFACE hardware_structs)
@ -154,12 +172,30 @@ macro(pico_simple_hardware_impl_target NAME)
endif()
endmacro()
function(pico_add_doxygen_pre_define PRE_DEFINE)
list(APPEND PICO_DOXYGEN_PRE_DEFINES "${PRE_DEFINE}")
set(PICO_DOXYGEN_PRE_DEFINES "${PICO_DOXYGEN_PRE_DEFINES}" CACHE INTERNAL "")
endfunction()
function(pico_add_doxygen_enabled_section ENABLED_SECTION)
list(APPEND PICO_DOXYGEN_ENABLED_SECTIONS "${ENABLED_SECTION}")
set(PICO_DOXYGEN_ENABLED_SECTIONS "${PICO_DOXYGEN_ENABLED_SECTIONS}" CACHE INTERNAL "")
endfunction()
function(pico_add_doxygen SOURCE_DIR)
set(PICO_DOXYGEN_PATHS "${PICO_DOXYGEN_PATHS} ${SOURCE_DIR}" CACHE INTERNAL "")
if (NOT IS_ABSOLUTE "${SOURCE_DIR}")
get_filename_component(SOURCE_DIR "${SOURCE_DIR}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()
list(APPEND PICO_DOXYGEN_PATHS "${SOURCE_DIR}")
set(PICO_DOXYGEN_PATHS "${PICO_DOXYGEN_PATHS}" CACHE INTERNAL "")
endfunction()
function(pico_add_doxygen_exclude SOURCE_DIR)
set(PICO_DOXYGEN_EXCLUDE_PATHS "${PICO_DOXYGEN_EXCLUDE_PATHS} ${SOURCE_DIR}" CACHE INTERNAL "")
if (NOT IS_ABSOLUTE "${SOURCE_DIR}")
get_filename_component(SOURCE_DIR "${SOURCE_DIR}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()
list(APPEND PICO_DOXYGEN_EXCLUDE_PATHS "${SOURCE_DIR}")
set(PICO_DOXYGEN_EXCLUDE_PATHS "${PICO_DOXYGEN_EXCLUDE_PATHS}" CACHE INTERNAL "")
endfunction()
include(${PICO_PLATFORM_CMAKE_FILE})

View File

@ -1,31 +0,0 @@
# PICO_CMAKE_CONFIG: PICO_BOARD, The board name being built for. This is overridable from the user environment, type=string, default=pico, group=build
if (DEFINED ENV{PICO_BOARD})
set(PICO_BOARD $ENV{PICO_BOARD})
message("Using PICO_BOARD from environment ('${PICO_BOARD}')")
else()
if (NOT PICO_BOARD)
set(PICO_BOARD "pico")
pico_message("Defaulting PICO target board to ${PICO_BOARD} since not specified.")
else()
message("PICO target board is ${PICO_BOARD}.")
endif()
endif()
set(PICO_BOARD ${PICO_BOARD} CACHE STRING "PICO target board (e.g. pico)" FORCE)
# PICO_CMAKE_CONFIG: PICO_BOARD_CMAKE_DIRS, Directories to look for <PICO_BOARD>.cmake in. This is overridable from the user environment, type=list, group=build
if (DEFINED ENV{PICO_BOARD_CMAKE_DIRS})
set(PICO_BOARD_CMAKE_DIRS $ENV{PICO_BOARD_CMAKE_DIRS})
message("Using PICO_BOARD_CMAKE_DIRS from environment ('${PICO_BOARD_CMAKE_DIRS}')")
endif()
list(APPEND PICO_BOARD_CMAKE_DIRS ${CMAKE_CURRENT_LIST_DIR}/boards)
pico_find_in_paths(PICO_BOARD_CMAKE_FILE PICO_BOARD_CMAKE_DIRS ${PICO_BOARD}.cmake)
if (EXISTS "${PICO_BOARD_CMAKE_FILE}")
message("Using CMake board configuration from ${PICO_BOARD_CMAKE_FILE}")
include(${PICO_BOARD_CMAKE_FILE} board_config)
else()
include(boards/generic_board.cmake)
endif()
list(APPEND PICO_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/boards/include) # so boards/foo.h can be explicitly included

View File

@ -5,41 +5,84 @@ package(default_visibility = ["//visibility:public"])
# Known board choices:
BOARD_CHOICES = [
"0xcb_helios",
"adafruit_feather_rp2040_usb_host",
"adafruit_feather_rp2040",
"adafruit_itsybitsy_rp2040",
"adafruit_kb2040",
"adafruit_macropad_rp2040",
"adafruit_qtpy_rp2040",
"adafruit_trinkey_qt2040",
"amethyst_fpga",
"archi",
"arduino_nano_rp2040_connect",
"cytron_maker_pi_rp2040",
"datanoisetv_rp2040_dsp",
"defcon32_badge",
"eetree_gamekit_rp2040",
"garatronic_pybstick26_rp2040",
"gen4_rp2350_24",
"gen4_rp2350_24ct",
"gen4_rp2350_24t",
"gen4_rp2350_28",
"gen4_rp2350_28ct",
"gen4_rp2350_28t",
"gen4_rp2350_32",
"gen4_rp2350_32ct",
"gen4_rp2350_32t",
"gen4_rp2350_35",
"gen4_rp2350_35ct",
"gen4_rp2350_35t",
"hellbender_2350A_devboard",
"ilabs_challenger_rp2350_bconnect",
"ilabs_challenger_rp2350_wifi_ble",
"ilabs_opendec02",
"melopero_perpetuo_rp2350_lora",
"melopero_shake_rp2040",
"metrotech_xerxes_rp2040",
"net8086_usb_interposer",
"none",
"nullbits_bit_c_pro",
"pico",
"phyx_rick_tny_rp2350",
"pi-plates_micropi",
"pico_w",
"pico",
"pico2",
"pimoroni_badger2040",
"pimoroni_interstate75",
"pimoroni_keybow2040",
"pimoroni_motor2040",
"pimoroni_pga2040",
"pimoroni_pga2350",
"pimoroni_pico_plus2_rp2350",
"pimoroni_picolipo_16mb",
"pimoroni_picolipo_4mb",
"pimoroni_picosystem",
"pimoroni_plasma2040",
"pimoroni_plasma2350",
"pimoroni_servo2040",
"pimoroni_tiny2040",
"pimoroni_tiny2040_2mb",
"pimoroni_tiny2040",
"pimoroni_tiny2350",
"pololu_3pi_2040_robot",
"pololu_zumo_2040_robot",
"seeed_xiao_rp2040",
"solderparty_rp2040_stamp",
"seeed_xiao_rp2350",
"solderparty_rp2040_stamp_carrier",
"solderparty_rp2040_stamp_round_carrier",
"solderparty_rp2040_stamp",
"solderparty_rp2350_stamp_xl",
"solderparty_rp2350_stamp",
"sparkfun_micromod",
"sparkfun_promicro_rp2350",
"sparkfun_promicro",
"sparkfun_thingplus",
"switchscience_picossci2_conta_base",
"switchscience_picossci2_dev_board",
"switchscience_picossci2_micro",
"switchscience_picossci2_rp2350_breakout",
"switchscience_picossci2_tiny",
"tinycircuits_thumby_color_rp2350",
"vgaboard",
"waveshare_rp2040_lcd_0.96",
"waveshare_rp2040_lcd_1.28",
@ -47,14 +90,11 @@ BOARD_CHOICES = [
"waveshare_rp2040_plus_16mb",
"waveshare_rp2040_plus_4mb",
"waveshare_rp2040_zero",
"wiznet_w5100s_evb_pico",
"cytron_maker_pi_rp2040",
"metrotech_xerxes_rp2040",
"pololu_zumo_2040_robot",
"weact_studio_rp2040_16mb",
"weact_studio_rp2040_2mb",
"weact_studio_rp2040_4mb",
"weact_studio_rp2040_8mb",
"wiznet_w5100s_evb_pico",
]
BOARD_CHOICE_FILES = ["include/boards/" + c + ".h" for c in BOARD_CHOICES]

View File

@ -12,6 +12,8 @@
//------------------------------------------------------------------------------------------
// Board definition for the 0xCB Helios
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_0XCB_HELIOS_H
#define _BOARDS_0XCB_HELIOS_H
@ -71,10 +73,10 @@
#endif
// board has 16M onboard flash
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ADAFRUIT_FEATHER_RP2040_H
#define _BOARDS_ADAFRUIT_FEATHER_RP2040_H
@ -81,10 +83,10 @@
#define PICO_FLASH_SPI_CLKDIV 4
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ADAFRUIT_FEATHER_RP2040_USB_HOST_H
#define _BOARDS_ADAFRUIT_FEATHER_RP2040_USB_HOST_H
@ -77,6 +79,7 @@
#define PICO_FLASH_SPI_CLKDIV 4
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ADAFRUIT_ITSYBITSY_RP2040_H
#define _BOARDS_ADAFRUIT_ITSYBITSY_RP2040_H
@ -84,10 +86,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ADAFRUIT_KB2040_H
#define _BOARDS_ADAFRUIT_KB2040_H
@ -76,10 +78,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -12,6 +12,8 @@
#ifndef _BOARDS_ADAFRUIT_MACROPAD_RP2040_H
#define _BOARDS_ADAFRUIT_MACROPAD_RP2040_H
// pico_cmake_set PICO_PLATFORM=rp2040
// For board detection
#define ADAFRUIT_MACROPAD_RP2040
@ -171,10 +173,10 @@
#define PICO_FLASH_SPI_CLKDIV 4
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
#define PICO_FLOAT_SUPPORT_ROM_V1 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ADAFRUIT_QTPY_RP2040_H
#define _BOARDS_ADAFRUIT_QTPY_RP2040_H
@ -83,10 +85,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ADAFRUIT_TRINKEY_QT2040_H
#define _BOARDS_ADAFRUIT_TRINKEY_QT2040_H
@ -61,10 +63,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -0,0 +1,105 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// FIXME delete this file before release (board file for Amethyst FPGA platform)
#ifndef _BOARDS_AMETHYST_FPGA_H
#define _BOARDS_AMETHYST_FPGA_H
#if !PICO_RP2350
#error "Invalid PICO_PLATFORM for amethyst_fpga.h: must be rp2350 or rp2350-riscv"
#endif
// For board detection
#define RASPBERRYPI_AMETHYST_FPGA
#define PICO_NO_FPGA_CHECK 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 46
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 47
#endif
// Match bootrom UART baud rate of 1 Mbaud:
#ifndef PICO_DEFAULT_UART_BAUD_RATE
#define PICO_DEFAULT_UART_BAUD_RATE 1000000
#endif
// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
#define PICO_SD_CLK_PIN 18
#define PICO_SD_CMD_PIN 19
#define PICO_SD_DAT0_PIN 20
#define PICO_ON_FPGA 1
#define PICO_SCANVIDEO_COLOR_PIN_COUNT 16
#define PICO_SCANVIDEO_DPI_PIXEL_RSHIFT 0u
#define PICO_SCANVIDEO_DPI_PIXEL_GSHIFT 6u
#define PICO_SCANVIDEO_DPI_PIXEL_BSHIFT 11u
#define PICO_SCANVIDEO_48MHZ 1
#define PICO_AUDIO_I2S_DATA_PIN 29
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE 30
#define PICO_AUDIO_PWM_L_PIN 28
#define PICO_AUDIO_PWM_R_PIN 27
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#endif

View File

@ -11,6 +11,8 @@
// This header may be included by other board headers as "boards/archi.h"
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ARCHI_H
#define _BOARDS_ARCHI_H
@ -102,9 +104,9 @@
#define PICO_FLASH_SPI_CLKDIV 4
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (4 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
#endif
#endif

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ARDUINO_NANO_RP2040_CONNECT_H
#define _BOARDS_ARDUINO_NANO_RP2040_CONNECT_H
@ -72,10 +74,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_CYTRON_MAKER_PI_RP2040_H
#define _BOARDS_CYTRON_MAKER_PI_RP2040_H
@ -177,10 +179,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -14,6 +14,8 @@
//
// This header may be included by other board headers as "boards/datanoisetv_rp2040_dsp.h"
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_DATANOISETV_RP2040_DSP_H
#define _BOARDS_DATANOISETV_RP2040_DSP_H
@ -38,10 +40,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// NOTE: since there is no UART on the badge, you should probably pass:
// -DPICO_BOARD=defcon32_badge -DPICO_STDIO_USB=1 -DPICO_STDIO_UART+0
// when building to set up stdio over USB CDC by default
#define PICO_DEFAULT_UART 0
#define PICO_DEFAULT_UART_TX_PIN 30
#define PICO_DEFAULT_UART_RX_PIN 31
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_DEFCON32_BADGE_H
#define _BOARDS_DEFCON32_BADGE_H
// For board detection
#define DEFCON32_BADGE
// --- RP2350 VARIANT ---
#define PICO_RP2350A 1
#define DEFCON32_BADGE_SRAM_CS_PIN 0
#define DEFCON32_BADGE_TOUCH_INT_PIN 1
#define DEFCON32_BADGE_I2C_SDA_PIN 2
#define DEFCON32_BADGE_I2C_SDL_PIN 3
#define DEFCON32_BADGE_WS2812_PIN 4
#define DEFCON32_BADGE_DISPLAY_RS_PIN 5
#define DEFCON32_BADGE_DISPLAY_DO_PIN 6
#define DEFCON32_BADGE_IR_SD_PIN 7
#define DEFCON32_BADGE_DISPLAY_SCK_PIN 8
#define DEFCON32_BADGE_DISPLAY_CS_PIN 9
#define DEFCON32_BADGE_DISPLAY_BL_PIN 10
#define DEFCON32_BADGE_SYS_POWER_CONTROL_PIN 11
#define DEFCON32_BADGE_SPI_MISO_PIN 12
#define DEFCON32_BADGE_SD_CS_PIN 13
#define DEFCON32_BADGE_SPI_CK_PIN 14
#define DEFCON32_BADGE_SPI_MOSI_PIN 15
#define DEFCON32_BADGE_SW_RIGHT_PIN 16
#define DEFCON32_BADGE_SW_DOWN_PIN 17
#define DEFCON32_BADGE_SW_UP_PIN 18
#define DEFCON32_BADGE_SW_LEFT_PIN 19
#define DEFCON32_BADGE_SW_B_PIN 20
#define DEFCON32_BADGE_SW_A_PIN 21
#define DEFCON32_BADGE_SW_START_PIN 22
#define DEFCON32_BADGE_SW_SELECT_PIN 23
#define DEFCON32_BADGE_SW_FN_PIN 24
#define DEFCON32_BADGE_SPEAKER_OUT_PIN 25
#define DEFCON32_BADGE_IR_RX_PIN 27
#define DEFCON32_BADGE_IR_TX_PIN 28
// --- LED ---
// no PICO_DEFAULT_LED_PIN
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN DEFCON32_BADGE_WS2812_PIN
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN DEFCON32_BADGE_I2C_SDA_PIN
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN DEFCON32_BADGE_I2C_SDL_PIN
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN DEFCON32_BADGE_SPI_CK_PIN
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN DEFCON32_BADGE_SPI_MISO_PIN
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN DEFCON32_BADGE_SPI_MOSI_PIN
#endif
// multiple devices, so this doesn't make much sense
// no PICO_DEFAULT_SPI_CSN_PIN
#ifndef PICO_AUDIO_PWM_L_PIN
#define PICO_AUDIO_PWM_L_PIN DEFCON32_BADGE_SPEAKER_OUT_PIN
#endif
#ifndef PICO_AUDIO_PWM_MONO_PIN
#define PICO_AUDIO_PWM_MONO_PIN PICO_AUDIO_PWM_L_PIN
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (4 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
#endif

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_EETREE_GAMEKIT_RP2040_H
#define _BOARDS_EETREE_GAMEKIT_RP2040_H
@ -67,6 +69,7 @@
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H
#define _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H
@ -68,10 +70,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (1 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (1 * 1024 * 1024)
#endif
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
// Linear regulator on Pybstick26
//#define PICO_SMPS_MODE_PIN 23

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_24
#define _BOARDS_GEN4_RP2350_24
// For board detection
#define GEN4_RP2350_24
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_NONE
#define LCD_TOUCH_POINTS 0
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_24CT
#define _BOARDS_GEN4_RP2350_24CT
// For board detection
#define GEN4_RP2350_24CT // CLB variants are exactly the same in operation
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_CTP_FT
#define LCD_TOUCH_POINTS 2
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_24T
#define _BOARDS_GEN4_RP2350_24T
// For board detection
#define GEN4_RP2350_24T
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_4WIRE
#define LCD_TOUCH_POINTS 1
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_28
#define _BOARDS_GEN4_RP2350_28
// For board detection
#define GEN4_RP2350_28
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_NONE
#define LCD_TOUCH_POINTS 0
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_28CT
#define _BOARDS_GEN4_RP2350_28CT
// For board detection
#define GEN4_RP2350_28CT // CLB variants are exactly the same in operation
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_CTP_FT
#define LCD_TOUCH_POINTS 2
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_28T
#define _BOARDS_GEN4_RP2350_28T
// For board detection
#define GEN4_RP2350_28T
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_4WIRE
#define LCD_TOUCH_POINTS 1
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_32
#define _BOARDS_GEN4_RP2350_32
// For board detection
#define GEN4_RP2350_32
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_NONE
#define LCD_TOUCH_POINTS 0
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_32CT
#define _BOARDS_GEN4_RP2350_32CT
// For board detection
#define GEN4_RP2350_32CT // CLB variants are exactly the same in operation
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_CTP_FT
#define LCD_TOUCH_POINTS 5
#define LCD_TOUCH_MIRROR_Y
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_32T
#define _BOARDS_GEN4_RP2350_32T
// For board detection
#define GEN4_RP2350_32T
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 240
#define LCD_HEIGHT 320
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_4WIRE
#define LCD_TOUCH_POINTS 1
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_35
#define _BOARDS_GEN4_RP2350_35
// For board detection
#define GEN4_RP2350_35
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 320
#define LCD_HEIGHT 480
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_NONE
#define LCD_TOUCH_POINTS 0
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_35CT
#define _BOARDS_GEN4_RP2350_35CT
// For board detection
#define GEN4_RP2350_35CT // CLB variants are exactly the same in operation
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 320
#define LCD_HEIGHT 480
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_CTP_FT
#define LCD_TOUCH_POINTS 5
#define LCD_TOUCH_MIRROR_Y
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_GEN4_RP2350_35T
#define _BOARDS_GEN4_RP2350_35T
// For board detection
#define GEN4_RP2350_35T
// --- RP2350 VARIANT ---
#define PICO_RP2350A 0
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 1
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 4
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 5
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 8
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 9
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 42
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 43
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 44
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 45
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// 4DLCD Interface
#define PORTRAIT 0
#define LANDSCAPE 1
#define PORTRAIT_R 2
#define LANDSCAPE_R 3
#define LCD_ORIENTATION PORTRAIT
#define LCD_WIDTH 320
#define LCD_HEIGHT 480
#define LCD_BACKLIGHT 17
#define LCD_RS_PIN 18
#define LCD_WR_PIN 19
#define LCD_RD_PIN 20
#define LCD_DATA0_PIN 21
#define LCD_RESET 37
#define LCD_TOUCH_INT 38
#define LCD_TOUCH_SCL 39
#define LCD_TOUCH_SDA 46
#define LCD_TOUCH_RST 47
#define LCD_TOUCH_YD LCD_TOUCH_INT
#define LCD_TOUCH_XL LCD_TOUCH_SCL
#define LCD_TOUCH_YU LCD_TOUCH_RST
#define LCD_TOUCH_XR LCD_TOUCH_SDA
#define LCD_TOUCH_I2C i2c1
#define LCD_TOUCH_4WIRE
#define LCD_TOUCH_POINTS 1
#define LCD_SD_CLK 10
#define LCD_SD_CMD 11
#define LCD_SD_D0 12
#define LCD_SD_D1 13
#define LCD_SD_D2 14
#define LCD_SD_D3 15
#endif

View File

@ -0,0 +1,98 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_HB_2350A_H
#define _BOARDS_HB_2350A_H
// pico_cmake_set PICO_PLATFORM=rp2350
// For board detection
#define HELLBENDER_2350A_DEVBOARD
// Pin aliases
#define HB_2350A_XIP_CS1_PIN 0
#define HB_2350A_IMU_INT_PIN 1
#define HB_2350A_USER_QWIIC_SDA_PIN 2
#define HB_2350A_USER_QWIIC_SCL_PIN 3
#define HB_2350A_RTC_INT_PIN 8
#define HB_2350A_SDCARD_CS_PIN 9
#define HB_2350A_LORA_IO1_PIN 10
#define HB_2350A_LORA_IO3_PIN 11
#define HB_2350A_LORA_CS_PIN 21
#define HB_2350A_RTC_CLKIN_PIN 22
#define HB_2350A_IMU_CLKOUT_PIN 23
#define HB_2350A_LORA_BUSY_PIN 24
#define HB_2350A_FUSB307_INT_PIN 25
#define HB_2350A_LORA_RESET_PIN 29
// --- UART ---
// Note, conflicts with HSTX range
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 12
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 13
#endif
// no PICO_DEFAULT_LED_PIN
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 6
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 7
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 20
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 21
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
// --- RP2350 VARIANT ---
#define PICO_RP2350A 1
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
#endif

View File

@ -0,0 +1,94 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// This header may be included by other board headers as "boards/ilabs_challenger_rp2350_bconnect.h"
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_CHALLENGER_RP2350_BCONNECT_H
#define _BOARDS_CHALLENGER_RP2350_BCONNECT_H
// For board detection
#define ILABS_CHALLENGER_RP2350_BCONNECT
// --- RP2350 VARIANT ---
#define PICO_RP2350A 1
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 12
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 13
#endif
// PICO_DEFAULT_LED_PIN
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 7
#endif
// PICO_DEFAULT_WS2812_PIN
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 22
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 20
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 21
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 1
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
#endif

View File

@ -0,0 +1,148 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// This header may be included by other board headers as "boards/ilabs_challenger_rp2350_wifi_ble.h"
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_CHALLENGER_RP2350_WIFI_BLE_H
#define _BOARDS_CHALLENGER_RP2350_WIFI_BLE_H
// For board detection
#define ILABS_CHALLENGER_RP2350_WIFI_BLE
// --- RP2350 VARIANT ---
#define PICO_RP2350A 1
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 12
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 13
#endif
// PICO_DEFAULT_LED_PIN
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 7
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 20
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 21
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 1
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// Board specific helper macros
// Types of valid modules on the board
#define ESP32C6_MINI_1 1
#define ESP32C3_MINI_1 2
// Specifies the default module used on this board
#ifndef ILABS_ONBOARD_ESP_MODULE
#define ILABS_ONBOARD_ESP_MODULE ESP32C6_MINI_1
#endif
// ESP module control signals
#ifndef ILABS_DEFAULT_ESP_MODULE_RST_PIN
#define ILABS_DEFAULT_ESP_MODULE_RST_PIN 15
#endif
#ifndef ILABS_DEFAULT_ESP_MODULE_BOOT_MODE_PIN
#define ILABS_DEFAULT_ESP_MODULE_BOOT_MODE_PIN 14
#endif
// ESP module UART definitions
#ifndef ILABS_ESP_AT_UART
#define ILABS_ESP_AT_UART 1
#endif
#ifndef ILABS_DEFAULT_ESP_AT_TX_PIN
#define ILABS_DEFAULT_ESP_AT_TX_PIN 4
#endif
#ifndef ILABS_DEFAULT_ESP_AT_RX_PIN
#define ILABS_DEFAULT_ESP_AT_RX_PIN 5
#endif
// ESP module SPI definitions
#ifndef ILABS_DEFAULT_ESP_SPI
#define ILABS_DEFAULT_ESP_SPI 1
#endif
#ifndef ILABS_DEFAULT_ESP_SPI_MISO_PIN
#define ILABS_DEFAULT_ESP_SPI_MISO_PIN 8
#endif
#ifndef ILABS_DEFAULT_ESP_SPI_MOSI_PIN
#define ILABS_DEFAULT_ESP_SPI_MOSI_PIN 11
#endif
#ifndef ILABS_DEFAULT_ESP_SPI_SCK_PIN
#define ILABS_DEFAULT_ESP_SPI_SCK_PIN 10
#endif
#ifndef ILABS_DEFAULT_ESP_SPI_SS_PIN
#define ILABS_DEFAULT_ESP_SPI_SS_PIN 9
#endif
#ifndef ILABS_DEFAULT_ESP_SPI_HS_PIN
#define ILABS_DEFAULT_ESP_SPI_HS_PIN 22
#endif
#endif

View File

@ -12,6 +12,8 @@
//------------------------------------------------------------------------------------------
// Board definition for the opendec02 open source dcc decoder
//
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_ILABS_OPENDEC02_H
#define _BOARDS_ILABS_OPENDEC02_H
@ -48,10 +50,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -0,0 +1,99 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// This header may be included by other board headers as "boards/melopero_perpetuo_rp2350_lora.h"
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_MELOPERO_PERPETUO_RP2350_LORA_H
#define _BOARDS_MELOPERO_PERPETUO_RP2350_LORA_H
// For board detection
#define MELOPERO_PERPETUO_RP2350_LORA
// --- RP2350 VARIANT ---
#define PICO_RP2350A 1
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 16
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 17
#endif
// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 23
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 24
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 25
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 22
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 20
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 21
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
// Board specific
#define MELOPERO_PERPETUO_ENABLE_WS2812 14
#define MELOPERO_PERPETUO_WS2812 15
#define MELOPERO_PERPETUO_LED 23
#define MELOPERO_PERPETUO_ENABLE_VSEN 0
#define MELOPERO_PERPETUO_FUEL_ALERT 3
#define MELOPERO_PERPETUO_CHARGER_STAT1 1
#define MELOPERO_PERPETUO_CHARGER_STAT2 2
#endif

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_MELOPERO_SHAKE_RP2040_H
#define _BOARDS_MELOPERO_SHAKE_RP2040_H
@ -80,10 +82,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_METROTECH_XERXES_RP2040_H
#define _BOARDS_METROTECH_XERXES_RP2040_H
@ -145,6 +147,7 @@
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 16
#endif // !PICO_XOSC_STARTUP_DELAY_MULTIPLIER
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
/**
* @brief 16MiB, Flash size in bytes

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_NET8086_USB_INTERPOSER_H
#define _BOARDS_NET8086_USB_INTERPOSER_H
@ -60,6 +62,7 @@
#define PICO_FLASH_SPI_CLKDIV 4
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif

View File

@ -14,6 +14,8 @@
//
// This header may be included by other board headers as "boards/nullbits_bit_c_pro.h"
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_NULLBITS_BIT_C_PRO_H
#define _BOARDS_NULLBITS_BIT_C_PRO_H
@ -98,10 +100,10 @@
#endif
// Bit-C PRO has 4MB SPI flash
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (4 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
#endif
// All boards have B1+ RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -0,0 +1,87 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// This header may be included by other board headers as "boards/phyx_rick_tny_rp2350.h"
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_PHYX_RICK_TNY_RP2350_H
#define _BOARDS_PHYX_RICK_TNY_RP2350_H
// For board detection
#define PHYX_RICK_TNY_RP2350
// --- RP2350 VARIANT ---
#define PICO_RP2350A 1
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 16
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 17
#endif
// no PICO_DEFAULT_LED_PIN
// --- Neopixel ---
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 11
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 6
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 7
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 22
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 23
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 20
#endif
// no PICO_DEFAULT_SPI_CSN_PIN
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
#endif

View File

@ -11,6 +11,8 @@
// Board definition for the Pi-Plates MICROPi processor board
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_PI_PLATES_MICROPI_H
#define _BOARDS_PI_PLATES_MICROPI_H
@ -70,6 +72,7 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024) //change to (16 * 1024 * 1024) on final product
#endif

View File

@ -11,6 +11,8 @@
// This header may be included by other board headers as "boards/pico.h"
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_PICO_H
#define _BOARDS_PICO_H
@ -70,10 +72,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
#define PICO_SMPS_MODE_PIN 23

View File

@ -0,0 +1,100 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// This header may be included by other board headers as "boards/pico.h"
// pico_cmake_set PICO_PLATFORM=rp2350
#ifndef _BOARDS_PICO2_H
#define _BOARDS_PICO2_H
// For board detection
#define RASPBERRYPI_PICO2
// --- RP2350 VARIANT ---
#define PICO_RP2350A 1
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (4 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
#endif
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
#define PICO_SMPS_MODE_PIN 23
// The GPIO Pin used to read VBUS to determine if the device is battery powered.
#ifndef PICO_VBUS_PIN
#define PICO_VBUS_PIN 24
#endif
// The GPIO Pin used to monitor VSYS. Typically you would use this with ADC.
// There is an example in adc/read_vsys in pico-examples.
#ifndef PICO_VSYS_PIN
#define PICO_VSYS_PIN 29
#endif
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif
#endif

View File

@ -9,6 +9,9 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM = rp2040
// pico_cmake_set PICO_CYW43_SUPPORTED = 1
// This header may be included by other board headers as "boards/pico_w.h"
#ifndef _BOARDS_PICO_W_H
@ -68,10 +71,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// note the SMSP mode pin is on WL_GPIO1
// #define PICO_SMPS_MODE_PIN

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_PIMORONI_BADGER2040_H
#define _BOARDS_PIMORONI_BADGER2040_H
@ -104,10 +106,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_PIMORONI_INTERSTATE75_H
#define _BOARDS_PIMORONI_INTERSTATE75_H
@ -94,10 +96,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_PIMORONI_KEYBOW2040_H
#define _BOARDS_PIMORONI_KEYBOW2040_H
@ -83,10 +85,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_PIMORONI_MOTOR2040_H
#define _BOARDS_PIMORONI_MOTOR2040_H
@ -126,10 +128,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

View File

@ -9,6 +9,8 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// pico_cmake_set PICO_PLATFORM=rp2040
#ifndef _BOARDS_PIMORONI_PGA2040_H
#define _BOARDS_PIMORONI_PGA2040_H
@ -67,10 +69,10 @@
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0

Some files were not shown because too many files have changed in this diff Show More