Add an example to read VBUS and VSYS (#331)
The process is different on Pico and Pico W so demonstrate how to do it. Fixes #324
This commit is contained in:
30
adc/read_vsys/CMakeLists.txt
Normal file
30
adc/read_vsys/CMakeLists.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
add_library(power_status_adc INTERFACE)
|
||||
target_sources(power_status_adc INTERFACE
|
||||
${CMAKE_CURRENT_LIST_DIR}/power_status.c
|
||||
)
|
||||
target_include_directories(power_status_adc INTERFACE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
target_link_libraries(power_status_adc INTERFACE
|
||||
hardware_adc
|
||||
hardware_gpio
|
||||
)
|
||||
|
||||
add_executable(read_vsys
|
||||
read_vsys.c
|
||||
)
|
||||
target_include_directories(read_vsys PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
target_link_libraries(read_vsys
|
||||
pico_stdlib
|
||||
power_status_adc
|
||||
)
|
||||
if (PICO_CYW43_SUPPORTED)
|
||||
target_link_libraries(read_vsys
|
||||
pico_cyw43_arch_none
|
||||
)
|
||||
endif()
|
||||
|
||||
pico_add_extra_outputs(read_vsys)
|
||||
example_auto_set_url(read_vsys)
|
||||
Reference in New Issue
Block a user