• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2023 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("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
17load("//pw_build:compatibility.bzl", "boolean_constraint_value", "incompatible_with_mcu")
18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24boolean_constraint_value(
25    name = "compatible",
26)
27
28cc_library(
29    name = "spi",
30    srcs = [
31        "spi.cc",
32    ],
33    hdrs = [
34        "public/pw_spi_mcuxpresso/spi.h",
35    ],
36    implementation_deps = ["//pw_assert:check"],
37    strip_include_prefix = "public",
38    target_compatible_with = [":compatible"],
39    deps = [
40        "//pw_chrono:system_clock",
41        "//pw_log",
42        "//pw_spi:chip_selector",
43        "//pw_spi:initiator",
44        "//pw_status",
45        "//pw_sync:binary_semaphore",
46        "//pw_sync:lock_annotations",
47        "//pw_sync:mutex",
48        "//targets:mcuxpresso_sdk",
49    ],
50)
51
52cc_library(
53    name = "flexio_spi",
54    srcs = [
55        "flexio_spi.cc",
56    ],
57    hdrs = [
58        "public/pw_spi_mcuxpresso/flexio_spi.h",
59    ],
60    strip_include_prefix = "public",
61    target_compatible_with = [":compatible"],
62    deps = [
63        "//pw_digital_io",
64        "//pw_log",
65        "//pw_spi:chip_selector",
66        "//pw_spi:initiator",
67        "//pw_status",
68        "//pw_sync:binary_semaphore",
69        "//pw_sync:lock_annotations",
70        "//pw_sync:mutex",
71        "//targets:mcuxpresso_sdk",
72    ],
73)
74
75cc_library(
76    name = "responder",
77    srcs = ["responder.cc"],
78    hdrs = [
79        "public/pw_spi_mcuxpresso/responder.h",
80    ],
81    strip_include_prefix = "public",
82    target_compatible_with = [":compatible"],
83    deps = [
84        "//pw_assert:check",
85        "//pw_dma_mcuxpresso",
86        "//pw_function",
87        "//pw_log",
88        "//pw_span:cast",
89        "//pw_spi:initiator",
90        "//pw_spi:responder",
91        "//pw_status",
92        "//targets:mcuxpresso_sdk",
93        "//third_party/fuchsia:stdcompat",
94    ],
95)
96
97pw_cc_test(
98    name = "spi_test",
99    srcs = ["spi_test.cc"],
100    deps = [
101        ":spi",
102        "//pw_spi:device",
103    ],
104)
105
106pw_cc_test(
107    name = "flexio_spi_test",
108    srcs = ["flexio_spi_test.cc"],
109    deps = [":flexio_spi"],
110)
111
112sphinx_docs_library(
113    name = "docs",
114    srcs = [
115        "docs.rst",
116    ],
117    prefix = "pw_spi_mcuxpresso/",
118    target_compatible_with = incompatible_with_mcu(),
119)
120