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
91 std::shared_ptr<rogue::Logging> log_;
92
93 static const uint32_t WrHeadLen = 8;
94 static const uint32_t RdHeadLen = 12;
95 static const uint32_t MaxHeadLen = 12;
96 static const uint32_t RxHeadLen = 8;
97 static const uint32_t TailLen = 4;
98
99 // Setup header, return write flag
100 bool setupHeader(std::shared_ptr<rogue::interfaces::memory::Transaction> tran,
101 uint32_t* header,
102 uint32_t& headerLen,
103 uint32_t& frameLen,
104 bool tx);
105
106 public:
117 static std::shared_ptr<rogue::protocols::srp::SrpV0> create();
118
120 static void setup_python();
121
129 SrpV0();
130
132 ~SrpV0();
133
144 void doTransaction(std::shared_ptr<rogue::interfaces::memory::Transaction> tran);
145
155 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
156};
157
158// Convenience
159typedef std::shared_ptr<rogue::protocols::srp::SrpV0> SrpV0Ptr;
160} // namespace srp
161} // namespace protocols
162} // namespace rogue
163#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:90
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:179
~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:159