driver: add get_hw_rev() fn

This commit is contained in:
linuswck 2024-09-03 16:33:40 +08:00
parent c5826876a6
commit c267c30b89

View File

@ -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.