pyfastservo dac: Change debug MSG

This commit is contained in:
linuswck 2024-11-08 15:36:33 +08:00
parent 6705b182d5
commit 9f2e609b6e
1 changed files with 2 additions and 2 deletions

View File

@ -86,9 +86,9 @@ def dac_self_calibration(spi):
def manual_override(enable=True): def manual_override(enable=True):
reg_contents = read_from_memory(CTRL_ADDR, 1)[0] reg_contents = read_from_memory(CTRL_ADDR, 1)[0]
print(f"REG contents: 0b{reg_contents:03b}")
to_write = reg_contents | 0b1 if enable else reg_contents & 0b110 to_write = reg_contents | 0b1 if enable else reg_contents & 0b110
write_to_memory(CTRL_ADDR, to_write) write_to_memory(CTRL_ADDR, to_write)
print(f"Set DAC Output Manual Override: {enable}")
def power_down_afe(channel, power_down=True): def power_down_afe(channel, power_down=True):
assert channel in (0, 1) assert channel in (0, 1)
@ -101,7 +101,7 @@ def power_down_afe(channel, power_down=True):
to_write = reg_contents | value to_write = reg_contents | value
write_to_memory(CTRL_ADDR, to_write) write_to_memory(CTRL_ADDR, to_write)
reg_contents = read_from_memory(CTRL_ADDR, 1)[0] reg_contents = read_from_memory(CTRL_ADDR, 1)[0]
print(f"REG contents: 0b{reg_contents:03b}") print(f"Power Down DAC AFE Ch{channel}: {power_down}")
def set_dac_output(value): def set_dac_output(value):
value = min(value, 0x3FFF) value = min(value, 0x3FFF)