Lines Matching +full:portable +full:- +full:device

4  * SPDX-License-Identifier: Apache-2.0
26 const struct device *bc12_dev;
31 static void bc12_test_result_cb(const struct device *dev, struct bc12_partner_state *state, in bc12_test_result_cb()
37 if (state->bc12_role == BC12_PORTABLE_DEVICE) { in bc12_test_result_cb()
38 LOG_INF("charging partner: type %d, voltage %d, current %d", state->type, in bc12_test_result_cb()
39 state->voltage_uv, state->current_ua); in bc12_test_result_cb()
40 } else if (state->bc12_role == BC12_CHARGING_PORT) { in bc12_test_result_cb()
41 LOG_INF("portable device partner: connected %d", in bc12_test_result_cb()
42 state->pd_partner_connected); in bc12_test_result_cb()
44 fixture->partner_state = *state; in bc12_test_result_cb()
47 fixture->partner_state.type = BC12_TYPE_NONE; in bc12_test_result_cb()
48 fixture->partner_state.current_ua = 0; in bc12_test_result_cb()
49 fixture->partner_state.voltage_uv = 0; in bc12_test_result_cb()
55 bc12_set_role(fixture->bc12_dev, BC12_CHARGING_PORT); in ZTEST_USER_F()
57 bc12_emul_set_pd_partner(fixture->bc12_emul, true); in ZTEST_USER_F()
61 zassert_true(fixture->partner_state.pd_partner_connected); in ZTEST_USER_F()
63 bc12_emul_set_pd_partner(fixture->bc12_emul, false); in ZTEST_USER_F()
67 zassert_false(fixture->partner_state.pd_partner_connected); in ZTEST_USER_F()
74 memset(&fixture->partner_state, 0, sizeof(struct bc12_partner_state)); in bc12_before()
76 bc12_set_result_cb(fixture->bc12_dev, &bc12_test_result_cb, fixture); in bc12_before()
83 bc12_set_result_cb(fixture->bc12_dev, NULL, NULL); in bc12_after()
84 bc12_set_role(fixture->bc12_dev, BC12_DISCONNECTED); in bc12_after()