typing and defaults
All checks were successful
Publish Python 🐍 distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Successful in -48s
Publish Python 🐍 distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Has been skipped

This commit is contained in:
Brendan Haines 2025-04-13 01:05:26 -06:00
parent 994080e574
commit 776c9cc491

View File

@ -82,12 +82,13 @@ class AD9361DacStepFactor(IntEnum):
class Charon: class Charon:
FREQUENCY_OFFSET = 1e6 FREQUENCY_OFFSET = 1e6
DEFAULT_IP = "192.168.2.1"
calibration: rf.calibration.Calibration | None = None calibration: rf.calibration.Calibration | None = None
def __init__( def __init__(
self, self,
ip: str = "192.168.2.1", ip: str = DEFAULT_IP,
frequency: npt.ArrayLike = np.linspace(1e9, 2e9, 3), frequency: npt.ArrayLike = np.linspace(1e9, 2e9, 3),
ports: Tuple[int] = (1,), ports: Tuple[int] = (1,),
): ):
@ -202,7 +203,7 @@ class Charon:
(value & 0x3) | (vref.value << 2) | (step_factor << 4), (value & 0x3) | (vref.value << 2) | (step_factor << 4),
) )
def _get_dac_code(self, channel: int) -> Tuple[float, AD9361DacVref, AD9361DacStepFactor]: def _get_dac_code(self, channel: Literal[1, 2]) -> Tuple[float, AD9361DacVref, AD9361DacStepFactor]:
word = self.ctrl.reg_read(AD9361Register.__getitem__(f"AUXDAC{channel}_WORD")) word = self.ctrl.reg_read(AD9361Register.__getitem__(f"AUXDAC{channel}_WORD"))
config = self.ctrl.reg_read(AD9361Register.__getitem__(f"AUXDAC{channel}_CONFIG")) config = self.ctrl.reg_read(AD9361Register.__getitem__(f"AUXDAC{channel}_CONFIG"))