TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
test_framework_helpers.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
9 
10 #include <stdio.h>
11 
12 const char *asset_perms_to_str(uint8_t permissions)
13 {
14  switch (permissions) {
15  case 0:
16  return "No permissions";
17  case 1:
18  return "SECURE_ASSET_REFERENCE";
19  case 2:
20  return "SECURE_ASSET_WRITE";
21  case 3:
22  return "SECURE_ASSET_REFERENCE | SECURE_ASSET_WRITE";
23  case 4:
24  return "SECURE_ASSET_READ";
25  case 5:
26  return "SECURE_ASSET_REFERENCE | SECURE_ASSET_READ";
27  case 6:
28  return "SECURE_ASSET_WRITE | SECURE_ASSET_READ";
29  case 7:
30  return "SECURE_ASSET_REFERENCE | SECURE_ASSET_WRITE | "
31  "SECURE_ASSET_READ";
32  default:
33  return "Unknown permissions";
34  }
35 }
36 
37 void printf_set_color(enum serial_color_t color_id)
38 {
39  TEST_LOG("\33[3%dm", color_id);
40 }
const char * asset_perms_to_str(uint8_t permissions)
Translates asset permissions into a string.
#define TEST_LOG(...)
void printf_set_color(enum serial_color_t color_id)
Sets the the text color in the serial port.