driver: Separate setting pd_config into two fns

This commit is contained in:
linuswck 2024-04-10 16:25:17 +08:00
parent 6bccbceb81
commit ae74455f94
1 changed files with 11 additions and 10 deletions

View File

@ -314,18 +314,19 @@ class Laser:
""" """
return await self._send_cmd(TARGET_LD, "SetISoftLimit", i_limit) return await self._send_cmd(TARGET_LD, "SetISoftLimit", i_limit)
async def config_pd_mon(self, responsitivity, dark_current): async def set_pd_mon_responsitivity(self, responsitivity):
""" """
Configure the photodiode monitor parameters Configure the photodiode monitor responsitivity parameter
- responsitivity: A/W - responsitivity: A/W
- dark current: A
""" """
async with self._cmd_lock: return await self._send_cmd(TARGET_LD, "SetPdResponsitivity", responsitivity)
response = await self._send_cmd(TARGET_LD, "SetPdResponsitivity", responsitivity, lock=False)
print(response) async def set_pd_mon_dark_current(self, dark_current):
if response["msg_type"] != "Acknowledge": """
return response Configure the photodiode monitor responsitivity parameter
return await self._send_cmd(TARGET_LD, "SetPdDarkCurrent", dark_current, lock=False) - dark_current: A/W
"""
return await self._send_cmd(TARGET_LD, "SetPdDarkCurrent", dark_current)
async def set_ld_pwr_limit(self, pwr_limit): async def set_ld_pwr_limit(self, pwr_limit):
""" """