blob: c0e7a7a0da93c9b244fdb33fd4e71c0b5087ae4e [file] [log] [blame]
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00001/*
Marc Moreno Berengue7d053a32018-06-27 18:22:14 +01002 * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00003 *
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/**
Marc Moreno Berengue7d053a32018-06-27 18:22:14 +010032 * \brief Translates psa_sst_err_t into a string.
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000033 *
Marc Moreno Berengue7d053a32018-06-27 18:22:14 +010034 * \param[in] err psa_sst_err_t error value.
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000035 *
Marc Moreno Berengue7d053a32018-06-27 18:22:14 +010036 * \return psa_sst_err_t as string.
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000037 */
Marc Moreno Berengue7d053a32018-06-27 18:22:14 +010038const char *sst_err_to_str(enum psa_sst_err_t err);
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000039
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__ */