Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 1 | /* |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, Arm Limited. All rights reserved. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __TFM_SST_API__ |
| 9 | #define __TFM_SST_API__ |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
Antonio de Angelis | eba14e1 | 2018-03-27 11:03:20 +0100 | [diff] [blame] | 15 | #include "tfm_sst_defs.h" |
| 16 | |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 17 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 18 | * \brief Allocates space for the asset, referenced by asset UUID, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 19 | * without setting any data in the asset. |
| 20 | * |
| 21 | * \param[in] asset_uuid Asset UUID |
| 22 | * |
| 23 | * \return Returns an TFM_SST_ERR_SUCCESS if asset is created correctly. |
| 24 | * Otherwise, error code as specified in \ref tfm_sst_err_t |
| 25 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 26 | enum tfm_sst_err_t tfm_sst_create(uint32_t asset_uuid); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 27 | |
| 28 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 29 | * \brief Gets asset's information referenced by asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 30 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 31 | * \param[in] asset_uuid Asset UUID |
| 32 | * \param[out] info Pointer to store the asset's information |
| 33 | * \ref tfm_sst_asset_info_t |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 34 | * |
| 35 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 36 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 37 | enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_uuid, |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame] | 38 | struct tfm_sst_asset_info_t *info); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 39 | |
| 40 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 41 | * \brief Gets asset's attributes referenced by asset UUID. |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 42 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 43 | * \param[in] asset_uuid Asset UUID |
| 44 | * \param[out] attrs Pointer to store the asset's attributes |
| 45 | * \ref tfm_sst_asset_attrs_t |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 46 | * |
| 47 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 48 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 49 | enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 50 | struct tfm_sst_asset_attrs_t *attrs); |
| 51 | |
| 52 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 53 | * \brief Sets asset's attributes referenced by asset UUID. |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 54 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 55 | * \param[in] asset_uuid Asset UUID |
| 56 | * \param[in] attrs Pointer to new the asset's attributes |
| 57 | * \ref tfm_sst_asset_attrs_t |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 58 | * |
| 59 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 60 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 61 | enum tfm_sst_err_t tfm_sst_set_attributes( |
| 62 | uint32_t asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 63 | const struct tfm_sst_asset_attrs_t *attrs); |
| 64 | |
| 65 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 66 | * \brief Reads asset's data from asset referenced by asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 67 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 68 | * \param[in] asset_uuid Asset UUID |
| 69 | * \param[out] data Pointer to data vector \ref tfm_sst_buf_t to store |
| 70 | * data, size and offset |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 71 | * |
| 72 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 73 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 74 | enum tfm_sst_err_t tfm_sst_read(uint32_t asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 75 | struct tfm_sst_buf_t* data); |
| 76 | |
| 77 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 78 | * \brief Writes data into an asset referenced by asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 79 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 80 | * \param[in] asset_uuid Asset UUID |
| 81 | * \param[in] data Pointer to data vector \ref tfm_sst_buf_t which |
| 82 | * contains the data to write |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 83 | * |
| 84 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 85 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 86 | enum tfm_sst_err_t tfm_sst_write(uint32_t asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 87 | struct tfm_sst_buf_t* data); |
| 88 | |
| 89 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 90 | * \brief Deletes the asset referenced by the asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 91 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 92 | * \param[in] asset_uuid Asset UUID |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 93 | * |
| 94 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 95 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 96 | enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_uuid); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 97 | |
| 98 | #ifdef __cplusplus |
| 99 | } |
| 100 | #endif |
| 101 | |
| 102 | #endif /* __TFM_SST_API__ */ |