From c267c30b8946959981691348324e4614e8085c12 Mon Sep 17 00:00:00 2001 From: linuswck Date: Tue, 3 Sep 2024 16:33:40 +0800 Subject: [PATCH] driver: add get_hw_rev() fn --- pykirdy/driver/kirdy.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pykirdy/driver/kirdy.py b/pykirdy/driver/kirdy.py index 36c409b..0c858d7 100644 --- a/pykirdy/driver/kirdy.py +++ b/pykirdy/driver/kirdy.py @@ -26,6 +26,7 @@ class CmdList: SetPdFinGain = _dt.f32 SetPdTransconductance = _dt.f32 SetActiveReportMode = _dt.bool + GetHwRev = _dt.none GetStatusReport = _dt.none GetSettingsSummary = _dt.none Dfu = _dt.none @@ -208,6 +209,20 @@ class Device: """ return await self._send_cmd(self._cmd._target, self._cmd.SetPdTransconductance, transconductance) + async def get_hw_rev(self): + """ + Get hardware revision of the connected Kirdy + + { + 'msg_type': 'HwRev', + 'hw_rev': { + 'major': 0, + 'minor': 3 + } + } + """ + return await self._send_cmd(self._cmd._target, self._cmd.GetHwRev, msg_type="HwRev") + async def get_status_report(self, sig=None): """ Get status of all peripherals in a json object.