From 6705b182d5a9b58f50aa170d7e9fa87da26e9d87 Mon Sep 17 00:00:00 2001 From: linuswck Date: Fri, 8 Nov 2024 15:33:40 +0800 Subject: [PATCH] pyfastservo dac: power_down -> power_down_afe --- fast-servo/pyfastservo/dac.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fast-servo/pyfastservo/dac.py b/fast-servo/pyfastservo/dac.py index d1299f9..609fcf5 100644 --- a/fast-servo/pyfastservo/dac.py +++ b/fast-servo/pyfastservo/dac.py @@ -90,7 +90,7 @@ def manual_override(enable=True): to_write = reg_contents | 0b1 if enable else reg_contents & 0b110 write_to_memory(CTRL_ADDR, to_write) -def power_down(channel, power_down=True): +def power_down_afe(channel, power_down=True): assert channel in (0, 1) bitmask = 1 << (channel + 1) & 0b111 @@ -137,6 +137,9 @@ def configure_ad9117(): print("Unrecognized DAC version") return False + power_down_afe(0, True) + power_down_afe(1, True) + configure_dac(spi) check_clk_relationship(spi) dac_self_calibration(spi) @@ -144,8 +147,8 @@ def configure_ad9117(): # Enable DAC outputs spi_write(spi, 0x01, spi_read(spi, 0x01) & ~((1 << 4) | (1 << 3))) - power_down(0, False) - power_down(1, False) + power_down_afe(0, False) + power_down_afe(1, False) manual_override(False) print("AD9117 configuration completed successfully")