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

View File

@ -313,19 +313,20 @@ class Laser:
- i_limit: A
"""
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
- dark current: A
"""
async with self._cmd_lock:
response = await self._send_cmd(TARGET_LD, "SetPdResponsitivity", responsitivity, lock=False)
print(response)
if response["msg_type"] != "Acknowledge":
return response
return await self._send_cmd(TARGET_LD, "SetPdDarkCurrent", dark_current, lock=False)
return await self._send_cmd(TARGET_LD, "SetPdResponsitivity", responsitivity)
async def set_pd_mon_dark_current(self, dark_current):
"""
Configure the photodiode monitor responsitivity parameter
- dark_current: A/W
"""
return await self._send_cmd(TARGET_LD, "SetPdDarkCurrent", dark_current)
async def set_ld_pwr_limit(self, pwr_limit):
"""