diff --git a/src/common/pico_util/BUILD.bazel b/src/common/pico_util/BUILD.bazel index d1e73c0c..a7a70c4a 100644 --- a/src/common/pico_util/BUILD.bazel +++ b/src/common/pico_util/BUILD.bazel @@ -11,6 +11,7 @@ cc_library( "queue.c", ], hdrs = [ + "include/pico/util/bitset.h", "include/pico/util/datetime.h", "include/pico/util/pheap.h", "include/pico/util/queue.h", diff --git a/src/rp2_common/hardware_rosc/BUILD.bazel b/src/rp2_common/hardware_rosc/BUILD.bazel new file mode 100644 index 00000000..2da676ae --- /dev/null +++ b/src/rp2_common/hardware_rosc/BUILD.bazel @@ -0,0 +1,19 @@ +load("//bazel:defs.bzl", "compatible_with_rp2") + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "hardware_rosc", + srcs = ["rosc.c"], + hdrs = ["include/hardware/rosc.h"], + includes = ["include"], + target_compatible_with = compatible_with_rp2(), + deps = [ + "//src/common/pico_base_headers", + "//src/rp2_common:hardware_regs", + "//src/rp2_common:hardware_structs", + "//src/rp2_common:pico_platform_internal", + "//src/rp2_common:platform_defs", + "//src/rp2_common/hardware_clocks:hardware_clocks_headers", + ], +) diff --git a/src/rp2_common/hardware_rosc/CMakeLists.txt b/src/rp2_common/hardware_rosc/CMakeLists.txt index 3ee667e2..83a6c373 100644 --- a/src/rp2_common/hardware_rosc/CMakeLists.txt +++ b/src/rp2_common/hardware_rosc/CMakeLists.txt @@ -1 +1,2 @@ -pico_simple_hardware_target(rosc) \ No newline at end of file +pico_simple_hardware_target(rosc) +pico_mirrored_target_link_libraries(hardware_rosc INTERFACE hardware_clocks) diff --git a/src/rp2_common/pico_low_power/BUILD.bazel b/src/rp2_common/pico_low_power/BUILD.bazel new file mode 100644 index 00000000..275fd75d --- /dev/null +++ b/src/rp2_common/pico_low_power/BUILD.bazel @@ -0,0 +1,22 @@ +load("//bazel:defs.bzl", "compatible_with_rp2") + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "pico_low_power", + srcs = ["low_power.c"], + hdrs = ["include/pico/low_power.h"], + includes = ["include"], + target_compatible_with = compatible_with_rp2(), + deps = [ + "//src/common/pico_time", + "//src/rp2_common:hardware_structs", + "//src/rp2_common:pico_platform", + "//src/rp2_common/hardware_clocks", + "//src/rp2_common/hardware_rosc", + "//src/rp2_common/hardware_xosc", + "//src/rp2_common/hardware_irq", + "//src/rp2_common/hardware_timer", + "//src/rp2_common/pico_aon_timer", + ], +) diff --git a/src/rp2_common/pico_low_power/CMakeLists.txt b/src/rp2_common/pico_low_power/CMakeLists.txt index 848a0413..cee328a5 100644 --- a/src/rp2_common/pico_low_power/CMakeLists.txt +++ b/src/rp2_common/pico_low_power/CMakeLists.txt @@ -17,6 +17,17 @@ pico_mirrored_target_link_libraries(pico_low_power INTERFACE pico_aon_timer ) +# pico_set_persistent_data_loc(TARGET PERSISTENT_DATA_LOC) +# \brief\ Set the persistent data location for the target +# +# This sets the target property PICO_TARGET_PERSISTENT_DATA_LOC to the given value, +# and also sets the target property PICO_TARGET_HEAP_LOC and PICO_TARGET_HEAP_LIMIT +# to the appropriate values based on the persistent data location. +# +# It also sets PICO_CRT0_PIN_XIP_SRAM=1 to pin the XIP_SRAM, +# if the persistent data is stored in XIP_SRAM on RP2350. +# +# \param\ PERSISTENT_DATA_LOC The persistent data location to set function(pico_set_persistent_data_loc TARGET PERSISTENT_DATA_LOC) if (NOT PICO_RP2350) message(FATAL_ERROR "pico_set_persistent_data_loc is only supported on RP2350") diff --git a/src/rp2_common/pico_standard_link/CMakeLists.txt b/src/rp2_common/pico_standard_link/CMakeLists.txt index 53cad553..6b37c6ef 100644 --- a/src/rp2_common/pico_standard_link/CMakeLists.txt +++ b/src/rp2_common/pico_standard_link/CMakeLists.txt @@ -61,6 +61,12 @@ if (NOT TARGET pico_standard_link) endif() endfunction() + # pico_add_linker_constants(TARGET) + # \brief\ Add custom linker script constants to the target + # + # This reads target properties PICO_TARGET_PERSISTENT_DATA_LOC, PICO_TARGET_HEAP_LOC, + # and PICO_TARGET_HEAP_LIMIT and writes them to a linker script constant file, which + # is included by the linker script function(pico_add_linker_constants TARGET) set(pico_ld_constants_dir ${CMAKE_BINARY_DIR}/pico_ld_constants/${TARGET}) diff --git a/test/hello_sleep/BUILD.bazel b/test/hello_sleep/BUILD.bazel new file mode 100644 index 00000000..a2607342 --- /dev/null +++ b/test/hello_sleep/BUILD.bazel @@ -0,0 +1,38 @@ +load("//bazel:defs.bzl", "compatible_with_rp2") + +package(default_visibility = ["//visibility:public"]) + +cc_binary( + name = "hello_sleep", + testonly = True, + srcs = ["hello_sleep.c"], + target_compatible_with = compatible_with_rp2(), + deps = [ + "//src/rp2_common/pico_stdlib", + "//src/rp2_common/pico_low_power", + "//src/rp2_common/pico_status_led", + ], +) + +cc_binary( + name = "hello_sleep_gpio", + testonly = True, + srcs = ["hello_sleep_gpio.c"], + target_compatible_with = compatible_with_rp2(), + deps = [ + "//src/rp2_common/pico_stdlib", + "//src/rp2_common/pico_low_power", + "//src/rp2_common/pico_status_led", + ], +) + +cc_binary( + name = "rtc_clksrc", + testonly = True, + srcs = ["rtc_clksrc.c"], + target_compatible_with = compatible_with_rp2(), + deps = [ + "//src/rp2_common/pico_stdlib", + "//src/rp2_common/pico_status_led", + ], +) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 60eb5dd3..6849c177 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -486,7 +486,7 @@ function(pico_embed_pt_in_binary TARGET PTFILE) ) endfunction() -# pico_encrypt_binary(TARGET AESFILE IVFILE [SIGFILE ] [EMBED] [MBEDTLS] [OTP_KEY_PAGE ]) +# pico_encrypt_binary(TARGET AESFILE IVFILE [SIGFILE ] [EMBED] [MBEDTLS] [OTP_KEY_PAGE ] [NO_CLEAR]) # \brief_nodesc\ Encrypt the taget binary # # Encrypt the target binary with the given AES key (should be a binary