cros_ec_python.commands
Description
This submodule contains commands that have been abstracted into a python function for easier use.
Each command has been split into separate categories for easier maintainability.
The original command values are also present in these files.
Format & Example
Each command is a function that takes a cros_ec_python.baseclass.CrosEcClass object as the first argument,
and any other arguments that are required.
For example:
from cros_ec_python import get_cros_ec, general
ec = get_cros_ec()
in_data = 42
print("Input:", in_data)
# We will run the `hello` command here:
# The first argument is the object of the EC, and the second is the input data.
resp = general.hello(ec, in_data)
print("Raw Response:", resp)
# The Hello command adds 0x01020304 to the input and returns it
# We can subtract this to get the input back
print("Input Echoed:", resp - 0x01020304)
1""" 2# Description 3 4This submodule contains commands that have been abstracted into a python function for easier use. 5 6Each command has been split into separate categories for easier maintainability. 7 8The original command values are also present in these files. 9 10## Format & Example 11 12Each command is a function that takes a `cros_ec_python.baseclass.CrosEcClass` object as the first argument, 13and any other arguments that are required. 14 15**For example:** 16 17```python 18from cros_ec_python import get_cros_ec, general 19 20ec = get_cros_ec() 21 22in_data = 42 23 24print("Input:", in_data) 25 26# We will run the `hello` command here: 27# The first argument is the object of the EC, and the second is the input data. 28resp = general.hello(ec, in_data) 29 30print("Raw Response:", resp) 31# The Hello command adds 0x01020304 to the input and returns it 32# We can subtract this to get the input back 33print("Input Echoed:", resp - 0x01020304) 34``` 35"""