11from typing import Final , Literal
22import struct
3- from ..cros_ec import CrOS_EC
3+ from ..baseclass import CrosEcClass
44from ..constants .COMMON import *
55
66EC_CMD_PROTO_VERSION : Final = 0x0000
77
88
9- def proto_version (ec : CrOS_EC ) -> UInt32 :
9+ def proto_version (ec : CrosEcClass ) -> UInt32 :
1010 """
1111 Get protocol version, used to deal with non-backward compatible protocol changes.
1212 @param ec: The CrOS_EC object.
@@ -19,7 +19,7 @@ def proto_version(ec: CrOS_EC) -> UInt32:
1919EC_CMD_HELLO : Final = 0x0001
2020
2121
22- def hello (ec : CrOS_EC , in_data : UInt32 ) -> UInt32 :
22+ def hello (ec : CrosEcClass , in_data : UInt32 ) -> UInt32 :
2323 """
2424 Hello. This is a simple command to test the EC is responsive to commands.
2525 @param ec: The CrOS_EC object.
@@ -34,7 +34,7 @@ def hello(ec: CrOS_EC, in_data: UInt32) -> UInt32:
3434EC_CMD_GET_VERSION : Final = 0x0002
3535
3636
37- def get_version (ec : CrOS_EC , version : Literal [0 , 1 ] = 0 ) -> dict [str , str | int ]:
37+ def get_version (ec : CrosEcClass , version : Literal [0 , 1 ] = 0 ) -> dict [str , str | int ]:
3838 """
3939 Get version number
4040 @param ec: The CrOS_EC object.
@@ -71,7 +71,7 @@ def get_version(ec: CrOS_EC, version: Literal[0, 1] = 0) -> dict[str, str | int]
7171EC_CMD_GET_BUILD_INFO : Final = 0x0004
7272
7373
74- def get_build_info (ec : CrOS_EC ) -> str :
74+ def get_build_info (ec : CrosEcClass ) -> str :
7575 """
7676 Get build information
7777 @param ec: The CrOS_EC object.
@@ -84,7 +84,7 @@ def get_build_info(ec: CrOS_EC) -> str:
8484EC_CMD_GET_CHIP_INFO : Final = 0x0005
8585
8686
87- def get_chip_info (ec : CrOS_EC ) -> dict [str , str ]:
87+ def get_chip_info (ec : CrosEcClass ) -> dict [str , str ]:
8888 """
8989 Get chip info
9090 @param ec: The CrOS_EC object.
@@ -102,7 +102,7 @@ def get_chip_info(ec: CrOS_EC) -> dict[str, str]:
102102EC_CMD_GET_BOARD_VERSION : Final = 0x0006
103103
104104
105- def get_board_version (ec : CrOS_EC ) -> UInt16 :
105+ def get_board_version (ec : CrosEcClass ) -> UInt16 :
106106 """
107107 Get board HW version
108108 @param ec: The CrOS_EC object.
@@ -118,7 +118,7 @@ def get_board_version(ec: CrOS_EC) -> UInt16:
118118EC_CMD_GET_CMD_VERSIONS : Final = 0x0008
119119
120120
121- def get_cmd_versions (ec : CrOS_EC , cmd : UInt8 | UInt16 , version : Literal [0 , 1 ] | None = None ) -> UInt32 :
121+ def get_cmd_versions (ec : CrosEcClass , cmd : UInt8 | UInt16 , version : Literal [0 , 1 ] | None = None ) -> UInt32 :
122122 """
123123 Read versions supported for a command.
124124 @param ec: The CrOS_EC object.
@@ -144,7 +144,7 @@ def get_cmd_versions(ec: CrOS_EC, cmd: UInt8 | UInt16, version: Literal[0, 1] |
144144EC_CMD_TEST_PROTOCOL : Final = 0x000A
145145
146146
147- def test_protocol (ec : CrOS_EC , result : UInt32 , ret_len : UInt32 , buf : bytes , in_size : Int32 | None = None ) -> bytes :
147+ def test_protocol (ec : CrosEcClass , result : UInt32 , ret_len : UInt32 , buf : bytes , in_size : Int32 | None = None ) -> bytes :
148148 """
149149 Fake a variety of responses, purely for testing purposes.
150150 @param ec: The CrOS_EC object.
@@ -162,7 +162,7 @@ def test_protocol(ec: CrOS_EC, result: UInt32, ret_len: UInt32, buf: bytes, in_s
162162EC_CMD_GET_PROTOCOL_INFO : Final = 0x000B
163163
164164
165- def get_protocol_info (ec : CrOS_EC ) -> dict [str , int ]:
165+ def get_protocol_info (ec : CrosEcClass ) -> dict [str , int ]:
166166 """
167167 Get protocol info
168168 @param ec: The CrOS_EC object.
0 commit comments