From 4ffdf4f8a5a972f569da1642a2c8f414df6739cc Mon Sep 17 00:00:00 2001 From: Jon Ngai Date: Wed, 28 Apr 2021 14:10:51 -0600 Subject: [PATCH 1/5] Changes to get SPIIn working (WIP) --- .../properties/SPIInProperties.hpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/depthai-shared/properties/SPIInProperties.hpp diff --git a/include/depthai-shared/properties/SPIInProperties.hpp b/include/depthai-shared/properties/SPIInProperties.hpp new file mode 100644 index 00000000..e916d162 --- /dev/null +++ b/include/depthai-shared/properties/SPIInProperties.hpp @@ -0,0 +1,28 @@ +// To parse this JSON data, first install +// +// Boost http://www.boost.org +// json.hpp https://github.com/nlohmann/json +// +// Then include this file, and then do +// +// SPIInProperties.hpp data = nlohmann::json::parse(jsonString); + +#pragma once + +#include + +namespace dai { + +/** + * Properties for SPIIn node + */ +struct SPIInProperties { + /// Output stream name + std::string streamName; + /// SPI bus to use + int busId; +}; + +NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SPIInProperties, streamName, busId); + +} // namespace dai From 9de02dfe5bdaee01362ce72bf41516b6b7fcbe1a Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Fri, 23 Jul 2021 01:22:56 +0200 Subject: [PATCH 2/5] Updated SPIIn properties --- .../properties/SPIInProperties.hpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/include/depthai-shared/properties/SPIInProperties.hpp b/include/depthai-shared/properties/SPIInProperties.hpp index e916d162..fb972953 100644 --- a/include/depthai-shared/properties/SPIInProperties.hpp +++ b/include/depthai-shared/properties/SPIInProperties.hpp @@ -17,10 +17,25 @@ namespace dai { * Properties for SPIIn node */ struct SPIInProperties { - /// Output stream name + /** + * Name of stream + */ std::string streamName; - /// SPI bus to use + + /** + * SPI bus to use + */ int busId; + + /** + * Maximum input data size + */ + std::uint32_t maxDataSize = dai::XLINK_USB_BUFFER_MAX_SIZE; + + /** + * Number of frames in pool + */ + std::uint32_t numFrames = 4; }; NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SPIInProperties, streamName, busId); From d9319e928cf083fdfdc3c165cce2d189fe8a60cf Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Fri, 23 Jul 2021 01:34:49 +0200 Subject: [PATCH 3/5] Fix includes in SPIInProperties.hpp --- .../depthai-shared/properties/SPIInProperties.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/include/depthai-shared/properties/SPIInProperties.hpp b/include/depthai-shared/properties/SPIInProperties.hpp index fb972953..b9f5c666 100644 --- a/include/depthai-shared/properties/SPIInProperties.hpp +++ b/include/depthai-shared/properties/SPIInProperties.hpp @@ -1,16 +1,9 @@ -// To parse this JSON data, first install -// -// Boost http://www.boost.org -// json.hpp https://github.com/nlohmann/json -// -// Then include this file, and then do -// -// SPIInProperties.hpp data = nlohmann::json::parse(jsonString); - #pragma once #include +#include "depthai-shared/xlink/XLinkConstants.hpp" + namespace dai { /** @@ -38,6 +31,6 @@ struct SPIInProperties { std::uint32_t numFrames = 4; }; -NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SPIInProperties, streamName, busId); +NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SPIInProperties, streamName, busId, maxDataSize, numFrames); } // namespace dai From 56af34b0ee3d132dd2d5f006ac30a554e6786f65 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Fri, 23 Jul 2021 13:38:32 +0200 Subject: [PATCH 4/5] Modified SPIIn and SPIOut properties --- .../properties/SPIInProperties.hpp | 2 +- .../properties/SPIOutProperties.hpp | 20 ++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/include/depthai-shared/properties/SPIInProperties.hpp b/include/depthai-shared/properties/SPIInProperties.hpp index b9f5c666..0795ba59 100644 --- a/include/depthai-shared/properties/SPIInProperties.hpp +++ b/include/depthai-shared/properties/SPIInProperties.hpp @@ -18,7 +18,7 @@ struct SPIInProperties { /** * SPI bus to use */ - int busId; + int busId = 0; /** * Maximum input data size diff --git a/include/depthai-shared/properties/SPIOutProperties.hpp b/include/depthai-shared/properties/SPIOutProperties.hpp index cf33fa12..69f24ccf 100644 --- a/include/depthai-shared/properties/SPIOutProperties.hpp +++ b/include/depthai-shared/properties/SPIOutProperties.hpp @@ -1,12 +1,3 @@ -// To parse this JSON data, first install -// -// Boost http://www.boost.org -// json.hpp https://github.com/nlohmann/json -// -// Then include this file, and then do -// -// SPIOutProperties.hpp data = nlohmann::json::parse(jsonString); - #pragma once #include @@ -17,10 +8,15 @@ namespace dai { * Specify properties for SPIOut node */ struct SPIOutProperties { - /// Output stream name + /** + * Name of stream + */ std::string streamName; - /// SPI bus to use - int busId; + + /** + * SPI bus to use + */ + int busId = 0; }; NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SPIOutProperties, streamName, busId); From cb3164a3a41e013cd8841eb90e4898276c3517fc Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Fri, 23 Jul 2021 20:23:34 +0200 Subject: [PATCH 5/5] Squashed and merged gen2_scripting branch --- .../depthai-shared/common/ProcessorType.hpp | 3 +- .../properties/MyProducerProperties.hpp | 2 +- .../properties/ScriptProperties.hpp | 31 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 include/depthai-shared/properties/ScriptProperties.hpp diff --git a/include/depthai-shared/common/ProcessorType.hpp b/include/depthai-shared/common/ProcessorType.hpp index 3c2524cf..4c8d36d1 100644 --- a/include/depthai-shared/common/ProcessorType.hpp +++ b/include/depthai-shared/common/ProcessorType.hpp @@ -3,11 +3,12 @@ #include namespace dai { + /** * On which processor the node will be placed * * Enum specifying processor */ -enum class ProcessorType : int32_t { LOS, LRT }; +enum class ProcessorType : int32_t { LEON_CSS, LEON_MSS }; } // namespace dai \ No newline at end of file diff --git a/include/depthai-shared/properties/MyProducerProperties.hpp b/include/depthai-shared/properties/MyProducerProperties.hpp index 7f3e6bf1..9a467fc2 100644 --- a/include/depthai-shared/properties/MyProducerProperties.hpp +++ b/include/depthai-shared/properties/MyProducerProperties.hpp @@ -19,7 +19,7 @@ struct MyProducerProperties { /** * On which processor the node will be placed */ - ProcessorType processorPlacement = ProcessorType::LOS; + ProcessorType processorPlacement = ProcessorType::LEON_CSS; }; NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(MyProducerProperties, message, processorPlacement); diff --git a/include/depthai-shared/properties/ScriptProperties.hpp b/include/depthai-shared/properties/ScriptProperties.hpp new file mode 100644 index 00000000..eaca324a --- /dev/null +++ b/include/depthai-shared/properties/ScriptProperties.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include +#include +#include + +namespace dai { + +/** + * Specify ScriptProperties options such as script uri, script name, ... + */ +struct ScriptProperties { + /** + * Uri which points to actual script + */ + std::string scriptUri = ""; + + /** + * Name of script + */ + std::string scriptName = "