Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed Aug 6, 2021
2 parents 226a206 + cb3164a commit 5fb8913
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 14 deletions.
3 changes: 2 additions & 1 deletion include/depthai-shared/common/ProcessorType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
#include <nlohmann/json.hpp>

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
2 changes: 1 addition & 1 deletion include/depthai-shared/properties/MyProducerProperties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
36 changes: 36 additions & 0 deletions include/depthai-shared/properties/SPIInProperties.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma once

#include <nlohmann/json.hpp>

#include "depthai-shared/xlink/XLinkConstants.hpp"

namespace dai {

/**
* Properties for SPIIn node
*/
struct SPIInProperties {
/**
* Name of stream
*/
std::string streamName;

/**
* SPI bus to use
*/
int busId = 0;

/**
* 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, maxDataSize, numFrames);

} // namespace dai
20 changes: 8 additions & 12 deletions include/depthai-shared/properties/SPIOutProperties.hpp
Original file line number Diff line number Diff line change
@@ -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 <nlohmann/json.hpp>
Expand All @@ -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);
Expand Down
31 changes: 31 additions & 0 deletions include/depthai-shared/properties/ScriptProperties.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include <depthai-shared/common/ProcessorType.hpp>
#include <depthai-shared/common/optional.hpp>
#include <nlohmann/json.hpp>

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 = "<script>";

/**
* Which processor should execute the script
*/
ProcessorType processor = ProcessorType::LEON_MSS;
};

NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(ScriptProperties, scriptUri, scriptName, processor);

} // namespace dai

0 comments on commit 5fb8913

Please sign in to comment.