aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2022-02-13 18:17:08 -0800
committerAaron Rossetto <aaron.rossetto@ni.com>2022-04-01 13:33:08 -0700
commitac5ddf9d0e2d110a9ead6eeadb38255b489af787 (patch)
tree325646705b734fc0af35ef77c10462d279edb928 /host/include
parent1545d3ff05f14b8dd175736b326fe6cae7dc830d (diff)
downloaduhd-ac5ddf9d0e2d110a9ead6eeadb38255b489af787.tar.gz
uhd-ac5ddf9d0e2d110a9ead6eeadb38255b489af787.tar.bz2
uhd-ac5ddf9d0e2d110a9ead6eeadb38255b489af787.zip
uhd: Replay block version 1.1
- Add ability to get current record position. - Add ability to get current play position. - Track space in play command FIFO and throw uhd::op_failed error when command requested would overflow the command FIFO. Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/replay_block_control.hpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/host/include/uhd/rfnoc/replay_block_control.hpp b/host/include/uhd/rfnoc/replay_block_control.hpp
index 615f6e294..ba8658a5c 100644
--- a/host/include/uhd/rfnoc/replay_block_control.hpp
+++ b/host/include/uhd/rfnoc/replay_block_control.hpp
@@ -139,6 +139,11 @@ public:
static const uint32_t REG_PLAY_CMD_ADDR;
static const uint32_t REG_PLAY_WORDS_PER_PKT_ADDR;
static const uint32_t REG_PLAY_ITEM_SIZE_ADDR;
+ static const uint32_t REG_REC_POS_LO_ADDR;
+ static const uint32_t REG_REC_POS_HI_ADDR;
+ static const uint32_t REG_PLAY_POS_LO_ADDR;
+ static const uint32_t REG_PLAY_POS_HI_ADDR;
+ static const uint32_t REG_PLAY_CMD_FIFO_SPACE_ADDR;
static const uint32_t PLAY_CMD_STOP;
static const uint32_t PLAY_CMD_FINITE;
@@ -212,6 +217,7 @@ public:
* just once. If set to true, stop() must be called to stop
* the play back.
* \throws uhd::value_error if offset+size exceeds the available memory.
+ * \throws uhd::op_failed Too many play commands are queued.
*/
virtual void play(const uint64_t offset,
const uint64_t size,
@@ -270,6 +276,13 @@ public:
*/
virtual uint64_t get_record_fullness(const size_t port = 0) = 0;
+ /*! Get the current record position
+ *
+ * \param port Which output port of the replay block to use
+ * \returns the byte address of the current record position
+ */
+ virtual uint64_t get_record_position(const size_t port = 0) = 0;
+
/*! Get the current record data type
*
* \param port Which input port of the replay block to use
@@ -317,6 +330,13 @@ public:
*/
virtual uint64_t get_play_size(const size_t port = 0) const = 0;
+ /*! Get the current playback position
+ *
+ * \param port Which output port of the replay block to use
+ * \returns the byte address of the current playback position
+ */
+ virtual uint64_t get_play_position(const size_t port = 0) = 0;
+
/*! Get the maximum number of items in a packet
*
* \param port Which output port of the replay block to use
@@ -430,7 +450,7 @@ public:
* Issue stream commands to start or stop playback from the configured playback
* buffer. Supports
* STREAM_MODE_START_CONTINUOUS to start continuous repeating playback,
- * STREAM_MODE_START_NUM_SAMPS_AND_DONE to play the given number of samples once, and
+ * STREAM_MODE_NUM_SAMPS_AND_DONE to play the given number of samples once, and
* STREAM_MODE_STOP_CONTINUOUS to stop all playback immediately.
* If a time_spec is supplied, it is placed in the header of the first packet produced
* for that command. Commands are queued and executed in order. A
@@ -439,6 +459,7 @@ public:
*
* \param stream_cmd The command to execute
* \param port Which output port of the replay block to use
+ * \throws uhd::op_failed Too many commands are queued.
*/
virtual void issue_stream_cmd(
const uhd::stream_cmd_t& stream_cmd, const size_t port = 0) = 0;