USRP Hardware Driver and USRP Manual Version: 4.1.0.1
UHD and USRP Manual
replay_block_control.hpp
Go to the documentation of this file.
1//
2// Copyright 2020 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#pragma once
8
9#include <uhd/config.hpp>
11
12namespace uhd { namespace rfnoc {
13
43{
44public:
46
47 static const uint16_t MINOR_COMPAT;
48 static const uint16_t MAJOR_COMPAT;
49
50 static const uint32_t REPLAY_ADDR_W;
51 static const uint32_t REPLAY_BLOCK_OFFSET;
52
53 static const uint32_t REG_COMPAT_ADDR;
54 static const uint32_t REG_MEM_SIZE_ADDR;
55 static const uint32_t REG_REC_RESTART_ADDR;
56 static const uint32_t REG_REC_BASE_ADDR_LO_ADDR;
57 static const uint32_t REG_REC_BASE_ADDR_HI_ADDR;
58 static const uint32_t REG_REC_BUFFER_SIZE_LO_ADDR;
59 static const uint32_t REG_REC_BUFFER_SIZE_HI_ADDR;
60 static const uint32_t REG_REC_FULLNESS_LO_ADDR;
61 static const uint32_t REG_REC_FULLNESS_HI_ADDR;
62 static const uint32_t REG_PLAY_BASE_ADDR_LO_ADDR;
63 static const uint32_t REG_PLAY_BASE_ADDR_HI_ADDR;
64 static const uint32_t REG_PLAY_BUFFER_SIZE_LO_ADDR;
65 static const uint32_t REG_PLAY_BUFFER_SIZE_HI_ADDR;
66 static const uint32_t REG_PLAY_CMD_NUM_WORDS_LO_ADDR;
67 static const uint32_t REG_PLAY_CMD_NUM_WORDS_HI_ADDR;
68 static const uint32_t REG_PLAY_CMD_TIME_LO_ADDR;
69 static const uint32_t REG_PLAY_CMD_TIME_HI_ADDR;
70 static const uint32_t REG_PLAY_CMD_ADDR;
71 static const uint32_t REG_PLAY_WORDS_PER_PKT_ADDR;
72 static const uint32_t REG_PLAY_ITEM_SIZE_ADDR;
73
74 static const uint32_t PLAY_CMD_STOP;
75 static const uint32_t PLAY_CMD_FINITE;
76 static const uint32_t PLAY_CMD_CONTINUOUS;
77
78 /**************************************************************************
79 * Replay Control API calls
80 *************************************************************************/
96 virtual void record(
97 const uint64_t offset, const uint64_t size, const size_t port = 0) = 0;
98
103 virtual void record_restart(const size_t port = 0) = 0;
104
127 virtual void play(const uint64_t offset,
128 const uint64_t size,
129 const size_t port = 0,
130 const uhd::time_spec_t time_spec = uhd::time_spec_t(0.0),
131 const bool repeat = false) = 0;
132
140 virtual void stop(const size_t port = 0) = 0;
141
149 virtual uint64_t get_mem_size() const = 0;
150
155 virtual uint64_t get_word_size() const = 0;
156
157 /**************************************************************************
158 * Record State API calls
159 *************************************************************************/
165 virtual uint64_t get_record_offset(const size_t port = 0) const = 0;
166
172 virtual uint64_t get_record_size(const size_t port = 0) const = 0;
173
182 virtual uint64_t get_record_fullness(const size_t port = 0) = 0;
183
189 virtual io_type_t get_record_type(const size_t port = 0) const = 0;
190
196 virtual size_t get_record_item_size(const size_t port = 0) const = 0;
197
198 /**************************************************************************
199 * Playback State API calls
200 *************************************************************************/
206 virtual uint64_t get_play_offset(const size_t port = 0) const = 0;
207
213 virtual uint64_t get_play_size(const size_t port = 0) const = 0;
214
220 virtual uint32_t get_max_items_per_packet(const size_t port = 0) const = 0;
221
229 virtual uint32_t get_max_packet_size(const size_t port = 0) const = 0;
230
236 virtual io_type_t get_play_type(const size_t port = 0) const = 0;
237
243 virtual size_t get_play_item_size(const size_t port = 0) const = 0;
244
245 /**************************************************************************
246 * Advanced Record Control API calls
247 *************************************************************************/
255 virtual void set_record_type(const io_type_t type, const size_t port = 0) = 0;
256
257 /**************************************************************************
258 * Advanced Playback Control API calls
259 *************************************************************************/
273 virtual void config_play(
274 const uint64_t offset, const uint64_t size, const size_t port = 0) = 0;
275
283 virtual void set_play_type(const io_type_t type, const size_t port = 0) = 0;
284
294 virtual void set_max_items_per_packet(const uint32_t ipp, const size_t port = 0) = 0;
295
303 virtual void set_max_packet_size(const uint32_t size, const size_t port = 0) = 0;
304
320 virtual void issue_stream_cmd(
321 const uhd::stream_cmd_t& stream_cmd, const size_t port = 0) = 0;
322};
323
324}} /* namespace uhd::rfnoc */
Definition: noc_block_base.hpp:42
Definition: replay_block_control.hpp:43
Definition: time_spec.hpp:31
#define UHD_API
Definition: config.h:70
std::string io_type_t
Definition: defaults.hpp:32
Definition: build_info.hpp:12
#define RFNOC_DECLARE_BLOCK(CLASS_NAME)
Definition: noc_block_base.hpp:21
Definition: stream_cmd.hpp:40