Software APIs
ujson_ottf_commands.c
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #include "sw/device/lib/testing/test_framework/ujson_ottf_commands.h"
6 
7 #include "sw/device/lib/testing/json/mem.h"
8 #include "sw/device/lib/testing/test_framework/ujson_ottf.h"
9 
10 status_t ujson_ottf_dispatch(ujson_t *uj, test_command_t command) {
11  if (uj == NULL) {
12  return INVALID_ARGUMENT();
13  }
14  switch (command) {
15  case kTestCommandMemRead32:
16  RESP_ERR(uj, ujcmd_mem_read32(uj));
17  break;
18  case kTestCommandMemRead:
19  RESP_ERR(uj, ujcmd_mem_read(uj));
20  break;
21  case kTestCommandMemWrite32:
22  RESP_ERR(uj, ujcmd_mem_write32(uj));
23  break;
24  case kTestCommandMemWrite:
25  RESP_ERR(uj, ujcmd_mem_write(uj));
26  break;
27  default:
28  return UNIMPLEMENTED();
29  }
30  return OK_STATUS();
31 }