-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
251f74b
commit 28b923a
Showing
20 changed files
with
1,428 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
add_subdirectory(helpers) | ||
add_subdirectory(digitizers) | ||
|
||
if (ENABLE_PICOSCOPE) | ||
add_subdirectory(picoscope4000a) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# setup header only library | ||
add_library(gr-helpers INTERFACE) | ||
|
||
set(HELPERS_HEADERS | ||
helper_blocks.h | ||
) | ||
|
||
target_include_directories(gr-helpers INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/>) | ||
|
||
target_link_libraries(gr-helpers INTERFACE graph-prototype) | ||
set_target_properties(gr-helpers PROPERTIES PUBLIC_HEADER "${HELPERS_HEADERS}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#ifndef GR_HELPERS_HELPER_BLOCKS_H | ||
#define GR_HELPERS_HELPER_BLOCKS_H | ||
|
||
#include <node.hpp> | ||
|
||
/** | ||
* TRANSITIONAL: some simple helpers blocks for tests, should go upstream or | ||
* replaced by upstream blocks. | ||
*/ | ||
namespace gr::helpers { | ||
|
||
template <typename T> | ||
struct vector_source : public fair::graph::node<vector_source<T>> { | ||
fair::graph::OUT<T> out; | ||
|
||
std::vector<T> data; | ||
std::size_t _produced = 0; | ||
|
||
explicit vector_source(std::vector<T> data_) : data{ std::move(data_) } {} | ||
|
||
constexpr std::make_signed_t<std::size_t> | ||
available_samples(const vector_source&) noexcept | ||
{ | ||
const auto v = | ||
static_cast<std::make_signed_t<std::size_t>>(data.size()) - _produced; | ||
return v > 0 ? v : -1; | ||
} | ||
|
||
T process_one() noexcept | ||
{ | ||
const auto n = _produced; | ||
_produced++; | ||
return data[n]; | ||
} | ||
}; | ||
|
||
template <typename T> | ||
struct vector_sink : public fair::graph::node<vector_sink<T>> { | ||
fair::graph::IN<T> in; | ||
std::vector<T> data; | ||
|
||
fair::graph::work_return_status_t process_bulk(std::span<const T> input) { | ||
std::cout << "Hello " << input.size() << std::endl; | ||
data.insert(data.end(), input.begin(), input.end()); | ||
return fair::graph::work_return_status_t::OK; | ||
} | ||
}; | ||
|
||
template <typename T> | ||
struct null_sink : public fair::graph::node<null_sink<T>> { | ||
fair::graph::IN<T> in; | ||
|
||
fair::graph::work_return_status_t process_bulk(std::span<const T>) const noexcept { | ||
return fair::graph::work_return_status_t::OK; | ||
} | ||
}; | ||
|
||
} | ||
|
||
ENABLE_REFLECTION_FOR_TEMPLATE(gr::helpers::vector_source, out, data); | ||
ENABLE_REFLECTION_FOR_TEMPLATE(gr::helpers::vector_sink, in, data); | ||
ENABLE_REFLECTION_FOR_TEMPLATE(gr::helpers::null_sink, in); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
set(PICOSCOPE4000A_SOURCES | ||
picoscope4000a.cc | ||
) | ||
|
||
set(PICOSCOPE4000A_HEADERS | ||
picoscope4000a.h | ||
) | ||
|
||
# TODO do not hardcode | ||
add_library(ps4000a SHARED IMPORTED) | ||
set_property(TARGET ps4000a PROPERTY | ||
IMPORTED_LOCATION ${PICOSCOPE_PREFIX}/lib/libps4000a.so) | ||
target_include_directories(ps4000a INTERFACE ${PICOSCOPE_PREFIX}/include/libps4000a ${PICOSCOPE_PREFIX}/include/libps5000a) # TODO PicoCallback.h is missing in libps4000a/ | ||
|
||
add_library(gr-picoscope4000a SHARED ${PICOSCOPE4000A_SOURCES}) | ||
target_include_directories(gr-picoscope4000a INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/>) | ||
|
||
target_link_libraries(gr-picoscope4000a ps4000a gr-helpers graph-prototype volk refl-cpp fmt) | ||
set_target_properties(gr-digitizers PROPERTIES PUBLIC_HEADER "${PICOSCOPE4000A_HEADERS}") | ||
|
||
if (ENABLE_TESTING) | ||
add_subdirectory(test) | ||
endif () |
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
blocklib/picoscope4000a/include/gnuradio/picoscope4000a/meson.build
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.