• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("@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
24cc_library(
25    name = "analog_input",
26    hdrs = [
27        "public/pw_analog/analog_input.h",
28    ],
29    strip_include_prefix = "public",
30    deps = [
31        "//pw_chrono:system_clock",
32        "//pw_result",
33    ],
34)
35
36cc_library(
37    name = "microvolt_input",
38    hdrs = [
39        "public/pw_analog/microvolt_input.h",
40    ],
41    strip_include_prefix = "public",
42    deps = [
43        ":analog_input",
44        "//pw_chrono:system_clock",
45        "//pw_result",
46        "//pw_status",
47    ],
48)
49
50cc_library(
51    name = "microvolt_input_gmock",
52    testonly = True,
53    hdrs = [
54        "public/pw_analog/microvolt_input_gmock.h",
55    ],
56    strip_include_prefix = "public",
57    # TODO: b/310957361 - gtest not supported on device
58    target_compatible_with = incompatible_with_mcu(),
59    deps = [
60        ":microvolt_input",
61        "@com_google_googletest//:gtest",
62    ],
63)
64
65cc_library(
66    name = "analog_input_gmock",
67    testonly = True,
68    hdrs = [
69        "public/pw_analog/analog_input_gmock.h",
70    ],
71    strip_include_prefix = "public",
72    # TODO: b/310957361 - gtest not supported on device
73    target_compatible_with = incompatible_with_mcu(),
74    deps = [
75        ":analog_input",
76        "@com_google_googletest//:gtest",
77    ],
78)
79
80pw_cc_test(
81    name = "analog_input_test",
82    srcs = [
83        "analog_input_test.cc",
84    ],
85    deps = [":analog_input"],
86)
87
88pw_cc_test(
89    name = "microvolt_input_test",
90    srcs = [
91        "microvolt_input_test.cc",
92    ],
93    deps = [":microvolt_input"],
94)
95
96sphinx_docs_library(
97    name = "docs",
98    srcs = [
99        "docs.rst",
100        # These header files must be provided to Sphinx because
101        # some of their code is directly included in docs.rst.
102        "public/pw_analog/analog_input_gmock.h",
103        "public/pw_analog/microvolt_input_gmock.h",
104    ],
105    prefix = "pw_analog/",
106    target_compatible_with = incompatible_with_mcu(),
107)
108
109filegroup(
110    name = "doxygen",
111    srcs = [
112        "public/pw_analog/analog_input.h",
113        "public/pw_analog/microvolt_input.h",
114    ],
115)
116