Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /******************************************************************************
lypinator 0:bb348c97df44 2 * @file tz_context.h
lypinator 0:bb348c97df44 3 * @brief Context Management for Armv8-M TrustZone
lypinator 0:bb348c97df44 4 * @version V1.0.1
lypinator 0:bb348c97df44 5 * @date 10. January 2018
lypinator 0:bb348c97df44 6 ******************************************************************************/
lypinator 0:bb348c97df44 7 /*
lypinator 0:bb348c97df44 8 * Copyright (c) 2017-2018 Arm Limited. All rights reserved.
lypinator 0:bb348c97df44 9 *
lypinator 0:bb348c97df44 10 * SPDX-License-Identifier: Apache-2.0
lypinator 0:bb348c97df44 11 *
lypinator 0:bb348c97df44 12 * Licensed under the Apache License, Version 2.0 (the License); you may
lypinator 0:bb348c97df44 13 * not use this file except in compliance with the License.
lypinator 0:bb348c97df44 14 * You may obtain a copy of the License at
lypinator 0:bb348c97df44 15 *
lypinator 0:bb348c97df44 16 * www.apache.org/licenses/LICENSE-2.0
lypinator 0:bb348c97df44 17 *
lypinator 0:bb348c97df44 18 * Unless required by applicable law or agreed to in writing, software
lypinator 0:bb348c97df44 19 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
lypinator 0:bb348c97df44 20 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
lypinator 0:bb348c97df44 21 * See the License for the specific language governing permissions and
lypinator 0:bb348c97df44 22 * limitations under the License.
lypinator 0:bb348c97df44 23 */
lypinator 0:bb348c97df44 24
lypinator 0:bb348c97df44 25 #if defined ( __ICCARM__ )
lypinator 0:bb348c97df44 26 #pragma system_include /* treat file as system include file for MISRA check */
lypinator 0:bb348c97df44 27 #elif defined (__clang__)
lypinator 0:bb348c97df44 28 #pragma clang system_header /* treat file as system include file */
lypinator 0:bb348c97df44 29 #endif
lypinator 0:bb348c97df44 30
lypinator 0:bb348c97df44 31 #ifndef TZ_CONTEXT_H
lypinator 0:bb348c97df44 32 #define TZ_CONTEXT_H
lypinator 0:bb348c97df44 33
lypinator 0:bb348c97df44 34 #include <stdint.h>
lypinator 0:bb348c97df44 35
lypinator 0:bb348c97df44 36 #ifndef TZ_MODULEID_T
lypinator 0:bb348c97df44 37 #define TZ_MODULEID_T
lypinator 0:bb348c97df44 38 /// \details Data type that identifies secure software modules called by a process.
lypinator 0:bb348c97df44 39 typedef uint32_t TZ_ModuleId_t;
lypinator 0:bb348c97df44 40 #endif
lypinator 0:bb348c97df44 41
lypinator 0:bb348c97df44 42 /// \details TZ Memory ID identifies an allocated memory slot.
lypinator 0:bb348c97df44 43 typedef uint32_t TZ_MemoryId_t;
lypinator 0:bb348c97df44 44
lypinator 0:bb348c97df44 45 /// Initialize secure context memory system
lypinator 0:bb348c97df44 46 /// \return execution status (1: success, 0: error)
lypinator 0:bb348c97df44 47 uint32_t TZ_InitContextSystem_S (void);
lypinator 0:bb348c97df44 48
lypinator 0:bb348c97df44 49 /// Allocate context memory for calling secure software modules in TrustZone
lypinator 0:bb348c97df44 50 /// \param[in] module identifies software modules called from non-secure mode
lypinator 0:bb348c97df44 51 /// \return value != 0 id TrustZone memory slot identifier
lypinator 0:bb348c97df44 52 /// \return value 0 no memory available or internal error
lypinator 0:bb348c97df44 53 TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
lypinator 0:bb348c97df44 54
lypinator 0:bb348c97df44 55 /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
lypinator 0:bb348c97df44 56 /// \param[in] id TrustZone memory slot identifier
lypinator 0:bb348c97df44 57 /// \return execution status (1: success, 0: error)
lypinator 0:bb348c97df44 58 uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
lypinator 0:bb348c97df44 59
lypinator 0:bb348c97df44 60 /// Load secure context (called on RTOS thread context switch)
lypinator 0:bb348c97df44 61 /// \param[in] id TrustZone memory slot identifier
lypinator 0:bb348c97df44 62 /// \return execution status (1: success, 0: error)
lypinator 0:bb348c97df44 63 uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
lypinator 0:bb348c97df44 64
lypinator 0:bb348c97df44 65 /// Store secure context (called on RTOS thread context switch)
lypinator 0:bb348c97df44 66 /// \param[in] id TrustZone memory slot identifier
lypinator 0:bb348c97df44 67 /// \return execution status (1: success, 0: error)
lypinator 0:bb348c97df44 68 uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
lypinator 0:bb348c97df44 69
lypinator 0:bb348c97df44 70 #endif // TZ_CONTEXT_H