pulse modulation added

This commit is contained in:
Ayzen
2026-09-01 18:09:03 +03:00
parent 4c6292d6aa
commit 62e0430668
9 changed files with 123 additions and 16 deletions
+7 -3
View File
@@ -294,13 +294,17 @@ class Protocol:
)
@staticmethod
def encode_ad9102_wave_begin(sample_count: int) -> bytes:
"""Build an AD9102 custom-wave upload BEGIN packet."""
def encode_ad9102_wave_begin(sample_count: int, pat_period_us: int = 0) -> bytes:
"""Build an AD9102 custom-wave upload BEGIN packet.
``pat_period_us`` is the pattern repetition period in microseconds;
0 keeps the legacy back-to-back playback.
"""
return Protocol._encode_short_control(
CMD_AD9102_WAVE_CONTROL,
AD9102_WAVE_OPCODE_BEGIN,
_ensure_uint(sample_count, "sample_count", 0, 0xFFFF),
0,
_ensure_uint(pat_period_us, "pat_period_us", 0, 0xFFFF),
)
@staticmethod