13 #include "sw/device/lib/testing/lc_ctrl_testutils.h"
14 #include "sw/device/lib/testing/test_framework/check.h"
18 #define LC_TOKEN_SIZE 16
20 static dif_lc_ctrl_t lc;
34 static volatile const uint8_t kTestIterationCount = 0x0;
37 static volatile const uint8_t kLcExitToken[LC_TOKEN_SIZE] = {
38 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
39 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
64 bool execute_lc_ctrl_transition_test(
bool use_ext_clk) {
65 LOG_INFO(
"Start LC_CTRL transition test.");
69 CHECK_DIF_OK(dif_lc_ctrl_init(lc_reg, &lc));
71 LOG_INFO(
"Read and check LC state.");
79 const uint8_t kLcStateTransitionCount = 8 + 1 + (kTestIterationCount - 1) * 2;
85 lc_ctrl_testutils_check_transition_count(&lc, kLcStateTransitionCount));
89 for (
int i = 0; i < LC_TOKEN_SIZE; i++) {
90 token.data[i] = kLcExitToken[i];
94 LOG_INFO(
"Acquired lc_ctrl mutex by software");
97 "LC transition configuration failed!");
100 LOG_INFO(
"Waiting for LC transition done and reboot.");
108 CHECK_STATUS_OK(lc_ctrl_testutils_check_transition_count(
109 &lc, kLcStateTransitionCount + 1));