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 = "pw_stream_uart_mcuxpresso", 30 srcs = ["stream.cc"], 31 hdrs = ["public/pw_stream_uart_mcuxpresso/stream.h"], 32 strip_include_prefix = "public", 33 target_compatible_with = [ 34 ":compatible", 35 ], 36 deps = [ 37 "//pw_clock_tree", 38 "//pw_preprocessor", 39 "//pw_stream", 40 "//targets:mcuxpresso_sdk", 41 ], 42) 43 44cc_library( 45 name = "interrupt_safe_writer", 46 srcs = ["interrupt_safe_writer.cc"], 47 hdrs = ["public/pw_stream_uart_mcuxpresso/interrupt_safe_writer.h"], 48 strip_include_prefix = "public", 49 target_compatible_with = [ 50 ":compatible", 51 ], 52 deps = [ 53 "//pw_clock_tree", 54 "//pw_status", 55 "//pw_stream", 56 "//targets:mcuxpresso_sdk", 57 ], 58) 59 60pw_cc_test( 61 name = "stream_test", 62 srcs = ["stream_test.cc"], 63 target_compatible_with = [ 64 ":compatible", 65 ], 66 deps = [":pw_stream_uart_mcuxpresso"], 67) 68 69pw_cc_test( 70 name = "stream_example", 71 srcs = ["stream_example.cc"], 72 target_compatible_with = [ 73 ":compatible", 74 ], 75 deps = [":pw_stream_uart_mcuxpresso"], 76) 77 78pw_cc_test( 79 name = "interrupt_safe_writer_example", 80 srcs = ["interrupt_safe_writer_example.cc"], 81 target_compatible_with = [ 82 ":compatible", 83 ], 84 deps = [ 85 ":interrupt_safe_writer", 86 ], 87) 88 89sphinx_docs_library( 90 name = "docs", 91 srcs = [ 92 "docs.rst", 93 "interrupt_safe_writer_example.cc", 94 "stream_example.cc", 95 ], 96 prefix = "pw_stream_uart_mcuxpresso/", 97 target_compatible_with = incompatible_with_mcu(), 98) 99