20 #include "sw/device/lib/testing/pwrmgr_testutils.h"
21 #include "sw/device/lib/testing/test_framework/check.h"
26 static dif_pwrmgr_t pwrmgr;
27 static dif_usbdev_t usbdev;
29 OTTF_DEFINE_TEST_CONFIG();
37 CHECK_DIF_OK(dif_pwrmgr_init(
39 CHECK_DIF_OK(dif_usbdev_init(
53 .request_sources = kDifPwrmgrWakeupRequestSourceFour,
56 bool low_power_exit =
false;
57 if (compare_wakeup_reasons(wakeup_reason, exp_por_wakeup_reason)) {
58 LOG_INFO(
"Powered up for the first time, begin test");
59 }
else if (compare_wakeup_reasons(wakeup_reason, exp_test_wakeup_reason)) {
60 low_power_exit =
true;
63 LOG_ERROR(
"Unexpected wakeup reason (types: %02x, sources: %08x)",
70 if (!low_power_exit) {
74 .dn_pullup_en =
false,
84 CHECK_STATUS_OK(pwrmgr_testutils_enable_low_power(
85 &pwrmgr, kDifPwrmgrWakeupRequestSourceFour,
86 kDifPwrmgrDomainOptionUsbClockInActivePower));