1 /***********************************************************************************************//** 2 * \file cyabs_rtos_impl.h 3 * 4 * \brief 5 * Template file for internal definitions for RTOS abstraction layer. 6 * Replace all TODO items with the proper values for the RTOS that is 7 * being wrapped. 8 * 9 *************************************************************************************************** 10 * \copyright 11 * Copyright 2019-2021 Cypress Semiconductor Corporation (an Infineon company) or 12 * an affiliate of Cypress Semiconductor Corporation 13 * 14 * SPDX-License-Identifier: Apache-2.0 15 * 16 * Licensed under the Apache License, Version 2.0 (the "License"); 17 * you may not use this file except in compliance with the License. 18 * You may obtain a copy of the License at 19 * 20 * http://www.apache.org/licenses/LICENSE-2.0 21 * 22 * Unless required by applicable law or agreed to in writing, software 23 * distributed under the License is distributed on an "AS IS" BASIS, 24 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 * See the License for the specific language governing permissions and 26 * limitations under the License. 27 **************************************************************************************************/ 28 29 #pragma once 30 31 /* 32 * Exclude template files except for documentation purposes. 33 * This should be removed when using the template to support a new RTOS. 34 */ 35 #if defined(DOXYGEN) 36 37 // #include "TODO: RTOS HEADER" 38 39 #ifdef __cplusplus 40 extern "C" 41 { 42 #endif 43 44 /** 45 * \addtogroup group_abstraction_rtos_port RTOS Specific Types and Defines 46 * \ingroup group_abstraction_rtos_common 47 * \{ 48 * The following defines and types have values that are specific to each RTOS port. 49 * The define values are specific to each RTOS. The types are simple aliases that 50 * wrap RTOS specifc types. Code cannot assume anything about the values or internals 51 * of any types. 52 */ 53 54 /****************************************************** 55 * Constants 56 ******************************************************/ 57 // TODO: Replace these with proper values for the target RTOS 58 #define CY_RTOS_MIN_STACK_SIZE 300 /**< Minimum stack size */ 59 #define CY_RTOS_ALIGNMENT_MASK 0x00000007UL /**< Checks for 8-bit alignment */ 60 61 62 /****************************************************** 63 * Type Definitions 64 ******************************************************/ 65 66 // TODO: Replace all priority values with values specific to the RTOS 67 /** RTOS thread priority. 68 * Note: Depending on the RTOS and interrupt options for the device, some of these priorities may 69 * end up being the same priority level in practice. Even if this happens, the relative ordering 70 * of priorities is still maintained. eg: 71 * MAX >= REALTIME >= HIGH >= ABOVENORMAL >= NORMAL >= BELOWNORMAL >= LOW >= MIN 72 */ 73 typedef enum 74 { 75 CY_RTOS_PRIORITY_MIN = 0, /**< Minumum allowable Thread priority */ 76 CY_RTOS_PRIORITY_LOW = 1, /**< A low priority Thread */ 77 CY_RTOS_PRIORITY_BELOWNORMAL = 2, /**< A slightly below normal Thread priority */ 78 CY_RTOS_PRIORITY_NORMAL = 3, /**< The normal Thread priority */ 79 CY_RTOS_PRIORITY_ABOVENORMAL = 4, /**< A slightly elevated Thread priority */ 80 CY_RTOS_PRIORITY_HIGH = 5, /**< A high priority Thread */ 81 CY_RTOS_PRIORITY_REALTIME = 6, /**< Realtime Thread priority */ 82 CY_RTOS_PRIORITY_MAX = 7 /**< Maximum allowable Thread priority */ 83 } cy_thread_priority_t; 84 85 /** Alias for the RTOS specific definition of a thread handle */ 86 typedef void* /* TODO: Replace with RTOS specific type*/ cy_thread_t; 87 /** Alias for the RTOS specific argument passed to the entry function of a thread */ 88 typedef void* /* TODO: Replace with RTOS specific type*/ cy_thread_arg_t; 89 /** Alias for the RTOS specific definition of a mutex */ 90 typedef void* /* TODO: Replace with RTOS specific type*/ cy_mutex_t; 91 /** Alias for the RTOS specific definition of a semaphore */ 92 typedef void* /* TODO: Replace with RTOS specific type*/ cy_semaphore_t; 93 /** Alias for the RTOS specific definition of an event */ 94 typedef void* /* TODO: Replace with RTOS specific type*/ cy_event_t; 95 /** Alias for the RTOS specific definition of a message queue */ 96 typedef void* /* TODO: Replace with RTOS specific type*/ cy_queue_t; 97 /** Alias for the RTOS specific definition of a timer */ 98 typedef void* /* TODO: Replace with RTOS specific type*/ cy_timer_t; 99 /** Alias for the RTOS specific argument passed to the timer callback function */ 100 typedef void* /* TODO: Replace with RTOS specific type*/ cy_timer_callback_arg_t; 101 /** Alias for the RTOS specific time unit (in milliseconds) */ 102 typedef void* /* TODO: Replace with RTOS specific type*/ cy_time_t; 103 /** Alias for the RTOS specific definition of a error status */ 104 typedef void* /* TODO: Replace with RTOS specific type*/ cy_rtos_error_t; 105 106 /** \} group_abstraction_rtos_port */ 107 108 #ifdef __cplusplus 109 } // extern "C" 110 #endif 111 112 #endif // defined(DOXYGEN) 113