plankton_charge¶
Source code: plankton_charge.py
Test USB type-C port charging function with Plankton-Raiden board.
Description¶
This test can be tested locally or in remote ADB connection manner.
Use Plankton-Raiden board control to verify device battery current. It supports charge-5V, charge-12V, charge-20V, and discharge. This test also takes INA current and voltage value on Plankton-Raiden board into account as a judgement.
Sometimes the charge current may not be stable, we have to wait for several seconds until the current stable then sampling the current value.
Test Procedure¶
This is an automated test without user interaction, but the environment must be setup first:
Connect the testing USB type-C port to Plankton-Raiden board.
Connect the Plankton-Raiden serial commanding port to Plankton-Raiden board.
Specify the type of the bft_fixutre connecting to.
Specify the charging/discharing voltage/current and its minimun/maximun threshold.
Start the test.
Dependency¶
Connections to Plankton-Raiden board must setup before starting.
Examples¶
To test 5V charge, add this in test list:
{
"pytest_name": "plankton_usb_c_charge",
"args": {
"bft_fixture": {
"class_name":
"cros.factory.test.fixture.dummy_bft_fixture.DummyBFTFixture",
"params": {}
},
"min_charge_5V_current_mA": 0
}
}
Test 20V charge without checking the input current:
{
"pytest_name": "plankton_usb_c_charge",
"args": {
"bft_fixture": {
"class_name":
"cros.factory.test.fixture.dummy_bft_fixture.DummyBFTFixture",
"params": {}
},
"min_charge_20V_current_mA": 0,
"check_ina_current": false
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
bft_fixture |
dict |
A dictionary with the following items:
The default value of |
charge_duration_secs |
int, float |
(optional; default: |
discharge_duration_secs |
int, float |
(optional; default: |
wait_after_engage_secs |
int, float |
(optional; default: |
min_charge_5V_current_mA |
int, float, None |
(optional; default: |
min_charge_12V_current_mA |
int, float, None |
(optional; default: |
min_charge_20V_current_mA |
int, float, None |
(optional; default: |
min_discharge_current_mA |
int, float, None |
(optional; default: |
current_sampling_period_secs |
int, float |
(optional; default: |
check_battery_cycle |
bool |
(optional; default: |
battery_cycle_threshold |
int |
(optional; default: |
check_protect_ina_current |
bool |
(optional; default: |
protect_ina_current_range |
list |
(optional; default: |
protect_ina_retry_times |
int |
(optional; default: |
check_ina_current |
bool |
(optional; default: |
ina_current_charge_range |
list |
(optional; default: |
ina_current_discharge_range |
list |
(optional; default: |
ina_voltage_tolerance |
float |
(optional; default: |
monitor_plankton_voltage_only |
bool |
(optional; default: |