Skip to content

Commit

Permalink
Add hardware emulation context support for ADF5611
Browse files Browse the repository at this point in the history
Edit harware_map.yml file to include ADF5611

Signed-off-by: Jude Osemene <[email protected]
  • Loading branch information
Jude-Osems committed Jan 28, 2025
1 parent 4c50d63 commit aba512e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adi/adf5611.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def rfoutdiv_divider(self):

@rfoutdiv_divider.setter
def rfoutdiv_divider(self, value):
# Check that the value is valid
# Check that the divider value is valid
if value.lower().strip() not in self._rfoutdiv_divider_options:
raise ValueError(
f"rfoutdiv_divider of \"{value}\" is invalid. Valid options: {', '.join(self._rfoutdiv_divider_options)}"
Expand Down
8 changes: 8 additions & 0 deletions test/emu/hardware_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ ad9172:
- filename: ad9172.xml
- data_devices:
- iio:device2
adf5611:
- adf5611
- pyadi_iio_class_support:
- adf5611
# - emulate:
# - filename: ad9172.xml
# - data_devices:
# - iio:device2
cn0511:
- ad9166-amp
- adf4372
Expand Down
4 changes: 1 addition & 3 deletions test/test_adf5611.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
("rfoutdiv_power", 1, 3, 1, 0, 2),
("reference_divider", 1, 16383, 2, 0, 1),
("rfout_frequency", 8000000000, 12000000000, 100000000, 0, 1),
],
)
def test_adf5611_attrs(
Expand All @@ -39,8 +38,7 @@ def test_adf5611_attrs(
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
@pytest.mark.parametrize(
"attr, value",
[("en_rfoutdiv", 0), ("en_rfoutdiv", 1)],
"attr, value", [("en_rfoutdiv", 0), ("en_rfoutdiv", 1)],
)
def test_adf5611_attrs_bool(
test_attribute_single_value_boolean, iio_uri, classname, attr, value,
Expand Down

0 comments on commit aba512e

Please sign in to comment.