Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 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 | |
| 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
Armando Montanez | a398cd1 | 2021-12-13 10:57:41 -0800 | [diff] [blame] | 17 | import("$dir_pw_build/module_config.gni") |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 18 | import("$dir_pw_build/target_types.gni") |
| 19 | import("$dir_pw_docgen/docs.gni") |
Wyatt Hepler | 70a6210 | 2022-02-11 15:14:35 -0800 | [diff] [blame] | 20 | import("$dir_pw_third_party/stm32cube/stm32cube.gni") |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 21 | |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 22 | declare_args() { |
Armando Montanez | a398cd1 | 2021-12-13 10:57:41 -0800 | [diff] [blame] | 23 | # The build target that overrides the default configuration options for this |
| 24 | # module. This should point to a source set that provides defines through a |
| 25 | # public config (which may -include a file or add defines directly). |
| 26 | pw_sys_io_stm32cube_CONFIG = pw_build_DEFAULT_MODULE_CONFIG |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | config("public_includes") { |
| 30 | include_dirs = [ "public" ] |
| 31 | } |
| 32 | |
Armando Montanez | a398cd1 | 2021-12-13 10:57:41 -0800 | [diff] [blame] | 33 | pw_source_set("config") { |
| 34 | public_deps = [ pw_sys_io_stm32cube_CONFIG ] |
| 35 | public = [ "pw_sys_io_stm32cube_private/config.h" ] |
| 36 | visibility = [ ":*" ] |
| 37 | } |
| 38 | |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 39 | pw_source_set("pw_sys_io_stm32cube") { |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 40 | public_configs = [ ":public_includes" ] |
| 41 | public_deps = [ |
| 42 | "$dir_pw_preprocessor", |
| 43 | "$dir_pw_status", |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 44 | ] |
Wyatt Hepler | 70a6210 | 2022-02-11 15:14:35 -0800 | [diff] [blame] | 45 | if (dir_pw_third_party_stm32cube != "") { |
| 46 | public_deps += [ "$dir_pw_third_party/stm32cube" ] |
| 47 | } |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 48 | public = [ "public/pw_sys_io_stm32cube/init.h" ] |
| 49 | sources = [ "sys_io.cc" ] |
| 50 | deps = [ |
Armando Montanez | a398cd1 | 2021-12-13 10:57:41 -0800 | [diff] [blame] | 51 | ":config", |
Armando Montanez | 70045e2 | 2021-12-08 15:44:08 -0800 | [diff] [blame] | 52 | "$dir_pw_sys_io:default_putget_bytes", |
| 53 | "$dir_pw_sys_io:facade", |
| 54 | ] |
| 55 | } |
Armando Montanez | a398cd1 | 2021-12-13 10:57:41 -0800 | [diff] [blame] | 56 | |
| 57 | pw_doc_group("docs") { |
| 58 | sources = [ "docs.rst" ] |
| 59 | } |