diff options
author | Lane Kolbly <lane.kolbly@ni.com> | 2022-02-18 08:59:43 -0600 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-03-02 14:43:15 -0600 |
commit | a630a36bb935dd66cb95a38c63df76a4477c4688 (patch) | |
tree | 3af2fadcbf9f4eb354de36591dedd75163095347 /host/tests/rfnoc_block_tests | |
parent | 159c21b75c6efa0952e8d446341b7a037593c350 (diff) | |
download | uhd-a630a36bb935dd66cb95a38c63df76a4477c4688.tar.gz uhd-a630a36bb935dd66cb95a38c63df76a4477c4688.tar.bz2 uhd-a630a36bb935dd66cb95a38c63df76a4477c4688.zip |
host: test: Add GPIO DDR register to x4xx mock
This is useful for unit testing certain code which operates the DDR
registers, in particular code which performs a read-modify-write
operation on that register.
Conceivably we could add more registers here, but I'm just doing one
at a time.
Diffstat (limited to 'host/tests/rfnoc_block_tests')
-rw-r--r-- | host/tests/rfnoc_block_tests/x4xx_radio_mock.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/host/tests/rfnoc_block_tests/x4xx_radio_mock.hpp b/host/tests/rfnoc_block_tests/x4xx_radio_mock.hpp index 597ffac7e..21b8529cc 100644 --- a/host/tests/rfnoc_block_tests/x4xx_radio_mock.hpp +++ b/host/tests/rfnoc_block_tests/x4xx_radio_mock.hpp @@ -36,6 +36,9 @@ class x4xx_radio_mock_reg_iface_t : public mock_reg_iface_t static constexpr uint32_t spi_offset = radio_control_impl::regmap::PERIPH_BASE + 0xC000 /*DIO Window*/ + 0x2000 /*DIO Regmap*/; + static constexpr uint32_t gpio_offset = + radio_control_impl::regmap::PERIPH_BASE + + 0xC000 /*DIO Window*/ + 0x1000 /*GPIO Regmap*/; public: x4xx_radio_mock_reg_iface_t(size_t num_channels) @@ -51,6 +54,9 @@ public: (32 /* bits per sample */ << 16) | 1 /* sample per clock */; // Ensure that the SPI Status is always SPI_READY read_memory[spi_offset + 0x18] |= 1 << 24; + + // Setup the GPIO addresses + read_memory[gpio_offset + 0x4] = 0; } void _poke_cb(uint32_t addr, uint32_t data, uhd::time_spec_t, bool) override |