1# Copyright 2024 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", "incompatible_with_mcu") 18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24log_defines = [ 25 "PW_LOG_MODULE_NAME=\\\"UART\\\"", 26 "PW_LOG_LEVEL=PW_LOG_LEVEL_ERROR", 27] 28 29cc_library( 30 name = "dma_uart", 31 srcs = ["dma_uart.cc"], 32 hdrs = ["public/pw_uart_mcuxpresso/dma_uart.h"], 33 implementation_deps = ["//pw_assert:check"], 34 local_defines = log_defines, 35 strip_include_prefix = "public", 36 target_compatible_with = [ 37 "//pw_build/constraints/board:mimxrt595_evk", 38 ], 39 deps = [ 40 "//pw_clock_tree", 41 "//pw_dma_mcuxpresso", 42 "//pw_preprocessor", 43 "//pw_sync:interrupt_spin_lock", 44 "//pw_sync:timed_thread_notification", 45 "//pw_uart:uart", 46 "//targets:mcuxpresso_sdk", 47 ], 48) 49 50pw_cc_test( 51 name = "dma_uart_example", 52 srcs = ["dma_uart_example.cc"], 53 target_compatible_with = [ 54 "//pw_build/constraints/board:mimxrt595_evk", 55 ], 56 deps = [":dma_uart"], 57) 58 59cc_library( 60 name = "dma_uart_nonblocking", 61 srcs = ["dma_uart_nonblocking.cc"], 62 hdrs = ["public/pw_uart_mcuxpresso/dma_uart_nonblocking.h"], 63 implementation_deps = ["//pw_assert:check"], 64 local_defines = log_defines, 65 strip_include_prefix = "public", 66 target_compatible_with = [ 67 "//pw_build/constraints/board:mimxrt595_evk", 68 ], 69 deps = [ 70 "//pw_clock_tree", 71 "//pw_dma_mcuxpresso", 72 "//pw_log", 73 "//pw_preprocessor", 74 "//pw_sync:interrupt_spin_lock", 75 "//pw_uart:uart_non_blocking", 76 "//targets:mcuxpresso_sdk", 77 ], 78) 79 80pw_cc_test( 81 name = "dma_uart_nonblocking_example", 82 srcs = ["dma_uart_nonblocking_example.cc"], 83 target_compatible_with = [ 84 "//pw_build/constraints/board:mimxrt595_evk", 85 ], 86 deps = [ 87 ":dma_uart_nonblocking", 88 "//pw_uart:blocking_adapter", 89 ], 90) 91 92sphinx_docs_library( 93 name = "docs", 94 srcs = [ 95 "dma_uart_example.cc", 96 "dma_uart_nonblocking_example.cc", 97 "docs.rst", 98 ], 99 prefix = "pw_uart_mcuxpresso/", 100 target_compatible_with = incompatible_with_mcu(), 101) 102