added dac

This commit is contained in:
Ayzen
2026-02-18 16:04:20 +03:00
parent 8ca2fe39d0
commit 12cf9d6716
7 changed files with 92 additions and 1 deletions

View File

@ -147,6 +147,13 @@ def start_ad9833_ramp(prt, freq_hz=None, mclk_hz=None, triangle=True, enable=Tru
return _print_state_reply(cmd.get_STATE(prt))
def set_stm32_dac(prt, dac_code, enable=True):
hexstring = cmd.create_STM32_DAC_command(dac_code=dac_code, enable=enable)
cmd.send_STM32_DAC(prt, hexstring)
time.sleep(WAIT_AFTER_SEND)
return _print_state_reply(cmd.get_STATE(prt))
def _wait_for_min_bytes(prt, expected_len, timeout_s, poll_s=0.01):
deadline = time.time() + timeout_s
while time.time() < deadline: