xref: /aosp_15_r20/external/pigweed/pw_build/platforms/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2021 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load("//pw_build:merge_flags.bzl", "flags_from_dict")
16
17package(default_visibility = ["//visibility:public"])
18
19# --------------------
20# --- OS Platforms ---
21# --------------------
22
23platform(
24    name = "freertos",
25    constraint_values = [
26        "//pw_build/constraints/rtos:freertos",
27        "@platforms//os:none",
28    ],
29)
30
31platform(
32    name = "embos",
33    constraint_values = [
34        "//pw_build/constraints/rtos:embos",
35        "@platforms//os:none",
36    ],
37)
38
39platform(
40    name = "threadx",
41    constraint_values = [
42        "//pw_build/constraints/rtos:threadx",
43        "@platforms//os:none",
44    ],
45)
46
47# --------------------------
48# --- Hardware Platforms ---
49# --------------------------
50platform(
51    name = "lm3s6965evb",
52    constraint_values = [
53        "@pw_toolchain//constraints/arm_mcpu:cortex-m3",
54        "//pw_build/constraints/chipset:lm3s6965evb",
55        "@platforms//cpu:armv7-m",
56        "@platforms//os:none",
57        "@rust_crates//:no_std",
58    ],
59    flags = flags_from_dict({
60        "@pigweed//pw_log/rust:pw_log_backend": "//pw_rust/examples/tokenized_logging:pw_log_backend",
61        "@pigweed//pw_sys_io:backend": "//pw_sys_io_baremetal_lm3s6965evb",
62    }),
63)
64
65platform(
66    name = "nrf52833",
67    constraint_values = [
68        "@pw_toolchain//constraints/arm_mcpu:cortex-m0",
69        "//pw_build/constraints/chipset:nrf52833",
70        "@platforms//cpu:armv6-m",
71        "@platforms//os:none",
72    ],
73)
74
75# Primarily a QEMU supported m0 target for rust development, based on the
76# nRF51822.
77platform(
78    name = "microbit",
79    constraint_values = [
80        "//pw_build/constraints/board:microbit",
81        "@rust_crates//:no_std",
82        "@platforms//os:none",
83        # We have no pw_sys_io backend for this platform.
84    ],
85    parents = [":nrf52833"],
86)
87
88# ----------------------
89# --- Misc Platforms ---
90# ----------------------
91
92platform(
93    name = "none",
94    constraint_values = ["@platforms//os:none"],
95)
96