blob: 517c4b09a333ccdef6d10ad86104a5c87de1c4d2 [file] [log] [blame]
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00001/*
2 * Copyright (c) 2017, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __HELPERS_H__
9#define __HELPERS_H__
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#include <stdint.h>
16#include "tfm_sst_defs.h"
17#include "secure_fw/services/secure_storage/sst_asset_management.h"
18#include "test_framework.h"
19
20enum serial_color_t {
21 BLACK = 0,
22 RED = 1,
23 GREEN = 2,
24 YELLOW = 3,
25 BLUE = 4,
26 MAGENDA = 5,
27 CYAN = 6,
28 WHITE = 7,
29};
30
31/**
32 * \brief Translates tfm_sst_err_t into a string.
33 *
34 * \param[in] err tfm_sst_err_t error value.
35 *
36 * \return tfm_sst_err_t as string.
37 */
38const char *sst_err_to_str(enum tfm_sst_err_t err);
39
40/**
41 * \brief Translates asset permissions into a string.
42 *
43 * \param[in] permissions Asset permissions value.
44 *
45 * \return asset permissions as string.
46 */
47const char *asset_perms_to_str(uint8_t permissions);
48
49/**
50 * \brief Sets the the text color in the serial port.
51 *
52 * \param[in] color_id Serial foreground color.
53 *
54 * \return 0 if the message is send successfully, 1 otherwise.
55 */
56void printf_set_color(enum serial_color_t color_id);
57
58#ifdef __cplusplus
59}
60#endif
61
62#endif /* __HELPERS_H__ */