rogue
Loading...
Searching...
No Matches
SrpV0.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_PROTOCOLS_SRP_SRPV0_H__
18#define __ROGUE_PROTOCOLS_SRP_SRPV0_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22
23#include <memory>
24#include <thread>
25
26#include "rogue/Logging.h"
30
31namespace rogue {
32namespace protocols {
33namespace srp {
34
87 std::shared_ptr<rogue::Logging> log_;
88
89 static const uint32_t WrHeadLen = 8;
90 static const uint32_t RdHeadLen = 12;
91 static const uint32_t MaxHeadLen = 12;
92 static const uint32_t RxHeadLen = 8;
93 static const uint32_t TailLen = 4;
94
95 // Setup header, return write flag
96 bool setupHeader(std::shared_ptr<rogue::interfaces::memory::Transaction> tran,
97 uint32_t* header,
98 uint32_t& headerLen,
99 uint32_t& frameLen,
100 bool tx);
101
102 public:
113 static std::shared_ptr<rogue::protocols::srp::SrpV0> create();
114
116 static void setup_python();
117
125 SrpV0();
126
128 ~SrpV0();
129
140 void doTransaction(std::shared_ptr<rogue::interfaces::memory::Transaction> tran);
141
151 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
152};
153
154// Convenience
155typedef std::shared_ptr<rogue::protocols::srp::SrpV0> SrpV0Ptr;
156} // namespace srp
157} // namespace protocols
158} // namespace rogue
159#endif
Memory slave device.
Definition Slave.h:54
Stream master endpoint.
Definition Master.h:65
Stream slave endpoint and default frame pool.
Definition Slave.h:72
SRP v0 bridge between Rogue memory transactions and stream frames.
Definition SrpV0.h:86
static void setup_python()
Registers Python bindings for this class.
Definition SrpV0.cpp:56
static std::shared_ptr< rogue::protocols::srp::SrpV0 > create()
Creates an SRP v0 interface instance.
Definition SrpV0.cpp:50
void doTransaction(std::shared_ptr< rogue::interfaces::memory::Transaction > tran)
Processes a memory transaction and emits SRP v0 request frame(s).
Definition SrpV0.cpp:103
void acceptFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Accepts an incoming SRP v0 response frame.
Definition SrpV0.cpp:175
~SrpV0()
Destroys the SRP v0 interface instance.
Definition SrpV0.cpp:71
SrpV0()
Constructs an SRP v0 interface instance.
Definition SrpV0.cpp:66
std::shared_ptr< rogue::protocols::srp::SrpV0 > SrpV0Ptr
Definition SrpV0.h:155