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", "incompatible_with_mcu") 18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 19 20package( 21 default_visibility = ["//visibility:public"], 22 features = ["-layering_check"], 23) 24 25licenses(["notice"]) 26 27cc_library( 28 name = "initiator", 29 srcs = [ 30 "initiator.cc", 31 ], 32 hdrs = [ 33 "public/pw_i2c_linux/initiator.h", 34 ], 35 implementation_deps = ["//pw_assert:check"], 36 strip_include_prefix = "public", 37 target_compatible_with = ["@platforms//os:linux"], 38 deps = [ 39 "//pw_bytes", 40 "//pw_chrono:system_clock", 41 "//pw_i2c:address", 42 "//pw_i2c:initiator", 43 "//pw_log", 44 "//pw_status", 45 "//pw_sync:lock_annotations", 46 "//pw_sync:timed_mutex", 47 ], 48) 49 50pw_cc_test( 51 name = "initiator_test", 52 srcs = [ 53 "initiator_test.cc", 54 ], 55 deps = [ 56 ":initiator", 57 "//pw_i2c:initiator", 58 ], 59) 60 61filegroup( 62 name = "doxygen", 63 srcs = [ 64 "public/pw_i2c_linux/initiator.h", 65 ], 66) 67 68sphinx_docs_library( 69 name = "docs", 70 srcs = [ 71 "docs.rst", 72 ], 73 prefix = "pw_i2c_linux/", 74 target_compatible_with = incompatible_with_mcu(), 75) 76